TeachMeBitcoin

RIPEMD160: The Address Compactor

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

RIPEMD160: The Address Compactor

While SHA256 provides massive security, its 32-byte (256-bit) length makes for very long addresses. To keep Bitcoin addresses manageable and to add another layer of security, Satoshi chose RIPEMD160 for the address generation process.

1. What is RIPEMD160?

RIPEMD160 stands for RACE Integrity Primitives Evaluation Message Digest. It is a 160-bit (20-byte) cryptographic hash function.

2. HASH160: The Hybrid Process

In Bitcoin, when we refer to a "Public Key Hash," we are actually talking about a two-step process called HASH160:

  1. Take the Public Key.

  2. Hash it with SHA256.

  3. Hash that result with RIPEMD160.

HASH160(K) = RIPEMD160(SHA256(K))

3. Why use two different algorithms?

This "Double Algorithm" strategy provides two key benefits:

  1. Defense in Depth: If a flaw is ever found in SHA256, the attacker still has to break RIPEMD160 (and vice-versa). The probability of both algorithms being broken simultaneously is extremely low.

  2. Shorter Addresses: 20 bytes is the perfect size for a Bitcoin address. It is large enough to prevent collisions but small enough to fit into QR codes and human-readable strings like Base58.

4. Quantum Resistance (Theoretical)

Some cryptographers argue that HASH160 provides a form of "Passive Quantum Resistance."

Algorithm Bit Length Primary Use
SHA256 256 Mining, Block Linking
RIPEMD160 160 Addresses (HASH160)

In the next section, we will discuss the Avalanche Effect & Pre-image Resistance.

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