Path: blob/main/frontier/07-pairings/sage/07a-bilinear-maps-definition.ipynb
483 views
Notebook 07a: Bilinear Maps, Definition
Module 07. Bilinear Pairings
Motivating Question. With elliptic curve groups (Module 06), we can build key exchange (ECDH) and signatures (ECDSA). But some powerful protocols, BLS aggregate signatures, identity-based encryption, SNARKs, require something more: a way to "multiply" two group elements and get a meaningful result in a third group. This is exactly what a bilinear map (pairing) provides. What is this mysterious map, and why does bilinearity unlock so much?
Prerequisites. You should be comfortable with:
Elliptic curve groups, scalar multiplication, and the ECDLP (Module 06)
Group theory basics: identity, order, generators (Module 01)
Finite fields and extension fields (Module 02/03)
Learning objectives. By the end of this notebook you will be able to:
State the formal definition of a bilinear map .
Verify the bilinearity and non-degeneracy properties computationally.
Understand the three groups () and how they relate to elliptic curves.
See why bilinearity enables "checking multiplications in the exponent."
1. The Idea: A Map That "Multiplies" Discrete Logs
Bridge from Module 06. In Module 06, we worked with a single elliptic curve group . Given points and , there's no way to "multiply" two points to get from and alone, that would break Diffie-Hellman! A bilinear pairing doesn't break DH, but it does something subtler: it maps pairs of points to elements of a different group where the discrete logs multiply.
Informal picture:
The pairing takes two curve points and outputs an element of a multiplicative group (typically ). The key magic: the "exponents" and end up multiplied in the output.
2. Formal Definition
Let be additive groups of prime order and a multiplicative group of the same order . A bilinear map (pairing) is a function:
satisfying:
Bilinearity: For all and :
(linear in the first argument)
(linear in the second argument)
Non-degeneracy: If and , then .
Computability: There is an efficient algorithm to compute .
From bilinearity, it follows immediately that:
This is the property that makes pairings cryptographically useful.
3. A Toy Example: Pairings in
Before using elliptic curves, let's build intuition with a simpler (and cryptographically useless, but illustrative) bilinear map.
Let and . Define:
This is bilinear: .
It's non-degenerate (for prime ): if and , then .
But it's useless for crypto because "computing discrete logs" in is trivial (just division). The real power comes when are elliptic curve groups where DLP is hard.
Checkpoint 1. The bilinearity property means the pairing is "linear in each argument separately." This is the same concept as a bilinear form in linear algebra. The cryptographic consequence: if you know , then , the scalars "pass through" to become exponents in .
4. Pairings on Elliptic Curves: The Weil Pairing
The real cryptographic pairing is defined on elliptic curve groups. SageMath provides the Weil pairing built in.
Setup:
An elliptic curve over
An integer (typically the order of the subgroup) with
The -torsion subgroup
Two linearly independent points (often lives in an extension field )
The Weil pairing maps:
where is the group of -th roots of unity and is the embedding degree (the smallest such that ).
Misconception alert. "The pairing output is a point on an elliptic curve." No, the output is an element of a multiplicative group, typically a subgroup of . The inputs are curve points; the output is a field element.
5. Verifying Bilinearity
The defining property: .
Let's test this exhaustively for our small groups.
Checkpoint 2. Bilinearity has a powerful consequence: . This means we can "check multiplication in the exponent" without knowing or individually. Given , , and a claimed product , we can check whether by testing:
This is the core trick behind BLS signatures and SNARKs.
6. Non-Degeneracy
A pairing is non-degenerate if there exist with .
Equivalently: for every non-identity , there exists some such that (and vice versa).
If the pairing were degenerate ( for all ), it would be useless, it couldn't distinguish anything.
7. The Three Groups
In pairing-based cryptography, we always work with three groups:
| Group | Type | Typical realization | Operation |
|---|---|---|---|
| Additive | or subgroup thereof | Point addition | |
| Additive | or a twist | Point addition | |
| Multiplicative | (-th roots of unity) | Multiplication |
All three have the same prime order . The pairing maps .
Important variants:
Type 1 (symmetric): . The Weil pairing on supersingular curves.
Type 3 (asymmetric): , no efficient map from to . Used in practice (BN, BLS curves).
For this module, we primarily use Type 1 pairings for simplicity.
8. Why Bilinearity Is Useful: The DDH Shortcut
Consider the Decisional Diffie-Hellman (DDH) problem: given , decide whether .
In a group without a pairing, DDH is believed to be hard.
In a group with a pairing, DDH is easy! Just check:
If , both sides equal . If , they differ (with overwhelming probability).
This means pairing groups are weaker for some assumptions (DDH) but enable new protocols.
Crypto foreshadowing. This DDH-solving trick is a double-edged sword:
Bad news: Protocols that rely on DDH being hard (like ElGamal in the curve group) are broken if a pairing exists.
Good news: The ability to "check multiplications" enables BLS signatures (Notebook 07d), identity-based encryption (07e), and zero-knowledge proofs (Module 10).
The art of pairing-based cryptography is exploiting bilinearity for new functionality while basing security on assumptions that remain hard (like CDH or the Bilinear Diffie-Hellman assumption).
9. Properties Summary
Let's collect all the useful identities that follow from bilinearity:
| Property | Formula |
|---|---|
| Bilinearity (left) | |
| Bilinearity (right) | |
| Scalar extraction | |
| Identity | |
| Inverse | |
| Alternating (Weil) | (for the Weil pairing when ) |
10. Exercises
Exercise 1 (Worked): Verifying Scalar Extraction
Problem. Using our curve and pairing, verify that .
Solution:
Exercise 2 (Guided): DDH Solver
Problem. Write a function ddh_test(P, Q, aP, bQ, cP, n) that uses the Weil pairing to decide whether . Test it with both real and fake tuples.
Fill in the TODOs:
Exercise 3 (Independent): Pairing on a Larger Curve
Problem.
Construct the supersingular curve over with (verify ).
Verify that .
Pick a prime dividing 468. Determine the embedding degree .
Find generators and of order .
Compute and verify bilinearity for 5 random pairs .
Summary
| Concept | Key Fact |
|---|---|
| Bilinear map | with |
| Three groups | (additive, curve points), (multiplicative, field elements) |
| Non-degeneracy | For generators : |
| Weil pairing | SageMath's built-in pairing on -torsion points |
| DDH shortcut | Pairings make the DDH problem easy: check |
| Embedding degree | Smallest with ; determines which extension field lives in |
We now have the abstract machinery. In the next notebook, we'll develop geometric intuition for why the Weil pairing works, using divisors on curves.