From e24f6859710a8047931eb68788dce0d0400a1569 Mon Sep 17 00:00:00 2001 From: Darius Parvin Date: Sun, 9 Oct 2022 14:36:32 -0700 Subject: BIP341: add bip340_aux_rand argument to taproot_sign_key --- bip-0341.mediawiki | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bip-0341.mediawiki') diff --git a/bip-0341.mediawiki b/bip-0341.mediawiki index 504514e..9ccf1be 100644 --- a/bip-0341.mediawiki +++ b/bip-0341.mediawiki @@ -245,10 +245,10 @@ TapTweak = tagged_hash("TapTweak", p + ABCDE) '''Spending using the key path''' A Taproot output can be spent with the secret key corresponding to the internal_pubkey. To do so, a witness stack consists of a single element: a [[bip-0340.mediawiki|BIP340]] signature on the signature hash as defined above, with the secret key tweaked by the same h as in the above snippet. See the code below: -def taproot_sign_key(script_tree, internal_seckey, hash_type): +def taproot_sign_key(script_tree, internal_seckey, hash_type, bip340_aux_rand): _, h = taproot_tree_helper(script_tree) output_seckey = taproot_tweak_seckey(internal_seckey, h) - sig = schnorr_sign(sighash(hash_type), output_seckey) + sig = schnorr_sign(sighash(hash_type), output_seckey, bip340_aux_rand) if hash_type != 0: sig += bytes([hash_type]) return [sig] -- cgit v1.2.3