UTXO
A bitcoin UTXO is an unspent transaction output. Learn how the UTXO set lets nodes check transactions and count the balance of an address.
By Dimitar Zurnov · Updated 4 Nov 2026
Adapted from Learn Me a Bitcoin by Greg Walker.
A UTXO is an unspent transaction output: an output that no later transaction has spent yet. The UTXO set is the collection of all of them. Nodes check every new transaction against this set. Wallets and explorers add up the UTXOs locked to an address to show its balance.
What makes an output unspent?
Every transaction creates outputs, and each output can be used as an input in a later transaction. When an output is used, it is consumed whole. Any change goes back to the sender as a new output.
So if you picture all transactions as one large graph, the UTXOs are the loose ends. Each one is a piece of bitcoin that can still be spent.
Why do nodes track the UTXO set?
A node needs the set for two jobs: checking new transactions, and counting balances. Both depend on knowing which outputs are still unspent.
How does a node check a transaction?
When a transaction arrives, the node reads each input. An input names an output by its outpoint, which is the transaction ID followed by the output's index, vout. The output must be in the UTXO set. If it is missing, the transaction is rejected, because the output was either spent already or never existed.
Being in the set is only half of the test. The node also checks that the input's unlocking data satisfies the output's lock, such as a valid signature. The UTXO set answers "is this output available?", and the scripts answer "may this spender use it?".
How is an address balance counted?
Add up the UTXOs locked to an address, and you have its balance. Bitcoin does not sit inside addresses. Coins are held by outputs, and an address is the lock placed on an output. Two different outputs can belong to the same address, and each counts toward the balance.
On our explorer, an address page under /address/<address> lists its unspent outputs. Its balance is their total. Any valid address works, including addresses that have never been used, which show an empty set.
Where is the UTXO set stored?
In Bitcoin Core, the set lives in the chainstate folder, inside the node's data directory. That database is a LevelDB key-value store. Each entry has:
- Key: the outpoint, the transaction ID and the output index, which identifies one output uniquely.
- Value: the height of the block that created the output, a flag saying whether it came from a coinbase transaction, the amount in satoshis, and the locking script.
When a block arrives, the node removes each output that the block spends and adds each new output. The set therefore always reflects the chain as it stands.
How does RAM fit in?
The database is on disk, but the node keeps part of it in memory as a cache. The -dbcache option sets how much memory that cache may use, in MiB. Since Bitcoin Core 31.0, the default is 1,024 MiB on machines with at least 4 GiB of RAM, and 450 MiB on smaller ones. A bigger cache lets the node check incoming transactions without reading the disk as often, which speeds up validation.
How do you measure the UTXO set?
The gettxoutsetinfo command reads the whole set and reports summary figures. Run on a node, it reports:
txouts: the number of unspent outputs.transactions: the number of transactions that still have unspent outputs.total_amount: the value of every unspent output, in BTC.disk_size: how much disk space the set takes.
The command scans the whole set, so it can take a few seconds or longer, and it is not something to run in a loop.
The total_amount figure is close to the coins in circulation, but not exact. Coins that are lost for good stay unspent, so they remain in the set. Outputs that can never be spent, such as those whose lock starts with OP_RETURN, are not added to the set at all.
Why do coinbase outputs wait 100 blocks?
The first transaction in each block, the coinbase, pays the block reward and the fees to the miner. Its outputs cannot be spent until they have 100 confirmations, a rule set by COINBASE_MATURITY in Bitcoin Core's consensus code.
The UTXO set records the coinbase flag for this reason. The node can then tell whether an output is old enough to spend, without looking up the block that created it.
Can an output be spent before it is confirmed?
Yes, with a catch. A transaction can spend an output from a transaction that is still in the mempool, the waiting area for unconfirmed transactions. The node checks such a spend against the UTXO set and the mempool together. This is how child pays for parent works: a new transaction spends an unconfirmed output to pull the old one into a block.
Summary
A UTXO is an output that has not been spent. Nodes keep all of them in the UTXO set, use it to reject double spends, and add up the UTXOs locked to an address to get its balance. The set lives on disk and is partly cached in memory, so a node can check transactions quickly. The inputs of a transaction spend UTXOs, and whatever the outputs do not claim becomes the fee, which the fee page explains.
Sources
- Bitcoin Core consensus constants, including
COINBASE_MATURITY. - Bitcoin Core kernel cache settings, which define the database cache sizes.
- Bitcoin Core 31.0 release notes raise the default
-dbcacheto 1,024 MiB on machines with at least 4 GiB of RAM.
In this section: Transactions
Something look wrong? Tell us