Skip to content
ecdsa.com
LegacyShort Weierstrass

alt_bn128

BN254 (alt_bn128) is the Barreto–Naehrig pairing curve built into Ethereum's precompiled contracts.

alt_bn128 is a short Weierstrass curve y² = x³ + ax + b over a 254-bit prime field with a 254-bit prime-order subgroup and cofactor 1; its estimated security level is 100 bits. Status: still secure, being phased out.

BN254 is y² = x³ + 3 over a 254-bit prime, from the family of pairing-friendly curves of Barreto and Naehrig (2005) with embedding degree 12. Its pairing maps G1 (points on this curve) and G2 (points on a twist over GF(p²)) into GF(p¹²), which is what zk-SNARK verifiers and aggregate signatures need.

Ethereum added precompiled contracts for addition, scalar multiplication and pairing checks on this curve in the Byzantium upgrade (EIP-196, EIP-197), and Groth16 and PLONK verifiers on Ethereum rely on these precompiles. Zcash's original Sprout circuits used it too.

Its security was estimated at 128 bits when it was chosen, but the extended tower number field sieve (Kim and Barbulescu, 2016) lowered the estimate to about 100 bits (Barbulescu and Duquesne, 2019). New designs use BLS12-381 instead.

Names in standards

StandardName
EIP-196alt_bn128
Barreto–NaehrigBN254
librariesBN256

Domain parameters

254-bit prime field · about 100-bit security

Field prime p
0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47
Coefficient a
0x0
Coefficient b
0x3
Base point x
0x1
Base point y
0x2
Order n of the base point
0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001
Cofactor h
0x1

Used in

  • Ethereum precompiles (EIP-196, EIP-197)
  • Groth16 and PLONK zk-SNARKs
  • Zcash Sprout (historical)

Standards and references

All curves