starknet-rs
starknet-rs copied to clipboard
Remove `infinity` flag from `ProjectivePoint`
In the affine representation of an elliptic curve, we have to include an additional boolean flag in order to denote the point at infinity.
That's why projective planes are particularly useful in the description of elliptic curves, including this point at infinity naturally in the set of points. A point in projective coordinates can then be defined by three coordinates (x,y,z).
- The projective coordinates of the form
(x,y,1)are descriptions of the affine points. - The projective coordinates of the form
(x,y,0)are descriptions of the point at infinity.
We have an example of this here: https://github.com/arkworks-rs/algebra/blob/cc2ad8c368c323ee9d9aacaabf8e353de95682e6/ec/src/models/short_weierstrass/group.rs#L149-L155
So I think we can remove the infinity flag on the projective representation and replace the identity point with a z = 0. This will make it possible to lighten the ProjectivePoint structure of a field which is not not necessary in my opinion in this context, because we can very well flag the point at infinity with z = 0.
@xJonathanLEI Any opinion on this?
As communicated separately, please feel free to go ahead and implement this if you have the time and interest :)
starknet-rs no longer controls this type. It now sources this type from starknet-types-core.