It was a Thursday, on January 21, 2021, when news outlets began circulating reports of a Bitcoin double spend flaw which led to an 11% drop in the price of the digital asset. This would have been a major exposure of a flaw in the blockchain ... except it never was.
In fact, what happened or reportedly occurred would be a part of how Bitcoin is supposed to work. It is hard to explain the full details unless you get technical, but let us try to explain it in simpler terms.
What Is A Double-Spend?
First, what is a "double spend"? This was the problem in digital currency that Bitcoin's creator Satoshi Nakamoto addressed using his methodology that is now called Nakamoto Consensus.
Prior to that, it was a problem in computerized electronic payment systems that other developers had proposed solutions for. Since computers are digital, when currency is created it can be easily copied or manipulated just like a file made in Excel or Word.
If you have a file that represents your money in a computer, without any means of control a user can create infinite copies and spend it all they want. It is possible to use the same digital money to purchase two different items, so long as there is no system checking for it.
Nakamoto solves the problem by implementing a blockchain to support provenance and verification. That means that the amount of currency in bitcoins (BTC) that a user holds, is determined by a mechanism that is verified through a consensus or agreement. In this case it is called Proof-of-Work (PoW).
The "Double-Spend" Incident
Bitmex Research first reported the incident in a tweet of a potential double-spend that occurred in the wild. They were the ones who also pointed out that it was a double-spend, but it was unconfirmed. The researcher who discovered it should have probably waited for what is called a chain reorganization, which is a part of the blockchain protocol's rules for validity.
It is true that a BTC (Bitcoin's unit of account) could appear to be spent two times. However, it must undergo validation using PoW that requires a series of confirmations, usually 6 but it could be more (depends on network activity), performed by special nodes called miners on the Bitcoin network.
It is also possible for two blocks to be mined simultaneously with different transactions that spend the same BTC. This creates a temporary anomaly that can be observed by anyone who has access to the mempool (where transactions are stored) of a Bitcoin node. The good thing is that it must be validated first to check for errors.
There is a built-in feature in the code that corrects this problem. It is part of a chain reorganization in which the nodes must add the valid transaction in the block on the longest chain, or the main network.
You can see two transactions that appear to have spent the same BTC, but after the chain reorganization and block confirmation it is resolved. Miners will validate the block with the correct transaction to be added to the blockchain. The other block will be orphaned and invalidated.
What Actually Happened
Many cryptocurrency and blockchain experts like Andreas Antonopoulos, Bitfinex CTO Paolo Ardoino, Coin Metrics Bitcoin Network Data Analyst Lucas Nuzzi and later, even Bitmex Research all agree that it was not a double-spend. There are counter points though, especially from among the Bitcoin SV (BSV) camp who do have some thoughts of their own.
What happened was that a user tried a feature called Replace-By-Fee (RBF) in which you can speed up a transaction by paying a higher transaction fee which invalidates a previous transaction that was sent out. The user had probably been waiting too long and decided they needed to have their transaction confirmed faster.
The previous or original transaction has the same UTXO (Unspent Transaction Output) as the new transaction that uses RBF. Their difference is in the transaction fees, with the RBF transaction having a higher fee to incentivize faster confirmation intended to replace the previous transaction.
What occurred next was the lower fee transaction somehow made it to a block first, perhaps because of the timing. Due to the time that elapsed before using RBF, the original transaction had already been added to a block on the longer chain. It was corrected during the chain reorganization, in which the RBF was applied and the original transaction was invalidated.
As to why this was not a double-spend, it is because the block that contained the original transaction and the block with the new transaction that applied RBF were both unconfirmed at the time of the incident. It can only be considered a double-spend if both blocks were confirmed and committed to the blockchain. Only the RBF transaction block was validated and later confirmed in this case.
Should we be worried that an actual double-spend can occur? It is always good to be alert and aware of what is happening. While the code does what it is intended to do, there will be bad actors who may try to game the system to see if they can get past the logic.
What will be proof or testament to Bitcoin's legitimacy as a cryptocurrency is how these validation measures will stand against the test of time. As long as it is working, it will help the network to remain secure and operational.
The lesson here perhaps is to be careful about what you read in crypto X (formerly Twitter) and other news. Make sure there are other sources of information to confirm the news, otherwise it might be misinformation.
Until the next one, HODL.