Understanding UTXO (Unspent Transaction Output)
UTXO (Unspent Transaction Output) represents a fundamental building block of Bitcoin's transaction model. Unlike traditional account-based payment systems where balances are stored numerically, cryptocurrencies using the UTXO model track funds differently.
In traditional banking:
When Person A sends $20 to Person B:
- The system verifies A's account has โฅ$20
- $20 is added to B's account
- $20 is deducted from A's account
With Bitcoin's UTXO model:
- Your "balance" consists of all unspent transaction outputs associated with your address
- Essentially, your Bitcoin holdings are represented by collections of UTXOs
Practical Example
Transaction 1001: Zhangsan mines 12.5 BTC (creating 12.5 UTXOs) sent to his address
Transaction 2001: Zhangsan sends Lisi 2.5 BTC:
- Input: 12.5 UTXO from Transaction 1001
- Outputs: 2.5 BTC to Lisi + 10 BTC returned to Zhangsan's address
Transaction 3001: Zhangsan and Lisi jointly send Wangwu 5 BTC: - Inputs: Two outputs from Transaction 2001
- Outputs: 5 BTC to Wangwu + 7.5 BTC returned to Zhangsan
๐ Learn more about Bitcoin transactions
Each block's first transaction (Coinbase) represents newly minted Bitcoin through mining - it has outputs but no inputs.
Transaction Structure
Transactions consist of inputs and outputs with this general format:
{
"txid":"5be7a9e47f56c98e5297a44df52da0475f448ece98bb51489103cdf70653092f",
"version":1,
"vin": [...],
"vout": [...],
"blockhash":"0000000000000000000c23ca00756364067ce5e815deb5982969df476bfc0b5c"
}Key components:
vin: Inputs (references to UTXOs being spent)vout: Outputs (new UTXOs being created)
The transaction is valid only when:
sum(inputs.value) = sum(outputs.value) + feeTransaction Inputs
Inputs reference specific UTXOs being spent:
{
"txid":"672042728dc9ce9a60aeb96df9e9817562648235b685f81f5eb7cbe601410ba9",
"vout":0,
"scriptSig":{...}
}txid: Transaction ID containing the UTXOvout: Index number of the output being spent
Transaction Outputs
Each unspent output becomes a new UTXO:
{
"value":0.10500000,
"scriptPubKey":{
"addresses":["3CcqrGq4oQcfx3u75ijj4tDiqf4HJvhoeP"]
}
}value: Amount being transferredscriptPubKey: Conditions for spending these funds
๐ Discover how Bitcoin wallets manage UTXOs
Key Characteristics
- Multiple Inputs/Outputs: Transactions can combine funds from multiple sources and distribute to multiple recipients
- Change Handling: When spending part of a UTXO, the remainder returns as "change" forming a new UTXO
- Indivisibility: Each UTXO is spent in its entirety - partial spending requires creating new UTXOs
FAQ Section
Q: Why does Bitcoin use UTXOs instead of account balances?
A: The UTXO model provides better privacy (no persistent addresses) and simpler verification of transaction validity.
Q: What happens when I receive multiple small UTXOs?
A: Your wallet combines them automatically when making transactions, though this may increase fees.
Q: How does a wallet know which UTXOs belong to it?
A: Wallets scan the blockchain for outputs containing addresses they control.
Q: What's the difference between confirmed and unconfirmed UTXOs?
A: Confirmed UTXOs are in validated blocks; unconfirmed ones are in pending transactions.
Q: Can UTXOs be too small to spend?
A: Yes - if the value is less than the network fee required to spend it, the UTXO becomes effectively unspendable.
Q: How do UTXOs affect transaction privacy?
A: Analyzing UTXO patterns can sometimes reveal connections between addresses, which is why new protocols like CoinJoin exist.