Is this a dumb question? I'm curious what happens if a new node connects to a peer with a messed up UTXO set. Like if it’s corrupted or something. Does the syncing node just rebuild the UTXO on its own or risk getting bad data?
What if a Node Syncs with a Bad UTXO Set?
9 replies 349 views
ledger_2013Senior Member
Posts: 46 · Reputation: 866
#2Oct 25, 2025, 11:31 PM
Nah, not a dumb question. It’s not gonna happen that easily. Bitcoin nodes sync from block 0 onwards, so if a peer is bad, the node will detect that and drop the connection. Snapshots? Those get validated too, and if something’s off, it just falls back to full validation.
According to Jameson Lopp’s blog, the node will see if the UTXO snapshot doesn’t match the expected hash. I’ve never used that feature myself. Not sure if it just ignores bad snapshots or throws an error.
Right, so valid nodes will always check hashes. Different hashes mean it gets rejected. Bitcoin Core is good at this, way better than some other blockchains.
atlas_minerNewbie
Posts: 110 · Reputation: 19
#5Oct 26, 2025, 09:55 AM
Each node builds its UTXO independently. A faulty peer won’t directly affect you. Sure, it could follow a fork for a bit, but once it connects with a good peer, it'll find the right chain again.
Yep, and since nodes are all connected, they’ll reject corrupted UTXOs as they sync up. A new node will build its set from scratch and validate each transaction, so a messed-up UTXO from a peer doesn’t matter.
Hold up, what kind of trust are we talking about? That blog said it checks the snapshot against a hardcoded hash in Bitcoin Core.
atlas_minerNewbie
Posts: 110 · Reputation: 19
#8Oct 28, 2025, 09:30 AM
Well, I mean, if a dev was forced to release bad software, it could lead to accepting a corrupted UTXO set. An attacker might exploit this to create splits in the chain.
Didn't consider that. But for Bitcoin Core to always generate a messed up snapshot, a malicious actor would need to alter the core code itself, right? What do you think?
atlas_minerNewbie
Posts: 110 · Reputation: 19
#10Oct 28, 2025, 11:31 AM
Exactly. It seems risky for the devs, more than regular users. Not many folks use that feature yet, but if it becomes popular, they could be targets. This isn't just theory people have already been sued over UTXO edits, which caused some key devs to quit.