[#CPubKey] = CPubKey :mrdocs: An encapsulated public key. == Synopsis Declared in `<pubkey.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class CPubKey; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:CPubKey/2constructor-00.adoc[`CPubKey`] [.small]#[constructor]# | Constructors | xref:CPubKey/Decompress.adoc[`Decompress`] | Turn this public key into an uncompressed public key. | xref:CPubKey/Derive.adoc[`Derive`] | Derive BIP32 child pubkey. | xref:CPubKey/GetHash.adoc[`GetHash`] | Get the 256‐bit hash of this public key. | xref:CPubKey/GetID.adoc[`GetID`] | Get the KeyID of this public key (hash of its serialization) | xref:CPubKey/IsCompressed.adoc[`IsCompressed`] | Check whether this is a compressed public key. | xref:CPubKey/IsFullyValid.adoc[`IsFullyValid`] | fully validate whether this is a valid public key (more expensive than IsValid()) | xref:CPubKey/IsValid.adoc[`IsValid`] | Check syntactic correctness. | xref:CPubKey/IsValidNonHybrid.adoc[`IsValidNonHybrid`] | Check if a public key is a syntactically valid compressed or uncompressed key. | xref:CPubKey/RecoverCompact.adoc[`RecoverCompact`] | Recover a public key from a compact signature. | xref:CPubKey/Serialize.adoc[`Serialize`] | Implement serialization, as if this was a byte vector. | xref:CPubKey/Set.adoc[`Set`] | Initialize a public key using begin/end iterators to byte data. | xref:CPubKey/Unserialize.adoc[`Unserialize`] | Deserialize the public key from a stream, as if it were a byte vector. | xref:CPubKey/Verify.adoc[`Verify`] | Verify a DER signature (~72 bytes). If this public key is not fully valid, the return value will be false. | xref:CPubKey/begin.adoc[`begin`] | Iterator to the first byte of the serialized public key. | xref:CPubKey/data.adoc[`data`] | Pointer to the first byte of the serialized public key. | xref:CPubKey/end.adoc[`end`] | Iterator past the last byte of the serialized public key. | xref:CPubKey/operator_subs.adoc[`operator[]`] | Access the byte at the given position. | xref:CPubKey/size-0a.adoc[`size`] | Number of bytes in the serialized public key. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:CPubKey/CheckLowS.adoc[`CheckLowS`] | Check whether a signature is normalized (lower‐S). | xref:CPubKey/ValidSize.adoc[`ValidSize`] | Check whether a byte vector has a valid public key length for its header byte. |=== == Static Data Members [cols="1,4"] |=== | Name| Description | xref:CPubKey/COMPACT_SIGNATURE_SIZE.adoc[`COMPACT_SIGNATURE_SIZE`] | Size in bytes of a compact (recoverable) ECDSA signature. | xref:CPubKey/COMPRESSED_SIZE.adoc[`COMPRESSED_SIZE`] | Size in bytes of a compressed public key. | xref:CPubKey/SIGNATURE_SIZE.adoc[`SIGNATURE_SIZE`] | Maximum size in bytes of a DER‐encoded ECDSA signature. | xref:CPubKey/SIZE-04.adoc[`SIZE`] | secp256k1: |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:operator_gt-0f.adoc[operator>]` | Order two public keys lexicographically by their serialized bytes. | `xref:operator_lt-05.adoc[operator<]` | Order two public keys lexicographically by their serialized bytes. | `xref:operator_eq-05d.adoc[operator==]` | Comparator implementation. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:CreateMuSig2SyntheticXpub.adoc[`CreateMuSig2SyntheticXpub`] | Construct the BIP 328 synthetic xpub for a pubkey | xref:GetScriptForRawPubKey.adoc[`GetScriptForRawPubKey`] | Generate a P2PK script for the given pubkey. | xref:HexToPubKey.adoc[`HexToPubKey`] | Parse a hex‐encoded public key, throwing an RPC error if it is invalid. | xref:MuSig2AggregatePubkeys-04.adoc[`MuSig2AggregatePubkeys`] | Compute the full aggregate pubkey from the given participant pubkeys in their current order. Outputs the secp256k1_musig_keyagg_cache and validates that the computed aggregate pubkey matches an expected aggregate pubkey. This is necessary for most MuSig2 operations. | xref:MuSig2AggregatePubkeys-09.adoc[`MuSig2AggregatePubkeys`] | Compute the full aggregate pubkey from the given participant pubkeys in their current order. | xref:MuSig2SessionID.adoc[`MuSig2SessionID`] | Computes an arbitrary unique session ID to identify ongoing signing sessions. It is the SHA256 of the signing (aggregate) pubkey, the participant pubkey, the sighash, and the pubnonce |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#