Skip to main content

Try it Live

Run BLS12-381 examples in the interactive playground
Future Plans: This page is planned and under active development. Examples are placeholders and will be replaced with accurate, tested content.

G2 Operations

G2 is the extension field elliptic curve group used for BLS public keys. Points are 96 bytes compressed or 192 bytes uncompressed.

G2 Curve Equation

Extension Field: Fp2 = Fp[i] / (i² + 1) Group Order: r (same as G1) Cofactor: h2 = 0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5

Point Formats

Uncompressed (192 bytes, padded to 256 for precompiles)

Each coordinate is Fp2 element: a + bi where a, b ∈ Fp

Compressed (96 bytes)

Operations

Point Addition

Gas Cost: 800 (EIP-2537) Time: ~25 μs

Scalar Multiplication

Gas Cost: 45,000 (EIP-2537) Time: ~200 μs

Multi-Scalar Multiplication

Use Case: Aggregate validator public keys

Subgroup Membership

Critical: G2 has large cofactor - must verify subgroup membership! Attack: Invalid curve attack if subgroup not checked BLST automatically validates:
  • Point on curve
  • In prime-order subgroup
  • Coordinates in field

Public Key Aggregation

Ethereum: Aggregate 512 sync committee public keys

Performance

Native (BLST):
  • Addition: ~25 μs
  • Scalar mul: ~200 μs
  • MSM (50): ~6 ms
  • MSM (512): ~50 ms
Optimization: MSM much faster than individual multiplications for validator key aggregation