Documentation

CslibFrontier.Crypto.Protocols.BCS.ROM.KnowledgeSoundness

Adaptive straight-line random-oracle knowledge soundness of the BCS transform #

Defines the combined BCS execution bcsExecROM and the zero-rewinding straight-line knowledge soundness experiment bcsKnowledgeSoundnessGame (which extracts a candidate witness directly from the prover's pre-verifier Merkle query trace tr_P), and proves explicit non-asymptotic bounds on extraction failure (bcsROMKnowledgeSoundness_trace_bound, bcsROMKnowledgeSoundness_bound, bcsROMKnowledgeSoundness_bound_of_prover_verifier) from IOPRoundByRoundKnowledgeSoundness ([BSCS16]; compare [CY24], Theorem 26.1.1 and Construction 26.1.3, printed pp. 288–291, and Chapter 31, Definition 31.1.6 and Theorem 31.3.1).

Main definitions #

Main results #

References #

def Cslib.Crypto.Protocols.BCS.bcsExecROM {r d : ℕ} {Stmt Wit Sym Chal : Type} (iop : PublicCoinIOP r d Stmt Wit Sym Chal) (encSym : Sym → List Bool) (P : OracleComp (BCSROMSpec Stmt Chal) (Stmt × BCSProof r Sym)) :
OracleComp (BCSROMSpec Stmt Chal) ((Stmt × BCSProof r Sym) × Bool)

Combined prover-and-verifier execution in the two-channel BCS random-oracle model: runs P to obtain (x, prf) and then runs bcsVerifyROM iop encSym x prf, returning ((x, prf), ok).

theorem Cslib.Crypto.Protocols.BCS.isCostBounded_bcsFSCost_bcsExecROM {r d : ℕ} {Stmt Wit Sym Chal : Type} (iop : PublicCoinIOP r d Stmt Wit Sym Chal) (encSym : Sym → List Bool) {P : OracleComp (BCSROMSpec Stmt Chal) (Stmt × BCSProof r Sym)} {t_FS : ℕ} (hFS : OracleComp.IsCostBounded bcsFSCost P t_FS) :
theorem Cslib.Crypto.Protocols.BCS.isCostBounded_bcsMTCost_bcsExecROM {r d : ℕ} {Stmt Wit Sym Chal : Type} (iop : PublicCoinIOP r d Stmt Wit Sym Chal) (encSym : Sym → List Bool) {P : OracleComp (BCSROMSpec Stmt Chal) (Stmt × BCSProof r Sym)} {t_MT q_V : ℕ} (hMT : OracleComp.IsCostBounded bcsMTCost P t_MT) (hV : ∀ (x : Stmt) (prf : BCSProof r Sym), (x, prf) ∈ P.support → OracleComp.IsCostBounded bcsMTCost (bcsVerifyROM iop encSym x prf) q_V) :
noncomputable def Cslib.Crypto.Protocols.BCS.bcsKnowledgeSoundnessGame {r d : ℕ} {Stmt Wit Sym Chal : Type} [BEq Stmt] [BEq Chal] [Fintype Chal] [Nonempty Chal] (iop : PublicCoinIOP r d Stmt Wit Sym Chal) (rel : Stmt → Wit → Prop) (iopExtract : Stmt → (Fin r → OracleTable d Sym) → Wit) (encSym : Sym → List Bool) (decSym : List Bool → Sym) (defaultSym : Sym) (P : OracleComp (BCSROMSpec Stmt Chal) (Stmt × BCSProof r Sym)) (σ : ℕ) :

Straight-line BCS ROM knowledge soundness experiment (bcsKnowledgeSoundnessGame), run once in the memoized two-channel ROM bcsMemoize σ from the empty traces ([], []):

  1. the cheating prover P outputs (x, prf);
  2. the Merkle trace tr_P recorded so far (the prover's own queries) gives the candidate witness w := bcsExtractWitness iopExtract decSym defaultSym tr_P x prf.roots, straight-line from tr_P alone, before the verifier runs and with zero rewinding;
  3. bcsVerifyROM iop encSym x prf continues in the same oracle to obtain ok;
  4. the game outputs true iff ok = true and ¬ rel x w.
def Cslib.Crypto.Protocols.BCS.BCSExtractionFails {r d : ℕ} {Stmt Wit Sym Chal : Type} (rel : Stmt → Wit → Prop) (iopExtract : Stmt → (Fin r → OracleTable d Sym) → Wit) (decSym : List Bool → Sym) (defaultSym : Sym) :
((Stmt × BCSProof r Sym) × Bool) × BCSTraceState Stmt Chal → Prop

Straight-line extraction failure on an output (((x, prf), ok), (tr_MT, tr_FS)) of bcsExecROM under bcsMemoize σ: the verifier accepts (ok = true), but the witness bcsExtractWitness iopExtract decSym defaultSym tr_MT x prf.roots extracted from the Merkle trace tr_MT fails rel x.

theorem Cslib.Crypto.Protocols.BCS.bcsROMKnowledgeSoundness_trace_bound {r d : ℕ} {Stmt Wit Sym Chal : Type} [DecidableEq Stmt] [DecidableEq Chal] [Fintype Chal] [Nonempty Chal] {iop : PublicCoinIOP r d Stmt Wit Sym Chal} {rel : Stmt → Wit → Prop} {iopExtract : Stmt → (Fin r → OracleTable d Sym) → Wit} {doomed : Stmt → List (OracleTable d Sym × Chal) → Prop} {goodStep : Stmt → List (OracleTable d Sym × Chal) → OracleTable d Sym → Chal → Prop} (hks : IOPRoundByRoundKnowledgeSoundness iop rel iopExtract doomed goodStep) {ε_rbr : ENNReal} (hescape : ∀ (x : Stmt) (pref : List (OracleTable d Sym × Chal)) (π : OracleTable d Sym), doomed x pref → (Probability.PMF.uniformOfFintype Chal).toOuterMeasure {c : Chal | ¬goodStep x pref π c} ≤ ε_rbr) {encSym : Sym → List Bool} {decSym : List Bool → Sym} (hdec : Function.LeftInverse decSym encSym) (defaultSym : Sym) (σ : ℕ) {P : OracleComp (BCSROMSpec Stmt Chal) (Stmt × BCSProof r Sym)} {t_FS Q_MT : ℕ} (hFS : OracleComp.IsCostBounded bcsFSCost P t_FS) (hMT : OracleComp.IsCostBounded bcsMTCost (bcsExecROM iop encSym P) Q_MT) :
((OracleComp.interpret (bcsMemoize σ) (bcsExecROM iop encSym P)).run ([], [])).toOuterMeasure {out : ((Stmt × BCSProof r Sym) × Bool) × BCSTraceState Stmt Chal | BCSExtractionFails rel iopExtract decSym defaultSym out} ≤ ↑(t_FS + r) * (ε_rbr + ↑(t_FS + r) * (1 / ↑(Fintype.card Chal))) + ↑Q_MT * (↑(3 * Q_MT + r * (t_FS + r)) * (1 / 2 ^ σ))

Trace-level straight-line BCS ROM knowledge soundness bound: on a combined execution of bcsExecROM iop encSym P under bcsMemoize σ, the probability of BCSExtractionFails (the verifier accepts (x, prf) while the witness extracted from the final Merkle trace tr_MT fails rel x) is at most (t_FS + r) * (ε_rbr + (t_FS + r) * (1 / Fintype.card Chal)) + Q_MT * ((3 * Q_MT + r * (t_FS + r)) * (1 / 2 ^ σ)).

theorem Cslib.Crypto.Protocols.BCS.bcsROMKnowledgeSoundness_bound {r d : ℕ} {Stmt Wit Sym Chal : Type} [DecidableEq Stmt] [DecidableEq Chal] [Fintype Chal] [Nonempty Chal] {iop : PublicCoinIOP r d Stmt Wit Sym Chal} {rel : Stmt → Wit → Prop} {iopExtract : Stmt → (Fin r → OracleTable d Sym) → Wit} {doomed : Stmt → List (OracleTable d Sym × Chal) → Prop} {goodStep : Stmt → List (OracleTable d Sym × Chal) → OracleTable d Sym → Chal → Prop} (hks : IOPRoundByRoundKnowledgeSoundness iop rel iopExtract doomed goodStep) {ε_rbr : ENNReal} (hescape : ∀ (x : Stmt) (pref : List (OracleTable d Sym × Chal)) (π : OracleTable d Sym), doomed x pref → (Probability.PMF.uniformOfFintype Chal).toOuterMeasure {c : Chal | ¬goodStep x pref π c} ≤ ε_rbr) {encSym : Sym → List Bool} {decSym : List Bool → Sym} (hdec : Function.LeftInverse decSym encSym) (defaultSym : Sym) (σ : ℕ) {P : OracleComp (BCSROMSpec Stmt Chal) (Stmt × BCSProof r Sym)} {t_FS Q_MT : ℕ} (hFS : OracleComp.IsCostBounded bcsFSCost P t_FS) (hMT : OracleComp.IsCostBounded bcsMTCost (bcsExecROM iop encSym P) Q_MT) :
(bcsKnowledgeSoundnessGame iop rel iopExtract encSym decSym defaultSym P σ) true ≤ ↑(t_FS + r) * (ε_rbr + ↑(t_FS + r) * (1 / ↑(Fintype.card Chal))) + ↑Q_MT * (↑(3 * Q_MT + r * (t_FS + r)) * (1 / 2 ^ σ))

Adaptive straight-line BCS ROM knowledge soundness theorem (compare state-restoration knowledge soundness and direct extraction in [BSCS16] and [CY24], Theorem 26.1.1 and Construction 26.1.3, printed pp. 288–291, and the round-by-round reduction in [CY24], Chapter 31, Definition 31.1.6 and Theorem 31.3.1): under IOPRoundByRoundKnowledgeSoundness iop rel iopExtract doomed goodStep with per-round challenge escape probability ≤ ε_rbr, for any adaptive cheating prover P making at most t_FS Fiat–Shamir queries such that bcsExecROM iop encSym P makes at most Q_MT Merkle hash queries, the probability that bcsVerifyROM accepts (x, prf) while the straight-line witness bcsExtractWitness iopExtract decSym defaultSym tr_P x prf.roots (extracted from the prover's own Merkle trace tr_P with zero rewinding, before running the verifier) fails rel x is at most (t_FS + r) * (ε_rbr + (t_FS + r) * (1 / Fintype.card Chal)) + Q_MT * ((3 * Q_MT + r * (t_FS + r)) * (1 / 2 ^ σ)).

theorem Cslib.Crypto.Protocols.BCS.bcsROMKnowledgeSoundness_bound_of_prover_verifier {r d : ℕ} {Stmt Wit Sym Chal : Type} [DecidableEq Stmt] [DecidableEq Chal] [Fintype Chal] [Nonempty Chal] {iop : PublicCoinIOP r d Stmt Wit Sym Chal} {rel : Stmt → Wit → Prop} {iopExtract : Stmt → (Fin r → OracleTable d Sym) → Wit} {doomed : Stmt → List (OracleTable d Sym × Chal) → Prop} {goodStep : Stmt → List (OracleTable d Sym × Chal) → OracleTable d Sym → Chal → Prop} (hks : IOPRoundByRoundKnowledgeSoundness iop rel iopExtract doomed goodStep) {ε_rbr : ENNReal} (hescape : ∀ (x : Stmt) (pref : List (OracleTable d Sym × Chal)) (π : OracleTable d Sym), doomed x pref → (Probability.PMF.uniformOfFintype Chal).toOuterMeasure {c : Chal | ¬goodStep x pref π c} ≤ ε_rbr) {encSym : Sym → List Bool} {decSym : List Bool → Sym} (hdec : Function.LeftInverse decSym encSym) (defaultSym : Sym) (σ : ℕ) {P : OracleComp (BCSROMSpec Stmt Chal) (Stmt × BCSProof r Sym)} {t_MT t_FS q_V : ℕ} (hMT : OracleComp.IsCostBounded bcsMTCost P t_MT) (hFS : OracleComp.IsCostBounded bcsFSCost P t_FS) (hV : ∀ (x : Stmt) (prf : BCSProof r Sym), (x, prf) ∈ P.support → OracleComp.IsCostBounded bcsMTCost (bcsVerifyROM iop encSym x prf) q_V) :
(bcsKnowledgeSoundnessGame iop rel iopExtract encSym decSym defaultSym P σ) true ≤ ↑(t_FS + r) * (ε_rbr + ↑(t_FS + r) * (1 / ↑(Fintype.card Chal))) + ↑(t_MT + q_V) * (↑(3 * (t_MT + q_V) + r * (t_FS + r)) * (1 / 2 ^ σ))

Adaptive straight-line BCS ROM knowledge soundness (separate prover/verifier Merkle budgets on P.support): if P makes at most t_MT Merkle hash queries and t_FS Fiat–Shamir queries, and bcsVerifyROM iop encSym x prf makes at most q_V Merkle hash queries for outputs (x, prf) ∈ P.support, then bcsKnowledgeSoundnessGame fails straight-line witness extraction on an accepted proof with probability at most (t_FS + r) * (ε_rbr + (t_FS + r) * (1 / Fintype.card Chal)) + (t_MT + q_V) * ((3 * (t_MT + q_V) + r * (t_FS + r)) * (1 / 2 ^ σ)).