28

Having read various pieces of documentation, it's still not completely clear to me what dictates the difficulty rise, and how Ethereum difficulty levels differ to Bitcoin.

In the past week difficulty has jumped from around 11 to over 17, whilst GH/s has fluctuated between 800.00 - 1400.00 but with no clear correlation between the two.

Has the "difficulty bomb" now been introduced? And if yes, is there any way for approximating or calculating how much difficulty will likely rise by in the next 6-12 months?

Related: If Serenity / PoS is unlikely to be introduced until early next year, has there been any suggestion from the dev team that the effects of this "difficulty bomb" will be reduced in either the homestead or metropolis releases?

1 Answer 1

21

From https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2.md:

Mining difficulty is calculated from the time difference between blocks. The exact formula will change in Homestead. The symbol // in the following denotes integer division.

  • Frontier:

block_diff = parent_diff + parent_diff // 2048 * (1 if block_timestamp - parent_timestamp < 13 else -1) + int(2**((block.number // 100000) - 2))

  • Homestead:

block_diff = parent_diff + parent_diff // 2048 * max(1 - (block_timestamp - parent_timestamp) // 10, -99) + int(2**((block.number // 100000) - 2))

EDIT:

The problem with the frontier formula and the reason for the change was that the frontier version doesn't take into account how far off from 13 seconds the block time was. A block mined 1 second after the previous one has the same effect on the difficulty as one mined after 12 seconds. This causes block difficulty to adjust to a median block time rather than a mean.

Again, check out the EIP for more details.

3
  • Apologies that I lack the the knowledge but how exactly would I use this to calculate? Seeing the difference "< 13 else -1" vs "// 10, -99" it's not clear to me what the difference will be. If you have a moment to explain in more depth that would be greatly appreciated! Commented Mar 13, 2016 at 16:59
  • 2
    In the formula the time between the latest block and the block before it is evaluated. If the time difference is smaller than 13, the difficulty goes up: block_diff = parent_diff + parent_diff // 2048 + int(2**((block.number // 100000) - 2)) If the time between the last two blocks was larger than 13 seconds, the difficulty goes down: block_diff = parent_diff - parent_diff // 2048 + int(2**((block.number // 100000) - 2))
    – MrChico
    Commented Mar 13, 2016 at 18:46
  • 1
    Missing link in the answer Commented Nov 4, 2018 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.