Compressed Public Keys (The Efficiency Upgrade)
Compressed Public Keys (The Efficiency Upgrade)
Around 2012, Bitcoin developers realized they could cut the size of public keys in half without losing any security. This led to the Compressed Public Key format, which is the standard for almost all Bitcoin transactions today.
1. The 33-Byte Structure
A compressed public key consists of:
-
Prefix (1 byte): Either
0x02or0x03. -
X-Coordinate (32 bytes): The horizontal position.
Total Size: 33 Bytes.
2. The Mathematical Magic
The secp256k1 curve follows the equation: $$y^2 = x^3 + 7 \pmod p$$
Because this is a symmetric curve, for every valid X, there are only two possible values for Y:
-
A Positive (Even) value.
-
A Negative (Odd) value.
By knowing the X-coordinate and whether the Y-coordinate is Even or Odd, a computer can solve the equation to find the exact Y-coordinate.
3. The 50% Space Saving
-
Uncompressed: 65 bytes.
-
Compressed: 33 bytes. By dropping the Y-coordinate, we save 32 bytes per public key. In a multisig transaction (e.g., 3-of-5), this saves nearly 160 bytes, significantly reducing transaction fees.
4. Activation in Bitcoin
Most modern wallets (Electrum, BlueWallet, Hardware Wallets) use compressed keys by default. If you see a raw public key starting with 02 or 03, you are looking at a compressed key.
| Format | Prefix | Size | Benefit |
|---|---|---|---|
| Uncompressed | 04 |
65 Bytes | None (Legacy) |
| Compressed | 02 / 03 |
33 Bytes | 50% Fee Savings |
In the next section, we will explain the Even/Odd Y-Coordinate and how the prefix is chosen.
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: