Block header
The block header is a section in aÂ
block that serves as a summary of the rest of the block. Itâs made up of all theÂ
metadata â such as the time and
difficulty when the block was
mined, theÂ
Merkle root of the included transactions, and theÂ
nonce. Also present is the previous blockâsÂ
hash, which is what allows us to create the âchainâ of blocks. In essence, the block header contains any data that isnât the list of raw transactions itself.
A block header is what the miners hash to try and make the block valid. This is a lot more efficient than hashing the entirety of the block, which can be made up of thousands of transactions. It would be vastly more cumbersome for a miner to change the nonce and to rehash a whole 2MB block for every attempt. Compare this with hashingÂ
Bitcoinâs block headers, for instance, which have a fixed length of 80 bytes.Â
Block headers are great from a mining point of view, but because of their small size, theyâre also ideal forÂ
light clients. The BitcoinÂ
blockchain is too large for devices like smartphones to store. If the chain had 100,000 1MB blocks, youâd consume 100GB of space. But with just the block headers for those same blocks, youâd only take up 0.008GB, or 8MB.
In this way, devices with less bandwidth or storage space can still perform some degree of validation. Because the Merkle root encapsulates all of the transactions, they can later check whether a transaction was included in a particular block. This does come at a cost â the user must still rely on a third party to provide them with necessary information. With that said, light clients are preferable to a system where the users perform no verification at all.