4
How to get X value from Y?
ECDSA x,y coordinate validity verification doesn't seem to work
X = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
Python code,
p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
x = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
ysquared = ((x*x*x+7) % p)
print "ysquared= %s " % hex(ysquared)
y = pow(ysquared, (p+1)/4, p)
print "y1 = %s " % hex(y)
print "y2 = %s " % hex(y * -1 % p)
Output
Y1 = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
Y2 = 0xb7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777
print hex((x**3 + 7 - y1**2) % p) // output 0
print hex((x**3 + 7 - y2**2) % p) // output 0
above python code to get Two possible y values from x
like the same how to get possible x values from y?,
Is it any formula or script available
My question is how to get x value from y
if y value
Y = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
above y value how to get x value
Well, you would have to solve the equation "y^2 = x^3 + ax + b", but keep in mind that this equation doesn't operate on normal numbers, it operates on integers modulo some large prime that is specified in the definition of secp256k1. I don't know how. – David Grayson – 2015-07-23T19:53:56.633