The goal is to "half" the point. You want to find the point Q where 2Q = P, your original point.
So you compute 2^-1 (mod n) where n is the order of the group (see the secp256k1 parameters:
https://en.bitcoin.it/wiki/Secp256k1)
2^1 is the multiplicative inverse of 2 (mod n). 2 x 2^1 = 1 (mod n). When you do the scalar multiplication it cancels out a factor of 2.
2Q = P
(2^-1)2Q = (2^-1)P
Q = (2^-1)P
Hope that makes sense.
here the another answer
https://crypto.stackexchange.com/questions/59972/half-of-any-bitcoin-crypto-public-key-public-key-half-is-possible
ECC is cryptography over an elliptic curve group.
Firstly you have an elliptic curve, e.g. Bitcoin uses a Koblitz curve secp256k1 y2=x3+7.
The group is defined over curve points over a finite field Fp (integer modular p). The group elements are points on the curve. A point in the affine form consists of two coordinates P=(x,y) where x,y∈Fp.
For group elements, you can do point addition P+Q, as well as scalar multiplication sP, where s is an integer in Zn where n is the order of the group (how many elements in the group).
A public key in bitcoin is a point P. To do P2, you multiply 12 to P where 12 is the multiplicative inverse of 2 in Zn. It is an integer that can be found using the extended Euclidean algorithm and is 57896044618658097711785492504343953926418782139537452191302581570759080747169 in the case of secp256k1.
but in crypt o ,
private key 3
x = f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9
y = 388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672
half of the above public key is 1 given below
x = 79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
y = 483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
but the output is
x = c62c910e502cb615a27c58512b6cc2c94f5742f76cb3d12ec993400a3695d413
y = 17f3dadd767275ddd3b23f46723631778bf01dadaebb9a953cf068712457c010
what wrong in this how to correct this
3/2 = 1
"the output is
x = c62c910e502cb615a27c58512b6cc2c94f5742f76cb3d12ec993400a3695d413
y = 17f3dadd767275ddd3b23f46723631778bf01dadaebb9a953cf068712457c010 "
to get scalar_pkey the xy above:
modinv2 = modinv(2, N)
= 57896044618658097711785492504343953926418782139537452191302581570759080747169 == ((N-1)/2)+1) or invers ((N-1)/2)
pkey xy = private key 3 * modinv2 % N
= 3 * 57896044618658097711785492504343953926418782139537452191302581570759080747169 % N
= 173688133855974293135356477513031861779256346418612356573907744712277242241507 % N
= 57896044618658097711785492504343953926418782139537452191302581570759080747170
**applies to all odd privatekey values
The private key : 0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a2L
Dec private key : 57896044618658097711785492504343953926418782139537452191302581570759080747170
Biner private key : 1111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111110101110101010111011011100111001
1010101111010010001010000000111011101111111101001001011110100011001101000000110
110010000010100010
the uncompressed DEC public key (not address):
(89636686429439908262420422079980100111093242688153882571369946125714247242771L, 10834049905482024808827094233028503931704324296739647619935835709590451240976L)
the uncompressed HEX public key (not address):
(0xc62c910e502cb615a27c58512b6cc2c94f5742f76cb3d12ec993400a3695d413L, 0x17f3dadd767275ddd3b23f46723631778bf01dadaebb9a953cf068712457c010L)
the uncompressed public key (HEX):
04c62c910e502cb615a27c58512b6cc2c94f5742f76cb3d12ec993400a3695d41317f3dadd76727
5ddd3b23f46723631778bf01dadaebb9a953cf068712457c010
the official Public Key - compressed:
02c62c910e502cb615a27c58512b6cc2c94f5742f76cb3d12ec993400a3695d413
Notice :
there is a doubling of scalar numbers either even or odd,
exm1 :
11 ECdouble => 22 ECdiv => 11
13 ECdouble => 26 ECdiv => 13
20 ECdouble => 40 ECdiv => 20 ECdiv => 10 ECdiv => 5
21 ECdouble => 42 ECdiv => 21
but actually there is no division of the odd scalar pkey divided by 2, there is only a 1xGpoint subtraction, then the result can be divided by 2
Exm: binary 1001
sequentially 1 2 4 9
the value of 9 is actually 8+1
for the last binary division result (right) or to get the decimal value 4 of 9, you can't divide 9 by 2,
but first subtract 9 by 1 and then divide by 2 (8 / 2 = 4)
if forced 9/2 and using the above operation, the calculation result will go to
57896044618658097711785492504343953926418782139537452191302581570759080747173 (HEX:0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a5)
the uncompressed public key (not address):
(46399714550823657646711952010527975805134803763457644396793103212103067379801L, 109666243570543015459678453826250465783941922322291717279653226122816671713075L)
the official Public Key - compressed:
0366954eca0543426304036fc70fc0fe3381f5195e88433bc32c5a8a60341e2859
Exm2: binary 10010
sequentially 1 2 4 9 18
18 /2 = 9
(9-1)/2 = 4
4/2 = 2
2/2 = 1