← Number theory

Lab · Elliptic curves

Chord and tangent over 𝔽p

The group law on an elliptic curve still works when the curve is a scatter of points modulo a prime. Watch the multiples of a point jump around, and see why that makes cryptography possible.

Over the real numbers, the points of $E : y^2 = x^3 + ax + b$ form a group: to add $P$ and $Q$, draw the line through them, find the third point $R$ where it meets the curve, and reflect $R$ in the $x$-axis. Every step is a rational formula in the coordinates, $$\lambda = \frac{y_Q - y_P}{x_Q - x_P}, \qquad x_{P+Q} = \lambda^2 - x_P - x_Q, \qquad y_{P+Q} = \lambda(x_P - x_{P+Q}) - y_P,$$ (with $\lambda = \frac{3x_P^2 + a}{2y_P}$ when $P = Q$), so the same formulas make sense modulo a prime $p$. The curve becomes a finite set of points in the square $\{0, \dots, p-1\}^2$, symmetric about the middle row because $(x, y)$ and $(x, -y)$ are both on it, and a "line" $y = \lambda x + \nu$ becomes a set of parallel strokes wrapping around the square.

What to look for

The construction is the real one. Each step draws the line through $P$ and $kP$, circles the third point where it meets the curve, and drops it to its mirror image $(k+1)P$. When the multiples come back to the point at infinity $O$, the walk has found the order of $P$.

The count obeys Hasse's bound. The number of points, including $O$, satisfies $|\#E(\mathbb{F}_p) - p - 1| \le 2\sqrt p$ (Hasse, 1933). This is the Riemann hypothesis for the curve, the genus-one case of the zeros on the unit circle lab.

The walk looks random. Knowing $P$ and $Q = nP$, finding $n$ is the elliptic curve discrete logarithm problem. For a well-chosen curve over a field of about $2^{256}$ elements, the best known methods take around $2^{128}$ steps, which is why elliptic curves secure most web traffic and cryptocurrencies. Hovering over a visited point shows its discrete logarithm, which the applet knows only because it walked there.

Full proof: a line through two points of the curve meets it in exactly one more

Lemma. Let $K$ be a field of characteristic not $2$ or $3$, and $P \ne \pm Q$ points of $E : y^2 = x^3 + ax + b$ over $K$. The line through $P$ and $Q$ meets $E$ in exactly one further point $R$ (counted with multiplicity), and $R$ has coordinates in $K$.

Proof. The line is $y = \lambda x + \nu$ with $\lambda, \nu \in K$, since $x_P \ne x_Q$. Substituting into the equation of $E$ gives $$x^3 - \lambda^2 x^2 + (a - 2\lambda\nu)x + (b - \nu^2) = 0,$$ a monic cubic over $K$ with roots $x_P$ and $x_Q$. Its roots sum to $\lambda^2$, so the third root is $x_R = \lambda^2 - x_P - x_Q \in K$, and then $y_R = \lambda x_R + \nu \in K$. A cubic has at most three roots, so there is no fourth intersection. $\square$

The same computation with the tangent line ($\lambda = \frac{3x_P^2 + a}{2y_P}$, a double root at $x_P$) handles $P = Q$. Associativity of the resulting operation is the hard part of the theory; over a general field it is cleanest via the Riemann–Roch theorem.

Further reading

  • J. H. Silverman and J. Tate, Rational Points on Elliptic Curves, 2nd ed., Springer UTM, 2015.
  • L. C. Washington, Elliptic Curves: Number Theory and Cryptography, 2nd ed., Chapman & Hall/CRC, 2008.
  • J. H. Silverman, The Arithmetic of Elliptic Curves, 2nd ed., Springer GTM 106, 2009.