Skip to content

Commit b1dbe62

Browse files
committed
BIP 341: fix tuple index
1 parent 40b10c8 commit b1dbe62

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
@@ -173,7 +173,7 @@ First, we define <code>taproot_tweak_pubkey</code> for 32-byte [[bip-0340.mediaw
173173
The function returns a bit indicating the tweaked public key's Y coordinate as well as the public key byte array.
174174
The parity bit will be required for spending the output with a script path.
175175
In order to allow spending with the key path, we define <code>taproot_tweak_seckey</code> to compute the secret key for a tweaked public key.
176-
For any byte string <code>h</code> it holds that <code>taproot_tweak_pubkey(pubkey_gen(seckey), h)[0] == pubkey_gen(taproot_tweak_seckey(seckey, h))</code>.
176+
For any byte string <code>h</code> it holds that <code>taproot_tweak_pubkey(pubkey_gen(seckey), h)[1] == pubkey_gen(taproot_tweak_seckey(seckey, h))</code>.
177177

178178
<source lang="python">
179179
def taproot_tweak_pubkey(pubkey, h):
@@ -219,7 +219,7 @@ def taproot_output_script(internal_pubkey, script_tree):
219219
h = bytes()
220220
else:
221221
_, h = taproot_tree_helper(script_tree)
222-
output_pubkey, _ = taproot_tweak_pubkey(internal_pubkey, h)
222+
_, output_pubkey = taproot_tweak_pubkey(internal_pubkey, h)
223223
return bytes([0x51, 0x20]) + output_pubkey
224224
</source>
225225

0 commit comments

Comments
 (0)