Bitcoin Block Header format detailed explained with example

Follow and share now!

The Block Header are six attributes in each Bitcoin Block, starting at the ninth Byte nearby begin. Please read the Computer Basics, if you are not familiar with computers, to understand the whole Byte structure.

Bitcoin Block Header format:

The Bitcoin Block Header has always a size of 80 Bytes, each field has a fixed length.

NameSize in BytesDescription
Version4The version of the block structure.
hashPrevBlock32The hash of the header of the previous block in the Blockchain.
hashMerkleRoot32The Merkle Root of the Transactions of this Block. This field is detailed described in the post about the Merkle Tree.
Time4The time of creation in seconds since the 1970-01-01 00:00 UTC (Unix Time).
Bits4The as floating-point number decoded Difficulty.
Nonce4Miners increment this field while searching for a matching header hash.
  • Version is the field containing the block version. Stratum defines the pool extension version-rolling, which may allows the miner to change some Bits of this data field.
  • hashPrevBlock contains the hash of SHA-256 twice times and the Bytes of the Header of the previous Block in the Blockchain.
  • The field hashMerkleRoot contains the hash of all transactions of the surrounding Block. Please read the article about Merkle Root and Tree, to learn, for what it is and how to generate this hash.
  • Time is the count of all passed seconds since 1970-01-01 00:00. This is called the Unix timestamp and should be available in any modern programming language. Some methods return them as milliseconds (divide by one thousand) or nanoseconds (divide by one billion). Microseconds (divide by one million) are unusual. Don’t forget to make sure to use a timezone-neutral way or to correct it manual, respectively. This field doesn’t need to contain the exact time, the field content has to follow some rules.
  • Miners increment the Nonce field to test the different hashes for a matching Header.

The purpose of a Bitcoin Block Header:

hashPrevBlock is on many sources described as the hash of the previous Block. hashMerkleRoot ensure the integrity of the Transactions, so it is enough to chain only the Block Headers. That is why it is seen as independent object. That is for fair mining very important, cause the hashing time of a Block Header doesn’t increase with the count of transactions, just the build of the new Merkle Root, each time the unconfirmed Transactions changes.

Bitcoin Block Header Bytes example:

Example Block 0

That is the Block Header part from the Bytes of the first Block of the main Blockchain with the height 0:


Consulting the table above, the Bytes forms these groups:

  • 01000000
  • 0000000000000000000000000000000000000000000000000000000000000000
  • 3ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a
  • 29ab5f49
  • ffff001d
  • 1dac2b7c
NameSize in BytesDataHint
Version401000000Version 1.
hashPrevBlock3200000000...This is the header of the first Block, so it is zero.
hashMerkleRoot323ba3edfd...The Merkle Root from the Transactions. The field contains in this case the Hash of the Transaction, since the Block contains just one one.
Time429ab5f49As big endian 0x495fab29, decimal and as time 2009-01-03 19:15.
Bits4ffff001dThe lowest possible Difficulty as Floating point number. As Difficulty notation 1.0, as Target 0x0000_0000_FFFF_0000_0000_0000_0000_0000_
Nonce41dac2b7cAs big endian 0x7c2bac1d and decimal Any number, just to change the Header hash.


Post Your Comment Here

Your email address will not be published. Required fields are marked *