← Back to all topics

UTXOs & Change

Why Bitcoin transactions work like cash, not like bank transfers

The Confusion

"I sent 0.5 BTC but my wallet shows a different balance than expected. Where did the rest go?"

This happens because Bitcoin doesn't work like a bank account with a running balance. Instead, it uses UTXOs — Unspent Transaction Outputs — which work more like physical cash or coins in your pocket.

Bank Account vs Bitcoin

🏦 Bank Account Model

You have a balance: $1,000

You spend $300

New balance: $700

The bank just updates a number in a database.

₿ Bitcoin UTXO Model

You have coins: 0.6 + 0.3 + 0.1 BTC

You spend 0.5 BTC

Use the 0.6 coin, get 0.1 back as change

You're spending actual "coins" and receiving change.

The Cash Analogy

💵 Think: Paying with Physical Notes

Imagine you have three notes in your wallet: a £20, a £10, and a £5. Your total is £35.

You want to buy something for £12. You can't just "send £12" — you have to hand over actual notes. You give the £20 note, and the shopkeeper gives you £8 back as change.

Now your wallet has: £10 + £5 + £8 = £23. The original £20 note is gone forever — it's been "spent". The £8 is a brand new note (a new UTXO).

Key insight: In Bitcoin, you don't have a "balance" — you have a collection of individual UTXOs (like coins/notes). When you spend, you consume entire UTXOs and create new ones as outputs.

Interactive Demo: Spend Some Bitcoin

Your Wallet (UTXOs)

Click on UTXOs to select them for spending:

0
Total Balance (BTC)
0
Selected (BTC)
0
UTXO Count

Create Transaction

Inputs (Selected UTXOs)
None selected
Outputs
Wallet initialized with sample UTXOs

Why UTXOs Matter

Privacy Implications

When you spend multiple UTXOs in one transaction, you're revealing they belong to the same person. This is called common input ownership heuristic — blockchain analysts use it to cluster addresses.

Fee Optimization

Transaction fees are based on data size, not value. A transaction spending 10 small UTXOs costs more in fees than one spending a single large UTXO (more inputs = more data).

Dust UTXOs

Watch out for dust: Very small UTXOs (e.g., 0.00001 BTC) can cost more in fees to spend than they're worth. These are called "dust" and can clutter your wallet.

UTXO Consolidation

When fees are low, it's smart to consolidate many small UTXOs into fewer larger ones. Send a transaction to yourself that combines multiple inputs into one output.

Technical Details

What's actually in a UTXO?

The UTXO Set

Every Bitcoin node maintains a database of all unspent outputs — the "UTXO set". Currently it's about 5-7 GB. When you spend a UTXO, it's removed from this set. When you create new outputs, they're added.

Why this design? UTXOs make validation simple and parallelizable. To verify a transaction, nodes just check: "Do these inputs exist in the UTXO set? Does the signature unlock them? Do outputs not exceed inputs?" No need to replay the entire transaction history.