KeyPair

Synopsis

Declared in <key.h>

class KeyPair;

Description

Wraps a secp256k1_keypair type, an opaque data structure for holding a secret and public key. This is intended for BIP340 keys and allows us to easily determine if the secret key needs to be negated by checking the parity of the public key. This class primarily intended for passing secret keys to libsecp256k1 functions expecting a secp256k1_keypair. For all other cases, CKey should be preferred.

A KeyPair can be created from a CKey with an optional merkle_root tweak (per BIP342). See CKey::ComputeKeyPair for more details.

Member Functions

Name

Description

KeyPair [constructor]

Constructors

operator=

Assignment operators

IsValid

Check whether this keypair is valid.

SignSchnorr

Create a BIP‐340 Schnorr signature using this key pair.

Friends

Name

Description

CKey::ComputeKeyPair

Compute a KeyPair

Created with MrDocs