diff options
Diffstat (limited to 'docs/journal/pages')
| -rw-r--r-- | docs/journal/pages/elliptic-curves.md | 2 | ||||
| -rw-r--r-- | docs/journal/pages/pairings.md | 24 |
2 files changed, 23 insertions, 3 deletions
diff --git a/docs/journal/pages/elliptic-curves.md b/docs/journal/pages/elliptic-curves.md index 214e8e5..166bf24 100644 --- a/docs/journal/pages/elliptic-curves.md +++ b/docs/journal/pages/elliptic-curves.md @@ -10,7 +10,7 @@ Curves are abelian groups, so we can implement addition and scalar multiplicatio The same principle can be extrapolated to doubling a point, which is a special case where `P = Q` in the example above, and the line would be the tangent to the curve passing by `P`. The formula of `x_R` and `y_R` are the same, but the slope is computed as the tangent `m = 3x_P^2 / 2y_P` (derivatives!). -It turns out that the equations for elliptic curves over real numbers also apply to finite fields, so yay! With this, we can implement the basic operations of a group over elliptic curve. +It turns out that the equations for elliptic curves over real numbers also apply to finite fields and polynomial extension fields, so yay! With this, we can implement the basic operations of a group over elliptic curve. # Resources diff --git a/docs/journal/pages/pairings.md b/docs/journal/pages/pairings.md index 7260b08..add0aff 100644 --- a/docs/journal/pages/pairings.md +++ b/docs/journal/pages/pairings.md @@ -2,10 +2,30 @@ # Pairings -TODO. +Pairings are the dark magic that make Groth-16 style (and hence PLONK) ZK systems work. They provide an **efficient** bilinear mapping from two groups to a third, all three with the same order `N`. + +To have a feel for what you get with pairing, imagine a _fictional_ pairing function defined as `e(P, Q) = R` where, given `s` and `t` such that `P = sG` and `Q = tG` for some generator point `G`, then `R = (s * t)G`. This gives us the wonderful bilinear properties of pairings: `e(P, Q) = e(sG, tG) = e(G, stG) = e(tG, sG) = (s * t) * e(G, G)`. In many ways, this acts like "multiplication" in contract to the addition of points (where `P + Q = sG + tG = (s + t)G`). There is an issue with our _fictional_ pairing definition: it is not efficient. Specifically, given two points `P` and `Q` without knowing `s` and `t`, it is not possible to compute `s * t` (otherwise, you could efficiently solve the discrete logarithm problem, and you would have broken the cryptography that underpins Ethereum signatures. + +By some black magic, mathematicians found a function `e` that behaves like the multiplication above with some caveats: instead of all `P`, `Q` and `R` being points on a curve, they are part of three different groups (with the same order -- i.e. number of elements): + +- `P` is a point on an elliptic curve over a finite field modulo `p`, lets call it `G1` +- `Q` is a point on an elliptic curve over a polynomial extension field over the same finite field as `G1`, lets call that `G2` +- `R` is **not** a point, but an element in the polynomial extension field over which `G2` is defined. + +For BLS12-381: + +- `G1` is just the elliptic curve BLS12-381 +- `G2` is... well complicated... _technically_, it is the BLS12-381 curve over a specific 12th degree polynomial extension field `Fp12`, with a chosen generator point. In practice, there exists another related curve over a 2nd degree polynomial extension field `Fp2` with a twisting operation that efficiently maps `E'[Fp2] -> E[Fp12]`. This allows you to do operations much more efficiently in the `E'[Fp2]` curve, and then "convert" it to a point in `E[Fp12]` for the pairing computation itself. +- `GT` is a group of elements in `Fp12`, where the: + - The identity element is `1` + - The group operation is field multiplication + +The exact magic that we use isn't super important (and I don't pretend to fully understand it). # Resources -- [Resource](https://example.com) +- [BLS12-381 For The Rest Of Us](https://hackmd.io/@benjaminion/bls12-381) +- [Pairings for Beginners](https://static1.squarespace.com/static/5fdbb09f31d71c1227082339/t/5ff394720493bd28278889c6/1609798774687/PairingsForBeginners.pdf) +- [Exploring Elliptic Curve Pairings](https://vitalik.eth.limo/general/2017/01/14/exploring_ecp.html) > [Index](../README.md) |
