3.1 Introduction
Instead, Bitcoin is made up of individual pieces of value called UTXOs. Unspent Transaction Outputs. Understanding UTXOs is essential for properly designing, building, and reasoning about Bitcoin wallets.3.2 What is a UTXO?
A UTXO is a piece of bitcoin that:- Has been sent to a Bitcoin address.
- Has not yet been spent.
- Is ready to be used as input to a future transaction.
3.3 Example: UTXOs in action
Suppose:- Ali receives 0.5 BTC from Dapo.
- Later, Ali receives 1.0 BTC from Kwame.
- UTXO1: 0.5 BTC
- UTXO2: 1.0 BTC
- His wallet must choose UTXOs to spend.
- Likely, the wallet will spend UTXO2 (1.0 BTC) fully.
- Create an output sending 0.8 BTC to Dapo.
- Return the leftover 0.2 BTC back to Ali as change.
3.4 Visual diagram: UTXO flow
3.5 Important properties of UTXOs
3.6 Wallet responsibilities with UTXOs
A Bitcoin wallet must:- Keep track of all UTXOs controlled by the user’s private keys.
- Select appropriate UTXOs when building a transaction (smart coin selection).
- Handle change outputs carefully to maintain privacy and efficiency.
- Consolidate small UTXOs when network fees are low.
- Warn users or sweep dust when necessary.
Even a simple “send” button click involves complex UTXO selection behind the scenes.
3.7 UTXO selection strategies
Wallets must often choose which UTXOs to use when sending bitcoin. Different strategies impact:- Transaction fees
- Privacy
- UX performance
Well-designed wallets adapt strategies based on transaction size, urgency, and user preferences.
3.8 Dust and wallet bloat
Dust = very small UTXOs that cost more to spend than they are worth. Example: A UTXO of 200 satoshis. If it costs 400 satoshis in fees to spend, it is dust. Wallets must:- Avoid creating dust outputs.
- Consolidate dust during periods of low network fees.
- Warn users when transactions would produce dust.
- Expensive transactions.
- Slower wallet performance.
- Difficulty moving funds quickly.
3.9 PM reflection points
If you are managing a Bitcoin wallet product:- Always remember that users’ “balances” are not simple numbers. They are collections of UTXOs.
- Wallet apps must hide UTXO complexity, but handle it carefully behind the scenes.
- Smart UTXO management improves:
- Fee efficiency
- Privacy
- Long-term wallet usability
- Backup flows must protect all keys necessary to spend future UTXOs.
- Change addresses must be rotated automatically to protect privacy.
3.10 Summary of module 3
- Bitcoin’s data model is a system of UTXOs, not account balances.
- UTXOs are indivisible chunks of bitcoin locked to addresses.
- Transactions consume old UTXOs and create new UTXOs.
- Wallets are responsible for tracking, selecting, and managing UTXOs intelligently.
- Poor UTXO management leads to high fees, privacy loss, and poor user experience.