diff --git a/bip-0352/reference.py b/bip-0352/reference.py index b4eaf94560..2f212f6de4 100755 --- a/bip-0352/reference.py +++ b/bip-0352/reference.py @@ -78,6 +78,11 @@ def get_pubkey_from_input(vin: VinInfo) -> ECPubKey: pubkey = ECPubKey().set(vin.prevout[2:]) if (pubkey.valid) & (pubkey.compressed): return pubkey + if is_p2a(vin.prevout): + anchor_script = vin.scriptSig[1:] + pubkey = ECPubKey().set(anchor_script) + if (pubkey.valid) & (pubkey.compressed): + return pubkey return ECPubKey()