Critical Bug Discovered in Bitcoin Mining Mechanism
A critical bug has been identified in the bitcoin mining mechanism, which allows an attacker to manipulate timestamps and potentially reduce the complexity of mining.
The issue arises from a calculation error in the complexity adjustment mechanism, where nodes measure the duration of the last period by comparing the timestamp of the first block of the period with the timestamp of the last block. However, this method introduces an error known as the 'one unit offset' bug, which slightly overestimates complexity.
The real problem lies in the fact that the adjustment periods do not overlap, allowing an attacker to manipulate timestamps and reduce complexity. This creates a vulnerability known as the 'time warp' attack, where an attacker can artificially increase block intervals by setting minimum allowable timestamps for all blocks except the last one.
By repeating this process several times, an attacker could potentially reduce mining complexity to create up to six blocks per second, rather than one every 10 minutes. This would have severe consequences, including overloading the network, reducing transaction confirmations, and allowing the attacker to collect block rewards at a furious pace.
A fix for this bug is proposed through a softfork within BIP-0054, which restricts the timestamp of the first block in a new complexity period to not exceed the timestamp of the last block of the previous period by more than two hours. This would restore continuity between periods and prevent timestamp manipulation.




