mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Improve comments in taproot signing logic
This commit is contained in:
13
src/key.h
13
src/key.h
@@ -133,10 +133,15 @@ public:
|
||||
* 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)
|
||||
* merkle_root is used to optionally perform tweaking of the private key, as specified
|
||||
* in BIP341:
|
||||
* - If merkle_root == nullptr: no tweaking is done, sign with key directly (this is
|
||||
* used for signatures in BIP342 script).
|
||||
* - If merkle_root->IsNull(): sign with key + H_TapTweak(pubkey) (this is used for
|
||||
* key path spending when no scripts are present).
|
||||
* - Otherwise: sign with key + H_TapTweak(pubkey || *merkle_root)
|
||||
* (this is used for key path spending, with specific
|
||||
* Merkle root of the script tree).
|
||||
*/
|
||||
bool SignSchnorr(const uint256& hash, Span<unsigned char> sig, const uint256* merkle_root = nullptr, const uint256* aux = nullptr) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user