Skip to content

Add an opt-in BabyBear Poseidon2 permutation precompile - #532

Open
ex10ded wants to merge 1 commit into
circlefin:mainfrom
x10xchange:feat/poseidon2-babybear-precompile
Open

ex10ded wants to merge 1 commit into
circlefin:mainfrom
x10xchange:feat/poseidon2-babybear-precompile

Conversation

@ex10ded

@ex10ded ex10ded commented Dec 4, 2026

Copy link
Copy Markdown

This PR adds native support for Poseidon2, a modern cryptographic permutation designed for efficient hashing in zero-knowledge proof systems. Verifiers that use Poseidon2 can call it directly from EVM contracts, lowering the gas cost of checking proofs on Arc.

This is especially useful for applications pursuing post-quantum security. Hash-based proof systems such as STARKs can verify computation without relying on elliptic-curve pairings, but checking their Merkle commitments on-chain requires repeated hashing. In a local Arc benchmark, accelerating Poseidon2 alone reduced the gas required to verify the same proof by 46.4%.

The precompile delegates the permutation and field arithmetic to Plonky3, using its published parameters and round constants. The Arc-specific code handles input validation, gas accounting and encoding the result. We pin Plonky3 to version 0.4.3 and check the output against a known-answer test vector. Least Authority’s independent 2024 audit of an earlier Plonky3 revision included both Poseidon2 and BabyBear field arithmetic. [Audit report, p. 5](https://leastauthority.com/wp-content/uploads/2024/11/Updated_071124_Polygon_Plonky3_Final_Audit_Report.pdf#page=5)

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