Pairing-based cryptography

Hidden scalar relationships, checked in public.

Pairings are maps between two elliptic-curve groups and a target group. Their useful trick is bilinearity: secret multiplications can be moved across an equation and compared without exposing the secret.

Read article
Before the examples

One operation hides a scalar. A pairing compares two hidden products.

Ordinary elliptic-curve cryptography turns a secret number into a public point. A pairing adds a second kind of operation: it takes one point from G1 and one point from G2, then checks whether their hidden scalar multiplication agrees in GT.

Step 1

Ordinary EC multiplication

The public key hides the secret key inside a point. Observers seepk, but they should not be able to recoversk.

GeneratorQ
Secret keysk is private
Public keypk = 23Q
Message pointH(m) = 17P
Step 2

Pairing comparison

The signature hides sk * H(m). The public key hidessk. The pairing compares those hidden products without exposing sk.

e(signature, Q) = e(88P, Q) = 537e(H(m), pk) = e(17P, 23Q) = 537same hidden product
Signature should be17 * 23 mod 101 = 88P
Checked signature88P
Left product88 * 1 mod 101 = 88
Right product17 * 23 mod 101 = 88
Pairing map

Two source points go in. One target-group element comes out.

In this toy model, a point in G1 is written as aP, a point in G2 is written as bQ, and the pairing output is controlled by a * b mod 101. Real pairings do this with elliptic-curve points and a real target group.

Left pairing
G1 source12P
G2 source9Q
GT output482
Pairinge(12P, 9Q)
Hidden product12 * 9 mod 101 = 7
Target element64^7 mod 607 = 482
Right pairing
G1 source3P
G2 source36Q
GT output482
Pairinge(3P, 36Q)
Hidden product3 * 36 mod 101 = 7
Target element64^7 mod 607 = 482
Verifier comparisone(12P, 9Q) = e(3P, 36Q)

The verifier compares the two GT outputs. Matching outputs mean the hidden scalar products match, even if the original G1 and G2 points look different.

hidden products match
Toy pairing parameters

The demo uses additive source groups of order 101 and a target group modulo 607 with generator 64. A real pairing uses elliptic-curve groups, not these small numbers.

Bilinearitye(13P, 29Q) = 64^74 mod 607 = 418e(P, Q)^(13 * 29) = 64^74 mod 607 = 418
Pairing check passes
Move scalar from G1e(13P, 29Q) = 418e(P, 29Q)^13 = 418
Pairing check passes
Move scalar from G2e(13P, 29Q) = 418e(13P, Q)^29 = 418
Pairing check passes
Concrete values
G1 point13P
G2 point29Q
Target exponent13 * 29 mod 101 = 74
Target element418
Where this shows up
Toy examples

What “move the secret across the equation” means

Each card reduces the idea to scalar products modulo 101. The numbers are intentionally small: the point is to see that pairing checks compare hidden products, not raw secrets.

1. Same secret, either side

This is the smallest version of the trick. The secret scalar can sit inside the G1 input or the G2 input, and the target result stays the same.

e(37P, Q) = 143e(P, 37Q) = 143Pairing check passes
Hidden product left37 * 1 mod 101 = 37
Hidden product right1 * 37 mod 101 = 37
What matchedsame exponent in GT

2. Different points, same product

The pairing is not checking whether the visible points are identical. It is checking whether their hidden scalar products match modulo the group order.

e(12P, 9Q) = 482e(3P, 36Q) = 482Pairing check passes
Left product12 * 9 mod 101 = 7
Right product3 * 36 mod 101 = 7
Target outputsame GT element

3. BLS signature as one hidden product

A valid BLS signature hides sk * H(message). The public key hides sk. Pairing verification proves those two uses of sk agree.

e(signature, Q) = e(28P, Q) = 369e(H(m), pk) = e(44P, 19Q) = 369signature accepted
Public key19Q
Valid signature44 * 19 mod 101 = 28P
Checked signature28P

4. Aggregation is product reuse

When two signers sign the same message, their signatures add in G1 and their public keys add in G2. The pairing still sees the same total hidden product.

e(sigA + sigB, Q) = e(81P, Q) = 559e(H(m), pkA + pkB) = e(22P, 45Q) = 559aggregate accepted
sigA22 * 14 mod 101 = 5P
sigB22 * 31 mod 101 = 76P
pkA + pkB14Q + 31Q = 45Q

5. KZG opening means no remainder

For a correct opening, f(tau) - y equals q(tau) * (tau - z). A wrong y leaves a remainder, and the pairing equality breaks.

e((f(tau) - y)P, Q) = e(96P, Q) = 346e(q(tau)P, (tau - z)Q) = e(8P, 12Q) = 346opening accepted
q(tau)8
tau - z12
Claim error0
Expected scalar96