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.