IntelligenceAlgorithmspairing-bn254
Pairings on BN254 (alt_bn128)
Bilinear pairings on the Barreto-Naehrig curve BN254, which Ethereum exposes as the alt_bn128 precompiles from EIP-196 and EIP-197. Most on-chain Groth16 and PLONK verifiers on Ethereum use it.
In short
What a quantum computer changes.
- Quantum effect
- Broken by Shor's algorithm
- Family
- Classical public keyRests on discrete logarithm in pairing groups.
- What it means
- Shor's algorithm, run on a large, fault-tolerant quantum computer, factors large numbers and solves discrete logarithms, including those on elliptic curves, far faster than any known classical method. The security of this algorithm rests on discrete logarithm in pairing groups, which is one of those problems. Anyone with such a machine could work out a private key from the matching public key. Signatures could then be forged, and data protected by a key exchange built on this algorithm could be decrypted, including traffic recorded now and kept for later. Longer keys do not fix this. The usual answer is to plan a move to a post-quantum or hybrid scheme.
This describes the family, not any project that uses it.
12 in the catalogue
Packages that provide it
| Package | Provides |
|---|---|
| @noble/curvesnpm | Pure TypeScript elliptic-curve library: ECDSA on secp256k1 and the NIST P curves, BIP340 Schnorr, Ed25519 and Ed448, X25519 and X448, ECDH, BLS signatures and pairings on BLS12-381 and BN254, FROST threshold signatures and the Poseidon hash. |
| ethereum-cryptographynpm | Collection of the primitives Ethereum uses: secp256k1, BN254 and BLS12-381 curves, Keccak, SHA-2, RIPEMD-160, BLAKE2b, PBKDF2, scrypt, AES, BIP-32, BIP-39 and random bytes. |
| snarkjsnpm | zkSNARK toolkit for Groth16, PLONK and FFLONK proving and verification over BN254 or BLS12-381, including powers of tau trusted setup ceremonies. |
| ffjavascriptnpm | Finite field and elliptic curve library used by snarkjs, with BN254 and BLS12-381 curve and pairing builders. |
| @aztec/bb.jsnpm | WebAssembly and native build of the Barretenberg prover with UltraHonk proving over BN254, Pedersen, Poseidon2 and BLAKE2s hashing, ECDSA on secp256k1 and P-256, Grumpkin Schnorr signatures and AES. |
| mcl-wasmnpm | WebAssembly build of the mcl pairing library, with BN254, BLS12-381 and other pairing curves and Ethereum consensus serialization. |
| @aptos-labs/ts-sdknpm | Aptos TypeScript SDK with Ed25519, secp256k1 and secp256r1 WebAuthn accounts, keyless accounts verified with Groth16 proofs over BN254 and Poseidon, and AES-GCM payload encryption. |
| ark-bn254crates.io | The BN254 pairing-friendly curve (fields, G1, G2 and pairing) for the arkworks ecosystem. |
| substrate-bncrates.io | Pure Rust pairing arithmetic on the BN254 (alt_bn128) Barreto-Naehrig curve, a Parity fork of the Zcash bn crate. |
| halo2curvescrates.io | Curves for halo2 provers: BN256 (BN254) with pairing, Grumpkin, Pasta, secp256k1, secp256r1 and others, implementing the zkcrypto ff, group and pairing traits. |
| revm-precompilecrates.io | EVM precompiled contracts for revm: ecrecover (secp256k1), P-256 verification (RIP-7212), SHA-256, RIPEMD-160, the BLAKE2 compression function, modexp, BN254 operations and pairing, BLS12-381 operations (EIP-2537) and KZG point evaluation (EIP-4844). |
| lambdaworks-mathcrates.io | Lambdaworks math for proof systems: finite fields, elliptic curves including BLS12-381 and BN254 with pairings, polynomials, FFT and multi-scalar multiplication. |
2 listed
Sources
- EIP-196: Precompiled contracts for addition and scalar multiplication on the elliptic curve alt_bn128eips.ethereum.orgRetrieved 3 December 2026
- EIP-197: Precompiled contracts for optimal ate pairing check on the elliptic curve alt_bn128eips.ethereum.orgRetrieved 3 December 2026
Full record
- Identifier
- pairing-bn254
- Kind
- pairing
- Family
- Classical public key
- Rests on
- discrete logarithm in pairing groups
- Quantum effect
- Broken by Shor's algorithm
Standards
No standard is listed for this algorithm.