1

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?

Murch
  • 75,206
  • 34
  • 186
  • 622
zman
  • 11
  • 1

1 Answers1

1

They are hashed in the order they appear in the network serialisation:

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:

RedGrittyBrick
  • 26,841
  • 3
  • 25
  • 51