<p>It is not stored as part of the block data itself. Other clients reply with their list of hashes ahead of yours when you broadcast getblocks. From that list, each block header is downloaded and kept in the local block chain leveldb with the hash as a key.</p>

<p>From <a href="https://en.bitcoin.it/wiki/Network#Initial_block_download" rel="nofollow">Bitcoin Wiki</a>:</p>

<blockquote>
  <h2>Initial block download</h2>
  
  <p>At the start of a connection, you send a getblocks message containing the hash of the latest block you know about. If the peer doesn't think that this is the latest block, it will send an inv that contains up to 500 blocks ahead of the one you listed. You will then request all of these blocks with getdata, and the peer will send them to you with block messages. After you have downloaded and processed all of these blocks, you will send another getblocks, etc., until you have all of the blocks.</p>
</blockquote>

CC BY-SA 3.0
2014-04-13T21:30:28.187Z
2014-04-13T21:30:28.187Z
Nell
<p>It is not stored. The proof of work is in the fact that the hash of your generated block should be of a certain form. It does not make sense to store it either, because you cannot trust it to be the real hash of the block and thus should be calculated anyway.</p>

CC BY-SA 3.0
2014-04-13T21:10:43.307Z
Then based on what information network can verify if I solved the PoW or not?
Nur
CC BY-SA 3.0
2014-04-13T21:12:12.947Z
The hash should be lower than or equal to a predefined number (i.e. the target).
Jori
CC BY-SA 3.0
2014-04-13T21:13:03.817Z
I know that, but this means that I need to send this hash, the hash of PoW. But which variable holds such a hash?
Nur
CC BY-SA 3.0
2014-04-13T21:13:36.223Z
No. The hash is implied in the block broadcasted to the network.
Jori
CC BY-SA 3.0
2014-04-13T21:14:35.357Z
So where is this hash? As you said yourself it is implemented. So I want to know what variable holds this hash?
Nur
CC BY-SA 3.0
2014-04-13T21:19:25.490Z
I said `implied`. I'm sorry, but I don't believe I understand you correctly. Could you clarify, please?
Jori
CC BY-SA 3.0
2014-04-13T21:25:36.110Z
I am sorry I misunderstood you. I mean that as far as I know in order to create a block I need to find a valid hash, which should be less than a target. In case if I found such a hash, it means that I solved a block. But as I understand, now I need to broadcast the whole network that I found such a hash and they should verify it. This means that I need to send them some DATA that will allow all nodes to verify my hash. So what is this DATA, that I am sending them, so they can verify my hash?
Nur
CC BY-SA 3.0
2014-04-13T21:27:02.960Z
The block. You can change the nonce and timestamp to change the hash until it is below or equal to the target.
Jori
CC BY-SA 3.0
2014-04-13T21:30:04.077Z
I do not get it, so how will they check whether I found a valid hash?
Nur
CC BY-SA 3.0
2014-04-13T21:32:19.590Z
Do you mean that I need to send a Nonce which let me generate such a hash, so other nodes can try this Nonce and verify that it gives a valid hash?
Nur
CC BY-SA 3.0
2014-04-13T21:36:03.903Z
They receive the block you created and hash it. If the hash is below the or equal to the target they accept it, else they reject it. Your above comment is correct, but notice that the nonce is part of the block, it isn't send separately.
Jori
CC BY-SA 3.0
2014-04-13T21:39:01.003Z
I ve never heard that nodes hash the entire block to check whether I solved it correctly or not. Can you please provide me with the resource for your statement?

I know that entire blocks are hashed to be added for the next block.
Nur
CC BY-SA 3.0
2014-04-13T22:41:27.037Z
@Nur: Other nodes *must* hash your new block to check your solution. Otherwise, you could supply any random number as the hash (that meets the required difficulty) and say "see? I solved it!". Other nodes have to hash your block to make sure you are not lying.
Greg Hewgill
CC BY-SA 3.0
2014-04-13T21:08:25.103Z
2014-04-13T21:18:15.363Z
2014-04-13T21:18:15.363Z
Jori
<p>Can anyone please tell me, which variable holds the hash of the solution of block's PoW in broadcasted block?
I know that a block consists of (I am pretty sure I am forgetting some variables here):</p>

<ul>
<li>Magic no</li>
<li>Block size</li>
<li>Transactions (raw)</li>
<li>Transactions counter</li>
<li>Block header
<ul>
<li>version</li>
<li>hash of previous block</li>
<li>timestamp</li>
<li>bits</li>
<li>nnonce</li>
<li>hash(MerkleRoot)</li>
</ul></li>
</ul>

<p>So basically, my question is which variable holds the hash of solution of current block's PoW?
Thanks in advance.</p>

<block><hash><proof-of-work>
What is the variable in a block that holds hash of found PoW?
Nur
# What is the variable in a block that holds hash of found PoW?

(Asked by: username_0 on 2014-04-13)

Can anyone please tell me, which variable holds the hash of the solution of block's PoW in broadcasted block?
I know that a block consists of (I am pretty sure I am forgetting some variables here):

* Magic no
* Block size
* Transactions (raw)
* Transactions counter
* Block header
  + version
  + hash of previous block
  + timestamp
  + bits
  + nnonce
  + hash(MerkleRoot)

So basically, my question is which variable holds the hash of solution of current block's PoW?
Thanks in advance.

**Tags:** block, hash, proof-of-work


---

## 2 answers

### Answer by username_2 on 2014-04-13. Score: 5 | Accepted answer

It is not stored. The proof of work is in the fact that the hash of your generated block should be of a certain form. It does not make sense to store it either, because you cannot trust it to be the real hash of the block and thus should be calculated anyway.

> **Comments:**
> **username_0**: Then based on what information network can verify if I solved the PoW or not?  
> **username_2**: The hash should be lower than or equal to a predefined number (i.e. the target).  
> **username_0**: I know that, but this means that I need to send this hash, the hash of PoW. But which variable holds such a hash?  
> **username_2**: No. The hash is implied in the block broadcasted to the network.  
> **username_0**: So where is this hash? As you said yourself it is implemented. So I want to know what variable holds this hash?  
> **username_2**: I said `implied`. I'm sorry, but I don't believe I understand you correctly. Could you clarify, please?  
> **username_0**: I am sorry I misunderstood you. I mean that as far as I know in order to create a block I need to find a valid hash, which should be less than a target. In case if I found such a hash, it means that I solved a block. But as I understand, now I need to broadcast the whole network that I found such a hash and they should verify it. This means that I need to send them some DATA that will allow all nodes to verify my hash. So what is this DATA, that I am sending them, so they can verify my hash?  
> **username_2**: The block. You can change the nonce and timestamp to change the hash until it is below or equal to the target.  
> **username_0**: I do not get it, so how will they check whether I found a valid hash?  
> **username_0**: Do you mean that I need to send a Nonce which let me generate such a hash, so other nodes can try this Nonce and verify that it gives a valid hash?  
> **username_2**: They receive the block you created and hash it. If the hash is below the or equal to the target they accept it, else they reject it. Your above comment is correct, but notice that the nonce is part of the block, it isn't send separately.  
> **username_0**: I ve never heard that nodes hash the entire block to check whether I solved it correctly or not. Can you please provide me with the resource for your statement?  I know that entire blocks are hashed to be added for the next block.  
> **username_3**: @username_0: Other nodes *must* hash your new block to check your solution. Otherwise, you could supply any random number as the hash (that meets the required difficulty) and say "see? I solved it!". Other nodes have to hash your block to make sure you are not lying.  

---

### Answer by username_1 on 2014-04-13. Score: 2

It is not stored as part of the block data itself. Other clients reply with their list of hashes ahead of yours when you broadcast getblocks. From that list, each block header is downloaded and kept in the local block chain leveldb with the hash as a key.

From [Bitcoin Wiki](https://en.bitcoin.it/wiki/Network#Initial_block_download):

> ## Initial block download
>
> At the start of a connection, you send a getblocks message containing the hash of the latest block you know about. If the peer doesn't think that this is the latest block, it will send an inv that contains up to 500 blocks ahead of the one you listed. You will then request all of these blocks with getdata, and the peer will send them to you with block messages. After you have downloaded and processed all of these blocks, you will send another getblocks, etc., until you have all of the blocks.


---

