1

In book "Mastering bitcoin" 3rd, page 278, There is a formula about bitcoin mining difficulty adjustment formula as below:

        New Target = Old Target * (20,160 minutes / Actual Time of Last 2015 Blocks)

I think it should be:

        New Target = Old Target * (Actual Time of Last 2015 Blocks / 20,160 minutes)

Anyone has comments about it? Thanks.

1 Answer 1

2

You are right, the formula is inverted here. Someone reported the same issue already to the repository for the book.

I think confusion arises from there being two relevant terms here:

  • target: the upper bound for the hash of an acceptable block. A higher target is easier to fit under, a lower target is harder. A representation of this value is stored in the nBits header field.
  • difficulty: a human readable representation of the target relative to the difficulty of the maximal target (i.e. the minimum difficulty). Difficulty goes up when it gets harder to find blocks.

It looks like the difficulty and target was mixed up here. Either

New Difficulty = Old Difficulty * (20,160 minutes / Actual Time of Last 2015 Blocks)

or

New Target = Old Target * (Actual Time of Last 2015 Blocks / 20,160 minutes)

would be correct, but the book has a mistake here.

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.