python code

def inverse(x, p):

    return pow(x,p-2,p)

p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f

#private key 2 -->(x , y) value

xx =  0xc6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5L
yy =  0x1ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52aL

#private key 4 -->(x , y) value

x  =  0xe493dbf1c10d80f3581e4904930b1404cc6c13900ee0758474fa94abe8c4cd13L
y  =  0x51ed993ea0d455b75642e2098ea51448d967ae33bfbdfe40cfe97bdc47739922L

a= (x*inverse(xx,p))%p

print "x = " + hex(a)

b= (y*inverse(yy,p))%p

print "y = " + hex(b)


x = 0x1d8a71dd4218a520a1f976b6a4f66ed600880baf69d401a73dd010dd60f859ffL
y = 0x8f73b0d00f8d9e262cc230b7a6bee35d44ac898986195e819d68ecafd6b7803bL

normal math 4/2 = 2

but here private key 2 x,y value divided by private key 4 x,y value, not provide correct value of x,y

bitcoin , math learning


There is no such thing as multiplication (or division) of two points in the world of ECC math. This is because the points on an Elliptic Curve form a mathematical Group, rather than a Ring.

As such, you shouldn't expect the coordinates of 4*G and 2*G to be related by the method you described. The result of 2*G is not the same as multiplying each of G's coordinates by 2. You can verify, however, that

4*G - 2*G = 2*G

The subtraction here is actually shorthand for a complex, but formulaic, procedure for two ECC points. Note that subtraction is simply addition of the additive inverse in the ECC group. This is very different than the multiplicative inverse in the modular field that your Python method defined.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.