Skip to content

Instantly share code, notes, and snippets.

@paulmillr
Last active May 18, 2025 12:51
Show Gist options
  • Save paulmillr/18b802ad219b1aee34d773d08ec26ca2 to your computer and use it in GitHub Desktop.
Save paulmillr/18b802ad219b1aee34d773d08ec26ca2 to your computer and use it in GitHub Desktop.
BLS Signature for Busy People

BLS Signature for Busy People

bls12-381 is pairing-friendly Barreto-Lynn-Scott elliptic curve construction allowing to:

  • Construct zk-SNARKs at the ~120-bit security, as per Barbulescu-Duquesne 2017
  • Efficiently verify N aggregate signatures with 1 pairing and N ec additions: the Boneh-Lynn-Shacham signature scheme is orders of magnitude more efficient than Schnorr

BLS can mean 2 different things:

  • Barreto-Lynn-Scott: BLS12, a Pairing Friendly Elliptic Curve
  • Boneh-Lynn-Shacham: A Signature Scheme.

Summary

  1. BLS Relies on expensive bilinear pairing
  2. Private Keys: 32 bytes
  3. Public Keys: 48 OR 96 bytes - big-endian x coordinate of point on G1 OR G2 curve
  4. Signatures: 96 OR 48 bytes - big-endian x coordinate of point on G2 OR G1 curve
  5. The 12 stands for the Embedding degree.

Modes of operation:

  • Long signatures: 48-byte keys + 96-byte sigs (G1 keys + G2 sigs).
  • Short signatures: 96-byte keys + 48-byte sigs (G2 keys + G1 sigs).

Formulas

  • P = pk x G - public keys
  • S = pk x H(m) - signing, uses hash-to-curve on m
  • e(P, H(m)) == e(G, S) - verification using pairings
  • e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si)) - signature aggregation

Curves

G1 is ordinary elliptic curve. G2 is extension field curve, think "over complex numbers".

  • G1: y² = x³ + 4
  • G2: y² = x³ + 4(u + 1) where u = √−1; r-order subgroup of E'(Fp²), M-type twist

Towers

Pairing G1 + G2 produces element in Fp₁₂, 12-degree polynomial. Fp₁₂ is usually implemented using tower of lower-degree polynomials for speed.

  • Fp₁₂ = Fp₆² => Fp₂³
  • Fp(u) / (u² - β) where β = -1
  • Fp₂(v) / (v³ - ξ) where ξ = u + 1
  • Fp₆(w) / (w² - γ) where γ = v
  • Fp²[u] = Fp/u²+1
  • Fp⁶[v] = Fp²/v³-1-u
  • Fp¹²[w] = Fp⁶/w²-v

Further Reading

Standards / Specs

Papers

Articles / Posts

Implementations

Notes

Thanks to @benjaminion.

@paulmillr
Copy link
Author

Thanks, updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment