Chain State (UTXO Set Database)
The live set of unspent outputs a node needs to check new transactions, separate from the historical blocks.
Basically
Chain state records all the bitcoin that has not yet been spent. Your node uses this record to check new transactions.
Key Takeaways
- Chain state is the minimal dataset a Bitcoin node needs to validate new transactions. It contains every unspent transaction output that currently exists on the network.
- Bitcoin Core stores the chainstate in a LevelDB database on disk. It grows as more UTXOs are created and currently occupies roughly 11 GB across over 173 million entries, directly affecting the hardware requirements for running a full node.
- AssumeUTXO lets new nodes load a pre-verified chainstate snapshot. They can begin validating transactions in minutes rather than waiting hours for a full initial block download.
What Is Chain State?
Chain state, often called the chainstate or UTXO set database, is the collection of all unspent transaction outputs on the Bitcoin network at a given block height. A node checks this database whenever it receives a new transaction to confirm that the inputs exist and have not already been used. Without the chain state, a node would need to replay the entire blockchain from the genesis block to verify a single transaction.
The chain state works like a ledger of all spendable coins. Spending a UTXO removes its entry, while creating new outputs adds them. The chain state always provides a snapshot of the current balance sheet, showing what coins exist right now, who can spend them, and under what conditions.
Bitcoin Core stores this data in a LevelDB database within the chainstate/ directory of the node's data folder. The blocks/ directory is separate and stores the raw block data. A pruned node can discard old block data but must always retain the full chain state to validate new transactions.
How It Works
A Bitcoin node updates the chain state when it processes a new block. It applies two operations for each transaction in the block.
The chain state is always derived from the blockchain history but represents only the current state. It discards everything that has already been spent and keeps only what matters for validating future transactions.
LevelDB Storage Format
Bitcoin Core uses LevelDB 1.22, maintained as a custom fork with Bitcoin-specific patches, to store the chainstate. Each UTXO entry is keyed by the transaction ID and output index, prefixed with the byte C. The best block hash is stored under the B prefix.
All values in the chainstate database are XOR-obfuscated with a random 8-byte key unique to each node. The obfuscation prevents antivirus software from flagging the database files as malicious because raw UTXO data can accidentally match virus signatures. The obfuscation key is stored as the first entry under the key name obfuscate_key.
The gettxoutsetinfo RPC command summarises the current UTXO set, including the total number of unspent outputs, the total amount of bitcoin they represent, and the on-disk size. The muhash field provides a cryptographic hash of the entire set that nodes can compare to verify consistency.
What Each UTXO Entry Contains
Each entry in the chainstate database has one purpose. It stores the minimum information needed to validate a spend.
Bitcoin Core compresses this data aggressively. Values use variable-length encoding, and scripts matching common templates such as P2PKH, P2SH, P2WPKH and P2WSH use a compressed format that omits predictable bytes.
Transaction Validation Flow
A node validates each new transaction against the chain state. These checks confirm that the transaction can spend its stated inputs.
Chain State Size and Growth
The Bitcoin chainstate database contained over 173 million UTXOs and occupied approximately 11 GB on disk as of early 2025. Its size has grown substantially over Bitcoin's history, with notable spikes during periods of high inscription and BRC-20 activity. Roughly 49% of all UTXOs hold fewer than 1,000 sats, and about 30% are related to inscriptions.
Chain state growth directly affects the cost of running a full node. The full blockchain in the blocks/ directory exceeds 750 GB, but a pruned node can discard old blocks and operate with the chainstate plus a small buffer. The chainstate itself cannot be pruned because every active UTXO must remain accessible for transaction validation.
Chain state growth creates a tension between network usage and decentralisation. More UTXOs mean a larger chainstate, which requires more RAM and faster storage for optimal node performance. UTXO consolidation helps reduce the set size, while protocols that create many small UTXOs expand it; for a deeper analysis of managing UTXO growth, see the UTXO management strategies research article.
AssumeUTXO: Faster Bootstrapping
The initial block download (IBD) is one of the biggest barriers to running a Bitcoin node. It processes every block from genesis to reconstruct the current chain state and can take over 10 hours even on modern hardware. AssumeUTXO addresses this by letting nodes load a pre-computed UTXO snapshot and begin operating almost immediately.
Bitcoin Core 28.0, released in October 2024, was the first version to ship with mainnet AssumeUTXO parameters, hardcoded at block height 840,000. Bitcoin Core 30.0 added a second snapshot at height 910,000. The process works as follows.
Benchmarks show that loading a snapshot and syncing to the chain tip takes roughly 90 minutes, compared with over 10 hours for a traditional IBD. The node remains useful during background validation because it can validate new blocks and transactions immediately, even before the full historical check completes. For a detailed walkthrough, see the AssumeUTXO fast sync research article.
UTXO Commitments
UTXO commitments are a related proposal that would embed a cryptographic hash of the entire UTXO set into each block header. Any node could then verify a UTXO snapshot against the blockchain without trusting the snapshot provider.
AssumeUTXO currently relies on hardcoded hashes in the Bitcoin Core source code. UTXO commitments would make this trustless by tying the hash to the consensus rules themselves. However, this requires a soft fork and raises concerns about the computational cost of maintaining a commitment structure, such as a Merkle tree or accumulator, over the UTXO set at every block.
Why It Matters
The chain state is the foundation of Bitcoin's security model. Every full node independently maintains and verifies its own copy of the UTXO set, ensuring that no one can spend coins that do not exist or have already been spent. Bitcoin is trustless because validation depends only on the data each node holds, not on any central authority.
Layer-2 protocols like the Lightning Network and Spark use the chain state as the ultimate settlement layer. Channels are opened and closed with on-chain transactions that create and spend UTXOs. The security of off-chain payments ultimately derives from the ability to broadcast a transaction and have the base layer validate it against the chain state.
Pruned nodes remain fully validating because they discard historical block data but keep the complete UTXO set. A pruned node cannot serve old blocks to other nodes, but it can independently verify every new transaction and block with the same security guarantees as a node storing the full blockchain. For a comparison of node types and their trade-offs, see the node implementation comparison research article.
UTXO Set Bloat
Uncontrolled growth of the UTXO set increases the resources required to run a full node. A chainstate that exceeds available RAM forces nodes to perform more disk reads during validation, slowing down block processing. Activities that create large numbers of small, unspendable or dust-threshold UTXOs, such as certain inscription protocols, accelerate this growth.
The dust limit partly mitigates this growth by refusing to relay transactions with outputs below a minimum value, preventing the cheapest forms of UTXO set pollution. However, the dust limit is a policy rule rather than a consensus rule, and miners can include dust outputs in blocks they mine.
Corruption and Recovery
The chainstate is a derived dataset computed from block data, so corruption is recoverable but expensive. Power loss, disk failure or software bugs can corrupt the LevelDB database. The node must then restore from a backup or perform a full reindex by replaying all blocks from the blocks/ directory, which can take many hours on modern hardware.
Snapshot Trust Model
AssumeUTXO introduces a temporary trust assumption until background validation completes. During that period, the node trusts that the hardcoded snapshot hash in the Bitcoin Core source code is correct. If a malicious snapshot were loaded and the hash were somehow compromised, the node would accept invalid transactions during the background validation period. The open-source review process for Bitcoin Core releases mitigates this risk, and background validation eventually catches any discrepancy.
This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.