1

I have a question about an implementation detail - when are old blocks verified by each full node? I.e. when will I be "caught" if I change the contents of an old block (and thus break the hash chain)

From what I've seen, the possible answers include: when it's downloaded and when you do a -rescan.

However, does a full node regularly verify the integrity of the chain from start to finish?

(I'm aware that changing the history on my node doesn't do any good, as those verifying my future transactions will have the correct chain and thus refuse any attempts to double spend)

1

Full nodes verify the complete blockchain history on the initial block download (IBD) or on a reindex. As the node is synchronizing with the network, they keep updating the overview of spendable balances, the Unspent Transaction Output Set.

When a node gets disconnected or turned off, they can pick up from their last known state and continue updating the UTXO Set with the changes from the new blocks that have since been published.

The history only needs to be checked once. If another node changes the content of an old block, this will not change the state of any other nodes. Other nodes will only ever discard information that they have already validated when they learn about and reorganize to a heavier chain.

If you change a block in the past, you will still not be able to get your node to accept that new information, unless you additionally manipulate your own node's UTXO Set or the software you're running on your node to accept it.

However, this would be a pointless exercise, as nobody else would accept your changed block unless it is backed by being part of a heavier chaintip.

  • Thanks. Does it mean that it's theoretically possible for blockchain.info to show you incorrect block data if someone internally has modified an old block? It won't change anything for the network of course, but if someline is relying on a service to display the true state of the blockchain, internarl modifications to the old blocks may be left undetected for a while? – Bozho Mar 24 '18 at 21:20
  • 1
    Yes, it would be theoretically possible, if someone had manipulated blockchain.info's database that they would show incorrect information. – Murch Mar 25 '18 at 0:59
1

when are old blocks verified by each full node?

never unless rescan=1 command-line option passed to

From what I've seen, the possible answers include: when it's downloaded and when you do a -rescan.

yes, on downloading also of course

one of my .dat files is broken (some garbage in contents) but bitcoin-qt works well because it uses UTXO, not blocks themselves

if I change the contents of an old block (and thus break the hash chain)

this depends what do you mean.

  • Rescan doesn't re-validate blocks. – Anonymous Mar 24 '18 at 16:36
  • oups. reindex=1 – amaclin Mar 24 '18 at 17:03
0

You can't change an old block without changing everyred hot chili peppers jorge subsequent block. You would have to mine again and rebroadcast every single block starting with the one you changed.

The nodes would then reject them because the blocks they have saved have more proof-of-work.

I don't know if a full node regularly verify the integrity of the chain from start to finish. But if they doesn't, that is unimportant for the attack you're describing.

  • This is wrong, changing an old block would change every subsequent block. Each block’s hash includes the previous block’s hash as input, so changing one will change the hash of every single block following it. Also, if a single block could be changed, that would not affect the total proof of work of the chain (all else held constant). So the nodes would not reject the block for the reason you cited, rather they would reject it because the new block would not have any other valid blocks built on it, and thus not be as long as the honest chain – chytrik Mar 24 '18 at 13:21
  • It was a typo, I tried to say "can't" – Osias Jota Mar 24 '18 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.