1

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?

1 Answer 1

2

According to https://www.secg.org/sec1-v2.pdf, points are encoded in compressed format as:

  • 0x02 + X coordinate: implicit Y coordinate is even
  • 0x03 + X coordinate: implicit Y coordinate is odd

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.