This question came up in a recent discussion with Hasu and I was wondering if there is a good/practical reason why a newly syncing node should change the assumevalid option to 0 (verifying all the signatures from the genesis block) or is it safe to assume that signatures buried under years and years of blocks are not "worth it" to be verified anymore? Is there anything that can go wrong (either by accident or as an exploit) when no new node verifies the old signatures anymore?
1 Answer
If you assume that a particular block is valid, then you are also assuming that all blocks prior to it are also valid, and by extension, all transactions and their scripts and signatures. This is the basic premise of assumevalid - that a particular block is valid and so is everything that came before it.
This assumption only holds if you assume that SHA256 is collision resistant. Each block commits to the previous block, and each block commits to its transactions and their contents. As long as the hashes are unique, then the assumevalid assumption holds as it would not be possible to produce a valid block of the specific hash.
However, if there were a SHA256 collision, it would be possible to produce a transaction with the same hash as another transaction but different contents. This would then break the assumevalid assumption as an invalid transaction could be inserted into the blockchain which would then result in a different UTXO set at the specified block hash. AFAIK, this is the only scenario where it would not be safe to assume that all scripts are valid.
But there are no known collision attacks for SHA256 and it is believed to be collision resistant. And so with that assumption, the assumevalid assumption also holds and so it is safe to not verify old scripts.
-
Thx. So beyond the SHA256 security assumption, do I understand it correctly that in the theoretical case in which no node on the network has ever verified scripts up until the assumevalid block, there are no systemic risks (neither for the individual node nor for the network as a whole)? Fwiw, this post also was helpful: bitcoin.stackexchange.com/questions/59940/… Commented Nov 18, 2021 at 11:51