Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXIP-0002: Improve / Replace Difficulty Scaling Algorithm #59

Closed
alexdovzhanyn opened this issue Nov 6, 2018 · 3 comments
Closed

EXIP-0002: Improve / Replace Difficulty Scaling Algorithm #59

alexdovzhanyn opened this issue Nov 6, 2018 · 3 comments
Assignees
Labels
Enhancement New feature or request Research This issue needs to be researched

Comments

@alexdovzhanyn
Copy link
Owner

We're currently using the same difficulty scaling algorithm that Bitcoin uses. This algorithm works well for Bitcoin because of its network's massive amount of hashing power -- making it difficult for miners to manipulate. In the case of Elixium, we're going to have to move away from this algorithm because it will be easily manipulated as miners can join / leave and (early on) cause large oscillations in mining difficulty.

Oscillations in mining difficulty are a huge problem, they could cause Elixium to have massive block delays -- instead of a block getting propagated every 2 minutes, it could grow to a new block every 3 days, in the following (pretty likely) scenario:

  1. Difficulty is set to 10 and the network is happily chugging along.
  2. Mining pool / group of miners with massive hashing power start mining Elixium (lets say, collectively, they have 10x the hashing power of the rest of the network).
  3. They quickly reach a new epoch and the difficulty scales proportionately to the new hashrate (becomes lets say a difficulty of 20).
  4. Now that mining has become more difficult, miners leave and go mine a different coin.
  5. We're now early in an epoch where the mining difficulty is 10x what the network hashrate can handle in order to produce a block every 2 minutes, so blocks are now produced every 20 minutes instead of every 2 minutes, and the entire network moves very slowly until the next epoch, where the difficulty will scale back down.
  6. Miners see that the difficulty scaled back down, so they start mining Elixium again, and now we oscillate back up to a high difficulty and repeat the cycle.

We want to find a difficulty scaling algorithm that quickly scales and rebounds from these oscillations and implement it into Elixium.

zawy12/difficulty-algorithms#3 and https://eprint.iacr.org/2017/731.pdf seem like good starting points.

@alexdovzhanyn alexdovzhanyn added Enhancement New feature or request Research This issue needs to be researched labels Nov 6, 2018
@alexdovzhanyn alexdovzhanyn self-assigned this Nov 6, 2018
@hlongvu
Copy link

hlongvu commented Nov 7, 2018

I think this would be helpful zawy12/difficulty-algorithms#8
The coin Masari which implements WWHM Di􏰀culty Adjustment Algorithm looks like the best out there.
More detail on this https://getmasari.org/research-papers/wwhm.pdf

@alexdovzhanyn
Copy link
Owner Author

Thanks for the suggestion @hlongvu! I'll look further into this -- would you mind updating EXIP-0002?

@alexdovzhanyn alexdovzhanyn changed the title Improve / Replace Difficulty Scaling Algorithm EXIP-0002: Improve / Replace Difficulty Scaling Algorithm Nov 7, 2018
@alexdovzhanyn
Copy link
Owner Author

Nevermind - I went ahead and updated the EXIP with your suggestion while doing some more research. Thanks for the help! It looks like we'll likely be using WWHM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Research This issue needs to be researched
Projects
None yet
Development

No branches or pull requests

2 participants