aboutsummaryrefslogtreecommitdiff
path: root/docs/journal/pages/pairings.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/journal/pages/pairings.md')
-rw-r--r--docs/journal/pages/pairings.md24
1 files changed, 22 insertions, 2 deletions
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)