TeachMeBitcoin

The Hash Chain Connection

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

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_hash as 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.

☕ Help support TeachMeBitcoin

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:

Ethereum: 0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin: bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana: 4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J
Address copied to clipboard!