Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: brainactive on August 04, 2021, 12:05:20 AM



Title: Aftermath of Bitcoin's 2018 inflation bug
Post by: brainactive on August 04, 2021, 12:05:20 AM
An inflation bug was discovered in 2018 which allowed some nodes to mint bitcoin out of thin air.

1) What are the impacts of this and has this compromised Bitcoin's 21 million supply?
2) Is this still a threat to the network at the moment?
3) I don't mean to be attack Bitcoin, but how is it that a bug as critical as this was discovered 10 years after launch, especially with so many developers working on the project (and bitcoin team being considered a conservative bunch that values security)?


Title: Re: Aftermath of Bitcoin's 2018 inflation bug
Post by: DaveF on August 04, 2021, 12:44:42 AM
1) What are the impacts of this and has this compromised Bitcoin's 21 million supply?

No impact at all, no "inflation bug" coins were created.

2) Is this still a threat to the network at the moment?

No.

3) I don't mean to be attack Bitcoin, but how is it that a bug as critical as this was discovered 10 years after launch, especially with so many developers working on the project (and bitcoin team being considered a conservative bunch that values security)?

Programming errors are out there now and will always be out there. How they are handled when found is more important then the fact that they exist.
If you only want to use software without bugs, you will not use any software.

-Dave


Title: Re: Aftermath of Bitcoin's 2018 inflation bug
Post by: gmaxwell on August 04, 2021, 01:30:48 AM
Sounds like you might have been fed some disinformation.

Versions 0.14 to 0.16.2 had a bug where a rogue miner could have made a transaction which consumed the same input twice. But this issue was caught and rejected by the startup sanity checks.

The issue was discovered by developers and corrected in 0.16.3 and later versions.  No attack block had been created, and if one had been created before the fix was published it would have been ultimately rejected because it was caught by the startup checks and by earlier versions so ultimately the effect would have been just a very costly DOS attack by the miner.

The issue was introduced because:

The original check against duplicate inputs didn't apply to mempool transactions, so these junk transactions could end up in the mempool. To protect the mempool an additional check was added.  IIRC this would have been in 2011 or 2012.

Then in 2013, 0.8 changed block validation logic significantly and accidentally removed the block validation rule against duplicate inputs. However, this wasn't discovered even with an extraordinary amount of review and testing at the time because the "redundant" check previously added was sufficient.

Then in 0.14 the redundant check was bypassed while validating blocks to speed up block propagation and make Bitcoin able to handle larger blocks without blocks becoming stale.

Unfortunately, unknown to anyone the non-consensus "redundant" check had become critical.  While there were ample tests for double spends, they didn't happen to cover the specific conditions required to bypass the checks.