Skip to content

Commit 79bb53d

Browse files
authored
Merge pull request bitcoin#1379 from DariusParvin/bip341-aux_rand
BIP341: add aux_rand argument to taproot_sign_key
2 parents c672558 + e24f685 commit 79bb53d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bip-0341.mediawiki

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,10 @@ TapTweak = tagged_hash("TapTweak", p + ABCDE)
248248
'''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:
249249

250250
<source lang="python">
251-
def taproot_sign_key(script_tree, internal_seckey, hash_type):
251+
def taproot_sign_key(script_tree, internal_seckey, hash_type, bip340_aux_rand):
252252
_, h = taproot_tree_helper(script_tree)
253253
output_seckey = taproot_tweak_seckey(internal_seckey, h)
254-
sig = schnorr_sign(sighash(hash_type), output_seckey)
254+
sig = schnorr_sign(sighash(hash_type), output_seckey, bip340_aux_rand)
255255
if hash_type != 0:
256256
sig += bytes([hash_type])
257257
return [sig]

0 commit comments

Comments
 (0)