Is it possible to get the x, y of the compressed public key?
I have decompress it and naturally it gives the xy of the decompress public key.
I need the xy coordinates of my compressed public key . How do I get it? Is there a python script I can get my hands on?
Update: I have tried it via
#! /usr/bin/env python3
import binascii
p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F
def decompress_pubkey(pk):
x = int.from_bytes(pk[1:33], byteorder='big')
y_sq = (pow(x, 3, p) + 7) % p
y = pow(y_sq, (p + 1) // 4, p)
if y % 2 != pk[0] % 2:
y = p - y
y = y.to_bytes(32, byteorder='big')
return b'\x04' + pk[1:33] + y
print(binascii.hexlify(decompress_pubkey(binascii.unhexlify('0245a6b3f8eeab8e88501a9a25391…