I'm learning that Bitcoin doesn't have a way to represent the account balance, but it's, rather, a sum of UTXO owned by the users of the private key. Then where is the change from the output stored?

What I mean is, when the output of a transaction is used as the input of another transaction, it must be spent in its entirety. Sometimes the coin value of the output is higher than what the user wishes to pay. In this case, the client generates a new Bitcoin address, and sends the difference back to this address.

Does the change get stored back in UTXO?

1 Answer 1


When a sender creates a transaction, they explicitly define which pieces of bitcoin they spend. We call such pieces of bitcoin Unspent Transaction Outputs (UTXO) and you can think of the UTXO set as the distributed ledger of Bitcoin balances. The state of UTXO is ternary: they either don't exist yet, are available for spending, or have been spent. You can't deduct from a UTXO, they must be spent completely in one transaction.

Spenders explicitly pick the transaction inputs by referencing the UTXO via its unique outpoint txid:vout which is derived from the transaction that created the to-be-spent UTXO and its position in the output list.

After declaring the UTXO getting spent, the spender has assignable balance to the sum of the inputs' total value. The spender will explicitly assign the value of the consumed inputs to new outputs. Any funds not assigned are considered transaction fees and will be collectable by the miner that includes the transaction in a block.

This means the total of assigned funds is less or equal than the value of the spent UTXOs, and the remainder is the transaction fee. The following hold true for non-coinbase transactions:

  • Σ(outputs) ≤ Σ(inputs)
  • transaction fees = Σ(inputs) - Σ(outputs)

So, only the inputs and outputs on transactions are explicitly defined. The transaction fee is implicitly defined by the inputs and output.

It follows that a simple transaction sending to a single recipient will usually have two outputs:

  • a recipient output to conduct the payment
  • a change output to return the remaining funds from the inputs to the sender

I grabbed a random transaction from blockchair.com to visualize:

transaction with one input and two outputs of which one has a round number amount

If Alice's wallet had not created the change output to itself, Alice would have paid 11,044.… BTC in additional fees. ;)

Note, that I'm simply guessing that the 610 BTC is the recipient output due to the round number, I'm not intimately familiar with this transaction.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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