Space Efficiency vs. Security
Space Efficiency vs. Security
The choice to use a 160-bit hash instead of a 256-bit hash (or the raw public key) was a fundamental optimization for the Bitcoin network. It balanced the need for security with the physical reality of hard drive and RAM limits.
1. Blockchain Bloat
The Bitcoin blockchain is an "Append Only" ledger. Every byte added to it must be stored by thousands of nodes forever.
-
Raw Public Key: 33 bytes (Compressed).
-
Public Key Hash: 20 bytes.
-
Saving: 13 bytes per output.
While 13 bytes seems small, across hundreds of millions of transactions, this adds up to Gigabytes of saved space.
2. RAM Efficiency (The UTXO Set)
Full nodes keep the UTXO Set in high-speed RAM to validate transactions quickly.
-
Smaller identifiers (20 bytes) allow nodes to store more UTXOs in the same amount of RAM.
-
This keeps the requirements for running a node low, ensuring that anyone with a standard laptop can help secure the network.
3. The 160-bit Security Threshold
Is 160 bits "Safe enough"?
-
To find a specific 160-bit hash by guessing (a Pre-image attack), you would need to try 2^160 keys.
-
This is a number with 48 zeros. Even a billion supercomputers working for the age of the universe could not find a single match.
-
Therefore, 160 bits provides "Computational Security" that is indistinguishable from infinite security for the foreseeable future.
4. Collision vs. Pre-image
-
Pre-image (Targeting an Address): 160-bit security. (Impossible)
-
Collision (Finding any two matching keys): 80-bit security (due to the Birthday Paradox). While 80-bit security is lower, it doesn't matter for Bitcoin because a hacker cannot choose which address they collide with. They would just find two keys they already own that go to the same address, which doesn't help them steal money.
| Identifier | Size | Security Level | Purpose |
|---|---|---|---|
| X-Coordinate | 32 Bytes | 128 bits | Signature Math |
| SHA256 Hash | 32 Bytes | 256 bits | Intermediate Math |
| HASH160 | 20 Bytes | 160 bits | Network Efficiency |
In the next section, we will discuss Quantum 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: