1

I'm confused by how exactly Bitcoin transaction are calculated. A transaction contains inputs and outputs, and if its inputs exceed its outputs the difference is deemed as the transaction fee.

So, if I just mined a block and received 25 coins in reward, there were no previous transactions related with my address and I want to make a transfer of 0.001 Btc using my 25 Btc balance. Then, there will be a 25 Btc input and a 0.001 Btc output, and the difference in the amount of 24.999 Btc all goes to miners?! Please help me understand.

2

You would create a transaction with two outputs, one being 0.001 BTC to the recipient, another being 24.9989 back to another key you own yourself (called a change output), and the difference of 0.0001 BTC would be fee.

  • So if I don't have an extra address and forget to create output, then I would lose the fund forever correct? – Yangrui Nov 5 '16 at 7:06
  • Yes, if you forget to add a change output, it will become fee. Bitcoin Core will actually refuse to send transactions that pay too much fee, to protect against this. – Pieter Wuille Nov 5 '16 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.