TeachMeBitcoin

Public Key Hash (PKH) Overview

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

Public Key Hash (PKH) Overview

A Public Key Hash (PKH) is a compact, 160-bit "Fingerprint" of your public key. In the Bitcoin hierarchy, it sits between your Public Key and your Base58 Address. It is the core data used in P2PKH (Pay-to-Public-Key-Hash) transactions.

1. The Compact Identifier

A raw public key is either 33 bytes or 65 bytes. By hashing it, we reduce it to exactly 20 bytes (160 bits).

2. The HASH160 Process

In Bitcoin technical documentation, this process is often called HASH160. It is a "Double Hash" consisting of:

  1. SHA256: For high-collision resistance.

  2. RIPEMD160: To shorten the result to 20 bytes.

3. The Obfuscation Layer

When you give someone your Bitcoin address, you are NOT giving them your public key. You are giving them a Hash of your public key.

4. The Standard for Legacy Addresses

Most addresses starting with the number 1 (Legacy) or the number 3 (P2SH) are built around a 20-byte HASH160 value. Even modern SegWit addresses use this hash, though they wrap it in a different format.

Attribute Public Key Public Key Hash
Size (Bytes) 33 or 65 20
Visibility Public (at spend) Public (always)
Security Elliptic Curve SHA256 + RIPEMD160
Role Signature Verification Address Derivation

In the next section, we will analyze the Double-Hash Algorithm in detail.

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