Bitcoin almost failed.
This is the story of how 184,000,000,000 BTC was created (and then destroyed)
The first Bitcoin block was mined on January 3, 2009.
From inception, 74,637 blocks were mined over 1.5 years without issue.
But on block 74638, mined on this day exactly 13 years ago, Jeff Garzik noticed something odd.
3 outputs totalling over 184,467,440,786 BTC ??
Computers store numbers in an odd way.
Depending on how they’re stored, there’s a limit to how high they can count before things get weird.
When this limit is exceeded, the number can sometimes “reset” back to 0 or even produce negative numbers.
But how did block 74638 get through? ??
Bitcoin’s code was designed to check each individual output for negative numbers.
It would then check that the output of a transaction was not higher than the input of a transaction.
In this block, there was an input of 50 BTC as part of the block reward, then three outputs:
? 50.51 BTC
? 92233720368.54277039 BTC
? 92233720368.54277039 BTC
The sum of these three outputs would result in an integer overflow, producing a negative number.
Unfortunately, Bitcoin’s code did not check what would happen if the sum of multiple “valid” outputs resulted in a negative number.
Because the input was greater than or equal to the negative-numbered output, it was accepted by the network as valid ?
It’s speculated that the exploiter was aware of this bug and used a modified version of Bitcoin’s software to trick the network into sending this insanely large amount of BTC.
领英推荐
But now that the block had been mined, time was ticking on a path for restoration ??
About an hour after block 74638 was mined, the problem was first reported on BitcoinTalk.
Roughly 2 hours later, a fix was proposed by Gavin Andresen
An hour after that, a new release was published by Satoshi to fix the bug.
In this new release, the sum of transaction outputs would now also be checked to ensure that they were not negative.
This new version of Bitcoin would require a reindexing of the network to ensure no existing transactions violated the negative-number rule.
To reduce network impact, Satoshi recommended downloading a snapshot of the network up to block 74000. From there, newer blocks would be validated with the new rules of the network.
And from these new rules, the block that would have been 74638 would be rejected by nodes.
In total, the Bitcoin network was down for ~5 hours.
Once released, the community was able to quickly upgrade to the new version. Within just 24 hours, Satoshi reported that a majority of the miners were already using it.
Can you imagine if something like this happened today? ??
This anniversary highlights what many believe to be the importance of the ossification of Bitcoin’s L1.
The less that Bitcoin changes, the less that new and unexpected bugs can be released into Bitcoin’s code.
But experimentation is still happening on Bitcoin layers ??
Make sure you’re following us to learn more about all the innovation still happening on Bitcoin!