TeachMeBitcoin

The Double-Hash Algorithm (HASH160)

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

The Double-Hash Algorithm (HASH160)

Bitcoin does not use a single hash for its addresses. Instead, it uses a specific sequence known as HASH160. This choice was a deliberate design decision by Satoshi Nakamoto to combine the strengths of two different cryptographic families.

1. The Sequence

The math behind a Public Key Hash is: $$PKH = RIPEMD160(SHA256(PublicKey))$$

2. Why two different algorithms?

Using two different hashing families (NSA-designed SHA and European-designed RIPEMD) provides a "Safety Net."

3. The 20-Byte Sweet Spot

Satoshi chose 20 bytes (160 bits) as the final length.

4. Implementation in Scripts

In raw Bitcoin Script, this is represented by the opcode OP_HASH160.

Algorithm Developer Output Size
SHA256 NSA (USA) 32 Bytes
RIPEMD160 KU Leuven (Belgium) 20 Bytes
Combined HASH160 20 Bytes

In the next section, we will look at the Space Efficiency of this hash.

☕ 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!