starknet-rs icon indicating copy to clipboard operation
starknet-rs copied to clipboard

Remove `infinity` flag from `ProjectivePoint`

Open tcoratger opened this issue 1 year ago • 2 comments

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.

tcoratger avatar Feb 15 '24 13:02 tcoratger

@xJonathanLEI Any opinion on this?

tcoratger avatar Feb 21 '24 14:02 tcoratger

As communicated separately, please feel free to go ahead and implement this if you have the time and interest :)

xJonathanLEI avatar Feb 24 '24 16:02 xJonathanLEI

starknet-rs no longer controls this type. It now sources this type from starknet-types-core.

xJonathanLEI avatar Jul 29 '24 14:07 xJonathanLEI