Enumeration
P256K.Format
Compressed (33-byte) and uncompressed (65-byte) serialization formats for secp256k1 public keys, passed as flags to secp256k1_ec_pubkey_serialize.
- iOS 13.0+
- macCatalyst 13.0+
- macOS 10.15+
- tvOS 13.0+
- visionOS 1.0+
- watchOS 6.0+
enum Format
Mentioned In
Overview
Use P256K.Format.compressed for standard secp256k1 key storage and transmission in Bitcoin and Nostr contexts — this has been the default since Bitcoin Core 0.6 (2012) and saves 32 bytes per key on the wire. Use P256K.Format.uncompressed when interoperating with systems that require the full (x, y) curve point, including legacy Bitcoin addresses, some OpenSSL wire formats, and non-Bitcoin ECDSA consumers that have not adopted the point-compression optimization.
Schnorr / BIP-340 / Taproot workflows use a third representation (x-only, 32 bytes) which is modeled separately via P256K.Schnorr.XonlyKey and is not a Format case.
Topics
Cases
Serialization Details
Initializers