Bitcoin Fundamentals: Transactions and UTXO Explained

ยท

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:

  1. 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:

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:

๐Ÿ‘‰ 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:

The transaction is valid only when:

sum(inputs.value) = sum(outputs.value) + fee

Transaction Inputs

Inputs reference specific UTXOs being spent:

{
 "txid":"672042728dc9ce9a60aeb96df9e9817562648235b685f81f5eb7cbe601410ba9",
 "vout":0,
 "scriptSig":{...}
}

Transaction Outputs

Each unspent output becomes a new UTXO:

{
 "value":0.10500000,
 "scriptPubKey":{
   "addresses":["3CcqrGq4oQcfx3u75ijj4tDiqf4HJvhoeP"]
 }
}

๐Ÿ‘‰ Discover how Bitcoin wallets manage UTXOs

Key Characteristics

  1. Multiple Inputs/Outputs: Transactions can combine funds from multiple sources and distribute to multiple recipients
  2. Change Handling: When spending part of a UTXO, the remainder returns as "change" forming a new UTXO
  3. 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.