<p>They are hashed in the order they appear in the <a href="https://en.bitcoin.it/wiki/Protocol_documentation#block" rel="nofollow noreferrer">network serialisation</a>:</p>
<blockquote>
<h3>block</h3>
<p>The <strong>block</strong> message is sent in response to a getdata message which requests transaction information from a block hash.</p>
<div class="s-table-container"><table class="s-table">
<thead>
<tr>
<th>Field Size</th>
<th>Description</th>
<th>Data type</th>
<th>Comments</th>
</tr>
</thead>
<tbody>
<tr>
<td>4</td>
<td>version</td>
<td>int32_t</td>
<td>Block version information (note, this is signed)</td>
</tr>
<tr>
<td>32</td>
<td>prev_block</td>
<td>char[32]</td>
<td>The hash value of the previous block this particular block references</td>
</tr>
<tr>
<td>32</td>
<td>merkle_root</td>
<td>char[32]</td>
<td>The reference to a Merkle tree collection which is a hash of all transactions related to this block</td>
</tr>
<tr>
<td>4</td>
<td>timestamp</td>
<td>uint32_t</td>
<td>A Unix timestamp recording when this block was created (Currently limited to dates before the year 2106!)</td>
</tr>
<tr>
<td>4</td>
<td>bits</td>
<td>uint32_t</td>
<td>The calculated difficulty target being used for this block</td>
</tr>
<tr>
<td>4</td>
<td>nonce</td>
<td>uint32_t</td>
<td>The nonce used to generate this block… to allow variations of the header and compute different hashes</td>
</tr>
<tr>
<td>1+</td>
<td>txn_count</td>
<td>var_int</td>
<td>Number of transaction entries</td>
</tr>
<tr>
<td>?</td>
<td>txns</td>
<td>tx[]</td>
<td>Block transactions, in format of &quot;tx&quot; command</td>
</tr>
</tbody>
</table></div>
</blockquote>
<p>The block header is hashed. So from version to nonce inclusive.</p>
<hr />
<p>Related:</p>
<ul>
<li><a href="https://bitcoin.stackexchange.com/q/107826/13866">What data is hashed to produce the block hash?</a></li>
<li><a href="https://bitcoin.stackexchange.com/q/114108/13866">What are the components of the raw block shown in this image?</a></li>
<li><a href="https://medium.com/hackergirl/how-to-calculate-the-hash-of-a-block-in-bitcoin-8f6aebb0dc6d" rel="nofollow noreferrer">https://medium.com/hackergirl/how-to-calculate-the-hash-of-a-block-in-bitcoin-8f6aebb0dc6d</a></li>
</ul>

CC BY-SA 4.0
2024-03-26T11:02:36.863Z
2024-03-26T13:55:38.523Z
2024-03-26T13:55:38.523Z
RedGrittyBrick
<p>In what order are the hash of the previous block, the root of the merkle and the nonce hashed to produce the hash of the next bitcoin block?</p>

CC BY-SA 4.0
2024-04-01T23:43:12.040Z
This is a forum for only bitcoin
Efe
<hash><block-header>
In what order is the blockheader hashed?
zman
# In what order is the blockheader hashed?

(Asked by: username_0 on 2024-03-26)

In what order are the hash of the previous block, the root of the merkle and the nonce hashed to produce the hash of the next bitcoin block?

**Tags:** hash, block-header

> **Comments:**
> **username_1**: This is a forum for only bitcoin  

---

## 1 answers

### Answer by username_2 on 2024-03-26. Score: 1

They are hashed in the order they appear in the [network serialisation](https://en.bitcoin.it/wiki/Protocol_documentation#block):

> ### block
>
> The **block** message is sent in response to a getdata message which requests transaction information from a block hash.
>
> | Field Size | Description | Data type | Comments |
> | --- | --- | --- | --- |
> | 4 | version | int32\_t | Block version information (note, this is signed) |
> | 32 | prev\_block | char[32] | The hash value of the previous block this particular block references |
> | 32 | merkle\_root | char[32] | The reference to a Merkle tree collection which is a hash of all transactions related to this block |
> | 4 | timestamp | uint32\_t | A Unix timestamp recording when this block was created (Currently limited to dates before the year 2106!) |
> | 4 | bits | uint32\_t | The calculated difficulty target being used for this block |
> | 4 | nonce | uint32\_t | The nonce used to generate this block… to allow variations of the header and compute different hashes |
> | 1+ | txn\_count | var\_int | Number of transaction entries |
> | ? | txns | tx[] | Block transactions, in format of "tx" command |

The block header is hashed. So from version to nonce inclusive.

---

Related:

* [What data is hashed to produce the block hash?](https://bitcoin.stackexchange.com/q/107826/13866)
* [What are the components of the raw block shown in this image?](https://bitcoin.stackexchange.com/q/114108/13866)
* <https://medium.com/hackergirl/how-to-calculate-the-hash-of-a-block-in-bitcoin-8f6aebb0dc6d>


---

