<p>You are right, the formula is inverted here. Someone <a href="https://github.com/bitcoinbook/bitcoinbook/issues/1126" rel="nofollow noreferrer">reported</a> the same issue already to the repository for the book.</p>
<p>I think confusion arises from there being two relevant terms here:</p>
<ul>
<li>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 <code>nBits</code> header field.</li>
<li>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.</li>
</ul>
<p>It looks like the difficulty and target was mixed up here. Either</p>
<pre><code>New Difficulty = Old Difficulty * (20,160 minutes / Actual Time of Last 2015 Blocks)
</code></pre>
<p>or</p>
<pre><code>New Target = Old Target * (Actual Time of Last 2015 Blocks / 20,160 minutes)
</code></pre>
<p>would be correct, but the book has a mistake here.</p>

CC BY-SA 4.0
2024-10-29T17:26:57.700Z
2024-10-29T17:26:57.700Z
Murch
<p>In book &quot;Mastering bitcoin&quot; 3rd, page 278, There is a formula about bitcoin mining difficulty adjustment formula as below:</p>
<pre><code>        New Target = Old Target * (20,160 minutes / Actual Time of Last 2015 Blocks)
</code></pre>
<p>I think it should be:</p>
<pre><code>        New Target = Old Target * (Actual Time of Last 2015 Blocks / 20,160 minutes)
</code></pre>
<p>Anyone has comments about it? Thanks.</p>

<mastering-bitcoin><difficulty-retargetting>
Question about bitcoin mining difficulty adjustment formula in book mastering bitcoin 3rd edtion
fa william
# Question about bitcoin mining difficulty adjustment formula in book mastering bitcoin 3rd edtion

(Asked by: username_0 on 2024-10-29)

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.

**Tags:** mastering-bitcoin, difficulty-retargetting


---

## 1 answers

### Answer by username_1 on 2024-10-29. Score: 2 | Accepted answer

You are right, the formula is inverted here. Someone [reported](https://github.com/bitcoinbook/bitcoinbook/issues/1126) 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.


---

