Pairings, particularly in the context of elliptic curves, have become an important cryptographic building block. In particular, pairings are used in popular zero-knowledge–proof protocols, enabling a wide variety of applications↗. They are also the crucial ingredient allowing fast aggregation of BLS signatures. These signatures are used by Ethereum, with efficient aggregation being essential for scaling to a high number of validators↗.
But what are pairings? This article is the first of a two-part series and offers an introduction to what pairings are and what problem they solve. In the second installment, we will then look at concrete applications, such as BLS signatures and the KZG commitment scheme that is used in some ZK proof systems.
We assume that the reader has basic familiarity with concepts like abelian groups, finite fields, and elliptic curves.
One-way Functions
In order to build up step-by-step to the definition of pairings, we start with more basic cryptographic primitives. Many cryptographic constructions rely on a one-way function: a map that is easy to compute but difficult to invert. For example, in the context of cryptographic hash functions, this is exactly the crucial property of preimage resistance.1
Generic Example: Abelian Groups
As a general example, assume that is a cyclic abelian group of order and a generator. Then, we can consider the map that is defined by . If computation of addition in is fast, then can be computed efficiently.2 However, while computation of the inverse of can be done efficiently for some examples, it is expected to be computationally intractable in others. The problem of computing for an element is called the discrete logarithm problem.
Let’s take a look at a few concrete examples that are of this generic form.
Concrete Example 1: Integers Modulo
A trivial example would be the identity map , with . In this case, is its own inverse, so the discrete logarithm problem is very easy.
Concrete Example 2: Multiplicative Subgroups of the Integers Modulo a Prime
Consider , integers modulo a prime . By , we mean the multiplicative group of units,3 which in this case means all elements except and with group structure given by multiplication modulo . Let be an element of that is of order ,4 and let be the subgroup that is multiplicatively generated by . Then, we can consider given by . In this case, we use multiplicative notation for , so this example can also serve as an illustration for why the problem of computing the inverse of is called the discrete logarithm problem.
Concrete Example 3: Elliptic Curves
Let be the points of an elliptic curve as an abelian group, an element of order of , and the subgroup of generated by . Then with is an example. The problem of computing preimages is called the elliptic curve discrete logarithm problem (ECDLP). Computational intractability of the ECDLP is the main assumption made in many elliptic-curve–based cryptographic systems.5
Linear One-way Functions
The generic example we gave above (and hence the three concrete instances we discussed), have the property that is not just a map of sets but a homomorphism of abelian groups, that is, satisfies . This has the interesting consequence that we can check additive relations in even if we only know the images of the involved elements under . Concretely, suppose someone has some integers , , and , gives us , , and , and claims that . If it is computationally intractable to compute , then we will not be able to recover , , or in order to check this directly. However, as is injective in our examples, holds if and only if . And due to being additive, we can actually compute the right-hand side as .
Linear Relations
It is clear that we could repeat the previous example with more summands as well. More generally, we can check every linear relation using the images under . If is an -tuple of integers and elements of some abelian group, we can write for the group element . Let us write for the map that sends to . Then, the main observation is that the following diagram commutes.
Let us unpack what this means. The notation refers to the -fold Cartesian product of , so elements are -tuples with . Correspondingly, the notation refers to the map that applies in each component and thus maps an element of to . That the diagram commutes means that , so the composites from the top left to the bottom right are the same, no matter which path we choose. The following diagram illustrates where an element in is mapped to in the other groups. Equality in the bottom right is what it means for the diagram to commute.
So now, if someone has a tuple in the top left and claims that the image on the bottom left is equal to some value , then we can check this even if we are only given the respective images on the right — in the top right and in the bottom right — by checking whether .
A practical example where checking linear relations like this is used in the context of the third concrete example above (elliptic curves) is ECDSA signature verification↗.
From Linear to Bilinear
What if we are not satisfied with only checking linear relations? The next step would be to verify quadratic relations, where one of the easiest examples would be , for . If we want to do this similarly as before, it would be useful if we had . However, the right-hand side isn’t even defined in general, as was just an abelian group (not a ring). For example, what would it mean to multiply two points on an elliptic curve?
The reframing we did using commutative diagram (1) might help us out, though. Note how we are not actually using the knowledge that the bottom map in diagram (1) is the same as the in the top map; it is only relevant that the diagram commutes. So it would already be enough if we had a commutative diagram like so.
Here, is some other cyclic abelian group of order , with for a generator of , and is some map.
Actually, we don’t even need the two on the top to be the same, so let us just use , , and , all of which are as in our generic example, so that the following diagram commutes, where is some map.
If we had this, and someone claimed that for , giving us , , and , we could check this by verifying whether . This works, as commutativity of the diagram implies and is injective.
There is also a slightly different way to use diagram (2). Suppose we are given , , and instead of , , and as before. Then as and , injectivity of again implies that we can check by checking . This variant has the advantage that we are given elements of only and but not additionally of as in the previous variant.
Pairings
Pairings can now informally be defined as maps that fit into a diagram like (2). More precisely, we define a pairing6 to be a map (where , , and are abelian groups) with the following properties:
- Bilinearity:7 and .
- Nondegeneracy: If is such that for every it holds that , then . Analogously, if is such that for every it holds that , then .
The term bilinear can be explained by the condition being that must be linear in the first and second factor separately.
The informal description indeed corresponds to this if we restrict to abelian groups , , and that are cyclic of order . For example, if is as in diagram (2), then we can check linearity in the first factor as follows, using commutativity of the diagram and the fact that , , and are linear and invertible.
Conversely, given a bilinear and nondegenerate , one can construct a diagram similar to (2) by taking any invertible linear maps and and defining as follows.
Linearity of then follows from being linear in the first factor and invertibility from being nondegenerate. Commutativity of the diagram follows from being linear in the second factor.
Pairings for Elliptic Curves
We have now discussed what kind of we would like to have, but do usable such maps actually exist? Note that for the cryptographic applications, we would like to fit into a diagram similar to (2),8 where , , , and are efficient to compute, but it is computationally intractable to invert , , and , so we cannot just take the multiplication map as and the identity maps for , , and . Luckily there exist usable pairings in the context of elliptic curves. However, we will not get a pairing that is just, for example, for elliptic curves and over . Instead, we get pairings that look like
so we will spend the next couple of subsections explaining the notation used. We will start by explaining the meaning of the parentheses, so of notation of the form . Next we will define the notation and . Finally, we will explain the meaning of the square brackets .
The -Points of Elliptic Curves
Let be a prime power and an elliptic curve defined over . In many applications of elliptic curves, is a prime, and one considers only the -points of , perhaps denoting them by as well by abuse of notation. This means concretely9 that if is, for example, given by some equation like (with and elements of , which is what it means that is defined over ), then we consider pairs that satisfy this equation and where and are elements of as well.
However, if is a field extension10 of , then we can also consider and that are elements of and satisfy the equation. We call such a pair a -point of and denote the abelian group of -points by .
To explain what from equation (3) is, we are now only missing , which we will define next.
Embedding Degree
Suppose that is as before and is an integer coprime to that divides , the number of -points of . Then, in this setting, the embedding degree refers to the smallest integer so that divides . Nearly always, and will be clear from context, and one just writes for .
One important alternative description is that is the smallest integer so that all -th roots of unity (this means solutions of ) are in . The subset of -th roots of unity of will be denoted by . It can be given the structure of an abelian group by multiplication, as if , then and .
So now we know what the codomain of in (3) is, and to understand the domain, the only thing remaining is what means.
Torsion Points
If is an abelian group, we can consider the elements of that satisfy . Such elements are often called -torsion elements, or elements of exponent . The set of all -torsion elements of forms a subgroup of that is sometimes denoted by .
In the situation we were in before, if , we can now consider the -torsion elements among the -points of . If , then , and we can consider as a subgroup of as well and hence as a subgroup of . One could now ask whether can get larger and larger when replacing with , then , and so on.
However, the answer to this is no. There is a largest such abelian group we can obtain, which we denote by . Furthermore, if is a prime that does not divide , then we will already have , where is the embedding degree defined in the previous subsection. So in this situation, it suffices to consider solutions in of the equation defining the elliptic curve in order to capture all -torsion points.
The Weil and Tate Pairings
We can now introduce the first usable pairing in the context of elliptic curves, the Weil pairing. For this, we let be an elliptic curve defined over and a positive integer that is coprime to . Then the Weil pairing is a pairing as follows.
To actually be able to compute such a pairing, we use the setup of the previous subsection: instead of a general integer , we consider a prime that does not divide . Then can be considered as a map from to , and furthermore is contained in .
That we need to work with elements of is of course inconvenient if the embedding degree happens to be large. So why can we not just restrict to ? We would still have a bilinear map, so why is it important we take all -torsion into account? The reason is that this restriction will in general be degenerate and hence not usable for our purposes.
The other classical pairing in this context is the (modified) Tate pairing (or Tate-Lichtenbaum pairing). Again, we let be an elliptic curve defined over and a positive integer. Then the modified Tate-Lichtenbaum pairing is a pairing
where is the embedding degree. Here, the notation means we are considering elements of only modulo elements of the form .
Both the Weil and Tate-Lichtenbaum pairings can be efficiently computed in practice using Miller’s algorithm↗. In practice, the pairings most used are (optimal) Ate pairings↗. These are variants of the Tate pairing that allow for faster computation, and for which, one can reduce the degree of the field extension that one needs to work over in the domain (so that one, for example, can make do with instead of ), using twists.
From the above, it seems like a low embedding degree would be very useful to make computation of the pairing we choose more efficient by avoiding use of a larger field. However, there is a flip side to this, as we will see in the next section.
MOV and Frey-Rück Attacks
Let be an elliptic curve defined over . Suppose we are given two points and in so that is of prime order and there is an so that . Recovering modulo from and is the ECDLP we already mentioned towards the beginning of this article, and computational intractability of this problem is crucial for many cryptographic systems based on elliptic curves.
Now assume that does not divide , and we can find a point in so that is of order and . By bilinearity of we have the following.
Finding modulo so that is exactly the DLP in . Finding a that satisfies the assumption is easy in practice, so this method reduces the original ECDLP to a DLP in .
The method just described is called the MOV attack↗ after the authors Menezes, Okamoto, and Vanstone. The Frey-Rück attack is similar but employs the Tate pairing.
Now for both the ECDLP and the above DLP, no algorithm is known that solves them in polynomial time. However, solving a DLP in using the index calculus algorithm↗ is faster than solving the ECDLP in using the fastest generic available algorithm, the baby-step giant-step algorithm↗. This means that in the situation above, the ECDLP can be solved faster than expected if the embedding degree is small.
If we wish to make use of pairing-based cryptography, we must thus use an elliptic curve with a carefully selected embedding degree — large enough to ensure the required security level for the ECDLP but otherwise as small as possible to ensure that the pairing can be computed efficiently. The embedding degrees chosen in practice for use with pairings are usually in the range from to or so, with a popular choice.
Conclusion
We have defined pairings and motivated why they might be useful and also looked at the form that pairings for elliptic curves take.
In the second (and final) installment of this article series, we are going to take a closer look at cryptographic applications of pairings. In particular, we are going to explain BLS signatures, including how they can be aggregated, which is a highly useful property enabling Ethereum to scale to a high number of validators↗. We are also going to discuss KZG polynomial commitments, which are a building block used in ZK proof systems such as Halo2.
About Us
Zellic specializes in securing emerging technologies. Our security researchers have uncovered vulnerabilities in the most valuable targets, from Fortune 500s to DeFi giants.
Developers, founders, and investors trust our security assessments to ship quickly, confidently, and without critical vulnerabilities. With our background in real-world offensive security research, we find what others miss.
Contact us↗ for an audit that’s better than the rest. Real audits, not rubber stamps.
Endnotes
-
We require additional properties from cryptographic hash functions, such as collision resistance. These will not play a role in the rest of this article, though. ↩
-
Using the double-and-add↗ method. ↩
-
A unit is an element of a ring that has a multiplicative inverse. ↩
-
That has order means that and for . ↩
-
Whether the ECDLP can be solved efficiently depends, in particular, on the curve . For example, if is an anomalous curve, then an efficient algorithm exists. ↩
-
What we call pairings here are also sometimes called bilinear pairings or nondegenerate bilinear maps. ↩
-
To be precise, this is -bilinearity. ↩
-
We relax the requirement that must be isomorphisms and that their domain must be exactly . ↩
-
The following description is simplified, for example, by ignoring the point at infinity. But discussing the Proj construction↗ is out of scope for this post. ↩
-
That is a field extension of means that is a subfield of (that is, a subset with the same addition and multiplication). For our purposes, it suffices to think of the case for ↩