lp: 4120 title: Baby Jubjub Twisted Edwards Curve description: EVM precompile for Baby Jubjub twisted Edwards curve arithmetic, defined over the BN254 scalar field so it is cheap inside BN254-based SNARK circuits author: Lux Core Team (@luxfi) discussions-to: https://github.com/luxfi/lps/discussions status: Final implementation-rust: none implementation-cpp: none implementation-go: shipped type: Standards Track category: Core tags: [evm, precompile, babyjubjub, classical-curve, zk, snarks]
- lp-4150
- lp-9015
Abstract
This LP specifies the Baby Jubjub twisted Edwards curve as an EVM precompile. Baby Jubjub is defined over the BN254 scalar field, which is what makes it useful: a point operation on Baby Jubjub is a handful of field operations in the field a BN254-based SNARK already works in, so the curve can be used inside a Groth16 or PLONK circuit at reasonable constraint cost. Circuits that need in-circuit signatures or in-circuit commitments reach for Baby Jubjub for exactly this reason — it is the curve used by circom's EdDSA gadget, by Polygon zkEVM, and by Hermez.
Specification
Address
0x0500000000000000000000000000000000000007 — Hashing/Curves range.
Interface
The operation selector is the first byte of input.
0x01 PointAdd: P1(64) + P2(64) -> P3(64)
0x02 ScalarMul: P(64) + scalar(32) -> P*s(64)
0x03 InCurve: P(64) -> bool(32)
Points are 64 bytes: x(32) + y(32), big-endian field elements over BN254 Fr.
Gas Schedule
| Operation | Gas |
|---|---|
| PointAdd | 2,000 |
| ScalarMul | 7,000 |
| InCurve | 500 |
Security Considerations
- Baby Jubjub's security is bounded by BN254 — roughly 100-bit discrete log. That is sufficient for SNARK-internal use, where the curve's job is to be arithmetized cheaply and the proof system carries the security argument. It is not sufficient for standalone, long-lived signatures. Do not use Baby Jubjub as an account signature curve.
- Points are validated on-curve before any operation. Invalid points return an error rather than a garbage point.
- Implementation uses the
gnark-cryptotwisted Edwards code.
References
- Barry WhiteHat et al., Baby Jubjub Elliptic Curve (EIP-2494)
- Source:
github.com/luxfi/precompile/babyjubjub/
Copyright
Copyright (C) 2024-2026, Lux Industries Inc. All rights reserved.
Licensed under the MIT License.