The Double-Spend That Never Was

On Thursday, January 21, 2021, 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.

First, what is a “double spend“? This was the problem Bitcoin’s creator Satoshi Nakamoto was able to solve for digital currency. 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 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 like Bitcoin (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) on the Bitcoin blockchain. You have nodes (computers) called miners that run software which run algorithms to try and solve a complex puzzle to discover a block for validation. The block contains transactions that are verified based on cryptographic hashes that can be traced back to what is called a genesis block. If it can be verified, then it is added to the blockchain.

Before a block is added, there is a competition among the miners to try and discover a number called the nonce. This is what is needed in order to validate a block. The miner who discovers it first will become the block validator and will receive a reward in return for their effort. The miners also collect fees for helping to validate transactions on the network. No transaction is ever allowed to pass unless it goes through a consensus among the miners on the network. Double-spends are prevented by the miners through this verification and validation process which also includes confirmations.

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 here is the problem. It was unconfirmed and the researcher who discovered it should have probably waited for what is called a chain reorganization, which is a part of the blockchain’s protocol. It is true that a BTC could appear to be spent two times on different transactions. It must undergo a series of confirmations, usually 6 but it could be more (depends on network activity). This was mentioned by Satoshi Nakamoto in the Bitcoin White Paper.

It is possible for two blocks to be mined simultaneously on the blockchain. This creates a temporary anomaly that can be observed by anyone who has access to the mempool of a Bitcoin node. 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 block to 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. Only one of those blocks that contain the transaction will be valid and added to the blockchain. The other block will be orphaned and not validated.

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 that occurred. There are counter points though, especially from among the Bitcoin SV (BSV) camp who do have some thoughts of their own. What we know for sure is that only one of the transactions has been verified and validated on a block. The user tried to use 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. What happened here was the lower fee somehow made it to valid block first, perhaps because of the timing. The user had waited too long and by the time the higher paying transaction fee was sent the previous one had already been added to a block on the longer chain which validates it first.

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 supposed to do, there will be bad actors who may try to exploit these types of attacks 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 measures will stand against the test of time. As long as it is working, it will help the network to remain secure and operational. Until the next news, HODL.