So, I got a public key (x, y) and its inverse (x, -y). How do we figure out which is positive and which is negative? Like, is there a simple way to tell?
How to Tell if a Public Key's Y Value is Positive or Negative?
12 replies 291 views
Here’s an example. For my private key 1 -> (x, y):
x = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798L
y = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8L
And for -y:
-y = 0xb7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777L
What can we do with this?
What about large numbers or private keys? Anyone got tips?
wizard_2016Full Member
Posts: 127 · Reputation: 575
#4Dec 31, 2021, 10:00 AM
To check even or odd, just look at the least significant bit. The LSB for Y and -Y are opposites. So it’s really about even/odd, not positive/negative, you know?
So, what you’re saying is there’s no positive or negative? All numbers are technically positive?
falcon2019Full Member
Posts: 90 · Reputation: 425
#6Jan 1, 2022, 04:50 PM
If you want a simple way to get the pubkey from the private key, divide the known pubkey. But first, check if it’s even or odd. Hope the thread creator is still around after all this time.
Yup, odd means y mod 2 == 1 and even means y mod 2 == 0. For negative, keep subtracting P until y < 0. Positive? Just add P until y > 0.
Wait, what’s the connection with scalar parity and y being odd/even? It seems like there’s no proof either way. Maybe a super-computer will figure it out someday.
I don’t get it... Like, if I subtract 21 10 = 11, how does -10 end up being -19? Is there a transition from positive to negative?
In secp256k1, 1/2 gives a huge number. Just checking if that method actually helps with odd/even pubkey definitions. Tried a bunch but patterns stay the same.
But think about this: 7/2 1/2 = 3, and when I subtract, 7 3 is odd. So, what gives?
Just remember, we’re working with the pubkey as our known variable. No decimals or private key involved.
I’m talking about this example:
1/2 = 57896044618658097711785492504343953926418782139537452191302581570759080747169
7/2 = 57896044618658097711785492504343953926418782139537452191302581570759080747172
Related topics
- Issues with ripemd160 on Ubuntu 22 9
- New Bitcoin Improvement Proposal with $100 Reward 9
- Clipboard Vulnerabilities in Cryptocurrency Transactions 8
- Understanding the Differences Between Traditional and Simplified Chinese Mnemonics 6
- Running Bitcoin Core on a Laptop with Limited Storage 20
- Exploring Blockstream's Satellite Tech and Its Potential 22