Skip to content

refactor: replace transcript with spongefish NARG protocol#17

Open
shreyas-londhe wants to merge 3 commits intoa16z:mainfrom
shreyas-londhe:feat/spongefish-1-core
Open

refactor: replace transcript with spongefish NARG protocol#17
shreyas-londhe wants to merge 3 commits intoa16z:mainfrom
shreyas-londhe:feat/spongefish-1-core

Conversation

@shreyas-londhe
Copy link

@shreyas-londhe shreyas-londhe commented Mar 6, 2026

Summary

Replace Blake2b rolling-hash Fiat-Shamir transcript with spongefish duplex-sponge construction. Proofs become opaque NARG byte strings — no separate Proof struct.

Breaking change: Proof format is incompatible with previous versions. Old proofs will not verify with the new system.

Core changes

  • Add spongefish dependency (pinned to commit 45df37a7)
  • New ProverTranscript/VerifierTranscript traits for sponge API
  • CheckedProverState/CheckedVerifierState enforce declared InteractionPattern at runtime
  • Domain separator binds (sigma, zk) into sponge instance
  • Sub-protocol patterns (sigma1, sigma2, reduce rounds, scalar product) composed via scoped nesting

Removed

  • blake2b_transcript.rs, ark_proof.rs, proof.rs, VMVMessage

Added

  • domain.rs — domain separator + pattern builder with scoped composition
  • spongefish_codecs.rsProverTranscript/VerifierTranscript impls (macro-generated)

Tests & examples

  • All tests migrated to CheckedProverState/CheckedVerifierState + check_eof()
  • Soundness tests rewritten for byte-level NARG tampering
  • All 6 examples and bench updated to use dory_prover()/dory_verifier()
  • 78/78 tests pass

Replace Blake2b rolling-hash Fiat-Shamir transcript with spongefish's
duplex-sponge construction. Proofs become opaque NARG byte strings.

- Add spongefish dependency (pinned to commit 45df37a7)
- New ProverTranscript/VerifierTranscript traits for sponge API
- Domain separator with InteractionPattern enforcement via
  CheckedProverState/CheckedVerifierState
- Scoped pattern composition for sub-protocols (sigma1, sigma2,
  reduce rounds, scalar product)
- Remove Proof struct, blake2b transcript, ark_proof, VMVMessage
- Use macros in spongefish_codecs to reduce boilerplate
- Migrate all tests to CheckedProverState/CheckedVerifierState + check_eof()
- Rewrite soundness tests for byte-level NARG tampering
- Update serialization tests for NARG round-trip
- Update all examples and bench to use dory_prover()/dory_verifier()
Expose dory_pattern(&mut PatternBuilder, sigma, zk) as the single
public pattern function, matching the convention of other sub-protocol
patterns. Eliminates code duplication between standalone and composable
pattern builders.
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.

1 participant