executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
bitcoin-core-indexesBitcoin Core indexes: txindex, blockfilterindex (BIP157/158), coinstatsindex, txospenderindex. Disk costs, rebuild times, when each is needed. USE WHEN: choosing which indexes to enable, troubleshooting "txid not found", integrating with electrs / fulcrum / LN nodes.
Independent GitHub snapshot · Automated classification · Original documentation governs
Four optional indexes as of Bitcoin Core 31.1 (July 2026), in addition to the always-on UTXO set:
txindex=1
Maps every txid to its block / position. Enables:
getrawtransaction <txid> for any historical tx (without
txindex, only mempool + recent blocks since restart).Cost:
When to enable:
When to skip:
blockfilterindex=1
peerblockfilters=1 # serve filters to peers
Maintains compact block filters per block. Enables:
getblockfilter <blockhash> RPC.Cost:
When to enable:
coinstatsindex=1
Maintains rolling stats for gettxoutsetinfo (UTXO set value, count,
hash) without a full scan.
Cost:
When to enable:
gettxoutsetinfo (without it, the call takes
minutes and locks the wallet).Without it, gettxoutsetinfo still works but does a full scan
on-demand → slow.
Upgrade note: Bitcoin Core 30.0 (October 2025) rewrote the index to fix
an overflow bug, and the rewritten index syncs from scratch on the first
start after the upgrade. It is stored at indexes/coinstatsindex/; the
pre-30.0 index at indexes/coinstats/ is deliberately left in place for
downgrades and must be deleted by hand to reclaim the space. Core logs a
warning naming the old directory on every start while it exists.
txospenderindex=1
Added in Bitcoin Core 31.0 (April 2026); default off. Records, for every non-coinbase input of every block transaction, which transaction spent that outpoint. Enables:
gettxspendingprevout to answer for confirmed spends, not just
mempool ones. With the index available the RPC also returns the
blockhash of the spending block.gettxspendingprevout gained two options in 31.0 alongside the index:
mempool_only (defaults to true only when the index is unavailable; set
false to fall through to the index) and return_spending_tx (returns
the full spending tx as spendingtx).
Cost:
When to enable:
When to skip:
All four can be enabled together. Pruning is incompatible with txindex
and, since 31.0, with txospenderindex; blockfilterindex and
coinstatsindex both work on a pruned node.
Typical configurations:
| Use case | txindex | blockfilterindex | coinstatsindex | prune |
|---|---|---|---|---|
| Personal wallet | no | no | no | optional |
| LN node (LDK) | no | yes | optional | no |
| LN node (LND/CLN) | no | optional | optional | no |
| Electrs/Fulcrum host | no | yes | optional | no |
| Block explorer | yes | yes | yes | no |
| Forensic / API | yes | optional | yes | no |
| Lightweight personal | no | no | no | yes (550-15000) |
Adding txindex=1 to existing node:
# Stop node
bitcoin-cli stop
# Edit conf, add txindex=1
# Restart; node rebuilds index
bitcoind -daemon
# Watch
tail -f ~/.bitcoin/debug.log
Output:
2025-... reindex-chainstate already=true txindex=true blockfilterindex=true coinstatsindex=true
2025-... Building txindex
... (hours later) ...
2025-... txindex is enabled
To force rebuild from scratch: -reindex (full reindex, days) or
-reindex-chainstate (UTXO + indexes only, hours).
Paths per doc/files.md at v31.1 (July 2026):
<datadir>/indexes/txindex/ — LevelDB.<datadir>/indexes/txospenderindex/ — LevelDB (31.0+).<datadir>/indexes/blockfilter/basic/ — filter files, plus a
db/ LevelDB alongside them.<datadir>/indexes/coinstatsindex/ — LevelDB (30.0+; the pre-30.0
index lived at indexes/coinstats/).txindex=1 to a pruned node → bitcoind exits.txindex from conf → bitcoind warns but continues with
index "stuck"; manually delete indexes/txindex/ to free disk.peerblockfilters=1 and
blockfilterindex=1 are both set.txospenderindex=1 to a pruned node → bitcoind exits, same as
txindex.indexes/coinstats/ is still there next to the new
indexes/coinstatsindex/; delete the old one once you are sure you
will not downgrade to 29.x or lower.