<p>If you want n zeroes when written in binary, 2<sup>n</sup>.</p>

<p>If you want n zeroes when written in decimal, 10<sup>n</sup></p>

<p>If you want n zeroes when written in hexadecimal, 16<sup>n</sup>.</p>

<p>If you want n zero bytes, 256<sup>n</sup>.</p>

<p>However, none of these things are relevant in terms of Bitcoin. The difficulty is not the number of zeroes required; the difficulty is the minimum ratio between a well-defined maximum value, and the hash you got (when interpreted as a 256-bit unsigned integer).</p>

<p>In practice, the formula is that you need difficulty * 2<sup>48</sup> / 65535 attempts.</p>

CC BY-SA 3.0
2017-10-08T19:59:35.877Z
2017-10-08T20:29:53.810Z
2017-10-08T20:29:53.810Z
Pieter Wuille
<p>I  think that you need on average difficulty * 2<sup>32</sup> trials to solve the proof-of-work puzzle. Cf <a href="https://en.bitcoin.it/wiki/Difficulty" rel="nofollow noreferrer">the bitcoin specification</a>.</p>

CC BY-SA 3.0
2017-10-09T11:36:06.820Z
2017-10-09T11:36:06.820Z
Charles Bouillaguet
<p>Assuming 256-bit hash output, how does the (average) number of nonces I need to try (to solve the proof-of-work puzzle) grow with the number of leading zeroes required, <em>n</em>? Is there a bound on this number?</p>

<mining-theory><proof-of-work>
How many nonces on average do I need to try in order to get n leading zeros?
aspen100
# How many nonces on average do I need to try in order to get n leading zeros?

(Asked by: username_0 on 2017-10-08)

Assuming 256-bit hash output, how does the (average) number of nonces I need to try (to solve the proof-of-work puzzle) grow with the number of leading zeroes required, *n*? Is there a bound on this number?

**Tags:** mining-theory, proof-of-work


---

## 2 answers

### Answer by username_1 on 2017-10-08. Score: 2

If you want n zeroes when written in binary, 2n.

If you want n zeroes when written in decimal, 10n

If you want n zeroes when written in hexadecimal, 16n.

If you want n zero bytes, 256n.

However, none of these things are relevant in terms of Bitcoin. The difficulty is not the number of zeroes required; the difficulty is the minimum ratio between a well-defined maximum value, and the hash you got (when interpreted as a 256-bit unsigned integer).

In practice, the formula is that you need difficulty \* 248 / 65535 attempts.


---

### Answer by username_2 on 2017-10-09. Score: 0

I think that you need on average difficulty \* 232 trials to solve the proof-of-work puzzle. Cf [the bitcoin specification](https://en.bitcoin.it/wiki/Difficulty).


---

