Understanding UTXOs

How Bitcoin tracks balances using Unspent Transaction Outputs instead of accounts. The foundation of every transaction you'll build.

0steps ·

Progress 0/0

What You’ll Learn

  • How the UTXO model differs from the account model
  • What a UTXO contains and how it is identified
  • How to find spendable UTXOs for a given address

The Account Model vs. The Coin Model

Most financial systems use an account model. Your bank stores a row: Alice: $5,000. When Alice pays Bob $200, the bank subtracts from Alice and adds to Bob. Simple, but it requires a trusted central ledger.

Bitcoin uses a coin model. There is no “balance” field anywhere. Instead, the network tracks individual coins — Unspent Transaction Outputs (UTXOs). Your wallet balance is the sum of all UTXOs that your private keys can spend.

Account ModelUTXO Model
Central ledger tracks balancesNo balances — only coins
One entry per accountMultiple UTXOs per address
Subtraction and additionConsumption and creation
Must process sequentiallyCan verify in parallel

Anatomy of a UTXO

Every UTXO is uniquely identified by two pieces of data:

  • Transaction ID (txid): The 32-byte hash of the transaction that created this output
  • Output Index (vout): Which output in that transaction (0, 1, 2…)

Together, txid:vout is like a serial number for a specific coin. The UTXO itself contains:

txid:    a1b2c3d4e5f6...  (32 bytes)
vout:    0                 (output index)
value:   50000             (satoshis = 0.0005 BTC)
script:  OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG

The script field (called ScriptPubKey or locking script) defines the conditions required to spend this UTXO. For a standard P2PKH output, it requires the spender to prove ownership of the corresponding private key.

UTXO Lifecycle

  1. Birth: A UTXO is created as an output of a confirmed transaction
  2. Existence: It sits in the UTXO set — a database every full node maintains
  3. Death: It is consumed as an input to a new transaction, permanently removed from the UTXO set

A UTXO can only be spent once and in full. If you have a 1 BTC UTXO and want to send 0.3 BTC, you must consume the entire 1 BTC and create two new outputs: 0.3 BTC for the recipient and ~0.6999 BTC back to yourself as change.

Finding Your UTXOs

Using Bitcoin Core’s CLI, you can list your spendable UTXOs:

bitcoin-cli listunspent

# Returns:
[
  {
    "txid": "a1b2c3d4...",
    "vout": 0,
    "address": "bc1q...",
    "amount": 0.00050000,
    "confirmations": 144,
    "spendable": true
  }
]

For our transaction, we need to pick one or more UTXOs whose total value covers the amount we want to send plus the transaction fee.

Why This Matters for Building Transactions

Every transaction input is a pointer to an existing UTXO. When we construct our transaction in the next steps, the first thing we need is a list of UTXOs we want to spend — their txid, vout, and value. Without understanding UTXOs, the rest of the process is impossible.

Key takeaway: a Bitcoin transaction does not move money between accounts. It destroys old coins and mints new ones.

Next Step

Continue to Constructing Transaction Inputs to learn how to reference UTXOs as inputs in your transaction.