Skip to content

Commit 6222dc4

Browse files
committed
BIP341: Clarify tweaking of secret keys
1 parent d690408 commit 6222dc4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bip-0341.mediawiki

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ 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.
176176
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

178+
Note that because tweaks are applied to 32-byte public keys, `taproot_tweak_seckey` may need to negate the secret key before applying the tweak.
179+
178180
<source lang="python">
179181
def taproot_tweak_pubkey(pubkey, h):
180182
t = int_from_bytes(tagged_hash("TapTweak", pubkey + h))

0 commit comments

Comments
 (0)