<p>Difficulty is defined relatively: it is how much more difficult it is to mine a block compared to a fixed &quot;maximum target&quot;, which corresponds to roughly <em>2<sup>32</sup></em> hashes.</p>
<p>In more detail, a Bitcoin block is PoW-valid when its hash (interpreted as a 256-bit integer) is less or equal to that block's &quot;target&quot;. Difficulty does not exist at the protocol level; internally, everything uses targets.</p>
<p>The rules for target adjustment are as follows:</p>
<ul>
<li>Blocks whose height <em>n</em> is not a multiple of 2016 have the same target as their parent block.</li>
<li>Blocks whose height <em>n</em> <em>is</em> a multiple of 2016:
<ul>
<li>Take the parent's target</li>
<li>Multiply that target by the number of seconds in two weeks.</li>
<li>Divide the result by the difference (in seconds) between the timestamp of block <em>n-2016</em> and that of block <em>n-1</em>.</li>
<li>If the result is more than 4 times the parent target, or less than 1/4th of the parent target, clamp it.</li>
<li>If the result is above the maximum target, use the maximum target instead.</li>
<li>Round the target down to fit in Bitcoin's custom 32-bit floating point format (called the &quot;nBits&quot; encoding).</li>
</ul>
</li>
</ul>
<p>The expected number of hashes at a given target <em>T</em> is <em>2<sup>256</sup> / (T+1)</em>. The higher the target, the easier it is to mine a block. The maximum target is thus a limit on how easy mining can get, and is the fixed constant <em>(2<sup>224</sup> - 2<sup>208</sup>)</em> in Bitcoin. The expected number of hashes at this target is <em>2<sup>48</sup> / (2<sup>16</sup>-1)</em>, or just over <em>2<sup>32</sup></em>.</p>
<p>The difficulty is now a purely human representation of the target value: it is the maximum target divided by the actual target, and is at least <em>1</em> (at maximum target).</p>

CC BY-SA 4.0
2022-06-26T14:12:47.180Z
thanks - that makes sense. so I guess a natural conclusion to draw from this would be, if blocks are on average created faster than 10 mins:
a). The network hash rate is probably greater than the difficulty for the last 2016 blocks and,
b). difficulty at the next epoch will be revised upwards or the target revised downward.
user135293
CC BY-SA 4.0
2022-06-26T13:28:04.630Z
2022-06-26T13:28:04.630Z
Pieter Wuille
<p>i read that some ASIC cards can produce upto 100 TH/s (= 100,000 bn hashes/s = 100 tn hashes/s)</p>
<p>Further, lets say network difficulty at the moment is 30tn (i understand this to mean that on average it will take 30tn hashes to come out with a solution per block). If the block time is roughly 10 mins =&gt; 30tn/600 = 0.05tn hashes/s (=50 bn TH/s) would get me the block solution.</p>
<p>i must be missing something - as if the net work is currently outputting 200 EH/s (200 bn TH/s) (by estimate) =&gt; it seems like we should get a solution to the problem pretty quickly (i.e. not the 10 mins as per the protocol).</p>
<p>i am sure my logic is flawed somewhere or i am being daft - can some one please point out the flaw?</p>
<p>thanks</p>

<difficulty>
Bitcoin hash rates/difficulty
user135293
# Bitcoin hash rates/difficulty

(Asked by: username_0 on 2022-06-26)

i read that some ASIC cards can produce upto 100 TH/s (= 100,000 bn hashes/s = 100 tn hashes/s)

Further, lets say network difficulty at the moment is 30tn (i understand this to mean that on average it will take 30tn hashes to come out with a solution per block). If the block time is roughly 10 mins => 30tn/600 = 0.05tn hashes/s (=50 bn TH/s) would get me the block solution.

i must be missing something - as if the net work is currently outputting 200 EH/s (200 bn TH/s) (by estimate) => it seems like we should get a solution to the problem pretty quickly (i.e. not the 10 mins as per the protocol).

i am sure my logic is flawed somewhere or i am being daft - can some one please point out the flaw?

thanks

**Tags:** difficulty


---

## 1 answers

### Answer by username_1 on 2022-06-26. Score: 2

Difficulty is defined relatively: it is how much more difficult it is to mine a block compared to a fixed "maximum target", which corresponds to roughly *232* hashes.

In more detail, a Bitcoin block is PoW-valid when its hash (interpreted as a 256-bit integer) is less or equal to that block's "target". Difficulty does not exist at the protocol level; internally, everything uses targets.

The rules for target adjustment are as follows:

* Blocks whose height *n* is not a multiple of 2016 have the same target as their parent block.
* Blocks whose height *n* *is* a multiple of 2016:
  + Take the parent's target
  + Multiply that target by the number of seconds in two weeks.
  + Divide the result by the difference (in seconds) between the timestamp of block *n-2016* and that of block *n-1*.
  + If the result is more than 4 times the parent target, or less than 1/4th of the parent target, clamp it.
  + If the result is above the maximum target, use the maximum target instead.
  + Round the target down to fit in Bitcoin's custom 32-bit floating point format (called the "nBits" encoding).

The expected number of hashes at a given target *T* is *2256 / (T+1)*. The higher the target, the easier it is to mine a block. The maximum target is thus a limit on how easy mining can get, and is the fixed constant *(2224 - 2208)* in Bitcoin. The expected number of hashes at this target is *248 / (216-1)*, or just over *232*.

The difficulty is now a purely human representation of the target value: it is the maximum target divided by the actual target, and is at least *1* (at maximum target).

> **Comments:**
> **username_0**: thanks - that makes sense. so I guess a natural conclusion to draw from this would be, if blocks are on average created faster than 10 mins: a). The network hash rate is probably greater than the difficulty for the last 2016 blocks and, b). difficulty at the next epoch will be revised upwards or the target revised downward.  

---

