Skip to content

Commit

Permalink
Merge pull request bitcoin#1350 from jonasnick/bip-0341-signingfix
Browse files Browse the repository at this point in the history
BIP 341: allow taproot_sign_key with no script tree
  • Loading branch information
kallewoof authored Jan 4, 2023
2 parents 79bb53d + 3d243d8 commit 00902d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bip-0341.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,10 @@ TapTweak = tagged_hash("TapTweak", p + ABCDE)

<source lang="python">
def taproot_sign_key(script_tree, internal_seckey, hash_type, bip340_aux_rand):
_, h = taproot_tree_helper(script_tree)
if script_tree is None:
h = bytes()
else:
_, h = taproot_tree_helper(script_tree)
output_seckey = taproot_tweak_seckey(internal_seckey, h)
sig = schnorr_sign(sighash(hash_type), output_seckey, bip340_aux_rand)
if hash_type != 0:
Expand Down

0 comments on commit 00902d1

Please sign in to comment.