Post
Topic
Board Development & Technical Discussion
Re: Half of any bitcoin (crypto) public key - (public key half)
by
j2002ba2
on 17/09/2020, 20:01:51 UTC
In secp256k1 there are two important primes - the prime p which is used for coordinates x and y (2^256 - 2^32 - 977), and the prime n, which is the group order (2^256 - 432420386565659656852420866394968145599).

The group is defined by two operations - addition of two points, and doubling a point.

From this we easily could multiply a point by scalar, this is series of additions and doublings.

Multiplying a point by scalar gives another point. Multiplying a point by n gives the point at infinity (0,0).

Dividing by 2 in a group with order n is equivalent to multiplying by the scalar 1/2 (mod n).

One can find the inverse of 2 modulo n by the Extended Euclidean Algorithm.
1/2 (mod n) = 57896044618658097711785492504343953926418782139537452191302581570759080747169

You'd have to multiply (x,y) by 1/2 (mod n), this gives
x = 21505829891763648114329055987619236494102133314575206970830385799158076338148
y = 98003708678762621233683240503080860129026887322874138805529884920309963580118


How Huh I just reread your post and I understand that you manage to do it ?
So my question is simple, how multiply a point (x,y) by 1/2 (mod n) ? I can't get a working méthod with python Huh

Assume i have this public key (x = 72488970228380509287422715226575535698893157273063074627791787432852706183111 , y = 2898698443831883535403436258712770888294397026493185421712108624767191)
what is the math méthod to multiply (x,y) by 1/2 (mod n) --> it is also assumed that I do not know the private key
How get (x = 21505829891763648114329055987619236494102133314575206970830385799158076338148 , y = 98003708678762621233683240503080860129026887322874138805529884920309963580118) Huh

 Roll Eyes

Multiply by 57896044618658097711785492504343953926418782139537452191302581570759080747169


Let the point you want to multiply is G, and the multiplication constant is c. The result will be P=c*G

One way to do it is:

1. Start with the point at infinity P = (0,0) = 0*G, Q = G = 1*G, d = c

2. if d is zero return P

3. If d is odd let P = P + Q

4. Double Q: Q = 2*Q, halve d rounding towards zero: d = floor(d/2)

5. Go to step 2