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.md7
1 files changed, 5 insertions, 2 deletions
diff --git a/docs/journal/pages/pairings.md b/docs/journal/pages/pairings.md
index add0aff..c65d99b 100644
--- a/docs/journal/pages/pairings.md
+++ b/docs/journal/pages/pairings.md
@@ -2,9 +2,9 @@
# Pairings
-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`.
+Pairings are the dark magic that make 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.
+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):
@@ -22,10 +22,13 @@ For BLS12-381:
The exact magic that we use isn't super important (and I don't pretend to fully understand it).
+> Small note on differences in BN254 and BLS12-381 curves: the Miller Loop is implemented slightly differently in that there is a post-computation in the case of the BN254 curve at the end of the Miller Loop algorithm. As far as I can tell (information on this was relatively hard to find), but it is to untwist the point.
+
# Resources
- [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)
+- [Noble Curves](https://github.com/paulmillr/noble-curves/blob/289db6f25979d226b3be2057c16d94e64dca3280/src/abstract/bls.ts#L97)
> [Index](../README.md)