mirror of
https://github.com/bitcoin/bips.git
synced 2025-05-12 12:03:29 +00:00
BIP341: Clarify tweaking of secret keys
This commit is contained in:
parent
d690408080
commit
6222dc45a3
@ -175,6 +175,8 @@ The parity bit will be required for spending the output with a script path.
|
|||||||
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.
|
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.
|
||||||
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>.
|
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>.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
<source lang="python">
|
<source lang="python">
|
||||||
def taproot_tweak_pubkey(pubkey, h):
|
def taproot_tweak_pubkey(pubkey, h):
|
||||||
t = int_from_bytes(tagged_hash("TapTweak", pubkey + h))
|
t = int_from_bytes(tagged_hash("TapTweak", pubkey + h))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user