Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
duyuefeng0708
GitHub Repository: duyuefeng0708/Cryptography-From-First-Principle
Path: blob/main/frontier/07-pairings/README.md
483 views
unlisted

Module 07: Bilinear Pairings

View on nbviewer

A map between curve groups that unlocks BLS signatures, IBE, and the road to SNARKs.

Prerequisites

Learning Objectives

After completing this module you will:

  1. Understand the definition and key properties of a bilinear map

  2. Build geometric intuition for the Weil pairing on elliptic curves

  3. Implement the BLS signature scheme (sign, verify, aggregate)

  4. Grasp how pairings enable identity based encryption (IBE)

Explore (SageMath Notebooks)

Work through these notebooks in order:

#NotebookWhat You'll Learn
aBilinear Maps: DefinitionWhat a bilinear map is and why bilinearity + non-degeneracy matter
bWeil Pairing IntuitionGeometric picture of the Weil pairing via divisors on curves
cPairing-Friendly CurvesWhy only certain curves admit efficient pairings, embedding degree
dBLS SignaturesSign, verify, and aggregate signatures using a single pairing check
eIdentity-Based EncryptionEncrypt to an identity string instead of a public key

Implement (Rust)

Build these from scratch in rust/src/lib.rs:

#FunctionDescription
1bls_signSign a message using a private scalar and hash to curve
2bls_verifyVerify a BLS signature via a pairing equation check
3bls_aggregate_sigsAggregate multiple BLS signatures into one curve point
4bls_aggregate_verifyVerify an aggregate signature against multiple public keys

Run: cargo test -p pairings

Break

Try these attacks in the break/ folder:

  • Rogue key attack on naive BLS aggregation. Craft a malicious public key that lets you forge an aggregate signature without knowing all private keys.

  • Pairing inversion attempt. Try to recover discrete logs from pairing outputs and see why the pairing inversion problem is hard.

Connect

See where this shows up in practice (in the connect/ folder):

  • BLS signatures in Ethereum 2.0 consensus. Validators sign attestations with BLS, and aggregation keeps beacon chain overhead manageable.

  • Pairing based identity based encryption. The Boneh-Franklin IBE scheme lets any string serve as a public key, used in enterprise key management.


Next: Module 08: Lattices and Post-Quantum Cryptography