This is part of a series on elliptic curve cryptography and its applications for Ethereum. This is simplified to a MINIMAL level, aiming at ~high-school math.
The modulo operator (written as "mod") is the operation that finds the remainder.
Imagine a clock being mod 12.
It is very difficult to solve the elliptic curve discrete logarithm problem (that is, if you add two points over and over again using modular arithmetic, it takes A LOT of work to find out how many times you did it).
If a clock is mod 12, then consider the following question: "Alice left at 4 and arrived at 6. How many hours did she spend traveling?" 2 hours? 14 hours? 26 hours? The only way to figure it out is to start guessing.
This is the discrete logarithm problem.
If you've gotten this far, you know how ridiculously difficult the math has already been. I would call it pretty far beyond advanced, right?
I literally laughed out loud when I got to this part in Vitalik's blog, how did you react?
Ok we'll start small: functions.
A function is a process that takes an input from a set of elements X and deterministically assigns exactly one (no more, no less) element from the set Y.
We write a function as f(x) = y; the function f, when applied to x, produces y.
Functions might be familiar, the term "set" might be new. A set is simply a collection of different things:
Mathematical sets and set theory is an incredibly important area of math; but we aren't really here to discuss sets.
For our purposes we just need to understand that functions can move from an input set to a different output set.
If an output set/group is different from an input set/group, we gain a very specific property: the output of this kind of function cannot be used as an input.
Put another way, you can only execute these kinds of functions one time; you cannot execute them repeatedly.
This property is incredibly important for cryptology; it breaks most efficient methods of cracking crypto schemes and forces an attacker to use the slow difficult method: guess and check.
So, let's build an elliptic curve pairing!
An elliptic curve pairing is a function that takes in two points on an elliptic curve and outputs a point in a finite field (think finite field = a predetermined set of points).
Think of a pairing as the elliptic curve equivalent of multiplication.
Not all elliptic curves have pairings, and not all pairings are secure. But once found, a single pairing can be shared by everyone.
Here's the plan: we are going to take two (different) elliptic curves, both of which are hiding a secret number S within their structured reference string (eg step 1 of a KZG commitment).
Once we have our two points, we will apply the pairing to get one final value.
While advanced math is difficult to visualize, the image below should help clarify.
The pairing (denoted as e(p,q)) takes a point from each elliptic curve and outputs t. t is NOT a point on either curve, and therefore the pairing cannot be used more than once.
If all you care about is how we are going to use pairings, you can stop here.
We are simply going to use them like multiplication: combine two points to make a third. We will use the pairing two times with different values and compare the results, looking for equality.
The rest of this article will BRIEFLY touch on the HIGHEST levels of pairings.
Honestly, this probably wont mean anything to you unless you already know relatively advanced algebra/number theory, but it's worth including just for completeness.
First, the most important property of pairings is that pairings are bilinear.
Bilinear is one of those arcane, hard-to-unpack terms.
Suffice to say that it is a specific algebraic property that allows us to expand/contract an expression.
Pairings do not break 2 of the 3 properties of Diffie-Hellman:
Decision Diffie-Hellman is the property that says given gx, gy, and gz, it should be hard to to see if xy = z.
The bilinear property of elliptic pairing break this assumptions, it is trivial to test if e(gx, gy) = e(gz).
Fortunately, pairings are cyclic, meaning that as the input values grow, the output values eventually wrap back around.
And, just like all the modular arithmetic problems we work in, undoing the operation is realistically impossible.
And so, if we modify the decision Diffie-Hellman problem to a bilinear Decision Diffie-Hellman problem, pairings hold all the same properties and assumptions required to implement Diffie-Hellman and most other public cryptography schemes.
There is one more property of pairings that is particularly useful: the decision linear assumption (DLIN).
DLIN is incredibly abstract (it has to do with being able to distinguish the linear combination of the exponents of a generator vs a random exponent).
DLIN is a property about comparing the results of applying two matrices to the exponent (take you number n and you matrix A and create a new matrix where each matrix element is n[matrix element]).
If the rank of matrix A is less than matrix B, B will appear random vs A.
Rough idea: the target group is has more elements than either of the input groups (the target group has higher order or rank), therefore feeding inputs produces outputs that appear to be random (even if you feed them in sequential order).
Bottom line: elliptic curve pairings are HARD.
This is the bleeding edge of math research... welcome to the workshop, where they make magic out of algebra!
Here is the main take away: A pairing an irreversible, one time elliptic curve point multiplication.
Source Material - Twitter Link
Source Material - PDF