Skip to main content
Became Hot Network Question
edited tags
Link
Murch
  • 77.9k
  • 35
  • 190
  • 641
Source Link
Keijyu
  • 125
  • 6

How to tweak a public key for Taproot

From what I know, to tweak a public key, I can use:

Q = P + H(P|c)G

where

Q is the tweaked public key
P is the initial public key (P = xG where x is the private key)
H is the hash function
| is concatenation
c is the commitment to the script path spend
G is the generator point

This might seem like high school math but can I calculate the H(P|c)G part by using the result of H(P|c) as a private key and computing the public key from it? I think this might work because the H() returns a 32 byte array and the result could be casted as a private key then multiplied by generator point G to get the corresponding public key which is equal to H(P|c)G?