TeachMeBitcoin

Compressed Public Keys (The Efficiency Upgrade)

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

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:

  1. Prefix (1 byte): Either 0x02 or 0x03.

  2. 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:

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

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.

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