<p>When a miner authors a new block, the block contains a <strong>block header</strong>. The block header is used to put the new block in relation to previous blocks and gives a summary of the transactions. In detail, the block header contains:</p>

<ul>
<li>a version byte</li>
<li>the block hash of the previous block</li>
<li>the Merkle root that commits to all transactions in the block</li>
<li>a timestamp</li>
<li>a field corresponding to the current difficulty</li>
<li>a nonce that provides some randomness.</li>
</ul>

<p>This block header has only 80 bytes of data. When these 80 bytes are put through SHA-256d once, they result in a hash which we use as the unique identifier of the block, the "block hash". The block hash is used to announce the block to peers and in the next block to commit to this one. This same "block hash" interpreted as a number has to meet the difficulty requirement ("have a certain number of leading zeros").</p>

<blockquote>
  <p>What you are saying is that the nodes have to do the work to find the valid hash all over again.</p>
</blockquote>

<p>Not quite! Finding a block header for which the hash meets the difficulty requires a multitude of tries. Since it is impossible to predict which block header will succeed except by hashing and checking, the fact that a valid block has been found proves that a large number of tries have been expended (about 4,92×10²² in average currently). We call this concept <strong>proof-of-work</strong>. However, the validation of the work only requires to put the provided block header once through a hash function and then to compare the resulting hash with the difficulty which is trivial to do!
In fact, this is the first of a number of validity checks that other network participants do when they receive a new block candidate.</p>

CC BY-SA 4.0
2019-08-25T15:09:45.987Z
2019-08-26T02:20:46.940Z
2019-08-26T02:20:46.940Z
Murch
<p>If all that the miner needs to do is find a hash with a certain number of leading 0's of the block's header, couldn't they just find a random hash with the required number of 0's that isn't necessarily the hash of the block header? How would the nodes know?</p>

<p>How exactly do the nodes decide if the proof of work is valid? What protocol is used for this?</p>

CC BY-SA 4.0
2019-08-25T00:16:24.183Z
I had to do more research to understand how the network prevents this kind of thing because these answers aren't clear at all. Basically what I understood is that the node will recalculate the hash with the given nonce and see if it matches the one put forward by the miner.
Sara
CC BY-SA 4.0
2019-08-25T01:06:50.577Z
the key is that there is no ‘hash put forward by the miner’. The miner puts forth the block, and all other nodes use it (the block’s header) to calculate the hash themselves, and ensure it is valid. The block does not explicitly contain its own hash.
chytrik
CC BY-SA 4.0
2019-08-25T14:24:25.017Z
What you are saying is that the nodes have to do the work to find the valid hash all over again. It doesn't make sense and I know it's not how this works. The question that you say is a duplicate also doesn't provide clear answers on how *exactly* does the network prevent this.
Sara
CC BY-SA 4.0
2019-08-25T17:30:41.050Z
no, the nodes do not have to do the work again, you misunderstood my comment. The network’s nodes simply hash the header of the *newly proposed block*, and thus determine for themselves the validity of that block. If it is valid, they will quickly and easily determine this to be true. If it is invalid, they will discard it. No iterative proof of work required, and no opportunity to just ‘propose a random hash’, as you suggested.
chytrik
CC BY-SA 4.0
2019-08-25T23:32:16.360Z
@Sara A miner tries to mine billions of possible blocks until they find one that works. They then propose that block and everyone else just has to try that one block one time to see if it works or not.
David Schwartz
<blockchain><hash><validation>
How exactly does the network know if the miner has put forth a valid proof of work?
Sara
# How exactly does the network know if the miner has put forth a valid proof of work?

(Asked by: username_0 on 2019-08-24)

If all that the miner needs to do is find a hash with a certain number of leading 0's of the block's header, couldn't they just find a random hash with the required number of 0's that isn't necessarily the hash of the block header? How would the nodes know?

How exactly do the nodes decide if the proof of work is valid? What protocol is used for this?

**Tags:** blockchain, hash, validation

> **Comments:**
> **username_0**: I had to do more research to understand how the network prevents this kind of thing because these answers aren't clear at all. Basically what I understood is that the node will recalculate the hash with the given nonce and see if it matches the one put forward by the miner.  
> **username_1**: the key is that there is no ‘hash put forward by the miner’. The miner puts forth the block, and all other nodes use it (the block’s header) to calculate the hash themselves, and ensure it is valid. The block does not explicitly contain its own hash.  
> **username_0**: What you are saying is that the nodes have to do the work to find the valid hash all over again. It doesn't make sense and I know it's not how this works. The question that you say is a duplicate also doesn't provide clear answers on how *exactly* does the network prevent this.  
> **username_1**: no, the nodes do not have to do the work again, you misunderstood my comment. The network’s nodes simply hash the header of the *newly proposed block*, and thus determine for themselves the validity of that block. If it is valid, they will quickly and easily determine this to be true. If it is invalid, they will discard it. No iterative proof of work required, and no opportunity to just ‘propose a random hash’, as you suggested.  
> **username_2**: @username_0 A miner tries to mine billions of possible blocks until they find one that works. They then propose that block and everyone else just has to try that one block one time to see if it works or not.  

---

## 1 answers

### Answer by username_3 on 2019-08-25. Score: 1 | Accepted answer

When a miner authors a new block, the block contains a **block header**. The block header is used to put the new block in relation to previous blocks and gives a summary of the transactions. In detail, the block header contains:

* a version byte
* the block hash of the previous block
* the Merkle root that commits to all transactions in the block
* a timestamp
* a field corresponding to the current difficulty
* a nonce that provides some randomness.

This block header has only 80 bytes of data. When these 80 bytes are put through SHA-256d once, they result in a hash which we use as the unique identifier of the block, the "block hash". The block hash is used to announce the block to peers and in the next block to commit to this one. This same "block hash" interpreted as a number has to meet the difficulty requirement ("have a certain number of leading zeros").

> What you are saying is that the nodes have to do the work to find the valid hash all over again.

Not quite! Finding a block header for which the hash meets the difficulty requires a multitude of tries. Since it is impossible to predict which block header will succeed except by hashing and checking, the fact that a valid block has been found proves that a large number of tries have been expended (about 4,92×10²² in average currently). We call this concept **proof-of-work**. However, the validation of the work only requires to put the provided block header once through a hash function and then to compare the resulting hash with the difficulty which is trivial to do!
In fact, this is the first of a number of validity checks that other network participants do when they receive a new block candidate.


---

