Add Poseidon2 Goldilocks inline#1570
Draft
jay-clarke wants to merge 3 commits into
Draft
Conversation
Contributor
|
Warning This PR has more than 500 changed lines and does not include a spec. Large features and architectural changes benefit from a spec-driven workflow. If this PR is a bug fix, refactor, or doesn't warrant a spec, feel free to ignore this message. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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
Adds a new
jolt-inlines-poseidon2-goldilockscrate implementing the canonical 8-wide Poseidon2 permutation over the Goldilocks field as a Jolt inline.Spec:
specs/1570-poseidon2-goldilocks-inline.mdThe inline exposes a small guest API:
poseidon2_permute(&mut [u64; 8])The host side registers the inline with the Jolt tracer/prover through the existing
register_inlines!path and adds aPoseidon2Goldilocksentry toInlineExtension.Why
Poseidon2 over Goldilocks is commonly used inside proof systems for Merkle trees, commitments, and other ZK-native hashing paths. Running that permutation as ordinary guest Rust creates a much larger trace than an inline expansion. This adds a dedicated inline for the Plonky3-compatible Poseidon2-Goldilocks-8 instance.
Validation
cargo check -p jolt-inlines-poseidon2-goldilockscargo check -p jolt-inlines-poseidon2-goldilocks --features hostcargo test -p jolt-inlines-poseidon2-goldilocks --features hostcargo test -p jolt-riscvThe new tests cover:
u128arithmetic.Poseidon2Goldilocks<8>.Poseidon2path.Notes
The crate intentionally covers only the 8-wide Goldilocks instance. Other widths or fields can be added separately if they are useful.