feat: Easier to use Fiat-Shamir transcript#1
Open
Tabaie wants to merge 4 commits into
Open
Conversation
5 tasks
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.
Introduces a debug-friendly Fiat-Shamir transcript that does not require challenge names to be registered up front.
Each transcript records the protocol layout as it is used: challenge names, the number of bindings per challenge, and nested sub-protocol structure. That layout can be exported and supplied to a fresh transcript instance, which will then verify that calls happen in the same order and shape, returning readable errors on mismatches.
In tests, we export the layout from the prover transcript and replay it on the verifier transcript. In production this does not affect soundness, but it is mainly useful as a debugging and consistency check.
Note
Medium Risk
Replaces the Fiat–Shamir transcript implementation and alters how challenges are derived/bound in both prover and verifier, which can change challenge values and break proof compatibility if misused. The change is localized and covered by a new unit test, but it touches core cryptographic flow.
Overview
Adds a new
internal/fiatshamirtranscript that does not require pre-registering challenge names, and can optionally record and replay aProtocolLayout(including nested sub-protocol structure and expected binding counts) to produce readable mismatch errors.Updates prover and verifier to drop
gnark-crypto/fiat-shamirusage and instead derive challenges viaTranscript.Challenge(name, bindings...), binding commitments directly at challenge time (and binding setup root once up front). Adds a unit test that exports the prover-side layout and replays it on a verifier-side transcript to validate ordering and error behavior.Cleans up module dependencies (
go.mod/go.sum) by addingtestifyand pruning/transitively adjusting sums.Reviewed by Cursor Bugbot for commit 163cdbb. Bugbot is set up for automated code reviews on this repo. Configure here.