<p><strong>Leading zeroes</strong></p>
<p>The number you refer to is usually called the mining difficulty or target.</p>
<p>The aim of miners is to produce a block with a hash less than that target.</p>
<p>If you represent numbers in binary, a number with more leading zeroes is a smaller number.
For example 00010 (2) is smaller than 00101 (5)</p>
<p>However you shouldn't think about leading zeroes because 00101 (5) is smaller than 00110 (6) but bigger than 00100 (4) although all have the same number of leading zeroes.</p>
<p>It is an arithmetic relationship that is tested, not the number of leading zeroes.</p>
<p><strong>Target value and mining</strong></p>
<p>The target is adjusted up and down regularly. It doesn't continually increase.</p>
<p>The target is adjusted to make the average time to find a new block close to 10 minutes.</p>
<p>This means as there are more miners the target is likely to increase. But more importantly, if there were fewer miners but each had more powerful hardware, the target would also increase, not decrease. It is the total amount of mining power, not the number of miners, that affects the target.</p>
<p>In the past, when the value of bitcoin fell, the value of the mining reward also fell. This can result in less efficient miners leaving the mining business and the difficulty target dropping not rising.</p>
<hr />
<p>Miners assemble a block of transactions selected from a pool, then calculate the hash, if too big, they make a small change to the block, like change the nonce value, and recalculate the hash, they repeat this until either they find an arrangement that hashes to a value smaller than the target or until some other miner beats them and they have to start all over again.</p>

CC BY-SA 4.0
2021-01-31T12:46:36.997Z
so it is basically, generate a random number, and if the SHA256 of it (together with other data) can be less than, say `0000000007426d23...39`, then it is a successful mining of a block, and therefore 12.5 bitcoins rewarded at the moment?
deeper-understanding
CC BY-SA 4.0
2021-01-31T13:06:13.537Z
It isn't generating a random number. Miners assemble a block of transactions selected from a pool, then calculate the hash, if too big, they make a small change to the block, like change the nonce value, and recalculate the hash, they repeat this until either they find an arrangement that hashes to a small value or until some other miner beats them and they have to start all over again.
RedGrittyBrick
CC BY-SA 4.0
2021-01-31T13:25:14.317Z
oh... how can the moms and pops understand this... I am already quite technical, but I guess it is like, you don't have to understand how a credit card works underneath in order to use it
deeper-understanding
CC BY-SA 4.0
2021-01-31T13:59:36.290Z
If the barrier to entry for any product is that it can be described in layman's terms we wouldn't be able to do anything. A black box understanding ("miners create timestamps") is far more useful than confusing people with technical explanations they don't need to know is counter productive.
Claris
CC BY-SA 4.0
2021-02-02T09:22:01.563Z
@RedGrittyBrick hmm... I have watched some YouTube videos, and they tend to say the same thing: they SHA256 together with some kind of random number, and SHA256 twice indeed, and reach a number, and compete for this number to be "small enough"... I guess you can say, they don't need to do it with a random number: they can go from 0, and 1, and 2... but how do they coordinate the effect with thousands of miners in their mining pool? And if two or three mining pools do the same sequence, isn't it a waste of duplicate effort? So wouldn't it be better just to go "random"?
deeper-understanding
CC BY-SA 4.0
2021-02-02T09:48:28.267Z
@RedGrittyBrick and that number is actually called `nonce`, which the book Mastering Bitcoin 2nd Ed by O'Reilly says p.225, is a random number...
deeper-understanding
CC BY-SA 4.0
2021-02-02T10:18:06.460Z
There's nonce, extranonce, the timestamp, the order of transactions and many other things that miners can change to affect the generated hash. This is a level of detail that you don't need to understand just to use Bitcoin. The same applies to the various mechanisms and stratagems of coopereating miners in pools and of competing pools. If you really want to go into that rabbit hole it goes very very deep. The material that is hashed may or may not have some randomly chosen elements at the discretion of the miner but that seems insufficient justification to label it "generate a random number".
RedGrittyBrick
CC BY-SA 4.0
2021-01-31T11:20:25.090Z
2021-01-31T13:37:18.983Z
2021-01-31T13:37:18.983Z
RedGrittyBrick
<p>It is said that to discover a block, the person has to get a SHA256 number that has all 0's for the first 72 bits.</p>
<p>Does this number <code>72</code> change and become bigger and bigger over the years (say, every 4 years)?  Or does it depend on how many miners are competing?</p>
<p>So that's could mean, in the year 2010, the number of 0's could be the same as in 2020, if there were as many miners in 2010 as today in 2021.</p>

CC BY-SA 4.0
2021-03-02T15:56:45.730Z
Possible duplicate of https://bitcoin.stackexchange.com/q/5838/5406
Murch
<mining-pools><mining-theory><difficulty><difficulty-retargetting>
ELI5: does the number of 0's required in mining for SHA256 over the years strictly increase, or does it depend on how many miners there are?
deeper-understanding
# ELI5: does the number of 0's required in mining for SHA256 over the years strictly increase, or does it depend on how many miners there are?

(Asked by: username_0 on 2021-01-31)

It is said that to discover a block, the person has to get a SHA256 number that has all 0's for the first 72 bits.

Does this number `72` change and become bigger and bigger over the years (say, every 4 years)? Or does it depend on how many miners are competing?

So that's could mean, in the year 2010, the number of 0's could be the same as in 2020, if there were as many miners in 2010 as today in 2021.

**Tags:** mining-pools, mining-theory, difficulty, difficulty-retargetting

> **Comments:**
> **username_1**: Possible duplicate of https://bitcoin.stackexchange.com/q/5838/5406  

---

## 1 answers

### Answer by username_2 on 2021-01-31. Score: 1

**Leading zeroes**

The number you refer to is usually called the mining difficulty or target.

The aim of miners is to produce a block with a hash less than that target.

If you represent numbers in binary, a number with more leading zeroes is a smaller number.
For example 00010 (2) is smaller than 00101 (5)

However you shouldn't think about leading zeroes because 00101 (5) is smaller than 00110 (6) but bigger than 00100 (4) although all have the same number of leading zeroes.

It is an arithmetic relationship that is tested, not the number of leading zeroes.

**Target value and mining**

The target is adjusted up and down regularly. It doesn't continually increase.

The target is adjusted to make the average time to find a new block close to 10 minutes.

This means as there are more miners the target is likely to increase. But more importantly, if there were fewer miners but each had more powerful hardware, the target would also increase, not decrease. It is the total amount of mining power, not the number of miners, that affects the target.

In the past, when the value of bitcoin fell, the value of the mining reward also fell. This can result in less efficient miners leaving the mining business and the difficulty target dropping not rising.

---

Miners assemble a block of transactions selected from a pool, then calculate the hash, if too big, they make a small change to the block, like change the nonce value, and recalculate the hash, they repeat this until either they find an arrangement that hashes to a value smaller than the target or until some other miner beats them and they have to start all over again.

> **Comments:**
> **username_0**: so it is basically, generate a random number, and if the SHA256 of it (together with other data) can be less than, say `0000000007426d23...39`, then it is a successful mining of a block, and therefore 12.5 bitcoins rewarded at the moment?  
> **username_2**: It isn't generating a random number. Miners assemble a block of transactions selected from a pool, then calculate the hash, if too big, they make a small change to the block, like change the nonce value, and recalculate the hash, they repeat this until either they find an arrangement that hashes to a small value or until some other miner beats them and they have to start all over again.  
> **username_0**: oh... how can the moms and pops understand this... I am already quite technical, but I guess it is like, you don't have to understand how a credit card works underneath in order to use it  
> **username_3**: If the barrier to entry for any product is that it can be described in layman's terms we wouldn't be able to do anything. A black box understanding ("miners create timestamps") is far more useful than confusing people with technical explanations they don't need to know is counter productive.  
> **username_0**: @username_2 hmm... I have watched some YouTube videos, and they tend to say the same thing: they SHA256 together with some kind of random number, and SHA256 twice indeed, and reach a number, and compete for this number to be "small enough"... I guess you can say, they don't need to do it with a random number: they can go from 0, and 1, and 2... but how do they coordinate the effect with thousands of miners in their mining pool? And if two or three mining pools do the same sequence, isn't it a waste of duplicate effort? So wouldn't it be better just to go "random"?  
> **username_0**: @username_2 and that number is actually called `nonce`, which the book Mastering Bitcoin 2nd Ed by O'Reilly says p.225, is a random number...  
> **username_2**: There's nonce, extranonce, the timestamp, the order of transactions and many other things that miners can change to affect the generated hash. This is a level of detail that you don't need to understand just to use Bitcoin. The same applies to the various mechanisms and stratagems of coopereating miners in pools and of competing pools. If you really want to go into that rabbit hole it goes very very deep. The material that is hashed may or may not have some randomly chosen elements at the discretion of the miner but that seems insufficient justification to label it "generate a random number".  

---

