The Hash Chain Connection
The Hash Chain Connection
The Previous Block Hash (prev_hash) is the second field in the 80-Byte Block Header. It is 32 bytes of cryptographic data that creates the "Chain" in Blockchain by linking each block to its immediate parent.
1. The Parent-Child Relationship
Every block in Bitcoin (except the Genesis Block) must contain the exact hash of the block that came before it.
* Block N: Contains Hash(Header N-1).
* Block N+1: Contains Hash(Header N).
This creates a rigid chronological order. A block cannot exist unless its parent has already been found and hashed.
2. Little-Endian Storage
Like most fields in the block header, the prev_hash is stored in Little-Endian byte order.
* If you look at a block explorer, the hash starts with many zeroes (e.g., 0000000000...).
* On disk (raw bytes), those zeroes are at the end of the 32-byte field.
3. Cryptographic Binding
By including the parent's hash inside the child's header, the child block effectively "signs off" on the entire history of the blockchain up to that point. Because the child's hash is itself dependent on its own header (which includes the parent's hash), any change to the parent would change the child's hash, and so on.
4. Why 32 Bytes?
Bitcoin uses SHA-256, which produces a 256-bit (32-byte) output. This size provides a massive "collision resistance" space ($2^{256}$), making it computationally impossible for two different blocks to ever have the same hash.
| Field | Size | Role |
|---|---|---|
prev_hash |
32 Bytes | The pointer to the previous block. |
hash_algorithm |
Double-SHA256 | The cryptographic function used to create the pointer. |
[!TIP] Think of the
prev_hashas a "digital fingerprint" of the past. If the fingerprint changes even slightly, the link is broken, and the network will reject the chain.In the next section, we will look at the Double-SHA256 algorithm and why Bitcoin uses it for these links.
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: