In different places I've read that the 2 or 3 is the sign or is the parity of the elided Y coordinate?
Which of these is it, or are the sign and parity equivalent in some way?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.Sign up to join this community
According to https://www.secg.org/sec1-v2.pdf, points are encoded in compressed format as:
You can call this parity or sign - it doesn't matter; they're the same thing in a finite field (and arguably, both are inaccurate). As the coordinates are numbers modulo an odd prime p (the field size; p = 2256 - 232 - 977 for the secp256k1 curve used in Bitcoin), -x and p-x are the same coordinate. One of these will always be odd, and the other will be even. One of them will be negative and the other will be positive.
The convention is that "even" refers to the coordinate which manifests as an even number when seen as an integer in the range [0..p-1], and "odd" the opposite. This is an arbitrary choice, as another range could be chosen (such as [-(p-1)/2..(p-1)/2]) in which different coordinates would be seen as even or odd.
Yet, it helps distinguish. If (x,y) satisfies y2 = x3 + 7 mod p, so does (x,y) = (x,p-y). To identify the solution, the criterion of "even/odd when restricted to [0..x-1]" is used in practice.