SEC Format


The Standards for Efficient Cryptography (SEC) is the standard method for encoding a Bitcoin public key. A Bitcoin public key is a point on the elliptic curve, called secp256k1, and thus has an x and y coordinate.

However, each x value only has two possible y values, and due to the nature of secp256k1, one of these y values is odd and the other is even for every x value. Thus, the x value and the parity of the y value are sufficient to identify the public key. The parity of the y value is displayed by either a 0x02 or an 0x03 byte, indicating even or odd respectively. This is followed by the x value, which is a 32 byte number.

This format is called compressed, because it only takes up 33 bytes, compared with the uncompressed SEC format, which begins with an 0x04 prefix followed by the full x and y values and takes up 65 bytes.

Learn more about Bitcoin public keys.