Browser Labs

Bitcoin HASH160 Pipeline

Trace SHA-256 followed by RIPEMD-160 for Bitcoin public-key address derivation.

Bitcoin Protocol Standard Client-Side Web Crypto

Bitcoin HASH160 & RIPEMD-160 Pipeline

Explore the exact dual-stage cryptographic hashing pipeline utilized in Bitcoin's proof-of-work consensus: RIPEMD160(SHA256(data)).

Preset Test Vectors
Input Type: Hex Bytes Length: 66 chars (33 bytes)
1 Stage 1: SHA-256 Digest
256 bits (32 bytes)
0b7c28c9b7290c98d7438e70b3d3f7c848fbd7d1dc194ff83f4f7cc9b1378e98
Collision Resistance: ~2¹²⁸ operations
↓ feeds into RIPEMD-160
2 Stage 2: Bitcoin HASH160 (RIPEMD-160)
160 bits (20 bytes, 37.5% compact)
f54a5851e9372b87810a8e60cdd2e7cfd80b6e31
Cryptographic Hash Payload for P2PKH scriptPubKey
↓ 0x00 Version Prefix + 4-byte Double SHA-256 Checksum + Base58
3 Standard P2PKH Bitcoin Address
Base58Check Encoded
1PMycacnJaSqwwJqjawXBErnLsZ7RkXUAs
Valid Bitcoin Mainnet Address starting with "1"
Why Did Satoshi Nakamoto Combine SHA-256 and RIPEMD-160?

1. Defense-in-Depth Cryptanalysis: SHA-256 was designed by the NSA, while RIPEMD-160 was engineered by the COSIC research group in the European Union (KU Leuven). An unexpected mathematical vulnerability in one algorithm would require an adversary to simultaneously break both distinct cryptographic primitives.

2. On-Chain Block Space Efficiency: Compressing the 256-bit SHA-256 output down to 160 bits saves 12 bytes per transaction output in the Bitcoin UTXO set. Across hundreds of millions of blockchain transactions, this conservation preserves decentralized node validation on commodity consumer hardware.

3. Length Extension Protection: Merkle–Damgård hash functions (like SHA-256) can be susceptible to length extension attacks if misused. Wrapping the SHA-256 digest inside RIPEMD-160 completely neutralizes this attack vector.

01
Why This Matters & 30-Second Experiment
Tap to expand plain-English guide & CLI command
Why This Matters

Bitcoin shortens 33-byte or 65-byte ECDSA public keys into compact 20-byte (160-bit) payloads using HASH160: first SHA-256, then RIPEMD-160, before Base58Check or Bech32 encoding.

Try This 30-Second Experiment
  1. Enter or prefill a compressed public key above to trace Stage 1 (SHA-256) into Stage 2 (RIPEMD-160).
  2. Change 1 hex character in the public key and watch both intermediate and final 160-bit digests change completely.
  3. Read the companion guide to see how the version byte and 4-byte checksum produce a mainnet address.
Compute HASH160 (RIPEMD-160 of SHA-256) in Node.js
node -e "const c=require('crypto'); const s=c.createHash('sha256').update('pubkey').digest(); console.log(c.createHash('ripemd160').update(s).digest('hex'))"
02
Visual Diagram, Guide & History
Tap to expand visual architecture & references
How It Works Visually
Any Input1 byte or 10 GBSHA-25664 roundsone-way256-bit64 hex chars