LogoLogo
LogoLogo
  • Introduction
    • About Us
    • Notations & Definitions
      • MPC
      • ZK
    • Contribute to this Site!
  • Primitives
    • Multiplication
      • Karatsuba Multiplication
      • Toom-Cook Multiplication
    • NAF (Non-adjacent form)
    • Chinese Remainder Theorem (CRT)
    • Euclidean Algorithm
      • Extended Euclidean Algorithm
      • Binary Euclidean Algorithm
      • Extended Binary Euclidean Algorithm
    • Coding Theory
      • Linear Code
    • Number Theoretic Transform
    • Abstract Algebra
      • Group
        • -Morphisms
        • Batch Inverse
      • Elliptic Curve
        • Weierstrass Curve
          • Coordinate Forms
          • Fast Elliptic Curve Arithmetic and Improved WEIL Pairing Evaluation
        • Edwards Curve
          • Coordinate Forms
          • Twisted Edwards ↔ Short Weierstrass Transformation
        • Batch Inverse for Batch Point Additions
        • Scalar Multiplication
          • Double-and-add
          • GLV Decomposition
        • MSM
          • Pippenger's Algorithm
          • Signed Bucket Index
          • CycloneMSM
          • EdMSM
          • cuZK
        • 2-Chain and 2-Cycle of Elliptic Curves
    • Encryption Scheme
      • ElGamal Encryption
    • Modular Arithmetic
      • Modular Reduction
        • Barrett Reduction
        • Montgomery Reduction
      • Modular Inverse
        • Bernstein-Yang's Inverse
    • Multiset Check
    • Sumcheck
    • Commitment Scheme
      • Fflonk
      • SHPlonk
      • Zeromorph
  • MPC
    • Yao's Garbled Circuits
    • GMW
    • BMR
  • ZK
    • Arithmetization
      • R1CS
      • PLONK
      • AIR
    • Folding
      • LatticeFold
      • Nova
        • Nova over Cycles of Curves
    • Lookup
      • Lasso
      • LogUp-GKR
    • SNARK
      • Groth16
      • HyperPlonk
      • Spartan
        • SPARK
    • STARK
      • Additive NTT
      • Basefold
      • Binius
      • Brakedown
      • CircleSTARK
      • FRI
        • FRI Security Features and Optimizations
      • DEEP FRI
      • STIR
      • WHIR
    • Distributed ZK
      • Ryan's Trick for Distributed Groth16
  • Application
    • zkLogin
    • zkHoldem
    • zkTLS
      • DECO
      • Proxying is enough
  • zkVM
Powered by GitBook
On this page
  • Affine
  • Problem
  • Solution
  • Projective
  • Affine Projective
  • Projective Affine
  • Calculating Operations
  • Jacobian
  • Affine Jacobian
  • Jacobian Affine
  • Calculating Operations
  • XYZZ - Extended Jacobian
  • Affine XYZZ
  • Jacobian XYZZ
  • Calculating Operations
  • Summary of all forms:
  • References
Export as PDF
  1. Primitives
  2. Abstract Algebra
  3. Elliptic Curve
  4. Weierstrass Curve

Coordinate Forms

PreviousWeierstrass CurveNextFast Elliptic Curve Arithmetic and Improved WEIL Pairing Evaluation

Last updated 1 month ago

Affine (x,y)(x,y)(x,y)

Affine form refers to the regular (x,y)(x,y)(x,y) form of coordinates on an xyxyxy-plane.

Problem

For elliptic curves, point addition is done very often as it is considered cheap. , we must compute the slope m=yQ−yPxQ−xPm = \frac{y_Q-y_P}{x_Q-x_P}m=xQ​−xP​yQ​−yP​​. However, calculating field inverses or the (xQ−xP)−1(x_Q-x_P)^{-1}(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 xxx and yyy are manipulated to use the same denominator () or related denominators ( & ). This denominator will then be calculated and stored as a continuous separate value ZZZ.

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 (XZ,YZ):(X,Y,Z)(\frac{X}{Z}, \frac{Y}{Z}) : (X,Y,Z)(ZX​,ZY​):(X,Y,Z)

In projective form, affine points of (x,y)(x,y)(x,y) are redefined as (XZ,YZ)(\frac{X}{Z}, \frac{Y}{Z})(ZX​,ZY​). In practice, projective form is stored as (X,Y,Z)(X,Y,Z)(X,Y,Z). With this conversion, the elliptic curve equation is changed to:

Y2Z=X3+aXZ2+bZ3Y^2Z =X^3 + aXZ^2 + bZ^3Y2Z=X3+aXZ2+bZ3

Affine ⟹\Longrightarrow⟹ Projective

Calculating Operations

Calculating Operations

Calculating Operations

Summary of all forms:

Form
Point Form in Affine Form
Storage of values
Elliptic Curve Equation

Affine

Projective

Jacobian

Extended Jacobian (XYZZ)

References

(x,y)⟹(x1,y1):(x,y,1)(x,y) \Longrightarrow (\frac{x}{1},\frac{y}{1}) :(x, y, 1)(x,y)⟹(1x​,1y​):(x,y,1)

Projective ⟹\Longrightarrow⟹ Affine

(X,Y,Z)⟹(XZ,YZ)(X, Y,Z) \Longrightarrow (\frac{X}{Z},\frac{Y}{Z})(X,Y,Z)⟹(ZX​,ZY​)

Refer to on the best practices on how to calculate addition and double operations on projective coordinates.

Jacobian (XZ2,YZ3):(X,Y,Z)(\frac{X}{Z^2},\frac{Y}{Z^3}) :(X, Y, Z)(Z2X​,Z3Y​):(X,Y,Z)

In Jacobian form, affine points of (x,y)(x,y)(x,y) are redefined as (XZ2,YZ3)(\frac{X}{Z^2}, \frac{Y}{Z^3})(Z2X​,Z3Y​). In practice, Jacobian form is stored as (X,Y,Z)(X,Y,Z)(X,Y,Z). With this conversion, the elliptic curve equation is changed to:

Y2=X3+aXZ4+bZ6Y^2 =X^3 + aXZ^4 + bZ^6Y2=X3+aXZ4+bZ6

Affine ⟹\Longrightarrow⟹ Jacobian

(x,y)⟹(x12,y13):(x,y,1)(x,y) \Longrightarrow (\frac{x}{1^2},\frac{y}{1^3}) :(x, y, 1)(x,y)⟹(12x​,13y​):(x,y,1)

Jacobian ⟹\Longrightarrow⟹ Affine

(X,Y,Z)⟹(XZ2,YZ3)(X, Y,Z) \Longrightarrow (\frac{X}{Z^2},\frac{Y}{Z^3})(X,Y,Z)⟹(Z2X​,Z3Y​)

Refer to on the best practices on how to calculate addition and double operations on Jacobian coordinates.

XYZZ - Extended Jacobian(XZ2,YZ3):(X,Y,Z2,Z3)(\frac{X}{Z^2},\frac{Y}{Z^3}) : (X,Y,Z^2,Z^3)(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)(x, y, z^2, z^3)(x,y,z2,z3) to provide better performance of computations with a slight tradeoff in memory.

Affine ⟹\Longrightarrow⟹ XYZZ

(x,y)⟹(x12,y13):(x,y,12,13)(x,y) \Longrightarrow (\frac{x}{1^2},\frac{y}{1^3}) :(x, y, 1^2, 1^3)(x,y)⟹(12x​,13y​):(x,y,12,13)

Jacobian ⟹\Longrightarrow⟹ XYZZ

(X,Y,Z2,Z3)⟹(XZ2,YZ3)(X, Y,Z^2, Z^3) \Longrightarrow (\frac{X}{Z^2},\frac{Y}{Z^3})(X,Y,Z2,Z3)⟹(Z2X​,Z3Y​)

Refer to on the best practices on how to calculate addition and double operations on XYZZ coordinates.

Written by of A41

(x,y)(x,y)(x,y)
(x,y)(x,y)(x,y)
y2=x3+ax+by^2 = x^3 + ax + by2=x3+ax+b
(XZ,YZ)(\frac{X}{Z}, \frac{Y}{Z})(ZX​,ZY​)
(X,Y,Z)(X,Y,Z)(X,Y,Z)
Y2Z=X3+aXZ2+Z3Y^2Z = X^3 + aXZ^2 + Z^3Y2Z=X3+aXZ2+Z3
(XZ2,YZ3)(\frac{X}{Z^2}, \frac{Y}{Z^3})(Z2X​,Z3Y​)
(X,Y,Z)(X,Y,Z)(X,Y,Z)
Y2=X3+aXZ4+bZ6Y^2 =X^3+aXZ^4+bZ^6Y2=X3+aXZ4+bZ6
(XZ2,YZ3)(\frac{X}{Z^2}, \frac{Y}{Z^3})(Z2X​,Z3Y​)
(X,Y,Z2,Z3)(X,Y,Z^2, Z^3)(X,Y,Z2,Z3)
Y2=X3+aXZ4+bZ6Y^2 =X^3+aXZ^4+bZ^6Y2=X3+aXZ4+bZ6
Hyperelliptic for Projective points
Hyperelliptic for Jacobian points
Hyperelliptic for XYZZ points
https://hackmd.io/@cailynyongyong/HkuoMtz6o#Projective-Coordinates-in-Elliptic-Curves
https://www.hyperelliptic.org/EFD/g1p/auto-shortw.html
projective
Jacobian
XYZZ
Ashley Jeong
To calculate point addition in affine form