Try it Live
Run BLS12-381 examples in the interactive playground
BLS12-381 Precompiles
EIP-2537 defines BLS12-381 precompiled contracts for the EVM.Status
| Network | Status |
|---|---|
| Ethereum Mainnet | ❌ Not activated |
| Sepolia | ✅ Available for testing |
| Some L2s | ⚠️ Check individual L2 docs |
Precompile Addresses
If/when activated, the precompiles occupy addresses0x0b through 0x13:
| Address | Name | Operation |
|---|---|---|
0x0b | BLS12_G1ADD | G1 point addition |
0x0c | BLS12_G1MUL | G1 scalar multiplication |
0x0d | BLS12_G1MSM | G1 multi-scalar multiplication |
0x0e | BLS12_G2ADD | G2 point addition |
0x0f | BLS12_G2MUL | G2 scalar multiplication |
0x10 | BLS12_G2MSM | G2 multi-scalar multiplication |
0x11 | BLS12_PAIRING | Pairing check |
0x12 | BLS12_MAP_FP_TO_G1 | Map field element to G1 |
0x13 | BLS12_MAP_FP2_TO_G2 | Map Fp2 element to G2 |
Gas Costs
G1 Operations
| Operation | Gas Cost |
|---|---|
| G1ADD | 500 |
| G1MUL | 12,000 |
| G1MSM (base) | 12,000 |
| G1MSM (per point) | Discount schedule |
G2 Operations
| Operation | Gas Cost |
|---|---|
| G2ADD | 800 |
| G2MUL | 45,000 |
| G2MSM (base) | 45,000 |
| G2MSM (per point) | Discount schedule |
Pairing
| Operation | Gas Cost |
|---|---|
| Pairing (base) | 115,000 |
| Pairing (per pair) | 23,000 |
Hash-to-Curve
| Operation | Gas Cost |
|---|---|
| MAP_FP_TO_G1 | 5,500 |
| MAP_FP2_TO_G2 | 110,000 |
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
| Feature | BLS12-381 | BN254 |
|---|---|---|
| Security | 128-bit | ~100-bit |
| Mainnet | ❌ Not yet | ✅ Available |
| Pairing gas | 115,000 + 23,000/pair | 45,000 + 34,000/pair |
| Use case | Consensus layer | zkSNARKs, DeFi |
Related
- BLS12-381 Overview - Curve fundamentals
- BN254 Precompiles - Available on mainnet
- EIP-2537 - Full specification

