RIPEMD160: The Address Compactor
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.
-
Output: 40 hex characters (compared to 64 for SHA256).
-
Result: It produces a shorter "Fingerprint" that is still highly secure.
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:
-
Take the Public Key.
-
Hash it with SHA256.
-
Hash that result with RIPEMD160.
HASH160(K) = RIPEMD160(SHA256(K))
3. Why use two different algorithms?
This "Double Algorithm" strategy provides two key benefits:
-
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.
-
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."
-
If a Quantum Computer can derive a private key from a public key, it still can't derive the public key from the Hash.
-
This means your Bitcoin is safe from Quantum Computers as long as you have never "spent" from that address (revealing the public key).
| 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.
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: