aboutsummaryrefslogtreecommitdiff
path: root/docs/journal/pages/elliptic-curves.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/journal/pages/elliptic-curves.md')
-rw-r--r--docs/journal/pages/elliptic-curves.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/journal/pages/elliptic-curves.md b/docs/journal/pages/elliptic-curves.md
index 8e9695f..baecf02 100644
--- a/docs/journal/pages/elliptic-curves.md
+++ b/docs/journal/pages/elliptic-curves.md
@@ -2,9 +2,9 @@
# Elliptic Curves
-We are implementing PLONK over the BN254 curve. Baretto-Naehrig curves are a type of elliptic curve that are designed to be pairing friendly, which we need for PLONK.
+We are implementing PLONK over the BLS12-381 curve. Named after Barreto, Lynn, and Scott, BLS curves are a pairing friendly elliptic curve, which we need for PLONK.
-Implementing elliptic curves is actually easier than it sounds. Elements are `(x, y)` coordinate pairs, where each of the coordinates is a field element from the prime field we previously implemented. Baretto-Naehrig curves specifically have equations of the form `y^2 = x^3 + b` for some `b ∈ Fp`. The BN254 curve we are implementing has `b = 3`. Note that there is another Barreto-Naehrig curve which is also sometimes called, BN254 with has `b = 2`, this is not our curve.
+Implementing elliptic curves is actually easier than it sounds. Elements are `(x, y)` coordinate pairs, where each of the coordinates is a field element from the prime field we previously implemented. BLS curves specifically have equations of the form `y^2 = x^3 + b` for some `b ∈ Fp`. The BLS12-381 curve we are implementing has `b = 4`.
Curves are abelian groups, so we can implement addition and scalar multiplication (which is just repeated addition). While the addition formula looks complicated, it actually isn't that hard to derive. Lets start with the basic idea of point addition on an elliptic curve: if you draw a straight line that passes through 3 distinct points `P`, `Q` and `R` on the curve, then `P + Q + R = 0` (where 0 is some imaginary point representing a "zero" value, i.e. additive identity, and sometimes referred to as the point at infinity). From basic algebra, we know that the slope of the line between two points is `m = (y_P - y_Q) / (x_P - x_Q)`. Also, because `R` is on the same line, we have `y_R = y_P + m(x_R - x_P)` (and equivalently `y_R = y_Q + m(x_R - x_Q)`). Figuring out how to compute `x_R` is a little more complicated (it involves cubic equations) so lets just share the formula: `x_R = m^2 - x_P - x_Q`.