How Bitcoin Balances Are Stored as UTXO
What is a UTXO in Bitcoin?
In Bitcoin, user balances are not stored as account balances like a bank account. Instead, the Bitcoin blockchain tracks individual pieces of bitcoin called UTXOs (Unspent Transaction Outputs).
A UTXO represents a specific amount of bitcoin created by a previous transaction that has not yet been spent. Your total bitcoin balance is simply the sum of all UTXOs that belong to your Bitcoin address on the blockchain.
To understand this better, it helps to think about how we use physical cash.
Understanding UTXO Using a Cash Example
Step 1: Imagine You Have Cash
You have one $10 note.
Step 2: You Buy Something
You go to a grocery store and buy milk for $3. But you don't have exact change, so you give the cashier your $10 note.
Step 3: The Cashier Processes the Payment
The cashier:
- •Keeps $3 as payment
- •Returns $7 as change
You might receive the $7 as $5 + $2, or $1 + $1 + $5, or other combinations.
Step 4: What Happened to Your Original Note?
Your original $10 note no longer exists in your possession. It was fully used in the transaction. Now you hold new notes totaling $7.
Before payment:
- •$10 (one note)
After payment:
- •$7 (new notes)
Your balance changed, but more importantly:
- •The original note was completely spent
- •New pieces of money replaced it
Now Let's Map This to Bitcoin
Bitcoin transactions work in a very similar way.
Step 5: Your Bitcoin "Note" (UTXO)
In Bitcoin, money exists as UTXOs recorded on the blockchain. You control one UTXO worth 0.01 BTC. This is similar to holding a $10 note.
Step 6: You Want to Send Bitcoin
Suppose you want to send 0.003 BTC to someone. But you only control one UTXO worth 0.01 BTC. Just like a cash note, a UTXO cannot be partially spent. It must be used completely in a transaction.
Step 7: The Transaction Splits the Value
The Bitcoin transaction does three things:
- •Uses your existing UTXO as an input (0.01 BTC)
- •Creates an output for the recipient (0.003 BTC)
- •Creates another output for the remaining amount (change)
Input:
- •0.01 BTC UTXO
Outputs:
- •0.003 BTC to the receiver
- •0.007 BTC returned as change
Step 8: The Old UTXO Is Consumed
Just like the $10 note was used completely, the original UTXO is fully consumed by the transaction. It no longer exists. Instead, the transaction creates new UTXOs on the Bitcoin blockchain:
- •One belonging to the receiver
- •One representing the remaining amount
What Does UTXO Mean?
UTXO = Unspent Transaction Output
It simply means: A piece of bitcoin created by a previous transaction that has not yet been spent and is still available to be used in a future transaction.
The Global Set of UTXOs
The Bitcoin network maintains a global list of all UTXOs on the blockchain. When someone sends bitcoin, the network:
- •Selects one or more UTXOs controlled by the sender
- •Spends them completely
- •Creates new UTXOs for the recipient and the remaining change
Simple Summary
Think of Bitcoin like digital cash notes stored on the blockchain.
- •A UTXO is like a cash note
- •When it is used, the entire note is spent
- •The transaction creates new pieces of bitcoin for the recipient and for the remaining change
UTXO is the unspent portion of bitcoin created by previous transactions on the blockchain that can be used in future transactions.