summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkallewoof <karljohan-alm@garage.co.jp>2023-01-04 10:55:06 +0900
committerGitHub <noreply@github.com>2023-01-04 10:55:06 +0900
commit79bb53dde55e94ebf51ada4adee38fb40f127ae6 (patch)
treec56755b0f3ecbcd5e7fdfefe578458856d9b5087
parentc6725580c53f6478239751fefbb199d3c08ed1c9 (diff)
parente24f6859710a8047931eb68788dce0d0400a1569 (diff)
downloadbips-79bb53dde55e94ebf51ada4adee38fb40f127ae6.tar.xz
Merge pull request #1379 from DariusParvin/bip341-aux_rand
BIP341: add aux_rand argument to taproot_sign_key
-rw-r--r--bip-0341.mediawiki4
1 files changed, 2 insertions, 2 deletions
diff --git a/bip-0341.mediawiki b/bip-0341.mediawiki
index 17a1797..9bc8723 100644
--- a/bip-0341.mediawiki
+++ b/bip-0341.mediawiki
@@ -248,10 +248,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 <code>internal_pubkey</code>. 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 <code>h</code> as in the above snippet. See the code below:
<source lang="python">
-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]