What if a Node Syncs with a Bad UTXO Set?

9 replies 349 views
just_sageFull Member
Posts: 12 · Reputation: 603
#1Oct 25, 2025, 09:17 PM
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?
5 Reply Quote Share
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.
0 Reply Quote Share
gang2015Member
Posts: 682 · Reputation: 62
#3Oct 26, 2025, 05:10 AM
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.
4 Reply Quote Share
nick_hawkMember
Posts: 52 · Reputation: 185
#4Oct 26, 2025, 08:34 AM
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.
2 Reply Quote Share
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.
4 Reply Quote Share
ColdGangMember
Posts: 152 · Reputation: 183
#6Oct 26, 2025, 11:37 AM
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.
3 Reply Quote Share
gang2015Member
Posts: 682 · Reputation: 62
#7Oct 26, 2025, 05:37 PM
Hold up, what kind of trust are we talking about? That blog said it checks the snapshot against a hardcoded hash in Bitcoin Core.
3 Reply Quote Share
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.
1 Reply Quote Share
gang2015Member
Posts: 682 · Reputation: 62
#9Oct 28, 2025, 09:42 AM
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?
2 Reply Quote Share
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.
0 Reply Quote Share

Related topics