summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkallewoof <karljohan-alm@garage.co.jp>2023-01-04 10:33:15 +0900
committerGitHub <noreply@github.com>2023-01-04 10:33:15 +0900
commitc6725580c53f6478239751fefbb199d3c08ed1c9 (patch)
tree6508a9511354022336aba43ad51c4d04d50ec4d2
parent15c8203eb36304efa1e4588b950f62a5bb32f965 (diff)
parentbe340277fcaa57a813a898700c1aef9637cfa90e (diff)
downloadbips-c6725580c53f6478239751fefbb199d3c08ed1c9.tar.xz
Merge pull request #1386 from jonasnick/fix-taproot-tweak-pubkey
BIP 341: Fix taproot_tweak_pubkey
-rw-r--r--bip-0341.mediawiki5
1 files changed, 4 insertions, 1 deletions
diff --git a/bip-0341.mediawiki b/bip-0341.mediawiki
index 504514e..17a1797 100644
--- a/bip-0341.mediawiki
+++ b/bip-0341.mediawiki
@@ -182,7 +182,10 @@ def taproot_tweak_pubkey(pubkey, h):
t = int_from_bytes(tagged_hash("TapTweak", pubkey + h))
if t >= SECP256K1_ORDER:
raise ValueError
- Q = point_add(lift_x(int(pubkey)), point_mul(G, t))
+ P = lift_x(int_from_bytes(pubkey))
+ if P is None:
+ raise ValueError
+ Q = point_add(P, point_mul(G, t))
return 0 if has_even_y(Q) else 1, bytes_from_int(x(Q))
def taproot_tweak_seckey(seckey0, h):