Skip to content

Commit

Permalink
Merge pull request bitcoin#41 from dgpv/patch-1
Browse files Browse the repository at this point in the history
taproot_output_script: first returned byte should be OP_1 (0x51)
  • Loading branch information
sipa authored May 9, 2019
2 parents 27e61d6 + 0c49346 commit b55fed9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bip-taproot.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def taproot_output_script(internal_pubkey, script_tree):
t = tagged_hash("TapTweak", internal_pubkey.get_bytes() + h)
assert int.from_bytes(t, 'big') < SECP256K1_ORDER
output_pubkey = internal_pubkey.tweak_add(t).get_bytes()
return bytes([0x01, 0x21, output_pubkey[0] & 1]) + output_pubkey[1:]
return bytes([0x51, 0x21, output_pubkey[0] & 1]) + output_pubkey[1:]
</source>
The function <code>taproot_output_script</code> returns a byte array with the scriptPubKey. It can be P2SH wrapped if desired (see BIP141).
Expand Down

0 comments on commit b55fed9

Please sign in to comment.