Sigma protocols are proofs of knowledge with a strict PPT rewinding extractor #
A special-sound Sigma protocol is a proof of knowledge: from any prover that convinces the
verifier on a statement y with probability ε, a knowledge extractor that may rewind the prover
computes a witness for y. This module formalizes the standard extractor for an indexed family
P i of Sigma protocols with a polynomial-time special-soundness extractor
(EfficientSpecialSoundness), and proves that it is uniform strict PPT whenever the prover is.
Proofs of knowledge are defined by Bellare and Goldreich ([BG93a], Definition 3.1).
The per-statement, strict-time form proved here, and its proof from the rewinding lemma, are the
library's own; the end of this overview compares it with their definition.
A prover A : MaliciousProver I works on words, so it may cheat: at index i it commits from the
encoded statement, keeping a state word, and answers the encoded challenge from that state. The
verifier accepts when the two words it receives encode a commitment and a response that P i
accepts (AcceptsWord). acceptanceGame is one run of A against the verifier, with challenges
drawn from a given law; with the uniform law it is the honest verifier.
The extractor knowledgeExtractor runs A to its commitment, draws two challenges with a
sampler sampleChallenge, answers both from the same state, and applies the word function
extractWord of the special-soundness extractor to the two conversations. It runs A twice, so
it is strict PPT with no expected-time argument (isPPTOn_knowledgeExtractor). Its success
probability follows from the rewinding lemma Rewinding.sq_sub_mul_le_twice: on every statement,
ε ^ 2 - κ * ε ≤ ε' (sq_sub_mul_le_extractionGame),
where ε is the acceptance probability of A with challenges from the sampler, κ bounds the
sampler's atoms and ε' is the extractor's success probability (extractionGame). For a sampler
that is exactly uniform this is ε ^ 2 - ε / |C| ≤ ε' against the honest verifier
(sq_sub_le_extractionGame). A strict PPT machine with fair coins samples a challenge space such
as ZMod q only approximately; for a sampler within statistical distance δ of uniform, the
honest verifier's acceptance probability satisfies ε ≤ 1 / |C| + 2 δ + √ε'
(le_add_sqrt_extractionGame).
The hypotheses are only about generic components supplied by the caller: special soundness of the protocol and a polynomial-time word function realizing its extractor, and a strict PPT challenge sampler. Nothing is assumed about the knowledge extractor this module builds.
Bellare and Goldreich's validity condition asks for an extractor that, whenever ε exceeds the
knowledge error κ, outputs a witness within an expected number of steps bounded by a polynomial
divided by ε - κ ([BG93a], Definition 3.1). The extractor here instead runs in
strict polynomial time and succeeds with probability at least ε ^ 2 - κ * ε; repeating it
amplifies its success probability.
Main definitions #
SigmaProtocol.MaliciousProver,SigmaProtocol.MaliciousProver.IsPPT: a two-stage prover on words and its uniform strict PPT admissibility.SigmaProtocol.AcceptsWord: the verifier ofP ion a commitment word and a response word.SigmaProtocol.acceptanceGame: one run of a prover against the verifier.SigmaProtocol.knowledgeExtractor: the rewinding knowledge extractor.SigmaProtocol.extractionGame: a word extractor outputs the encoding of a witness.
Main results #
SigmaProtocol.isPPTOn_knowledgeExtractor: the extractor is uniform strict PPT whenever the prover is.SigmaProtocol.sq_sub_mul_le_bind_extractionGame,SigmaProtocol.sq_sub_mul_le_extractionGame:ε ^ 2 - κ * ε ≤ ε'for a sampler with atoms at mostκ(averaged over a statement distribution and on a fixed statement).SigmaProtocol.sq_sub_le_bind_extractionGame,SigmaProtocol.sq_sub_le_extractionGame:ε ^ 2 - ε / |C| ≤ ε'for an exactly uniform sampler.SigmaProtocol.le_add_sqrt_bind_extractionGame,SigmaProtocol.le_add_sqrt_extractionGame:ε ≤ 1 / |C| + 2 δ + √ε'for a sampler withinδof uniform.
References #
Provers on words and acceptance #
A prover for a family of Sigma protocols indexed by I, which may cheat. At index i, its
first stage reads the encoded statement and returns a commitment word and a state word; its second
stage reads the state word and the encoded challenge and returns a response word. Both stages may
use fresh randomness.
Commit from the index and the encoded statement, keeping a state word.
Respond from the index, the state word and the encoded challenge.
Both stages of a prover are uniform strict PPT in their whole inputs, with the index encoded
by encI.
- commit : Probability.IsPPTOn (Turing.MultiTapeTM.encPair encI Turing.MultiTapeTM.encBits) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) fun (x : I × List Bool) => match x with | (i, y) => A.commit i y
The first stage is uniform strict PPT.
- respond : Probability.IsPPTOn (Turing.MultiTapeTM.encPair encI (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits)) Turing.MultiTapeTM.encBits fun (x : I × List Bool × List Bool) => match x with | (i, s, c) => A.respond i s c
The second stage is uniform strict PPT.
The verifier of P i on words: the commitment word t and the response word z encode a
commitment and a response that P i accepts on the statement y at the challenge c. Words that
encode no commitment or no response are rejected.
One run of the prover A against the verifier of P i on the statement y, with the
challenge drawn from challenge; it succeeds when the verifier accepts. With
challenge = PMF.uniformOfFintype (C i) this is the honest verifier.
The rewinding knowledge extractor #
The rewinding knowledge extractor: on the index i and a statement word y, run A to its
commitment t, draw two challenges with sampleChallenge i, answer both from the same state,
and apply the word function extractWord of a special-soundness extractor to the two
conversations.
A word extractor E, run on the index i and the encoded statement y, outputs the encoding
of a witness for y under the relation R i.
Efficiency #
The knowledge extractor is uniform strict PPT whenever the prover is, the challenge
sampler writes encoded challenges in strict polynomial time, and extractWord is computable in
polynomial time.
Success probability #
Average-statement extraction by rewinding: for any statement distribution μ : PMF (Y i),
if the prover A convinces the verifier with average probability ε over y ← μ when challenges
are drawn by sampleChallenge i, and every challenge has probability at most κ under that
sampler, the knowledge extractor outputs a witness for y with average probability at least
ε ^ 2 - κ * ε over y ← μ.
Extraction by rewinding: on every statement y, if the prover A convinces the verifier
with probability ε when challenges are drawn by sampleChallenge i, and every challenge has
probability at most κ under that sampler, the knowledge extractor outputs a witness for y
with probability at least ε ^ 2 - κ * ε.
Average-statement extraction by rewinding with exactly uniform challenges: for any statement
distribution μ : PMF (Y i), if the prover A convinces the honest verifier with average
probability ε over y ← μ and sampleChallenge i samples uniform challenges, the knowledge
extractor outputs a witness for y with average probability at least ε ^ 2 - ε / |C i| over
y ← μ.
Extraction by rewinding with exactly uniform challenges: on every statement y, if the
prover A convinces the honest verifier with probability ε and sampleChallenge i samples
uniform challenges, the knowledge extractor outputs a witness for y with probability at least
ε ^ 2 - ε / |C i|.
Average-statement extraction by rewinding with approximately uniform challenges: for any
statement distribution μ : PMF (Y i), if sampleChallenge i is within statistical distance δ
of uniform, the honest verifier's average acceptance probability ε of the prover A over
y ← μ and the knowledge extractor's average success probability ε' over y ← μ satisfy
ε ≤ 1 / |C i| + 2 δ + √ε'.
Extraction by rewinding with approximately uniform challenges: on every statement y, if
sampleChallenge i is within statistical distance δ of uniform, the honest verifier's
acceptance probability ε of the prover A and the knowledge extractor's success probability
ε' satisfy ε ≤ 1 / |C i| + 2 δ + √ε'.