Skip to content

Commit 00902d1

Browse files
authored
Merge pull request bitcoin#1350 from jonasnick/bip-0341-signingfix
BIP 341: allow taproot_sign_key with no script tree
2 parents 79bb53d + 3d243d8 commit 00902d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bip-0341.mediawiki

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,10 @@ TapTweak = tagged_hash("TapTweak", p + ABCDE)
249249

250250
<source lang="python">
251251
def taproot_sign_key(script_tree, internal_seckey, hash_type, bip340_aux_rand):
252-
_, h = taproot_tree_helper(script_tree)
252+
if script_tree is None:
253+
h = bytes()
254+
else:
255+
_, h = taproot_tree_helper(script_tree)
253256
output_seckey = taproot_tweak_seckey(internal_seckey, h)
254257
sig = schnorr_sign(sighash(hash_type), output_seckey, bip340_aux_rand)
255258
if hash_type != 0:

0 commit comments

Comments
 (0)