1
0
mirror of https://github.com/bitcoin/bips.git synced 2025-05-19 12:08:05 +00:00

Fxied typo in taproot_sign_script()

This commit is contained in:
LaurentMT 2019-11-11 01:20:28 +01:00 committed by GitHub
parent 3700e18055
commit ad4156a394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -254,7 +254,7 @@ This function returns the witness stack necessary and a <code>sighash</code> fun
def taproot_sign_script(internal_pubkey, script_tree, script_num, inputs): def taproot_sign_script(internal_pubkey, script_tree, script_num, inputs):
info, h = taproot_tree_helper(script_tree) info, h = taproot_tree_helper(script_tree)
(leaf_version, script), path = info[script_num] (leaf_version, script), path = info[script_num]
_, is_y_square = taproot_tweak_pubkey(internal_pubkey, t) _, is_y_square = taproot_tweak_pubkey(internal_pubkey, h)
output_pubkey_tag = 0 if is_y_square else 1 output_pubkey_tag = 0 if is_y_square else 1
pubkey_data = bytes([output_pubkey_tag + leaf_version]) + internal_pubkey pubkey_data = bytes([output_pubkey_tag + leaf_version]) + internal_pubkey
return inputs + [script, pubkey_data + path] return inputs + [script, pubkey_data + path]