The Block Hash Definition
The Block Hash Definition
The Block Hash is the unique fingerprint of a Bitcoin block. While it is the most important piece of data for the network's security, it is often misunderstood: The block hash is not actually stored inside the block header.
1. What is the Block Hash?
The block hash is the result of applying the Double-SHA256 algorithm to the 80-Byte Block Header. $$Block\ Hash = SHA256(SHA256(Header))$$
2. The Unique Identifier (ID)
In Bitcoin, the block hash serves as the Block ID.
-
It is used by nodes to reference blocks in the P2P protocol.
-
It is used as the
prev_hashfield in the next block's header. -
If even a single bit in the header changes (like the Nonce), the entire hash changes.
3. Why Not Store It?
Since the hash is a direct mathematical result of the 80 bytes in the header, storing it inside the header would be redundant. Every node in the world can calculate the hash in microseconds upon receiving the block. By not storing it, Bitcoin saves 32 bytes of space per block header.
4. The Proof of Work Condition
For a block to be valid, its hash must be numerically less than the current Target.
-
This is why block hashes start with many leading zeroes.
-
The more leading zeroes required, the harder it is to find a valid hash.
| Property | Value |
|---|---|
| Input | 80 Bytes (The Header) |
| Algorithm | Double-SHA256 |
| Output Size | 32 Bytes (256 bits) |
| Storage | Calculated on-the-fly, not in header. |
A "Block Hash" is essentially a very large number. When we say a block has "18 leading zeroes," we are saying the number is so small that its first 72 bits (18 hex chars) are all zero.
In the next section, we will look at the Byte-Level Calculation and the importance of Endianness.
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: