Compute a KeyPair
Synopsis
Description
Wraps a secp256k1_keypair type.
merkle_root is used to optionally perform tweaking of the internal key, as specified in BIP341:
-
If merkle_root == nullptr: no tweaking is done, use the internal key directly (this is used for signatures in BIP342 script).
-
If merkle_root‐>IsNull(): tweak the internal key with H_TapTweak(pubkey) (this is used for key path spending when no scripts are present).
-
Otherwise: tweak the internal key with H_TapTweak(pubkey || *merkle_root) (this is used for key path spending with the Merkle root of the script tree).
Return Value
The computed key pair.
Parameters
Name |
Description |
merkle_root |
Optional Merkle root controlling BIP341 tweaking (see above). |
Created with MrDocs