Skip to main content

Try it Live

Run BLS12-381 examples in the interactive playground

BLS12-381 Precompiles

EIP-2537 defines BLS12-381 precompiled contracts for the EVM.
NOT on Mainnet - These precompiles are proposed but NOT activated on Ethereum mainnet. For execution layer zkSNARKs, use BN254 precompiles (addresses 0x06-0x08) which ARE available on mainnet.

Status

Precompile Addresses

If/when activated, the precompiles occupy addresses 0x0b through 0x13:

Gas Costs

G1 Operations

G2 Operations

Pairing

Hash-to-Curve

Input/Output Formats

G1 Point (Uncompressed)

G2 Point (Uncompressed)

Scalar

Operation Details

G1ADD (0x0b)

Add two G1 points. Input: 256 bytes (two G1 points) Output: 128 bytes (one G1 point)

G1MUL (0x0c)

Multiply G1 point by scalar. Input: 160 bytes (G1 point + 32-byte scalar) Output: 128 bytes (one G1 point)

G1MSM (0x0d)

Multi-scalar multiplication on G1. Input: Variable (pairs of G1 point + scalar) Output: 128 bytes (one G1 point) Computes: Σ sᵢ·Pᵢ

PAIRING (0x11)

Pairing check on multiple pairs. Input: Variable (pairs of G1 and G2 points) Output: 32 bytes (boolean: 1 if check passes, 0 otherwise) Verifies: e(P₁, Q₁) · e(P₂, Q₂) · ... · e(Pₙ, Qₙ) = 1

Use Cases (When Available)

BLS Signature Verification

Aggregated Signature Verification

Error Conditions

Precompiles return error (consume all gas) for:
  • Invalid point encoding
  • Point not on curve
  • Point not in correct subgroup
  • Invalid scalar (> field modulus)
  • Input length mismatch

Comparison with BN254