Skip to main content
2 of 5
added 20 characters in body

Formula for calculating bitcoin transaction size doesn't always work out but why

Please refer to this question:

Calculator for estimated TX-Fees

I have a question for clarity, in response to James' answer as in his example of 2 inputs/1 output, I recently calculated using the formula provided in that question (and found all over the web) and confirming my inputs are both compressed:

size := X * 148 + Y * 34 + 10 +- X

I had 2 inputs each it's own address and a single output and wanted to spend them to a single address w/ no change address. 2-in/1-out

I calculated: (2 x 148) + (1 x 34) + 10 = 340 bytes and James came up with 404 bytes (he used uncompressed inputs @ 180 bytes and the formula works), yet the real transaction would up being 638 bytes (stuck in the pool now) which makes using formulas like the one above a little less trustworthy.

What am I missing? Why when using the formula above, some transactions are spot on and others are way off with no way for me to make sense of it, math doesn't lie so I must be using the formula wrong and I just can't see the forest through through the trees?

Any clarity is greatly appreciated.