Computational zero-knowledge interactive proofs for NP #
Goldreich, Micali, and Wigderson [GMW91] proved that if one-way functions
exist, then every language in NP has a computational zero-knowledge interactive proof system.
This module defines computational zero-knowledge interactive proofs (ZeroKnowledgeProof) together
with explicit public API predicates distinguishing restricted polynomial-time-generable
zero-knowledge (GenerableZeroKnowledge) from general auxiliary-input zero-knowledge over
arbitrary polynomially bounded valid families (AuxiliaryInputZeroKnowledge), and constructs a
proof system for ThreeSAT and hence for every language in NP via ThreeSAT_npHard and Naor's
bit commitment scheme [Nao91] (Complexity.Crypto.Computational.Commitment).
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 Complexity.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,ZeroKnowledgeProof.zero_knowledge,ZeroKnowledgeProof.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 (ZeroKnowledgeProof.zero_knowledge_const) is an immediate corollary for constant familiesfun _ => aandfun _ => w. - General auxiliary-input zero-knowledge (
AuxiliaryInputZeroKnowledge,ZeroKnowledgeProof.AuxiliaryInputZeroKnowledge). Quantifies over the same uniform strict oracle PPT malicious verifiersVstarand chooses one efficient witness-free simulatorSperVstarbefore the choice of families, then ranges over arbitrary polynomially bounded families of instancesa : ℕ → α, valid witnessesw : ℕ → List Bool, and 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). Under the explicit advice-PRG premiseGMW.AdvicePRG(fromGMW.gmwView_negligible_of_advice_prg), the GMW proof systems satisfyZeroKnowledgeProof.AuxiliaryInputZeroKnowledge(PseudorandomGenerator.auxiliaryInputZeroKnowledge_zeroKnowledgeProofOfReduction,PseudorandomGenerator.auxiliaryInputZeroKnowledge_zeroKnowledgeProofThreeSAT); this module does not deriveGMW.AdvicePRGfrom uniform PRG or one-way function assumptions. - Bundled witness relation (
ZeroKnowledgeProof.isWitness).ZeroKnowledgeProofbundles 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(mem_IP) does not need one, and inzero_knowledgethe witness familyw : ℕ → List Boolis polynomial-time-generable in1^n. InPseudorandomGenerator.zeroKnowledgeProofOfReductionandPseudorandomGenerator.exists_zeroKnowledgeProof_of_mem_NP, 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.ZeroKnowledgeProof.AuxiliaryInputZeroKnowledge: general auxiliary-input computational zero-knowledge over arbitrary polynomially bounded valid families against full-input uniform strict PPT distinguishers.Cslib.Crypto.ZeroKnowledgeProof: a computational zero-knowledge interactive proof system for a languageA, bundling a uniform strict oracle PPT verifier, an honest prover with a uniform strict PPT interaction realization, perfect completeness, soundness1 / 3against unbounded provers, andGenerableZeroKnowledge.Cslib.Crypto.PseudorandomGenerator.zeroKnowledgeProofOfReduction,Cslib.Crypto.PseudorandomGenerator.zeroKnowledgeProofThreeSAT: GMW zero-knowledge proof systems for any language Karp-reducible toThreeSATand forThreeSATitself.
Main results #
Cslib.Crypto.AuxiliaryInputZeroKnowledge.generableZeroKnowledge,Cslib.Crypto.ZeroKnowledgeProof.AuxiliaryInputZeroKnowledge.generableZeroKnowledge: general auxiliary-input zero-knowledge implies poly-time-generable zero-knowledge.Cslib.Crypto.ZeroKnowledgeProof.isInteractiveProof,Cslib.Crypto.ZeroKnowledgeProof.mem_IP: every language with aZeroKnowledgeProofbelongs toIP.Cslib.Crypto.ZeroKnowledgeProof.zero_knowledge_const,Cslib.Crypto.ZeroKnowledgeProof.AuxiliaryInputZeroKnowledge.zero_knowledge_const: fixed-instance computational zero-knowledge.Cslib.Crypto.PseudorandomGenerator.exists_zeroKnowledgeProof_of_mem_NP,Cslib.Crypto.OneWay.exists_zeroKnowledgeProof_of_mem_NP: GMW zero-knowledge proof systems for every language inNPfrom any pseudorandom generator (with stretch3 * k + 1) or one-way function, establishingGenerableZeroKnowledge.Cslib.Crypto.PseudorandomGenerator.auxiliaryInputZeroKnowledge_zeroKnowledgeProofOfReduction,Cslib.Crypto.PseudorandomGenerator.auxiliaryInputZeroKnowledge_zeroKnowledgeProofThreeSAT,Cslib.Crypto.PseudorandomGenerator.exists_auxiliaryInputZeroKnowledge_of_mem_NP: generalAuxiliaryInputZeroKnowledgefor the GMW proof systems under the explicit advice-PRG premiseGMW.AdvicePRG.
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: Volume 1, Basic Tools, Chapter 4.
- S. Arora, B. Barak, Computational Complexity: A Modern Approach, Chapter 9.
Restricted versus general auxiliary-input zero-knowledge predicates #
Uniform computational zero-knowledge with polynomial-time-generable families.
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 _).
Instances For
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, and 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), and 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.
Instances For
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 #
A computational zero-knowledge interactive proof system for a language A : Set α (with
instance encoding enc : α ↪ List Bool), indexed by a security parameter n : ℕ Goldreich,
Micali, and Wigderson.
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.zeroKnowledgeProofOfReduction),isWitness a wisThreeSAT.verifier (f a, w), checking aThreeSATwitness forf a.completeandsound: completeness1for valid witnesses and soundness error at most1 / 3against 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 asZeroKnowledgeProof.AuxiliaryInputZeroKnowledge.
- verifier : ℕ → α → Probability.WordOracleComp Unit Bool
The honest verifier, indexed by security parameter
nand instancea. - prover : ℕ → α → List Bool → Complexity.Prover Unit
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 = PMF.map Prod.fst ((self.prover n a w).run prog (self.prover n a w).init)
interacthas the exact output distribution ofprover.run. - isPPT_interact (Vstar : ℕ → α → List Bool → Probability.WordOracleComp Unit (List Bool)) : (Probability.IsOraclePPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits)) Turing.MultiTapeTM.encBits fun (p : ℕ × α × List Bool) => Vstar p.1 p.2.1 p.2.2) → Probability.IsPPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair enc (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits))) Turing.MultiTapeTM.encBits fun (p : ℕ × α × List Bool × List Bool) => self.interact p.1 p.2.1 p.2.2.1 (Vstar p.1 p.2.1 p.2.2.2)
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 ≤ 1 / 3
Soundness: for every
a ∉ Aand every computationally unbounded stateful proverP, the verifier accepts with probability at most1 / 3. - zero_knowledge : GenerableZeroKnowledge enc self.prover self.isWitness
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.
Instances For
Named projection for the restricted polynomial-time-generable zero-knowledge property bundled by
ZeroKnowledgeProof.
General auxiliary-input computational zero-knowledge for a bundled ZeroKnowledgeProof system,
ranging over arbitrary polynomially bounded instance, valid-witness, and auxiliary-input
families.
Instances For
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 every security parameter n, the honest verifier of a zero-knowledge proof system is an
interactive proof for A with completeness 2 / 3 and soundness 1 / 3.
Every language with a zero-knowledge interactive proof system belongs to IP.
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.
GMW zero-knowledge proof systems #
Construct the Goldreich–Micali–Wigderson zero-knowledge proof system for any language A with
a polynomial-time many-one reduction f : α → CNF ℕ to ThreeSAT, using a pseudorandom generator
with stretch at least 3 * k + 1 and the 3-copy masked-3SAT commitment protocol in
Cslib.Crypto.GMW. The bundled witness check isWitness a w is ThreeSAT.verifier (f a, w) on
the reduced formula f a.
Instances For
Under the explicit advice-PRG premise GMW.AdvicePRG enc generator length, the GMW proof
system hG.zeroKnowledgeProofOfReduction hstretch hf hred satisfies general auxiliary-input
zero-knowledge (ZeroKnowledgeProof.AuxiliaryInputZeroKnowledge) across all arbitrary polynomially
bounded valid instance, witness, and auxiliary-input families.
The Goldreich–Micali–Wigderson computational zero-knowledge proof system for ThreeSAT, built
from any pseudorandom generator with stretch at least 3 * k + 1 via the 3-copy masked-3SAT
commitment protocol in Cslib.Crypto.GMW.
Instances For
Under the explicit advice-PRG premise GMW.AdvicePRG encCNF generator length, the GMW proof
system hG.zeroKnowledgeProofThreeSAT hstretch satisfies general auxiliary-input zero-knowledge
(ZeroKnowledgeProof.AuxiliaryInputZeroKnowledge).
Goldreich–Micali–Wigderson theorem (from a pseudorandom generator). Given a pseudorandom
generator with stretch at least 3 * k + 1 (such as fun k => 3 * k + 1), every language
A ∈ NP enc has a computational zero-knowledge interactive proof system
Goldreich, Micali, and Wigderson in the uniform
polynomial-time-generable sense (GenerableZeroKnowledge).
Goldreich–Micali–Wigderson theorem under an explicit advice-PRG premise. Given a
pseudorandom generator with stretch at least 3 * k + 1 that also satisfies the advice-supplied
premise GMW.AdvicePRG enc generator length, every language A ∈ NP enc has a computational
zero-knowledge interactive proof system satisfying general auxiliary-input zero-knowledge
(ZeroKnowledgeProof.AuxiliaryInputZeroKnowledge) across all polynomially bounded valid families.
This theorem takes GMW.AdvicePRG as an explicit hypothesis rather than deriving it from uniform
PseudorandomGenerator or OneWay security.
Goldreich–Micali–Wigderson theorem (from a one-way function). If a one-way function exists,
then every language A ∈ NP enc has a computational zero-knowledge interactive proof system
Goldreich, Micali, and Wigderson, in the uniform-family sense of
GenerableZeroKnowledge (ZeroKnowledgeProof.zero_knowledge): instances, witnesses and auxiliary
inputs range over polynomial-time-generable families rather than arbitrary ones.