Passer au contenu

Bitcoin accepté au paiement  |  Expédié depuis Laval, QC, Canada  |  Soutien expert depuis 2016

Coinstats Index

Network & Protocol

Definition

The coinstats index, enabled with -coinstatsindex=1, is an optional Bitcoin Core database that precomputes statistics about the unspent transaction output set at every block height. Its purpose is to make the gettxoutsetinfo RPC instant and, more importantly, queryable for arbitrary past heights. Without the index, that RPC must iterate the entire UTXO set — well over a hundred million entries — which takes minutes of heavy disk work and can only answer for the current tip. With it, questions like "exactly how much bitcoin existed at block 840,000?" come back in milliseconds.

What it tracks

Stored under indexes/coinstatsindex/ in the data directory, the index maintains a running, height-by-height accounting of the UTXO set using a hash-and-aggregate scheme (the MuHash rolling hash) that can be updated incrementally as blocks arrive and unwound cleanly during reorgs. Per height it records the count of unspent outputs, the total amount in circulation, cumulative subsidies and fees, and — the subtle part — the value that is provably unspendable: OP_RETURN burns, outputs rendered unreachable by consensus quirks, and the genesis block's unclaimable subsidy. That last category is why the honest circulating supply is slightly below the naive schedule, and the index is what lets you quantify the gap precisely instead of repeating folklore.

Auditing the 21 million

This is the index's marquee use: independently verifying Bitcoin's monetary policy against the live chain. "Don't trust, verify" is easy to say about supply; the coinstats index is the tool that makes it a five-second command rather than a research project. Anyone running a node with the index can confirm the issuance schedule, watch each halving take effect in the data, and check that no inflation bug has ever minted unexpected coins — the audit that gettxoutsetinfo performs is your own hardware speaking, not an explorer's API. Researchers and dashboard builders use the same per-height data to chart UTXO-set growth, fee totals, and burn statistics over time.

Costs and compatibility

Like every optional index it costs an initial backfill pass over the whole chain (bundled into a reindex if you enable it late) and a modest, steadily growing slice of disk. Its compatibility profile is friendlier than most: because it summarizes UTXO state rather than pointing into historical block files, the coinstats index works on a pruned node — unlike the transaction index, which needs the full block archive. That makes it one of the cheapest sovereignty upgrades available: even a small-disk node on a single-board computer can keep a full, queryable audit trail of the money supply. One operational note: if the index was disabled while blocks were processed, Core must sync it forward (or reindex) before queries at recent heights succeed.

Where it sits among the indexes

The MuHash design also gives the index a verification superpower: two independent nodes can compare their UTXO-set hashes at any height and confirm, with a single 32-byte comparison, that they agree on the entire monetary state of the system — millions of unspent outputs summarized into one short number that either matches exactly or does not. It is consensus auditing reduced to its most minimal and honest possible form.

Bitcoin Core's optional indexes each answer a different question: txindex finds any historical transaction by ID, the block filter index serves compact filters to light clients, and the coinstats index audits aggregate monetary state through time. A node operator who understands which questions they intend to ask can enable exactly the indexes that earn their disk — and for anyone whose reason for running a node includes verifying that the 21-million promise is being kept, this one earns it easily.

In Simple Terms

The coinstats index, enabled with -coinstatsindex=1, is an optional Bitcoin Core database that precomputes statistics about the unspent transaction output set at every block height.…

Explore the Full Glossary

Browse all Bitcoin mining terms from A to Z. Whether you are a beginner or expert, deepen your understanding of the mining ecosystem.

Glossaire du minage

ASIC Miner Database

Compare 500+ miners with real-time profitability data, home mining scores, and detailed specs.

Comparer les mineurs