Bitcoin Forum
May 25, 2024, 10:37:13 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: x , y coordination division  (Read 1062 times)
sss555 (OP)
Newbie
*
Offline Offline

Activity: 16
Merit: 1


View Profile
August 06, 2015, 03:15:40 AM
 #1

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)

output

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
andytoshi
Full Member
***
Offline Offline

Activity: 179
Merit: 151

-


View Profile
August 06, 2015, 03:55:06 PM
 #2

Hi sss555,

Sorry I missed your message about this the other day about this.

From reading your code I understand you have some point P, then 2*P = (xx, yy) while 4*P = (xx, yy). You then compute (a, b) = (xx/2, yy/2), and expect this to be equal to 2*P.

This won't be the case because "2*P" does not mean "the point whose coordinates are twice P's". It actually means P + P, where addition is defined according to the elliptic curve group law.

To contrast, when you multiply coordinates by numbers, you are simply multiplying them modulo p. This can still be described as repeated addition, but this addition is ordinary arithmetic addition modulo p, nothing exotic.

Does this clarify things?

Andrew
sss555 (OP)
Newbie
*
Offline Offline

Activity: 16
Merit: 1


View Profile
August 07, 2015, 02:23:47 AM
 #3

Hi sss555,

Sorry I missed your message about this the other day about this.

From reading your code I understand you have some point P, then 2*P = (xx, yy) while 4*P = (xx, yy). You then compute (a, b) = (xx/2, yy/2), and expect this to be equal to 2*P.

This won't be the case because "2*P" does not mean "the point whose coordinates are twice P's". It actually means P + P, where addition is defined according to the elliptic curve group law.

To contrast, when you multiply coordinates by numbers, you are simply multiplying them modulo p. This can still be described as repeated addition, but this addition is ordinary arithmetic addition modulo p, nothing exotic.

Does this clarify things?

Andrew



Thank you I understand
StephenMorse
Member
**
Offline Offline

Activity: 88
Merit: 12


View Profile
August 07, 2015, 02:25:32 PM
 #4

Looks like you posted the same question on the Bitcoin SE (http://bitcoin.stackexchange.com/questions/38978/x-y-coordination-division). Hope between Andytoshi's answer and mine, you got what you needed.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!