impl poseidon2 with plonky3 - #9
Merged
Merged
Conversation
Closed
lighter-zz
marked this pull request as ready for review
November 12, 2025 21:57
Merged
Closed
lighterabc
reviewed
Dec 8, 2025
lighterabc
reviewed
Dec 9, 2025
lighterabc
reviewed
Dec 9, 2025
lighterabc
reviewed
Dec 9, 2025
lighterabc
reviewed
Dec 9, 2025
lighterabc
approved these changes
Dec 9, 2025
* optimize poseidon2 * Merge branch 'zz/impl_poseidon2_with_plonky3' into zz/optimize_poseidon2 * finally faster than poseidon * clean up * update num_constants for poseidon * reverting add_canonical_u64 * Update hash.rs * Update hash.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements Poseidon2 hash function in Plonky2, adapted from the
zklighter-perps-circuits-plonkyrepository with additional hand-optimizations.It is split into two PRs: this one #9 and a follow up one #10. For the ease of reviewing.
Key Features
Performance (single permutation, GoldilocksField, width=12)
Notes
Poseidon2 implementation will be removed from
zklighter-perps-circuits-plonkyhttps://github.com/elliottech/zklighter-perps-circuits-plonky/pull/379Misc
Replace #8
Reason: #8 uses poseidon2 from horizon labs. this PR uses
zklighter-perps-circuits-plonky's version