diff options
author | Pieter Wuille <pieter@wuille.net> | 2021-02-08 00:15:51 -0800 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2021-06-12 12:25:28 -0700 |
commit | a91d532338ecb66ec5bed164929d878dd55d63a4 (patch) | |
tree | 6a4d736bcf31222e9fcb7d46545bc2d292b29d90 /src/key.h | |
parent | e77a2839b54fa2039bba468e8c09dbbbf19b150a (diff) | |
download | bitcoin-a91d532338ecb66ec5bed164929d878dd55d63a4.tar.xz |
Add CKey::SignSchnorr function for BIP 340/341 signing
Diffstat (limited to 'src/key.h')
-rw-r--r-- | src/key.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -128,6 +128,18 @@ public: */ bool SignCompact(const uint256& hash, std::vector<unsigned char>& vchSig) const; + /** + * Create a BIP-340 Schnorr signature, for the xonly-pubkey corresponding to *this, + * optionally tweaked by *merkle_root. Additional nonce entropy can be provided through + * aux. + * + * When merkle_root is not nullptr, this results in a signature with a modified key as + * specified in BIP341: + * - If merkle_root->IsNull(): key + H_TapTweak(pubkey)*G + * - Otherwise: key + H_TapTweak(pubkey || *merkle_root) + */ + bool SignSchnorr(const uint256& hash, Span<unsigned char> sig, const uint256* merkle_root = nullptr, const uint256* aux = nullptr) const; + //! Derive BIP32 child key. bool Derive(CKey& keyChild, ChainCode &ccChild, unsigned int nChild, const ChainCode& cc) const; |