Repository navigation
Description
Problem
With AssumeUTXO, a node starts from a UTXO snapshot in an effectively pruned state and validates new blocks immediately, while downloading and validating earlier blocks in the background to become an archival node.
This leaves us in a confusing limbo: we trust the expected UTXO set hash enough to use the snapshot, but still treat the blocks preceding it as unvalidated until background validation finishes.
If we trust the hash, why does every snapshot user have to validate those blocks? If we do not, what assurance are users relying on in the meantime?
If background validation finds that the reconstructed UTXO set does not match the snapshot, it is unclear what users should do.
Managing multiple chainstates adds substantial maintenance work across RPC and wallet reporting, notifications, pruning, cache allocation, indexes, and reorgs, and introduces race conditions and unintuitive corner cases.
Script-check logs need to distinguish snapshot and background validation, restarts need extra completion checks (even for a fully validated snapshot), and RPCs report different progress for the same background chainstate.
Reviewing even an ordinary validation fix requires reasoning about block candidates in both chainstates, making the most critical part of the codebase harder to understand and review.
AssumeUTXO shortens the wait for a usable node, but completing background validation still requires downloading the snapshot in addition to all the blocks and temporarily keeping two UTXO databases.
Each chainstate also starts its own prevout-fetching worker pool when enabled, doubling the number of workers.
The cache budget follows a fixed 95/5 split that reverses once the snapshot chainstate catches up, then goes entirely to that chainstate when background validation finishes.
These changing budgets complicate presizing the UTXO cache, and resizing can require flushing and discarding cached entries or reopening the database.
AssumeUTXO adoption remains below expectations.
@ryanofsky raised similar concerns about code complexity in the original implementation PR, arguing that validation outside ChainstateManager should not need to know about the different AssumeUTXO phases and roles.
David Harding's original feedback also questioned keeping old snapshots and requiring every snapshot user to validate earlier blocks, while calling for easy hash checks by ordinary nodes.
We already bake the expected UTXO set hash at the snapshot block into the source code and binary, but normal IBD ignores it completely.
Proposed approach
Nodes doing a full IBD could use the baked-in hash to check their own UTXO set, giving others confidence to bootstrap more quickly from the snapshot.
These routine checks could replace background validation on snapshot nodes, letting them skip the blocks before the snapshot and run validation on a single chainstate.
1. Check the UTXO set hash during IBD
When a node doing IBD reaches the snapshot height, it could hash the flushed UTXO set and compare the result with the hash in Core.
With this check enabled by default, every full IBD would strengthen trust in the hash, much like reproducible builds do for release binaries (we don't have a background-recompilation either): a single honest participant is enough to expose a mismatch for everyone to investigate.
2. Keep only the latest UTXO set hash
Keeping only the latest UTXO snapshot hash would let nodes running the same release share one reference and scan the UTXO set only once during IBD.
Older snapshots (including those whose background validation is unfinished) would remain usable with a compatible older release.
3. Make UTXO snapshot trust an explicit choice
Users already choose how much to verify during IBD: -assumevalid=0 checks every script, while the default can skip scripts in older blocks.
Relying on the independent checks above would extend that choice to snapshot startup, removing the chainstate role changes, cache splitting, and special handling of progress reporting and block downloads.
Without background validation, a snapshot node would lack the earlier blocks, so wallet rescans, indexes, and serving old blocks could follow the existing pruning behavior.
We could also improve wallet and index support for pruning, so they handle missing blocks more reliably.
Users who later want an unpruned node could disable pruning and run with -reindex to download and validate all blocks, rebuilding the UTXO set from scratch.
Since the snapshot would be trusted from the outset, restoring the missing blocks would be optional rather than a required step before trusting the node.
Why the IBD check is not a new checkpoint
The IBD check would compare against a hash that already exists, without changing the rules for accepting blocks or choosing the valid chain with the most work.
The node would warn if its UTXO set did not match the baked-in hash, without stopping IBD.
An extreme reorg could replace the snapshot block itself, in which case the node would report that change and skip the comparison, since the baked-in hash describes a different chain.
Cost and related work
Checking the UTXO set takes a few minutes, and the check could be disabled or moved to a separate thread if needed.
The check could also build confidence in faster approaches such as pruneassumevalid and SwiftSync by confirming that they produce the expected UTXO set.
P2P UTXO snapshot distribution could make AssumeUTXO easier to use and to integrate into node packages, and the single-chainstate approach proposed here could address concerns about extending multiple-chainstate validation.
The discussion already considered removing background validation to save bandwidth and reduce complexity, and users who want to validate every block locally could do so afterward with -reindex.
Activity
mzumsande commentedon Apr 29, 2025
Depending on what we do if the hash doesn't match, wouldn't this be effectively be reintroducing something similar to checkpoints (which we just got rid of in #31649)?
l0rinc commentedon Apr 29, 2025
Yes, we already have the "checkpoints", we're just ignoring them.
The difference is that we're also validating the checkpoints themselves - giving the assumeutxo scenario more credence ("every IBD verifies these hashes").
mzumsande commentedon May 5, 2025
Removing the existing checkpoints is something that has been done to a large part for ideological reasons (devs shouldn't prescribe / hardcode what the "correct" chain is), so introducing something similar back in (and not just historical but new ones) just for the sake of AssumeUxto would be quite contentious I think - I view AssumeUtxo as a nice feature, but a second-class citizen to normal IBD.
I guess if we'd just log a warning in case of a mismatch there is no harm (except for the added time spent calculating the hash), but asserting / refusing to continue normal IBD in that case would not be something I'd want.
l0rinc commentedon May 5, 2025
Agree, IBD would validate that the AssumeUTXO hashes are correct - lending its credibility to the quicker alternative.
[-]Verify AssumeUTXO snapshot hashes during full validation as well[/-][+]AssumeUTXO: crowdsource trust through independent snapshot verification[/+]l0rinc commentedon Oct 10, 2026
I've expanded the description into a proposal to replace background validation with crowdsourced UTXO snapshot verification through default IBD hash checks, keeping only the latest hash.
This extends the existing choice between
-assumevalid=0and the default to the UTXO starting state, with confidence in its hash coming from routine checks across the network.The hash check would warn on a mismatch without stopping IBD, replacing my original proposal to assert. Snapshot imports would still require the expected UTXO set hash.
The update adds local hash timings, the pruning model and optional reindexing, resource and maintenance costs, and the differing views on P2P snapshot distribution.
validation: verify the provided AssumeUTXO hash
validation: verify the provided AssumeUTXO hash
Sjors commentedon Oct 17, 2026
I opened #36557 to separately discuss dropping background sync (because I think it's worth considering regardless of code complexity, and even if this particular proposal doesn't work out).
That's not what #36543 does, but it should imo, see #36543 (comment).
melvincarvalho commentedon Oct 19, 2026
A data point for the crowdsourcing proposal: I recomputed the UTXO set hashes at four AssumeUTXO heights using Bitcoin Core 31.0, synced from genesis on my own hardware, with no snapshot ever loaded. All four match the values in
chainparams.hash_serialized_3a2a5521b1b5ab65f67818e5e8eccabb7171a517f9e2382208f77687310768f96dbd190983eaf433ef7c15f78a278ae42c00ef52e0fd2a54953782175fbadcea94daf8a17b4902498c5787966a2b51c613acdab5df5db73f196fa59a4da2f15684a8d794337118c0c615b574f817c7306c687584a537184b8d233df42bf477ec2The corresponding block hashes and signed JSON statements are collected at https://assumeutxo.com/, alongside the expected hashes. Each statement records the node’s reported result and carries a secp256k1 Schnorr signature for attribution. The signature does not establish that a node is independent or that the computation was performed correctly.
To contribute your own node’s results, the one-command instructions are at https://assumeutxo.com/attest.html. Results from other nodes are added alongside these.
optout21 commentedon Oct 20, 2026
Kudos for your valuable work with assumeutxo.com!
The crowdsourcing proposed here is different though: high number of checks but without structured feedback. Checks are executed by many nodes -- by all nodes completing IBD with the same BitcoinCore major version. Successful checks are unreported, potential negative results are handled in non-structured, haphazard way by users -- e.g. retry, shout to users/devs on social media channels.
The two approaches (low number of high quality reports vs. crowd-sourcing) have different focus, but complement each other well.
validation: verify the provided AssumeUTXO hash
ajtowns commentedon Nov 30, 2026
Note that we can "already" do a fairly quick verification of a utxo set snaphot, given a trusted node with coinstatsindex enabled:
That could be automated by updating/saving the muhash values for the tip including during reorgs, storing the muhash values in the assumeutxo data, and comparing the tip's muhash versus the hardcoded assumeutxo data during IBD. Updating the tip's muhash during IBD is a bit of extra work, but pretty parallelizable with other work, so might not have much impact.
l0rinc commentedon Nov 30, 2026
In my benchmarks, rebuilding
coinstatsindextook almost 10 hours on an i9-9900K with SSD, compared to 2.1 hours fortxindexand 2.3 hours forblockfilterindex.For context, separate
-reindex-chainstatemeasurements on the same machine took about 5.3 hours (which is even faster now).It's by far the heaviest index, despite attempts at batching index writes. Granted, we would need to make this check work regardless of whether the index is enabled, and we don't need to keep hashes for every height, only the AssumeUTXO one.
Also, parallelizing it is not trivial because the current implementation advances cumulative state one block at a time. We could split the computation into independent MuHash accumulators and combine them later, but that adds coordination around block boundaries, persisted state, and reorgs.
Maintaining the MuHash throughout IBD also requires hashing coins both when they are created and when they are spent. My suggestion only scans the remaining UTXOs once at the snapshot height, which is a relatively fast one-off calculation without adding overhead to the rest of IBD.
yancyribbens commentedon Nov 30, 2026
Is the AssumeUTXO model complimentary or in contradiction to SwiftSync? It seems to me the two are contradictory, since in the SwitftSync model, the state begins from an unstrusted state, then uses the provided hints and p2p blocks to validate the UTXO set. AssumeUTXO seems to be the opposite, where it's starting in a trusted state, then in the background validating that trusted state? While SwitfySync will take longer to reach a trusted usable state, it seems like a better approach from what I understand of the two competing proposals.
Sjors commentedon Dec 3, 2026
The idea of tracking MuHash separate from
-coinstatsindexis interesting. But given that #36543 adds no noticeable delay, and is simpler, that seems good enough.