Home Crypto Dev Digest CRYPTO DEV DIGEST: Bitcoin Cash DAA Gamed Again, Plasma Postmortem, EOS Dev...

CRYPTO DEV DIGEST: Bitcoin Cash DAA Gamed Again, Plasma Postmortem, EOS Dev Portal Live

TL;DR: Crypto Dev Digest (CDD) documents cryptocurrency development, highlighting the projects and persons working under the hood. We talk with developers to better understand the recent gaming of the Bitcoin Cash DAA (difficulty adjustment algorithm). Ethereum’s Plasma is given a postmortem. EOS launches a developer portal, and a ton more in this installment.

Bitcoin Cash DAA Gamed Again

At the same time Bitcoin Cash (BCH) enthusiasts are openly debating funding schemes for infrastructure development, BCH experienced a five-hour gap between blocks. To the camp pressing for the community to act on infrastructure funding, to come up with some doable funding mechanism, it illustrates their reality: everyone freaks out when its too, too late, asking something be done.

The DAA issue for Bitcoin Cash is not new. Peer-to-peer electronic cash opponents use its gaming to exploit the issue in hopes of sullying the project or casting upon it some kind of fatal flaw. In reality, the BCH community has debated the DAA for years, and continues. At various intervals, long block times have happened … as have very fast blocks. Mining pools simply switch to BTC, which can cause the BCH difficulty to fall, and rush to then mine a bunch at once. The DAA shoots back up, and to BTC miners once again return. As developer Tyler Smith explained, “We’re stuck with a difficulty tuned for hash rate X but the actual rate is a lot less than X. Current DAAs don’t account for future large changes to hash rate.”

Bitcoin Cash

Interview With Tyler Smith of OpenBazaar on the BCH DAA 

CoinSpice: In case folks are unfamiliar, what’s your background?

Tyler Smith: I’m a full-stack engineer working on the OpenBazaar project for the company OB1. I spend most of my free time building libraries and tools for developers to work with Bitcoin, trying to help out with projects like BCHD and the Avalanche project, and doing R&D into scalability solutions.

Recently, BCH went without blocks for more than 5 hours. What happened?

The time it takes for a block to be found is, on average, proportional to a value we call the “difficulty.” The difficulty changes from block to block based on the times it took to find previous blocks and its goal is to raise and lower the difficulty such that blocks are found on average every 10 minutes. However, the algorithm that changes this difficulty, the DAA, has no idea what the future hash rate will be like, so it can only make decisions based on past and current hash rate. This is especially problematic for the case that we have a large drop in hash rate because the difficulty will be tuned for the hash rate we had before the drop-off. Now the difficulty is much higher than it should be for the amount of hash rate currently working on finding a block.

Because Bitcoin Cash is a minority chain for our proof of work algorithm (SHA256d), our DAA needs to adapt quickly as hash rate comes and goes between chains. Unfortunately, this allows miners to “game” the DAA in the following manner:

1) Miner mines non-BCH chains which slows block production on our network. Only dedicated BCH miners are still mining and blocks come out very slow.

2) Miner waits for the BCH difficulty to fall in response to this loss of hash rate.

3) Now that the difficulty is low, they bring on all their hash rate to BCH and mine blocks as fast as they can. These blocks will come out faster than 10 minutes on average because their difficulty was tuned for the lower hash rate.

Bitcoin Cash
Bitcoin Cash DAA Graph by Tom Harding

4) This sudden torrent of new blocks tells the DAA a lot of new hash rate has come on board so it ratchets the difficulty up in response.

5) Now the difficulty is very high again and the miner switches back to a non-BCH chain, and the cycle starts again.

If you look at the blocks preceding the 5 hour gap, they were coming out very fast. If you look at their “nBits” or “Difficulty” value on explorers that show it, you can see it getting lower and lower (more and more difficult) leading up to the gap after block 620025. After the gap was ended with block 620026, you can see the difficulty respond by getting easier again in block 620027.

You can see this hash rate change in this graph generated by Tom Harding (above).

Is this what pools like BTC.TOP are doing?

It appears that way based on the blocks being produced.

Is it a big deal?

It is certainly sub-optimal because the gaps are bad for users that need confirmations, and the post-gap spikes require node operators to have more resources over-provisioned which is inefficient and harms scalability.

Is there a way to end DAA gaming?

It can almost certainly be significantly reduced with a new DAA, but there is research to do there to find one that both addresses these issues and doesn’t cause any new ones. This is the ideal fix because it addresses the root of the problem.

Pre-consensus solutions can alleviate the effects of these situations by actively working to reduce network entropy between blocks and provide stronger assurances of a transaction’s irreversibility.

Interview With Independent Developer Mark Lundeberg on the BCH DAA

CoinSpice: Was what happened recently a problem? Is it as meaningful as haters insist?

Somewhat. BCH tries to make unconfirmed transactions relatively “reliable” and our security of confirmed transactions is also unfortunately not huge, so getting the first confirmation is not really a big deal.

But there are some things it impacts: the 25 tx limit problem only ‘clears out’ when a block mines them; and some protocols (like CashFusion) will not accept unconfirmed coins, so it means there are some times of day when certain things slow down.

Also since 5 hours should have 30 blocks, it means if you’re depositing on an exchange with (say) a 10-conf minimum then you’re waiting ~3-4x longer than you expected.

What can be done to mitigate?

The primary reason for this is that the same mining equipment can be used to mine other chains (and there are many cryptocurrencies that face this same issue because they are GPU / CPU mineable). The most effective technical solution is to choose an ASIC-hashable algorithm unique to BCH, but it is probably not acceptable politically to change from SHA256. The second-best mitigation is to ask more miners to mine steadily on BCH. This is not free for them, because they miss out on profits, especially at first.

Bitcoin Cash

Is it BCH’s DA that’s the problem?

BCH’s DA does contribute to the problem since it decides the highs and lows of difficulty, and it contains oscillatory behavior and it’s more volatile than necessary. If the difficulty were more stable then perhaps miners would be less reluctant to steady-mine BCH since they wouldn’t be missing out on profits as much. But fundamentally, any traditional DA will have a similar issue.

There has been some discussion of using non-traditional DA to avoid this, but they all introduce new alien concerns and should be regarded as experimental.

Is this a new problem?

It’s not new. From what I understand we’ve been seeing this for 2 years. There were some times where it was not as bad because more people were steady mining. For example, in advance of the hash war [in late 2018], CoinGeek was mining steadily. Once that whole thing was over, BCH started oscillating.

So BCH has a unique DA?

Yes, but many coins have a unique DA. Many of them have problems too. Actually, BTC’s difficulty algorithm is one of the worst possible ones — any minority chain using that would probably die very quickly. The only reason it isn’t a problem for them is that they consume the dominant hash rate.

  • Postmortem on Plasma

  • Development Script Meeting #2

  • BUCash Bitcoin Unlimited Client

  • Script Breakthrough

  • CacheOut Attack

  • bitcoincashj Updated

  • Tendermint Restructuring

  • Advanced BCH Monitoring

  • Y Combinator’s Winter Batch: 240 Startups

  • Anytype Alpha

  • FIO Road to Mainnet

  • Brain Broken

  • Top Programming Languages

  • CashScript v0.3.2 Released

  • Geth Networking Improvements

  • CashFusion Icon for Crescent Cash

  • Crescent Cash v1.11.3

  • GMax Quits


CONTINUE THE SPICE and check out our piping hot VIDEOS. Our podcast, The CoinSpice Podcast, has amazing guests. Follow CoinSpice on Twitter. Join our Telegram feed to make sure you never miss a post. Drop some BCH at the merch shop — we’ve got some spicy shirts for men and women. Don’t forget to help spread the word about CoinSpice on social media.

DYOR: CoinSpice is your home for just spicy crypto things. We’re not affiliated with any cryptocurrency project or token. Each published piece is intended for information purposes only, not investment advice and not in the hope of impacting speculative markets. There are plenty of trading sites and coin-specific advocacy journals out there, we’re neither. CoinSpice strives for rigorous accuracy in our reporting. Information presented here is contingent usually on a host of factors, and the ecosystem moves fast — prices change, projects change, and at warp speed. Do your own research.

DISCLOSURE: The author holds cryptocurrency as part of his financial portfolio, including BCH.