# Calculation for transaction input-output balling:

To roughly calculate transaction send size in bytes we do:

``````((numberOfInputs*148)+(numberOfOutputs*34)+10)
``````

We want to make a transaction using two inputs of 0.01BTC (Amount to send = 0.015BTC, change left over = 0.005BTC). Number of outputs in this case will be two; as we have two inputs, one of which we are 'tearing-in-two' creating change that will be sent back to us (we are the second output so the change is not lost).

So to calculate the fee

• We calculate the value of each input in BTC multiplied by the age of the input in blocks
• Divide the priority by the size of the transaction in bytes
• If this gives a number less than 0.576 then the transaction requires a fee
• Also if the transaction size exceeds 1000 bytes it requires a fee

If both inputs were 1000 conformations old, a fee would be required:

``````((0.01*1000) + (0.01*1000)) = 20 //priority
((2*148)+(2*34)+10) = 374 //bytes
20 / 374 = 0.053475935828877004
``````

If both inputs were 11000 conformations old, a fee would not be required:

``````((0.01*11000) + (0.01*11000)) = 220 //priority
((2*148)+(2*34)+10) = 374 //bytes
220 / 374 = 0.5882352941176471
``````

Is this correct?

If one input was old dust and the other new and large (this looks free to me):

``````((0.00001*11000) + (1*1000)) = 1000.11 //priority
((2*148)+(2*34)+10) = 374 //bytes
1000.11 / 374 = 2.6740909090909093
``````

Does this explain how you can put a dust-input with a large-input to rescue dust?

Will the threshold of 0.576 change in the future and if so how will we find out?

• where does you initial formula come from? Is it form you or from some wiki? – Dennis Kriechel Jun 11 '14 at 7:04
• bitcoinfees.com – BENZ.404 Jun 11 '14 at 13:50
• The whole section about priority is not relevant anymore; free transaction mining doesn't happen in any significant amount anymore and software support for it has been removed in various places. Every transaction just pays bytes * feerate in fee. – Pieter Wuille Jun 20 '17 at 7:07