The UTXO Set (Chainstate)
The UTXO Set (Chainstate)
While the blockchain is a record of every transaction that ever happened, a Bitcoin node does not look at the whole blockchain to verify a new payment. Instead, it maintains a highly optimized database called the UTXO Set, also known as the Chainstate.
1. What is in the UTXO Set?
The UTXO set is a snapshot of all currently spendable coins.
-
When a new block is mined, the node adds the new outputs created in that block to the set.
-
The node removes any outputs that were used as inputs in that block.
2. Storage on Disk: LevelDB
Bitcoin Core uses a high-performance key-value database called LevelDB to store the chainstate. It is usually located in the chainstate/ directory of your data folder.
-
Value: The amount (satoshis), the scriptPubKey, and the block height.
3. The RAM Constraint
Because nodes must check the UTXO set for every single transaction they receive, they try to keep as much of it as possible in RAM.
-
The size of the UTXO set is the primary bottleneck for Bitcoin node performance.
-
As of 2024, there are over 150 million entries in the global UTXO set, taking up several gigabytes of space.
4. Pruning and the UTXO Set
Even if you run a Pruned Node (deleting old block data to save space), you must keep the entire UTXO set. You cannot verify new transactions without knowing which coins are currently unspent.
| Database | Contains | Size (Approx) | Growth |
|---|---|---|---|
| Blocks | Full History | 600 GB | Linear |
| Chainstate | Current UTXOs | 5-10 GB | Variable |
In the next section, we will explore the "Primary Key" of the UTXO set: Outpoints.
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: