Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article covers ERC-2494, which proposes Baby Jubjub to make elliptic curve cryptography safe and efficient inside Ethereum zk-SNARK circuits.
This article translates, summarizes, and expands on the following material.
I have also written about a range of other EIPs.
Overview
ERC-2494 defines Baby Jubjub, an elliptic curve for use inside Ethereum zk-SNARK circuits.
Ethereum uses the alt_bn128 (BN254) curve for zk-SNARK verification. Although this curve is suitable for generating and verifying zk-SNARK proofs, its arithmetic is not natively suited to elliptic curve cryptography inside the zk-SNARK circuit.
Baby Jubjub is defined over the field corresponding to the prime order of BN254 and enables elliptic curve operations inside the circuit, such as Pedersen hashing and EdDSA signatures.
This makes it possible to build advanced cryptographic functionality using zero-knowledge proofs in Ethereum smart contracts.
Motivation
Scalability (processing capacity) and privacy (keeping transaction details confidential) are two barriers to wider blockchain adoption.
Zero-knowledge proofs (ZKPs) offer a way to address both. In particular, zk-SNARK proofs have properties that make them suitable for Ethereum.
- Non-interactive: only one message is needed.
- Very small proofs.
- Fast verification.
Smart contracts can act as zk-SNARK verifiers. Anyone can generate a proof off-chain and submit it in a transaction; the contract then verifies it automatically and executes logic based on the result.
This can improve privacy and scalability.
However, the BN254 curve used in Ethereum's existing zk-SNARK implementations supports proof verification but does not provide native elliptic curve arithmetic inside the circuit for operations such as Pedersen hashes and EdDSA signatures.
The reason is that the curve needed for those operations must be defined over the same finite field as the zk-SNARK circuit.
This is why Baby Jubjub was proposed.
It is defined over and enables elliptic curve cryptography inside zk-SNARK circuits.
This supports more advanced uses of ZKPs, such as zk-rollups for scalability and transaction processing that protects confidential information.
Specification
Definition
Baby Jubjub is a twisted Edwards curve defined over the finite field .
The finite field has prime order and contains elements, with the four arithmetic operations defined (division by zero excluded).
The proposal uses the following large prime.
The curve is given by the equation below.
Here, and .
Baby Jubjub consists of the -rational points on this curve, meaning points whose coordinates belong to .
Curve Order
The set of all points on the Baby Jubjub curve has the following order (total number of points).
The order factors as follows.
The cofactor is the ratio of the order to the prime and describes a structural property of the curve.
- (cofactor)
- $ l = 2736030358979909402780800718157159386076813972158567259200215660948447373041$ (a 251-bit prime)
Generator Point
The specification defines a point that generates all points on the curve.
Repeatedly adding this point produces every point on the curve.
Base Point
The specification also defines a base point that generates the prime-order subgroup of order (whose points satisfy ).
This point serves as the base for cryptographic algorithms such as EdDSA.
Arithmetic
Given two points with coordinates and , point addition on Baby Jubjub is calculated as follows.
The same formulas work for both point addition and doubling, simplifying the implementation. All operations take place over the finite field .
These properties make Baby Jubjub a foundation for efficient and secure elliptic curve arithmetic inside zk-SNARK circuits.
In particular, they enable cryptographic operations such as Pedersen hashing and EdDSA that are not native to the circuit when using Ethereum's existing alt_bn128 curve.
Additional Details
Baby Jubjub was designed to support secure and efficient elliptic curve cryptography inside zk-SNARK circuits. Three factors shaped the choice of curve: curve form, generation process, and security criteria.
Curve Form
Baby Jubjub is a twisted Edwards curve that is birationally equivalent to a Montgomery curve. There are several reasons for choosing this form.
First, EdDSA (Edwards-curve Digital Signature Algorithm) is based on twisted Edwards curves, so this form simplifies signature algorithm implementation.
In addition, twisted Edwards curves allow point addition to use a single complete formula, making group operations efficient inside circuits.
The curve can also be converted to Montgomery form, which can make point addition and doubling faster.
An implementation can therefore use Montgomery form outside the circuit and twisted Edwards form inside it for efficiency.
Curve Generation Process
To reduce the risk of backdoors (deliberately introduced weaknesses), the generation process for Baby Jubjub is transparent and deterministic.
It follows the criteria defined in Appendix A.1 of RFC 7748, using a procedure that anyone can reproduce.
Given a prime , the procedure searches for the smallest satisfying the following conditions.
- is divisible by 4.
- The Montgomery curve has cofactor 8.
The input is the order of the alt_bn128 curve used by Ethereum for zk-SNARK verification. The procedure yields .
The curve was converted from Montgomery form to twisted Edwards form, and Sage was used to verify the order .
The generator was chosen as the point of order with the smallest positive coordinate. The base point was defined as , giving it order .
Security Criteria
Baby Jubjub is intended to resist known attacks on elliptic curves.
The curve was therefore required to meet the SafeCurves project's security criteria, which assess curves against the best known attack methods. The proposal reports that Baby Jubjub meets these criteria.
Compatibility
Baby Jubjub is a twisted Edwards curve, but it can be mapped to other curve forms through birational transformations.
In practice, Baby Jubjub has been used mainly in three forms.
- Standard
Twisted Edwardsform Montgomeryform- Reduced
Twisted Edwardsform
These are different coordinate representations of the same curve, with explicit formulas for converting between them.
Three Curve Forms
Twisted Edwards Form (Standard)
The equation is as follows.
The parameters are and .
This is the standard representation of Baby Jubjub, with a generator point for the entire curve and a base point that generates the subgroup of order .
Montgomery Form
The equation is as follows.
The parameters are and .
Montgomery form supports efficient elliptic curve arithmetic, particularly doubling, making it suitable for computation outside the circuit and for certain algorithms.
Reduced Twisted Edwards Form
The equation is as follows.
The parameter , and this representation scales the coordinates of the standard form. Some cryptographic algorithms use this form to improve efficiency.
Converting Between Forms
Coordinate transformations allow conversion between the three forms.
Let denote the coordinates in Montgomery form, those in standard Twisted Edwards form, and those in reduced Twisted Edwards form.
Some transformations use a scaling factor .
Its negative is as follows.
The main transformations are listed below.
- Montgomery → Twisted Edwards
- Twisted Edwards → Montgomery
- Montgomery → Reduced Twisted Edwards
- Reduced Twisted Edwards → Montgomery
- Twisted Edwards → Reduced Twisted Edwards
- Reduced Twisted Edwards → Twisted Edwards
These conversions preserve the mathematical structure of Baby Jubjub while allowing an implementation to choose a representation that suits its algorithm and execution environment.
This improves efficiency both inside and outside circuits and maintains compatibility with existing implementations and different libraries.
Security
The security of Baby Jubjub was assessed using SafeCurves, a widely recognized set of criteria for elliptic curve cryptography.
The criteria cover resistance to known attacks and security properties relevant to cryptographic implementations.
The major checks performed on Baby Jubjub are described below.
Curve Parameter Validation
First, the parameters in the specification were checked to ensure they define a valid elliptic curve over the finite field . The checks cover the following conditions.
- is prime.
- The values of and correctly define the elliptic curve equation.
- The product of the cofactor and the prime equals the curve order .
- The generator point generates the entire curve.
- is prime and the base point has order .
Difficulty of the Discrete Logarithm Problem
Elliptic curve cryptography relies on the difficulty of the elliptic curve discrete logarithm problem (ECDLP).
Baby Jubjub was checked for sufficient resistance to the following known attacks.
- Rho method
- The computational cost is additions, which amounts to at least operations.
- Additive and multiplicative transfer attacks
- The embedding degree is at least .
- Complex multiplication discriminant attacks
- The magnitude of the discriminant of the complex multiplication field exceeds .
Implementation Security
Baby Jubjub also meets several security requirements relevant to cryptographic implementations.
- Montgomery Ladder
- Supports the Montgomery ladder, a scalar multiplication method that can help implementations resist side-channel attacks.
- Twist security
- Provides resistance to small-subgroup, invalid-curve, and twist attacks.
- Completeness
- The point addition and doubling formulas are complete, so they do not encounter exceptional cases for valid inputs.
- Indistinguishability
- A mapping is available to represent elliptic curve points in a form indistinguishable from random strings.
References
Barry WhiteHat (@barryWhiteHat), Marta Bellés (@bellesmarta), Jordi Baylina (@jbaylina), "ERC-2494: Baby Jubjub Elliptic Curve [DRAFT]," Ethereum Improvement Proposals, no. 2494, January 2020. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-2494.
Conclusion
This article covered ERC-2494, which proposes Baby Jubjub for secure and efficient elliptic curve cryptography inside Ethereum zk-SNARK circuits.
If you have any questions, feel free to send me a direct message on Twitter.
I also publish content on the following platforms.



