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.

Bitcoin Wrapped In Ether – Yummy!

You can take two good things and combine them together to get the best of both. In LA’s streets you can get what some would consider one of the city’s iconic sandwiches. It is the hotdog wrapped in bacon. It brings you the meaty flavor of a hotdog with the greasy goodness of bacon. Now think about the top digital asset Bitcoin (BTC). What would you wrap it with if you were to compare it to a hotdog wrapped in bacon? How about Ether (ETH), the Ethereum blockchain’s token. BTC is your hotdog, while ETH is your bacon. It actually exists and it is called Wrapped Bitcoin (WBTC).

Wrapping one cryptocurrency with another uses the hotdog wrapped in bacon example as a simpler way to illustrate an analogy. Wrapping in this sense means to create a protocol to represent one cryptocurrency on another cryptocurrency’s blockchain. BTC can be represented on the Ethereum blockchain by issuing an ERC-20 token called WBTC. This allows BTC integration with smart contracts that can be traded on the Ethereum network using the ERC-20 standard.

In Wrapped Bitcoin, BTC is locked into a smart contract and issued as WBTC. This allows BTC holders to access DeFi systems on the Ethereum blockchain. It is as good in value as BTC which is verified by a Proof-of-Reserve system. This ensures a 1:1 peg between the issued or minted WBTC tokens and BTC. The actual BTC is still on the Bitcoin blockchain since you cannot store it on the Ethereum blockchain. The BTC is taken under the custody of the WBTC token issuer, so it is not directly with the WBTC token holder. It is maintained by a group called the WBTC DAO, who are the custodians of the BTC. The group’s members include blockchain-based organizations like BitGo, Ren and Kyber.

What is the purpose of WBTC?

As mentioned earlier, it is primarily for giving BTC holders a way to gain access to the DeFi markets. A large portion of the DeFi space uses the Ethereum blockchain and BTC is not directly compatible with it. It is a bridge that allows BTC holders to use DeFi protocols to provide liquidity or participate in other services that yield returns. WBTC is a way to bring the value from BTC into the DeFi space without having to convert BTC to ETH. BTC (as of 2020) has the largest cryptocurrency market cap and this is crucial in helping bring liquidity to the DeFi space as well as expanding on the collateral types available.

This is a great way for BTC holders to take part in the DeFi markets. Many BTC holders have plenty of value stored, but are not able to use it if they are HODLing. DeFi provides ways for cryptocurrency to earn even while HODLing, using decentralized protocols like Uniswap, Curve and Yearn. Most DeFi protocols will only support ERC-20 or ETH since they execute from smart contracts on the Ethereum blockchain. WBTC is a protocol that allows BTC to be wrapped in an Ethereum ERC-20 token. Holders would not need to convert their BTC to ETH during this process.

Minting WBTC

To enter the DeFi space, Bitcoin holders would have to deposit their BTC into a smart contract of a WBTC issuer (e.g. BitGo, Coinsquare, etc.). This can be a digital exchange or DEX (Decentralized Exchange) that accepts BTC. Once the BTC has been deposited, WBTC tokens are minted that have a 1:1 value to the BTC that was deposited. Once the holder receives their WBTC, they can now use it for loan collateral, providing liquidity and swapping for other tokens. Digital exchanges will most likely require a KYC (Know Your Customer) in compliance with the law before the WBTC can be issued. On a DEX or over-the-counter it is not required (check with the exchange requirements always). The WBTC can be cashed out to either BTC or ETH.

Another way to get WBTC is through a DEX like Uniswap. Instead of depositing BTC into a smart contract, anyone who holds ETH can purchase WBTC. It requires connecting a digital wallet like Metamask to perform the transaction with ETH. The WBTC is already available in the market and it does not require BTC for purchase in this case. Since WBTC is an ERC-20 token, it can be purchased with ETH very easily.

Other Uses For WBTC

WBTC can be put to use in DeFi yield farming protocols. This allows WBTC holders to put their digital asset for lending and trading purposes. In return, the WBTC holders earn yields as a their return on investment. These yields are fees collected from the transactions. Rewards can be issued in the form of governance tokens, which allow the holders to participate in digital governance through voting. This provides holders a way of participating in decisions that govern these protocols.

Yield farming requires the holders to deposit their WBTC. In return, they are issued another token. Examples of these tokens include SNX (Synthetix token), REN (Ren Project token) and BAL (Balancer token). The tokens are specific to which protocol is used by the yield provider. To learn more about yield farming, there is an article on Coindesk that explains it a little bit further. (Link here)

The Best Of Both

Wrapped Bitcoin brings the best of two blockchains. It is a way to interoperate between two digital assets at the protocol layer. The value of Bitcoin and the decentralized applications on Ethereum. BTC is the digital asset while ETH is the protocol that utilizes it for liquidity, trades and financing. The Ethereum blockchain is serving as a transaction layer that can bring more capital into diverse markets. Bitcoin can provide the capital, as institutional investment grows in the digital asset. WBTC provides a way for investors to bring capital for yielding returns using the Ethereum blockchain.

Disclaimer: This is not financial advice, just reference. Do your own research always to verify information.