Author: Ben Reeves 2012-03-01 17:20:41
Published on: 2012-03-01T17:20:41+00:00
In this conversation, the individuals are discussing a potential vulnerability in the Bitcoin blockchain. If an attacker were to mine a duplicate coinbase of an old block, and that block is then invalidated, DisconnectBlock() will erase both the coinbase of the new block and of the old block. This leaves the blockchain in an inconsistent state because with the coinbase missing, the old block will no longer pass CheckBlock(). When affected clients are restarted LoadBlockIndex() will try to verify all blocks in the main chain, failing at the block with the missing coinbase.There are two potential scenarios. Firstly, if an attacker was to do this with an early block, it would force all affected clients to redownload the majority of the blockchain. Secondly, if the attacker was able to do this on a block after the March 1st deadline (future block A), they could mine a fake copy of block A (block B) with the same coinbase but a different hash. Clients who received block B before block A will refuse to accept block A because of the unspent duplicate coinbase in block B. The attacker can then fork the chain at this point despite the real chain being longer.The individuals suggest that a full block height fix may be better to address this issue. However, the implementation in the reference patch fixes the blockchain forking issue. Still, allowing spent coinbases to be disconnected patched clients are still vulnerable to blockchain corruption. While not an immediate issue, it would mean LoadBlockIndex() would error on restart and could cause problems for new clients during the initial blockchain download.When asked why duplicate coinbases weren't disallowed entirely, it was explained that this would make it impossible for nodes to prune the values. They'd all have to forever keep a set of all the coinbase hashes to perform the test. The height-in-coinbase BIP will make duplicates effectively impossible to create, which is a much more clean behavior.
Updated on: 2023-06-06T03:09:21.370540+00:00