Bitcoin Unlimited Dev: Bug Caused By ‘Miscounting of Bytes’

bug

Bitcoin.com pool has lost 13.21 BTC or over $12,000 USD due to a bug in BitcoinUnlimited software, which caused it to mine a block bigger than 1MB.


So…What Happened?

Bitcoin.com, an information portal, which also provides mining pool services has lost out on 13.2 BTC due to a bug in the Bitcoin Unlimited software, which is used on the pool.

Bitcoinist spoke with Bitcoin Unlimited developer Andrew Stone a.k.a. “theZerg” to figure out what really happened:

Bitcoinist: So what caused this bug?

Andrew Stone (AS): The bug was caused by a miscounting of the bytes in the coinbase. Basically the coinbase informational string was counted but the rest of the coinbase txn was not.  This happened because the coinbase txn is added separately after the normal transaction selection loop.

[The bug described by Stone caused the pool to mine an invalid block which was rejected by the rest of the network due to its size, which was bigger than the allowed 1MB. The invalid block resulted in Bitcoin Core nodes banning the BU peers that gave them this invalid block.]

Bitcoinist: According to some, Bitcoin core nodes “banned” the BU nodes that gave them this block. What does this mean?

AS: With Regard to the “banned” nodes, when you send a Core node a > 1MB block, it bans you for 24 hours.  We have been aware of this issue for some time.

[Following the bug, one can see that the Bitcoin Unlimited node count is down, according to some websites. However, this may be related to the so-called ban by Bitcoin core nodes.]

Bitcoinist: Since then, the BU node count has dropped by more than 25%. Do you think this is temporary?

AS: This is complete speculation but I’m guessing that the BU node count did not actually drop by 25%. I’m guessing that the software polling the network did not see the nodes due to this ban.

[Some Simple Payment Verification (SPV) clients who were connected to BU nodes may have seen false confirmations for some minutes until the block #450530 was mined, overtaking the invalid #450529.]

Could Have Been Much Worse?

However, according to Adam Back, founder of HashCash and the CEO of Blockstream, this mistake could have had worse consequences:

SPV mining is 60% hashrate so I think they just by chance happened not to fork the network again like bip66.

However, Stone dismissed this risk explaining,

With Regards to following the wrong blockchain, the blockchain suffers small forks like this whenever 2 miners find a block at approximately the same time so this single block posed no danger. Most if not all BU miners have their EB set to 1, so this block was orphaned by all miners, even the miner that generated it. But even if we imagine that for some reason more blocks had been built on this blockchain, the emergent consensus algorithm would have ensured that the blockchain did not suffer a significant fork. You can see simulations of that process here.

It is still unclear if the pool will repay its users for the block which, although invalid, took the same hashpower and electricity to generate. However, Bitcoin.com previously stated that it would pay miners double the block reward for mining on a Bitcoin Unlimited pool, thus money doesn’t seem to be an issue for this pool.

According to a moderator on the r/BTC subreddit, the bug was reported and the BU team was quick to fix the issue. He stated: 

When this happened I reported the bug directly to Bitcoin Unlimited, they responded and fixed the issue very fast. Every software has bugs once in a while, what matters is how they respond and act. The Bitcoin Unlimited developers acted great in this case.

Even before the fix, Bitcoin Unlimited was able to propose a workaround, according to Stone:

There was a simple quick “fix” which was to set the max mined block size to 999000 (thus giving 1k bytes for the coinbase), which could be done from bitcoin-client. You can poke through the proposed fix for more details (its up on github).

Bitcoin Unlimited

The Bitcoin Unlimited protocol is designed to allow a dynamic block size, which can be voted on by all stakeholders in the Bitcoin ecosystem, e.g. coin holders. In the BU system, node operators and miners can choose their own blocksize by modifying their client via a GUI menu.

This would, in theory, create a system where Bitcoin scales according to the space needed to accommodate the transactions in the network.

However, there may be some problems with BU’s approach, which David Vorick, co-founder at Sia, has laid out in this blog post. Meanwhile, other vocal opponents, such as BTCC COO Samson Mow, slammed Bitcoin Unlimited for incompetence, tweeting:

Will Bitcoin Unlimited recover from this mishap and loss of funds? Let us know in the comments below!


Images courtesy of news.bitcoin.com, twitter, Shutterstock

Exit mobile version