<blockquote>
  <p>a miner has to solve a mathematical puzzle</p>
</blockquote>

<p>Let's be specific: a miner has to find a block header (which you construct with the block content, i.e. transactions) whose hash (double <code>sha256</code>) is a number inferior to the <strong>target</strong>.</p>

<blockquote>
  <p>But who decides what would be that puzzle for each block ?</p>
</blockquote>

<p>This can be rephrased as: <em>But who decide of the value of the target for each block ?</em></p>

<p>Short and abstract answer: The network sets the target value.</p>

<blockquote>
  <p>Or How do the other miners verify that he really did find the winning hash?</p>
</blockquote>

<p>Not only the other miners but all the participants of the network (full nodes) verify the PoW upon receiving a block, with "verifying the PoW" meaning "check that the hash (double <code>sha256</code>) of the block header represents a number below the <em>current</em> target.</p>

<p>So, how all the nodes can agree on the validity of the block ? Or, how all nodes can share the same target ?</p>

<p>The target <a href="https://github.com/bitcoin/bitcoin/blob/0cda5573405d75d695aba417e8f22f1301ded001/src/chainparams.cpp#L106" rel="nofollow noreferrer">is hardcoded</a> for the genesis block and is adjusted (the higher the target, the lesser the difficulty. The lesser the target, the higher the difficulty) every 2016 blocks.
Since all participants share the same block chain and the same formula for adjusting the target, they share the same current target.
And since they share the same current target, they accept the same blocks and hence share the same block chain :-).</p>

CC BY-SA 4.0
2019-12-24T09:25:24.850Z
"The network sets the target value". But the network is collection of nodes. So which node decides target for current Block ? Or if they do it collectively what is the mechanism ?
Rizstien
CC BY-SA 4.0
2019-12-24T21:29:50.480Z
I began with this abstraction in my answer to then answer *precisely* your comment. The target is updated individually at a fixed interval by each node, since the same algorithm and the same interval is used they collectively share the same value for the target.
Antoine Poinsot
CC BY-SA 4.0
2019-12-23T11:11:31.413Z
2019-12-23T11:11:31.413Z
Antoine Poinsot
<p>The system generates the next puzzle. Think of it as the next A is the result of hashing current A and the next transaction just solved. Therefore the hash output, new A, is random again. So the miner who just solved the puzzle does not have any advantages. The beauty is that you can always find a B that meets the target difficulty.</p>

CC BY-SA 4.0
2021-07-30T17:01:53.463Z
2021-07-30T17:01:53.463Z
Sllu
<p>In PoW algorithm a miner has to solve a mathematical puzzle whose difficulty depends upon load on network and total computing power. But who decides what would be that puzzle for each block? 
For Example I am mining a block and I have to solve following equation <code>A + B = C</code> now I have <code>A</code> and I have to find <code>B</code>
 to solve this equation but who in blockchain network provides <code>C</code> (predetermined number) for each block ?
Or 
How do the other miners verify that he really did find the winning hash?</p>

<proof-of-work><nonce>
Who decides for Blockchain PoW puzzle?
Rizstien
# Who decides for Blockchain PoW puzzle?

(Asked by: username_0 on 2019-12-23)

In PoW algorithm a miner has to solve a mathematical puzzle whose difficulty depends upon load on network and total computing power. But who decides what would be that puzzle for each block?
For Example I am mining a block and I have to solve following equation `A + B = C` now I have `A` and I have to find `B`
to solve this equation but who in blockchain network provides `C` (predetermined number) for each block ?
Or
How do the other miners verify that he really did find the winning hash?

**Tags:** proof-of-work, nonce


---

## 2 answers

### Answer by username_1 on 2019-12-23. Score: 2

> a miner has to solve a mathematical puzzle

Let's be specific: a miner has to find a block header (which you construct with the block content, i.e. transactions) whose hash (double `sha256`) is a number inferior to the **target**.

> But who decides what would be that puzzle for each block ?

This can be rephrased as: *But who decide of the value of the target for each block ?*

Short and abstract answer: The network sets the target value.

> Or How do the other miners verify that he really did find the winning hash?

Not only the other miners but all the participants of the network (full nodes) verify the PoW upon receiving a block, with "verifying the PoW" meaning "check that the hash (double `sha256`) of the block header represents a number below the *current* target.

So, how all the nodes can agree on the validity of the block ? Or, how all nodes can share the same target ?

The target [is hardcoded](https://github.com/bitcoin/bitcoin/blob/0cda5573405d75d695aba417e8f22f1301ded001/src/chainparams.cpp#L106) for the genesis block and is adjusted (the higher the target, the lesser the difficulty. The lesser the target, the higher the difficulty) every 2016 blocks.
Since all participants share the same block chain and the same formula for adjusting the target, they share the same current target.
And since they share the same current target, they accept the same blocks and hence share the same block chain :-).

> **Comments:**
> **username_0**: "The network sets the target value". But the network is collection of nodes. So which node decides target for current Block ? Or if they do it collectively what is the mechanism ?  
> **username_1**: I began with this abstraction in my answer to then answer *precisely* your comment. The target is updated individually at a fixed interval by each node, since the same algorithm and the same interval is used they collectively share the same value for the target.  

---

### Answer by username_2 on 2021-07-30. Score: 0

The system generates the next puzzle. Think of it as the next A is the result of hashing current A and the next transaction just solved. Therefore the hash output, new A, is random again. So the miner who just solved the puzzle does not have any advantages. The beauty is that you can always find a B that meets the target difficulty.


---

