Skip to content

Feat : Added parameter selection logic (Part 3)#9

Open
ocdbytes wants to merge 31 commits into
aj/zk-whir-3-2from
aj/zk-whir-3-3
Open

Feat : Added parameter selection logic (Part 3)#9
ocdbytes wants to merge 31 commits into
aj/zk-whir-3-2from
aj/zk-whir-3-3

Conversation

@ocdbytes

@ocdbytes ocdbytes commented May 7, 2026

Copy link
Copy Markdown
Owner

Introduces protocols/params/ — derives all per-sub-protocol Configs from one SecuritySpec + TuningSpec. Entry point: ProtocolConfig::derive(spec, tuning) returns a validated plan covering
every round (sumcheck + code-switch, with a per-round mask oracle in ZK) plus the basecase tail. PoW is wired into every FS-bound soundness slot; HVZK privacy error is tracked separately via
privacy_error_bits().

What's in this PR

protocols/params/:

  • spec.rs — SecuritySpec, TuningSpec + FoldingFactor, Mode { Standard, ZeroKnowledge }, DecodingRegime { Unique, Johnson, Capacity }, PowBudget { Forbidden, PerSlot }, ZkSpec phantom-typed
    witness, tagged newtypes (OodSampleBudget, MaskCodeMessageLen, LogInvRate, ListSize).
  • protocol_config.rs — ProtocolConfig (private fields + accessors), RoundConfig, RoundMode, MaskOracleConfig / MaskOracleInfo. Auto-validates PoW budget + cross-round chaining at construction.
  • derive.rs — unified build_round_config over both modes via RoundBuildMode. solve_t_ood handles the per-round OOD-sample search (STIR Lemma 4.5); build_mask_oracle assembles the ZK mask
    oracle (C_zk + mask-proximity, Construction 9.7).
  • regime.rs — DecodingRegimeParams carrying materialized slack for each regime + analytic helpers (list size, ε_mca, OOD security bits, 1 − δ).
  • bounds.rs, error.rs — shared analytic primitives and the DeriveError taxonomy.
  • Sub-protocol solvers — each owns its own analytic_error_bits + solve: basecase (Lemma 7.4 γ-combination), sumcheck (Lemma 6.5), code_switch (Lemma 9.9), mask_proximity (Lemma 7.4, ZK-only),
    irs_commit (RS mask sized at in_domain + t_ood per Construction 9.7 / Definition 3.16 / Proposition 3.19). sumcheck::solve and code_switch::solve share the params::SolveMode { Standard,
    ZeroKnowledge { mask_oracle } } enum.
  • test_utils.rs — shared fixtures: test fields/embeddings, deterministic + proptest spec generators, build_round_io (self-consistent (source, target, t_ood) triple), assert_pow_closes_gap.

References

Next

Protocol wiring.

@ocdbytes ocdbytes marked this pull request as ready for review May 12, 2026 22:46
@ocdbytes ocdbytes requested a review from Bisht13 May 13, 2026 03:26
@ocdbytes ocdbytes changed the title Feat : Added parameter selection logic for sumcheck and IRS commit protocol (Part 3) Feat : Added parameter selection logic (Part 3) May 15, 2026
Comment thread src/protocols/params/protocol_config.rs Outdated
Comment thread src/protocols/params/derive.rs Outdated
Comment thread src/protocols/params/basecase.rs
Comment thread src/protocols/params/protocol_config.rs Outdated
Comment thread src/protocols/params/derive.rs Outdated
Comment thread src/protocols/params/protocol_config.rs
Comment thread src/protocols/params/protocol_config.rs Outdated
Comment thread src/protocols/params/code_switch.rs Outdated
assert!(matches!(config.mode, code_switch::CodeSwitchMode::Standard));
}

/// Placeholder mask-oracle list size for the smoke test. Pow2 keeps

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prove() mutates the covector/state transition, but verify() only returns the target commitment. Please return structured verifier output containing the updated claim/state needed for composition.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already done in the protocol wiring PR

Comment thread src/protocols/params/bounds.rs Outdated
Comment thread src/protocols/params/code_switch.rs
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.

2 participants