Computational zero-knowledge interactive proofs for NP #
This module defines computational zero-knowledge interactive proofs (ZKProof enc A soundness)
bundling uniform GenerableZeroKnowledge only (zero knowledge restricted to (instance, witness)
families generated from 1^n in deterministic polynomial time, #6044, rather than Goldreich's
auxiliary-input GMW zero knowledge of [Gol98], Definition 4.3.8 and
Theorem 4.4.10, proved under nonuniform one-way functions in
NonuniformOneWay.exists_zkProof_of_mem_NP), alongside the separate general predicate
AuxiliaryInputZeroKnowledge over arbitrary polynomially bounded valid families. Goldreich,
Micali, and Wigderson [GMW91] introduced zero-knowledge interactive proofs
for NP from bit commitments; here we construct the single-session masked-3SAT ZKProof system,
with soundness 1 / 3 and uniform GenerableZeroKnowledge (#6044), for ThreeSAT and for every
language Karp-reducible to it using Naor's bit commitment scheme [Nao91]
(CslibFrontier.Crypto.Computational.Commitment). Sequential repetition to negligible soundness is
in CslibFrontier.Crypto.Computational.ZeroKnowledge.Amplification. The statements compare the
real view zkRealView with the simulator's output against distinguishers of type
ZKDistinguisher, both from CslibFrontier.Crypto.Computational.ZeroKnowledge.View.
Protocol design and source credit #
While the theorem that every language in NP has a computational zero-knowledge interactive proof
system from one-way functions is due to Goldreich, Micali, and Wigderson
[GMW91] using Naor's commitment scheme [Nao91], the concrete underlying
ThreeSAT protocol formalized in CslibFrontier.Crypto.Computational.GMW is a direct 3-copy
masked-3SAT truth-table commitment protocol rather than GMW's original 3-coloring protocol:
each of 3 parallel copies commits to a random variable mask, the XOR-masked assignment, and the
8-entry masked truth table of each clause, and a random 3-bit challenge selects for each copy
whether to open the mask and full truth tables or the masked assignment and the active truth-table
entries.
Restricted versus general auxiliary-input zero-knowledge and witness conventions #
- Restricted polynomial-time-generable zero-knowledge (
GenerableZeroKnowledge,ZKProof.zero_knowledge,ZKProof.generableZeroKnowledge). Matching the library's uniform strict-PPT cryptographic conventions (ComputationallyIndistinguishable),GenerableZeroKnowledgequantifies over uniform strict oracle PPT malicious verifiersVstar(producing one efficient witness-free simulatorSperVstarbefore the choice of families) and deterministic polynomial-time-generable families of instancesa : ℕ → α, valid witnessesw : ℕ → List Bool(∀ n, isWitness (a n) (w n) = true), and auxiliary inputsz : ℕ → List Bool(ComputableInPolyTime · encUnary _). Fixed-instance zero-knowledge (ZKProof.zero_knowledge_const) is an immediate corollary for constant familiesfun _ => aandfun _ => w. - General auxiliary-input zero-knowledge (
AuxiliaryInputZeroKnowledge,ZKProof.AuxiliaryInputZeroKnowledge). Quantifies over the same uniform strict oracle PPT malicious verifiersVstarand chooses one efficient witness-free simulatorSperVstarbefore the choice of families, and then ranges over arbitrary polynomially bounded families of instancesa : ℕ → α, valid witnessesw : ℕ → List Bool, verifier auxiliary inputsz : ℕ → List Bool, and distinguisher auxiliary inputsz' : ℕ → List Bool(PolynomiallyBounded), against all full-input uniform strict PPT distinguishersadversarycharged for the complete encoded input((1^n, (a n, z' n)), view). Every system satisfyingAuxiliaryInputZeroKnowledgesatisfiesGenerableZeroKnowledge(AuxiliaryInputZeroKnowledge.generableZeroKnowledge), and lifts via the prefix-clock bridge inCslibFrontier.Crypto.Computational.ZeroKnowledge.AuxClockto unbounded auxiliary input (UnboundedAuxiliaryInputZeroKnowledge,InstanceAuxiliaryInputZeroKnowledge). As steps toward the GMW theorem, the GMW proof systems satisfyZKProof.AuxiliaryInputZeroKnowledgeunder the advice-PRG premiseGMW.AdvicePRG(PseudorandomGenerator.auxiliaryInputZeroKnowledge_singleZKProofOfReduction_of_advicePRG,PseudorandomGenerator.auxiliaryInputZeroKnowledge_singleZKProofThreeSAT_of_advicePRG, fromGMW.gmwView_negligible_of_advice_prg). That premise is novel to this library: it follows from a nonuniform PRG (NonuniformPRG.advicePRG) and is not known to follow from a uniform PRG or one-way function. The library's GMW theorem isNonuniformOneWay.exists_zkProof_of_mem_NP. - Bundled witness relation (
ZKProof.isWitness).ZKProofbundles its own polynomial-time witness predicateisWitness : α → List Bool → BoolcharacterizingA(mem_iff_exists_witness). No witness-length bound is imposed, soisWitnessby itself need not be anNPrelation; membership inIP(ZKProof.mem_IP) does not need one, and inzero_knowledgethe witness familyw : ℕ → List Boolis polynomial-time-generable in1^n. InPseudorandomGenerator.singleZKProofOfReduction, the bundled predicateisWitness a w := ThreeSAT.verifier (f a, w)checks aThreeSATwitness for the Karp-reduced formulaf arather than a witness for the originalNPverifier ofA.
Main definitions #
Cslib.Crypto.GenerableZeroKnowledge: uniform computational zero-knowledge over deterministic polynomial-time-generable instance, valid-witness, and auxiliary-input families.Cslib.Crypto.AuxiliaryInputZeroKnowledge,Cslib.Crypto.ZKProof.AuxiliaryInputZeroKnowledge: general auxiliary-input computational zero-knowledge over arbitrary polynomially bounded valid families against full-input uniform strict PPT distinguishers.Cslib.Crypto.ZKProof: an interactive proof system for a languageAbundling a uniform strict oracle PPT verifier, an honest prover with a uniform strict PPT interaction realization, perfect completeness, soundnesssoundness nagainst unbounded provers, and uniformGenerableZeroKnowledgeonly (#6044).Cslib.Crypto.PseudorandomGenerator.singleZKProofOfReduction,Cslib.Crypto.PseudorandomGenerator.singleZKProofThreeSAT: single-session masked-3SATZKProofbuilders with soundness1 / 3and uniformGenerableZeroKnowledgeonly (#6044) for any language Karp-reducible toThreeSATand forThreeSATitself.
Main results #
Cslib.Crypto.AuxiliaryInputZeroKnowledge.generableZeroKnowledge,Cslib.Crypto.ZKProof.AuxiliaryInputZeroKnowledge.generableZeroKnowledge: general auxiliary-input zero-knowledge implies poly-time-generable zero-knowledge.Cslib.Crypto.ZKProof.isInteractiveProof,Cslib.Crypto.ZKProof.mem_IP: every language with aZKProofwhose soundness bound is at most1 / 3at some security parameter belongs toIP.Cslib.Crypto.ZKProof.zero_knowledge_const,Cslib.Crypto.ZKProof.AuxiliaryInputZeroKnowledge.zero_knowledge_const: fixed-instance computational zero-knowledge.PseudorandomGenerator.auxiliaryInputZeroKnowledge_singleZKProofOfReduction_of_advicePRG,PseudorandomGenerator.auxiliaryInputZeroKnowledge_singleZKProofThreeSAT_of_advicePRG: steps: generalAuxiliaryInputZeroKnowledgefor the single-session GMW proof systems under the advice-PRG premiseGMW.AdvicePRG, which is novel to this library.
References #
- O. Goldreich, S. Micali, A. Wigderson, Proofs that Yield Nothing But Their Validity, or All Languages in NP Have Zero-Knowledge Proof Systems
- M. Naor, Bit Commitment Using Pseudorandomness
- O. Goldreich, Foundations of Cryptography (1998 fragments, v2.03), Definition 4.3.8 (pp. 151–152) and Theorem 4.4.10 (pp. 175–176).
- S. Arora, B. Barak, Computational Complexity: A Modern Approach, Chapter 9.
Restricted versus general auxiliary-input zero-knowledge predicates #
Uniform computational zero-knowledge restricted to (instance, witness) and auxiliary-input
families generated from 1^n in deterministic polynomial time (#6044), rather than auxiliary-input
zero knowledge over arbitrary inputs ([Gol98], Definition 4.3.8).
For every uniform strict oracle PPT malicious verifier Vstar (taking security parameter n,
instance a, and auxiliary input z, charged for the complete encoded input (1^n, (a, z))),
there exists a single uniform strict PPT witness-free simulator S (chosen before the families and
charged for (1^n, (a, z))) whose output ensemble is computationally indistinguishable from the
real interaction output across all deterministic polynomial-time-generable families of instances
a : ℕ → α, valid witnesses w : ℕ → List Bool (∀ n, isWitness (a n) (w n) = true), and
auxiliary inputs z : ℕ → List Bool (ComputableInPolyTime · encUnary _).
This notion is novel to this library, and incomparable with [Gol98],
Definition 4.3.8, pp. 151–152. It is weaker in ranging only over families generated from 1^n in
deterministic polynomial time, where the source quantifies over all instances, witnesses and
auxiliary inputs; the distinguisher receives only n and a sample, from which it can compute those
families itself. It is stronger in decoupling the security parameter from the instance, as
AuxiliaryInputZeroKnowledge does: every party runs in time polynomial in n and the gap is
negligible in n, so on generable instances much shorter than n the prover must withstand
verifiers and distinguishers that run in time superpolynomial in the instance length.
Relation to standard assumptions. It follows from AuxiliaryInputZeroKnowledge
(AuxiliaryInputZeroKnowledge.generableZeroKnowledge). Unlike that notion, it is not shown to
imply the library's instance-indexed form of Definition 4.3.8,
InstanceAuxiliaryInputZeroKnowledge, since it covers only generable families.
Why it is plausible. Every ZKProof carries it, and
OneWay.exists_generableZKProof_of_mem_NP builds a ZKProof with uniform GenerableZeroKnowledge
only (#6044; auxiliary-input GMW is NonuniformOneWay.exists_zkProof_of_mem_NP) for every language
in NP from any uniform one-way function.
General auxiliary-input computational zero-knowledge for arbitrary polynomially bounded
valid families.
For every uniform strict oracle PPT malicious verifier Vstar (charged for its complete encoded
input (1^n, (a, z))), there exists a single uniform strict PPT witness-free simulator S
(chosen before the families and distinguisher, charged for (1^n, (a, z))) such that for all
arbitrary polynomially bounded families of instances a : ℕ → α, valid witnesses
w : ℕ → List Bool (∀ n, isWitness (a n) (w n) = true), verifier auxiliary inputs
z : ℕ → List Bool, and distinguisher auxiliary inputs z' : ℕ → List Bool, and for every
uniform strict PPT distinguisher adversary (charged for its complete encoded input
((1^n, (a, z')), view)), the distinguishing advantage between the real interaction view and the
simulated view is negligible.
This notion is novel to this library. It strengthens [Gol98], Definition 4.3.8, pp. 151–152, which compares, as here, the malicious verifier's output with the simulator's, in two ways.
- The distinguisher's auxiliary input
z'is chosen independently of the verifier'sz, while the verifier is clocked in, and may read, all ofz. The source gives the distinguisher the verifier'sz(p. 152), the casez' = zhere. It obtains independent advice for the distinguisher only by hiding it in a padding ofzthat the verifier and simulator, clocked in|x|, cannot reach (pp. 152–153), and that fails for a verifier that reads all ofz. - The security parameter is decoupled from the instance. The source indexes its ensembles by the
instance
x, admits auxiliary inputs of every length, clocks the verifier, simulator and distinguisher in|x|alone and measures the gap in|x|. Here every party also receivesnin unary, the instances, witnesses and auxiliary inputs are polynomially bounded families indexed bynand clocked as part of the input, and the gap is negligible inn. So on instances much shorter thann, the prover must withstand verifiers and distinguishers that run in time superpolynomial in|x|.
The prover's private input ranges over valid witnesses (isWitness), where the source's ranges
over every string with which the prover meets the completeness condition. That weakens the notion
but does not offset the two strengthenings.
Relation to standard assumptions. It implies the library's instance-indexed form,
InstanceAuxiliaryInputZeroKnowledge, which follows the source's indexing, clocks and
distinguisher input, with the prover's security parameter set to |x|
(AuxiliaryInputZeroKnowledge.instanceAuxiliaryInputZeroKnowledge). It also implies
UnboundedAuxiliaryInputZeroKnowledge and GenerableZeroKnowledge.
Why it is plausible. From any nonuniformly one-way function, the library's
Goldreich–Micali–Wigderson theorem NonuniformOneWay.exists_zkProof_of_mem_NP builds a proof
system with this property for every language in NP. Its commitments use generator seeds of length
n + 7, set by the security parameter rather than by the instance.
General auxiliary-input zero-knowledge implies poly-time-generable zero-knowledge.
Every deterministic polynomial-time-generable family has polynomially bounded encoded output length,
and every unary-indexed ComputationallyIndistinguishable distinguisher lifts to a full-input
distinguisher by ignoring the extra (a, z) component.
Under GenerableZeroKnowledge, any full-input uniform strict PPT distinguisher
adversary n (a n) (z n) also has negligible distinguishing advantage on deterministic
polynomial-time-generable families a, w, z, since (a n, z n) can be recomputed from 1^n.
Bundled computational zero-knowledge proof systems #
Interactive proof system for a language A : Set α (with instance encoding
enc : α ↪ List Bool), indexed by a security parameter n : ℕ, with soundness bound
soundness : ℕ → ENNReal, bundling uniform GenerableZeroKnowledge only (#6044; general
auxiliary-input zero knowledge over arbitrary inputs, cf. [Gol98],
Definition 4.3.8, is stated separately as ZKProof.AuxiliaryInputZeroKnowledge).
The single-session masked-3SAT builders have soundness := fun _ => 1 / 3; sequential repetition
gives fun n => (1 / 3) ^ (k n)
(CslibFrontier.Crypto.Computational.ZeroKnowledge.Amplification).
verifier n a: the honest verifier's interactive program on security parameternand instancea, certified uniform strict oracle PPT in(1^n, a)byisOraclePPT_verifier.prover n a w: the honest prover strategy on security parametern, instancea, and witnessw, certified efficient byinteract,eval_interact, andisPPT_interact.isWitness a w: the bundled polynomial-time witness predicate characterizing membership inA(mem_iff_exists_witness). No witness-length bound is imposed, soisWitnessby itself need not be anNPrelation (inzero_knowledge,wis polynomial-time-generable in1^n). When constructed via a Karp reductionf : α → CNF ℕtoThreeSAT(PseudorandomGenerator.singleZKProofOfReduction),isWitness a wisThreeSAT.verifier (f a, w), checking aThreeSATwitness forf a.completeandsound: completeness1for valid witnesses and soundness error at mostsoundness nagainst all computationally unbounded stateful proversP : Prover Unit.zero_knowledge: uniform zero-knowledge with poly-time-generable families (GenerableZeroKnowledge enc prover isWitness). For every uniform strict oracle PPT malicious verifierVstar(taking security parametern, instancea, and auxiliary inputz), there is a uniform strict PPT simulatorS(taking(1^n, a, z)without any witness) whose output ensemble is computationally indistinguishable from the real interaction output across all deterministic polynomial-time-generable families of instancesa : ℕ → α, valid witnessesw : ℕ → List Bool, and auxiliary inputsz : ℕ → List Bool(ComputableInPolyTime · encUnary _). The stronger general auxiliary-input property over arbitrary polynomially bounded valid families is stated separately asZKProof.AuxiliaryInputZeroKnowledge.
The honest verifier, indexed by security parameter
nand instancea.The honest prover strategy, taking security parameter
n, instancea, and witnessw.The polynomial-time witness check used by the honest prover.
- polyTime_isWitness : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : α × List Bool) => self.isWitness p.1 p.2) (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool
isWitnessis computable in plain polynomial time. a ∈ Aif and only if some witnesswsatisfiesisWitness a w = true.- isOraclePPT_verifier : Probability.IsOraclePPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary enc) Turing.MultiTapeTM.encBool fun (p : ℕ × α) => self.verifier p.1 p.2
The honest verifier is uniform strict oracle PPT in
(1^n, a). The PPT program realizing the honest prover's interaction with a verifier program.
- eval_interact (n : ℕ) (a : α) (w : List Bool) (prog : Probability.WordOracleComp Unit (List Bool)) : (self.interact n a w prog).eval = zkRealView (self.prover n a w) prog
interacthas the exact output distribution ofprover.run. - isPPT_interact (Vstar : ℕ → α → List Bool → Probability.WordOracleComp Unit (List Bool)) : (Probability.IsOraclePPTOn (encInstanceAuxInput enc) Turing.MultiTapeTM.encBits fun (x : ℕ × α × List Bool) => match x with | (n, a, z) => Vstar n a z) → Probability.IsPPTOn (encInstanceWitnessAuxInput enc) Turing.MultiTapeTM.encBits fun (x : ℕ × α × List Bool × List Bool) => match x with | (n, a, w, z) => self.interact n a w (Vstar n a z)
Running any uniform strict oracle PPT verifier against the honest prover is uniform strict PPT in
(1^n, a, w, z). - complete (n : ℕ) (a : α) (w : List Bool) : self.isWitness a w = true → Complexity.acceptProb (self.verifier n a) (self.prover n a w) = 1
Perfect completeness: for every valid witness
wofa, the honest prover convinces the honest verifier with probability1. - sound (n : ℕ) (a : α) : a ∉ A → ∀ (P : Complexity.Prover Unit), Complexity.acceptProb (self.verifier n a) P ≤ soundness n
Soundness: for every
a ∉ Aand every computationally unbounded stateful proverP, the verifier accepts with probability at mostsoundness n. Uniform computational zero-knowledge with poly-time-generable auxiliary input against all uniform strict oracle PPT malicious verifiers, quantified over polynomial-time-generable families of instances
a, valid witnessesw, and auxiliary inputsz.
General auxiliary-input computational zero-knowledge for a bundled ZKProof system, ranging
over arbitrary polynomially bounded instance, valid-witness, and auxiliary-input families:
Cslib.Crypto.AuxiliaryInputZeroKnowledge for the bundled prover and witness predicate.
Like that notion, this one is novel to this library: it strengthens [Gol98],
Definition 4.3.8, pp. 151–152, by giving the distinguisher an auxiliary input independent of the
verifier's and by decoupling the security parameter from the instance. It implies the bundled
instance-indexed form ZKProof.InstanceAuxiliaryInputZeroKnowledge, which follows the source's
indexing (ZKProof.AuxiliaryInputZeroKnowledge.instanceAuxiliaryInputZeroKnowledge). It is
plausible because the library's Goldreich–Micali–Wigderson theorem
NonuniformOneWay.exists_zkProof_of_mem_NP builds systems with this property for every language in
NP from any nonuniformly one-way function.
General auxiliary-input zero-knowledge for zk implies the bundled restricted
GenerableZeroKnowledge guarantee.
Fixed-instance auxiliary-input zero-knowledge under zk.AuxiliaryInputZeroKnowledge: for any
fixed instance a, valid witness w, and arbitrary polynomially bounded auxiliary-input family
z : ℕ → List Bool, the real and simulated views have negligible distinguishing advantage against
every full-input uniform strict PPT distinguisher.
At any security parameter n, the honest verifier of a ZKProof is an interactive proof for
A with completeness 2 / 3 and soundness soundness n.
Fixed-instance computational zero-knowledge: for every fixed instance a and valid witness w
(zk.isWitness a w = true), and every polynomial-time auxiliary input family z : ℕ → List Bool,
the real interaction output and simulator output are computationally indistinguishable.
Single-session masked-3SAT ZKProof builder with uniform GenerableZeroKnowledge only (#6044;
see GenerableZeroKnowledge) and soundness 1 / 3 for any language A Karp-reducible via
f : α → CNF ℕ to ThreeSAT, from a pseudorandom generator with stretch at least 3 * k + 1.
The bundled witness check isWitness a w is ThreeSAT.verifier (f a, w) on the reduced formula
f a.
A step toward the Goldreich–Micali–Wigderson theorem, not that theorem: it rests on
GMW.AdvicePRG, a premise novel to this library. Under GMW.AdvicePRG enc generator length, the
GMW proof system hG.singleZKProofOfReduction hstretch hf hred satisfies general auxiliary-input
zero-knowledge (ZKProof.AuxiliaryInputZeroKnowledge) across all arbitrary polynomially bounded
valid instance, witness, and auxiliary-input families. A nonuniform PRG satisfies the premise
(NonuniformPRG.advicePRG); the library's GMW theorem is
NonuniformOneWay.exists_zkProof_of_mem_NP.
Single-session masked-3SAT ZKProof builder for ThreeSAT with uniform
GenerableZeroKnowledge only (#6044; see GenerableZeroKnowledge) and soundness 1 / 3, from any
pseudorandom generator with stretch at least 3 * k + 1.
A step toward the Goldreich–Micali–Wigderson theorem, not that theorem: it rests on
GMW.AdvicePRG, a premise novel to this library. Under GMW.AdvicePRG encCNF generator length,
the GMW proof system hG.singleZKProofThreeSAT hstretch satisfies general auxiliary-input
zero-knowledge (ZKProof.AuxiliaryInputZeroKnowledge). The library's GMW theorem is
NonuniformOneWay.exists_zkProof_of_mem_NP.