Skip to content

Commit 4e44559

Browse files
committed
BIP341: Clarify tweaking of secret keys
1 parent 7d8f372 commit 4e44559

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
@@ -181,6 +181,8 @@ The parity bit will be required for spending the output with a script path.
181181
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.
182182
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>.
183183

184+
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.
185+
184186
<source lang="python">
185187
def taproot_tweak_pubkey(pubkey, h):
186188
t = int_from_bytes(tagged_hash("TapTweak", pubkey + h))

0 commit comments

Comments
 (0)