Post
Topic
Board Development & Technical Discussion
Re: Pubkeys with even y coordinate correspond to privKeys that are less than n/2?
by
COBRAS
on 25/09/2022, 19:00:09 UTC
The question is somewhat complex and directed to clearing thing out.

Suppose that n is the order of the cyclic group, n - 1 is the number of all private keys possible

Code:
n = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141

We also know that every private and public key has its modular inverse. To get a modular inverse of a private key, we need to subtract the private key from n.

Code:
n - privKey

To get a modular inverse of a public key, we'll have to multiply its y coordinate by -1 and modulo by the p - order of the finite field.

Code:
x,y = x, -y % p

A modular inversed public key has the same x coordinate as original public key, but different y coordinate, and the y coordinate is always different in its polarity. If the original y was odd, in a modular inversed key it will be even, and vice versa.

If a compressed public key has "02" index at the biggining then it has even y. If it is "03" then it is odd.

The question is, if the ycoordinate of a public key is even, does it mean that the corresponding private key is less than n/2 by its value? If the y is odd, the private key is more than n/2?

Is there any relationship between the eveness/oddness of the y (or x) coordinate and the value of the corresponding private key?

Is there any way to know that the private key is more or less than n/2 while not knowing the private key itself?

Is there a way to find out the public key of an address that never sent Bitcoin but only received it?



const char *EC_constant_N = "b0d0ee25d5359133" ;/$
const char *EC_constant_P =  "b0d0ee25d5359133"; $

./calculatefromkey 8 privatekey: 0000000000000000000000000000000000000000000000000000000000000008
publickey compressed: 020000000000000000000000000000000000000000000000005845e9bd763c77d3
public address compressed 192GE4d69h7hTtppJB1UrNqTNNjykjVQUC
publickey uncompressed: 040000000000000000000000000000000000000000000000005845e9bd763c77d30000000000000 000000000000000000000000000000000004a91d9db8323b056
public address uncompressed 1FZ4ptaUs6WPHuPXyUJT5TpYtZCBzQJLfx