Skip to content

feat(stir): implement STIR protocol as alternative to DEEP-FRI (OPT-S1→S7)#1

Merged
nol4lej merged 2 commits into
mainfrom
feat/phase5-stir-opt-s7
Mar 21, 2026
Merged

feat(stir): implement STIR protocol as alternative to DEEP-FRI (OPT-S1→S7)#1
nol4lej merged 2 commits into
mainfrom
feat/phase5-stir-opt-s7

Conversation

@nol4lej
Copy link
Copy Markdown
Member

@nol4lej nol4lej commented Mar 21, 2026

Protocol & Core

  • Add src/stir.rs: StirProver, StirVerifier, StirRound, StirInnerProof
  • Optimize lagrange_eval_at_coset with batch_inverse (Montgomery trick)
  • Add phase_time! macro + HYPER_SNARK_PHASE_TIMING instrumentation (5 timing points)
  • deep_fri.rs: add FriFoldProof::Stir, runtime protocol dispatch
  • config.rs: PROOF_VERSION=18, STIR_QUERY_ROUNDS, active_protocol()

Proof Header (self-describing)

  • proof.rs: embed num_queries and pow_bits in Proof struct
  • verifier.rs: read pow_bits/num_queries from proof, not env vars

Size Optimizations

  • merkle.rs: truncate BLAKE3 digests 24B → 16B (OPT-S1, PROOF_VERSION=12)
  • config.rs: compact profile 15q+30PoW (OPT-S2, PROOF_VERSION=13)
  • folding.rs / fri.rs / domain.rs: fold-by-8 FRI (OPT-S3, PV=15), reverted in PV=17

Tests

  • zk_tests.rs: e2e STIR tests, tampering rejection, STIR < DEEP-FRI size
  • Mutex to serialize HYPER_SNARK_PROTOCOL env-var tests
  • merkle_tests.rs / unit_merkle_tests.rs: updated for 128-bit digests

Scripts & Docs

  • profile-prover.sh: stir / dfri / stir-dfri modes
  • docs/timeline/phase-5_proof-size-footprint.md: OPT-S1→S7 results documentd

Fix clippy: doc_lazy_continuation, too_many_arguments, needless_range_loop

nol4lej added 2 commits March 21, 2026 13:05
…1→S7)

Protocol & Core
- Add src/stir.rs: StirProver, StirVerifier, StirRound, StirInnerProof
- Optimize lagrange_eval_at_coset with batch_inverse (Montgomery trick)
- Add phase_time! macro + HYPER_SNARK_PHASE_TIMING instrumentation (5 timing points)
- deep_fri.rs: add FriFoldProof::Stir, runtime protocol dispatch
- config.rs: PROOF_VERSION=18, STIR_QUERY_ROUNDS, active_protocol()

Proof Header (self-describing)
- proof.rs: embed num_queries and pow_bits in Proof struct
- verifier.rs: read pow_bits/num_queries from proof, not env vars

Size Optimizations
- merkle.rs: truncate BLAKE3 digests 24B → 16B (OPT-S1, PROOF_VERSION=12)
- config.rs: compact profile 15q+30PoW (OPT-S2, PROOF_VERSION=13)
- folding.rs / fri.rs / domain.rs: fold-by-8 FRI (OPT-S3, PV=15), reverted in PV=17

Tests
- zk_tests.rs: e2e STIR tests, tampering rejection, STIR < DEEP-FRI size
- Mutex to serialize HYPER_SNARK_PROTOCOL env-var tests
- merkle_tests.rs / unit_merkle_tests.rs: updated for 128-bit digests

Scripts & Docs
- profile-prover.sh: stir / dfri / stir-dfri modes
- docs/timeline/phase-5_proof-size-footprint.md: OPT-S1→S7 results documentd

Fix clippy: doc_lazy_continuation, too_many_arguments, needless_range_loop
@nol4lej nol4lej merged commit 599dfd0 into main Mar 21, 2026
4 checks passed
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