Currently the serialization of a point compressed it to a single x coordinate (so 32 bytes) and add an extra byte for flags where:
1 << 7 is set if the y coordinate is greater than -y (as bigints)
1 << 6 is set if the point is the point at infinity
For the pasta curves the canonical serialization is usually over 32 bytes and encoded as such:
1 << 7 is set in the last byte if the y coordinate is odd (LSB is 1)
all zero ([0u8; 32]) if it's the point at infinity
This would effectively save 1 byte for every point we serialize, but not only that, it would also be compatible with other implementations implementing this canonical serialization
Once https://github.com/o1-labs/proof-systems/issues/980 is in, we can override the serialization for the pasta curves.
Currently the serialization of a point compressed it to a single x coordinate (so 32 bytes) and add an extra byte for flags where:
1 << 7
is set if the y coordinate is greater than -y (as bigints)1 << 6
is set if the point is the point at infinityFor the pasta curves the canonical serialization is usually over 32 bytes and encoded as such:
1 << 7
is set in the last byte if the y coordinate is odd (LSB is 1)[0u8; 32]
) if it's the point at infinityThis would effectively save 1 byte for every point we serialize, but not only that, it would also be compatible with other implementations implementing this canonical serialization