Ad

Do You Have To Spent The Entire Output Of A Bitcoin Transaction?

- 1 answer

After reading about how bitcoin is transferred, I learned that you take the outputs of a previous transaction and use them as inputs for a current transaction, in other words you use the transaction id of the previous transaction to supply coins to the current one. There can be multiple inputs and outputs but if you want to spend the bitcoin in an output do you have to spend the entire output or can you spend part of one output and then use that transaction id later to spend the rest of that output. How would the UTXO database keep track of this and handle the math?

Ad

Answer

Unspent outputs are claimed by the miner of the block. Transaction fees are just unspent outputs.

If you want to spend the bitcoin in an output do you have to spend the entire output or can you spend part of one output and then use that transaction id later to spend the rest of that output.

Yes, you need to spend all of the outputs unless you plan to donate it to the block miner. Usually this is achieved by paying the "change" back to yourself.

Ad
source: stackoverflow.com
Ad