Skip to content

Add ERC-2494 compliant Baby Jubjub curve (continues #926) - #1123

Open
luksgrin wants to merge 9 commits into
arkworks-rs:masterfrom
luksgrin:baby-jubjub
Open

Add ERC-2494 compliant Baby Jubjub curve (continues #926)#1123
luksgrin wants to merge 9 commits into
arkworks-rs:masterfrom
luksgrin:baby-jubjub

Conversation

@luksgrin

@luksgrin luksgrin commented Jul 9, 2026

Copy link
Copy Markdown

Description

This PR adds a Circom-compatible Baby Jubjub Twisted Edwards curve (ark-babyjubjub) as specified in ERC-2494, and carries a stalled-but-accepted contribution across the finish line.

Lineage / credit (authorship preserved in the commit history):

This PR supersedes #926: it rebases @vasemkin's work onto current master and resolves the three items @Pratyush requested:

  • README: ark-babyjubjub is now listed in curves/README.md, with an explanation of how it differs from ark-ed-on-bn254: they are two representations of the same curve, related by an isomorphism, but ark-ed-on-bn254 uses the arkworks-normalized a = 1 form and its own generator, whereas ark-babyjubjub uses the exact ERC-2494 parameters (A = 168700, D = 168696) and standard base point (circom/iden3 compatible).
  • Literature tests: the worked test vectors from EIP-2494 are now explicit base-point order l), complementing the generated test_group! tests.
  • Build fix: declared the asm feature (mirroring ark-ed-on-bn254) so the crate builds on current master, where the MontConfig derive now emits a cfg(feature = "asm") gate that otherwise trips #![deny(warnings)].

cargo test -p ark-babyjubjub --all-features passes (61 tests).

Note: continues #926; there is no separate tracking issue: the accepted design is documented in the linked discussions above.


Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why.

  • Targeted PR against correct branch (master)
  • Linked to GitHub issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md (entry currently links to Add ERC-2494 compliant BabyJubJub #926; can be updated to this PR's number)
  • Re-reviewed Files changed in the GitHub PR explorer

vasemkin and others added 6 commits July 9, 2026 10:22
The `MontConfig` derive now emits a `cfg(feature = "asm")` gate; without
the feature declared, `#![deny(warnings)]` turns the unexpected-cfg lint
into a hard error. Mirror the `asm` feature from `ark-ed-on-bn254`.
Pin the implementation to the concrete worked examples from EIP-2494 (https://eips.ethereum.org/EIPS/eip-2494):
point addition, point doubling, curve membership, the base point being
8*G, and the base point having order l. Complements the generated
property-based `test_group!` tests.
…s README

Addresses review feedback on arkworks-rs#926: link the new crate from the curves
README and explain that ark-ed-on-bn254 and ark-babyjubjub are two
representations of the same curve (arkworks-normalized a=1 form vs. the
exact ERC-2494 parameters and base point).
@luksgrin
luksgrin requested review from a team as code owners July 9, 2026 08:37
@luksgrin
luksgrin requested review from WizardOfMenlo, weikengchen and z-tech and removed request for a team July 9, 2026 08:37
@luksgrin

luksgrin commented Jul 9, 2026

Copy link
Copy Markdown
Author

@Pratyush @vasemkin for vis 🙏

luksgrin added a commit to luksgrin/pedersen-py that referenced this pull request Jul 9, 2026
Core library + PyO3 binding members. ark-babyjubjub is pinned to the arkworks-rs/algebra#1123 commit (ERC-2494 Baby Jubjub) until it is published, with a [patch.crates-io] block unifying the arkworks graph on that revision.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants