Bitcoin Cash Mining Difficulty Algorithm Can Be Exploited by Miners

A few days ago, we talked about how the Bitcoin Cash mining adjustments were seemingly controlled in some way. Developer Gregory Maxwell alluded to as much not too long ago. We have now received a bit more evidence to further confirm these claims, although they still remain subject to interpretation. There certainly appears to be solid evidence of a bug affecting the difficulty retarget algorithm of Bitcoin Cash.

Bitcoin Cash’s Mining Difficulty Adjustment Boggles the Mind

Since the day the Bitcoin Cash network was launched, people have been questioning the way its mining difficulty adjusts. It is certainly true there have been some “profitable” changes in this regard. Not too long ago we saw the difficulty drop to as low as 7% compared to the original Bitcoin blockchain despite a growing amount of network hashpower. Lower difficulty and higher hashpower should be, under normal circumstances, mutually exclusive except for a brief moment. However, this situation has remained active for some time.

As a result, there were a ton of blocks mined on the Bitcoin Cash network. That also resulted in large amounts of BCH being mined, so much even that the Bitcoin Cash blockchain is now slightly ahead of Bitcoin’s in size and block height. This is an interesting development, although it was only a matter of time until this happened due to the 8MB block size as compared to 1MB. After the mining difficulty was adjusted to 30% of that of the Bitcoin blockchain, profitability suddenly plummeted by a whopping 200%.

It is not entirely strange we would see the profitability change by such a large margin. What is rather disconcerting is how exactly this difficulty adjustment algorithm works. A few days ago, we reported on Gregory Maxwell’s comments that this technology is seemingly based on some very unusual conditions. As a result, mining pools – or even small mining operations – could take advantage of this algorithm and improve their overall profitability. Manipulating the mining difficulty of the entire network is often frowned upon, for obvious reasons.

According to new evidence emailed to us by JM, it certainly appears there is a bug in the difficulty adjustment algorithm. Whether this was added intentionally or is merely a major oversight by the development team remains to be determined right now. It certainly appears Bitcoin Cash is susceptible to price manipulation and attack by miners. The bug allows the timestamps of network blocks to be altered, which could speed up the mining process. It would certainly explain why so many miners have flocked to BCH these past two days, as they were finding blocks on the network quickly.

Based on the code, the Bitcoin Cash difficulty adjustment algorithm trusts these timestamps on blocks created by the miner. Any malicious miner could effectively exploit this trust and mine more blocks at an increased rate. In fact, one could effectively make the algorithm retarget without causing an actual network attack. This is a very disturbing development, to say the least, and one that does not bode well for the BCH network as a whole. As a result, we see an inflated mining income which can be used for short-term gains by both miners and the Bitcoin Cash developers accordingly.

Considering that Bitcoin Cash boasts the largest Bitcoin blockchain at the time of writing, it appears this “bug” was coded in on purpose. Making this altcoin stand out from Bitcoin would require trickery of some sort, including ensuring the chain is larger compared to Bitcoin’s. Unfortunately, it will not enjoy this status for long, as the current mining difficulty makes it nearly impossible to mine new BCH blocks. Eventually, the Bitcoin network will catch up without too many issues and things will go back to normal.