This guide explains Bitcoin Core scanblocks RPC in plain English. It shows what the command does, what its result means and what it cannot prove.
TL;DR
- What it is: Bitcoin Core 25.0 introduced scanblocks to scan compact block filters for scripts derived from descriptors and return block hashes that may be relevant. It requires a completed blockfilterindex.
- Why it matters: scanblocks accelerates discovery by narrowing the block set, but it does not complete wallet recovery. Reliable use preserves descriptor and range evidence, verifies candidates against blocks and reconciles the resulting wallet history.
- Current position: Require a second reviewer and explicit rollback or expiry, and pause payments, signing or network-dependent services until post-change evidence is complete.
Bitcoin Core scanblocks RPC in simple English
Bitcoin Core scanblocks RPC: The node must construct the compact filter index with blockfilterindex enabled. Confirm index readiness with getindexinfo before starting.
Simple example
A miner is checking Bitcoin Core scanblocks RPC. Confirm index readiness with getindexinfo before starting. A configured option is not evidence of completion. Validate descriptors, scan a bounded range, fetch candidate blocks, rescan wallet history, compare transactions and UTXOs with independent records, then extend the range only when evidence requires it.
Key terms in plain English
- BIP:
- Bitcoin Improvement Proposal: a document describing a proposed rule, standard or process. Its status must be checked separately.
- Bitcoin Core:
- Widely used software that validates Bitcoin and can provide wallet, network and operator tools.
- RPC:
- A command that software sends to a node to request information or a local action.
- UTXO:
- An unspent transaction output: a piece of bitcoin that can be used as an input to a later transaction.
- Node:
- A computer running Bitcoin software that checks data and communicates with other peers.
Index prerequisite
The node must construct the compact filter index with blockfilterindex enabled. Confirm index readiness with getindexinfo before starting; a configured option is not evidence of completion.
Actions
start performs a scan and returns only when complete, status reports approximate progress and current height, and abort requests cancellation. An abort true result does not promise instant termination.
Scan objects
Each item is a descriptor string or an object with desc and an optional range. Ranged HD descriptors default to 1000, so choose bounds from recovery evidence rather than habit.
Height range
start_height defaults to zero and stop_height to the chain tip. Pin both for reproducible jobs and preserve the observed tip hash so reorganisations can be reconciled.
False positives
By default relevant_blocks may include compact-filter false positives. Filtering those requires block access, is slower and may fail on pruned nodes; every candidate still needs full verification.
Timeout and concurrency
The call may take minutes, and official examples recommend no RPC client timeout. Use one controlled scan, poll status separately and prevent competing jobs from confusing operators.
Recovery flow
Validate descriptors, scan a bounded range, fetch candidate blocks, rescan wallet history, compare transactions and UTXOs with independent records, then extend the range only when evidence requires it. Build a revision-pinned evidence pack on an isolated node, wallet or protocol harness. Record source commit, binary hash, network, chain identity, configuration and dependencies.
Frequently asked questions
What is the main point of Bitcoin Core scanblocks RPC?
Bitcoin Core scanblocks RPC: The node must construct the compact filter index with blockfilterindex enabled.
For Bitcoin Core scanblocks RPC, what should a beginner know about index prerequisite?
The node must construct the compact filter index with blockfilterindex enabled. Confirm index readiness with getindexinfo before starting.
For Bitcoin Core scanblocks RPC, what should a beginner know about actions?
start performs a scan and returns only when complete, status reports approximate progress and current height, and abort requests cancellation.
For Bitcoin Core scanblocks RPC, what should a beginner know about scan objects?
Each item is a descriptor string or an object with desc and an optional range.
Conclusion
scanblocks accelerates discovery by narrowing the block set, but it does not complete wallet recovery. Reliable use preserves descriptor and range evidence, verifies candidates against blocks and reconciles the resulting wallet history.
Primary sources
Check the current specification status and the documentation for the exact implementation you operate before moving production funds or changing a mining node.
Join the ASIC Mining Discussion
Members can read and join the discussion
Log in to read comments from other miners. Create a free account if you would like to ask a question or share your experience.
Membership helps us protect the discussion from spam and keep answers useful.