Public Key Hash (PKH) Overview
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).
-
Shorter Addresses: 20 bytes is much easier to convert into a short, human-readable address.
-
Uniformity: Whether you use a compressed or uncompressed key, the resulting hash is always the same size.
2. The HASH160 Process
In Bitcoin technical documentation, this process is often called HASH160. It is a "Double Hash" consisting of:
-
SHA256: For high-collision resistance.
-
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.
-
The network only learns your actual public key when you Spend your Bitcoin.
-
This provides a layer of privacy and security, as your public key is hidden behind a cryptographic wall until the moment it is needed.
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.
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: