((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
- Add up all the answers into a total priority
- 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:
Code:
((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:
Code:
((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):
Code:
((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?
I gathered this theory from various posts on this site, google, bitcoin.stackexchange, and bitcoinfees.com