Coordinate Forms
Affine (x,y)
Affine form refers to the regular (x,y) form of coordinates on an xy-plane.
Problem
For elliptic curves, point addition is done very often as it is considered cheap. To calculate point addition in affine form, we must compute the slope m=xQ−xPyQ−yP. However, calculating field inverses or the (xQ−xP)−1 in this case is expensive, so we want to prevent the calculation of inverses as much as possible.
Solution
When calculating a series of point operations, we convert points to a different intermediate form that does not require field inverses for point operations and for the final result, we revert back to affine. Calculating through these intermediate forms does not cost any inverse operations; however, converting the forms back to affine will cost one inverse operation.
The reasoning for why our intermediate forms do not calculate inverses is quite simple: when calculating an operation, the resulting formulas of the final x and y are manipulated to use the same denominator (projective) or related denominators (Jacobian & XYZZ). This denominator will then be calculated and stored as a continuous separate value Z.
We will provide an explanation of projective coordinates to ease our way into understanding Jacobian coordinates, yet in reality for our elliptic curves, we use Jacobian coordinates as it yields much simpler results to work with.
Projective (ZX,ZY):(X,Y,Z)
In projective form, affine points of (x,y) are redefined as (ZX,ZY). In practice, projective form is stored as (X,Y,Z). With this conversion, the elliptic curve equation is changed to:
Affine ⟹ Projective
Projective ⟹ Affine
Calculating Operations
Refer to Hyperelliptic for Projective points on the best practices on how to calculate addition and double operations on projective coordinates.
Jacobian (Z2X,Z3Y):(X,Y,Z)
In Jacobian form, affine points of (x,y) are redefined as (Z2X,Z3Y). In practice, Jacobian form is stored as (X,Y,Z). With this conversion, the elliptic curve equation is changed to:
Affine ⟹ Jacobian
Jacobian ⟹ Affine
Calculating Operations
Refer to Hyperelliptic for Jacobian points on the best practices on how to calculate addition and double operations on Jacobian coordinates.
XYZZ - Extended Jacobian(Z2X,Z3Y):(X,Y,Z2,Z3)
XYZZ form also known as "Extended Jacobian form" follows the same calculation and reasoning as Jacobian, but with one minor difference: Extended Jacobian is instead stored as (x,y,z2,z3) to provide better performance of computations with a slight tradeoff in memory.
Affine ⟹ XYZZ
Jacobian ⟹ XYZZ
Calculating Operations
Refer to Hyperelliptic for XYZZ points on the best practices on how to calculate addition and double operations on XYZZ coordinates.
Summary of all forms:
Affine
(x,y)
(x,y)
y2=x3+ax+b
Projective
(ZX,ZY)
(X,Y,Z)
Y2Z=X3+aXZ2+Z3
Jacobian
(Z2X,Z3Y)
(X,Y,Z)
Y2=X3+aXZ4+bZ6
Extended Jacobian (XYZZ)
(Z2X,Z3Y)
(X,Y,Z2,Z3)
Y2=X3+aXZ4+bZ6
References
Written by Ashley Jeong of Fractalyze
Last updated