When using zero-knowledge proofs of knowledge (ZKPoKs) as a tool to construct multi-party computation (MPC) protocols, it is convenient to prove that those ZKPoKs realize ideal functionalities as is typical for MPC tools. Unfortunately, there is often a definitional mismatch. In the context of ZKPoKs, the property of knowledge soundness is defined by the existence of a knowledge extractor, which often relies upon the technique of rewinding the prover. To prove that a ZKPoK realizes an ideal functionality, we must describe a simulator that interacts with the ideal functionality and simulates the view of the prover. In order to supply an input to the functionality, the simulator for the prover's view usually exracts that input from a copy of the prover that it runs internally. However, we often insist upon straight-line simulation, meaning that the simulator must perform the extraction without rewinding its internal prover, and thus the knowledge extractor is not directly helpful. Straight-line simulation is a key component of achieving security under concurrent composition, and straight-line extraction techniques are also important because they enable asymptotically-tight security reductions to be constructed.
To prove that a ZKPoK realizes a functionality, we must also construct a simulator for the view of the verifier. The zero-knowledge property of ZKPoKs guarantees the existence of a simulator for the verifier's view, but it is common for this simulator to rewind an internal copy of the verifier, or else to sample protocol messages out of order (e.g. such that the first message depends upon the second one). This also conflicts with the requirement for straight-line simulation, when it arises.
For many ZKPoKs (and in particular, sigma protocols) there exist straight-line extraction (SLE) compilers that transform the protocols in order to resolve the above mismatches. The most notable examples are the compilers of [Pass03], [Fischlin05], [Unruh15], and [Ks22]. However, these compilers also aim to achieve non-interactivity and therefore make use of random oracles. Interactive SLE compilers without random oracles do exist in the common reference string (CRS) model (for example, [HN10]), but they often require other advanced primitives such as universally-composable commitments. Finally, there exist straight-line-simulatable ZKPoKs that fix specific interactive proof systems as starting points, rather than compiling arbitrary sigma protocols (e.g. [CF01], which is based upon graph hamiltonicity).
When developing my MPC class, I wished to teach an SLE compiler for arbitrary sigma protocols that does not require random oracles or ideal commitments. I could find no such thing in the literature, so I developed the one I will present in this document. It is based upon commitments that are extractable in the CRS model, but not necessarily equivocable, allowing it to be used with simple commitment schemes based upon trapdoor permutations. It is compatible with nearly any variation on the real-ideal security paradigm (even ones that do not support reactive functionalities or concurrent composition), and it does not attempt to achieve non-interactivity, concrete efficiency, or CRS re-use. In other words, I have tried to optimise it for ease of understanding, and to make use of only simple, easy-to-construct primitives.
The intuition behind the construction is simple. A sigma protocol has three rounds: the first is from the prover to the verifier, the second is a challenge from the verifier to the prover, and the prover responds to this challenge in the third. If the prover responds to multiple distinct challenges (for a single first message) in such a way that the verifier would accept the responses, then the responses can be used to compute a witness for the prover's statement. In the real world, no prover would do this, but knowledge extractors often use rewinding to feed multiple challenges to the prover. Our compiler will do something different: before receiving the challenge, the prover in the compiled protocol will commit to responses to all possible challenges, and then open only the appropriate commitment. The commitment scheme enables straight-line extraction by the simulator, and thus the simulator can compute a witness without rewinding. Similarly, the verifier will commit to its challenges at the beginning of the protocol, before the prover sends its first message. This will enable us to use the simulator that is guaranteed to exist for sigma protocols, even though that simulator requires the verifier's challenge (i.e. the second message) to be chosen before the prover's first message. In order to achieve negligible soundness error, the construction will repeat the underlying sigma protocol many times in parallel.
I do not claim that anything here is novel or surprising. The construction I will present is inspired by several prior works (notably [Pass03] and [GK96]), and it is extremely similar to [HN10, Protocol 9], although the security analysis differs substantially due to the fact that ideal commitments are avoided.
A very large amount of background information will not be covered in this document. In particular, the reader will need to have a basic understanding of distributional ensembles and computational indistinguishability, languages and witness relations, interactive proof systems, and zero-knowledge. These topics are covered in depth in [Goldreich04, Sections 3.2 and 4.1-4.3] and in many other textbooks. The goal of this document is to prove a particular protocol secure in the real-ideal paradigm, also known as the simulation-based security paradigm. A version of this paradigm is covered in detail in [Goldreich04, Chapter 7], but the proof presented here holds in many variations, including [Canetti00] and [Canetti01]. The notation used in this document largely follows the conventions of the Universal Composition framework [Canetti01], but note that the protocol is explicitly structured to avoid the need for concurrent composition, and session IDs are omitted.
In this document, denotes equality, denotes deterministic assignment, and denotes assignment by sampling from the distribution produced by a sampling algorithm on the right-hand side. Finally, denotes the computational indistinguishability of two distributional ensembles. In general, is a security parameter and denotes a negligible function.
A sigma protocol is an interactive proof system for language with witness-relation comprising the following 3-message interaction generated by four PPT algorithms :
The basic properties required of all interactive proof systems are completeness and soundness, for descriptions of which the reader is referred to [Goldreich04, Section 4.2]. For more information about sigma protocols in particular, including special soundness and special honest-verifier zero-knowledge, the reader is referred to [Damgård10]. To avoid confusion with other “commitments” in the protocol we will construct in this document, we will refer to as the first, second, and third messages of .
We will use to denote a version of that is restricted to accepting statements of exactly length . In other words, if any of the algorithms in is given such that , then it does nothing. We will similarly use and to the restrictions of and to statements of length .
We will assume that the challenge-sampling algorithm chooses a challenge uniformly from a set that depends only upon the statement , and that the size of is upper-bounded by some polynomial in the statement length. That is, we will assume there exists some polynomial such that . We will also assume that does nothing if it is given . Finally, we will assume that is deterministic.
A sigma protocol is said to be -Special-Sound for language with witness-relation if and only if there exists an additional PPT algorithm with the following property:
Suppose that we have transcripts of that share their statement and first message , but differ in their second message; that is, we have such that if and are distinct. If for every , then outputs such that . For simplicity, we assume that this holds with probability 1, and that can accept more than transcripts as input.
Note that this property is only meaningful when , and so we will assume this condition holds from now on.
A sigma protocol is said to be Special Honest-Verifier Zero-Knowledge (SHVZK) for language with witness-relation if there exists an additional PPT algorithm such that
where the distinguishing advantage is considered relative to . Note that this differs from ordinary HVZK in that the the simulator works even conditioned on a fixed value of . As a corollary of the above statement of SHVZK, it holds that for every PPT adversary there exists a negligible function such that
A non-interactive commitment scheme is a trio of PPT algorithms with the following syntax:
There are three basic properties that all commitment schemes must achieve:
A non-interactive commitment scheme is said to be trapdoor straight-line extractable if there exist two additional PPT algorithms and with the following syntax and properties:
Note that commitments with this property are easy to construct: for example, they can be built trivially from ElGamal Encryption.
The construction below will realize the standard zero-knowledge functionality for two parties, where is the witness relation for some language. For more information, see [CLOS02, Section 6]. The code of the functionality is as follows:
On receiving from the prover, sends to the verifier if ; otherwise does nothing.
For the purposes of this exposition, the Common Reference String (CRS) model augments the standard model of cryptography by providing the parties with access to a functionality that honestly samples a public string according to an arbitrary sampling algorithm. In our case, will sample and publish the key for a trapdoor straight-line extractable commitment scheme.
This protocol involves a prover, a verifier, and the ideal functionality . It is parameterized by a sigma protocol and a commitment scheme , and it takes as common input a security parameter .
Theorem: If is an -special-sound SHVZK sigma protocol for language with witness-relation , such that the size of the challenge space is always at most polynomial in , and if is a trapdoor straight-line extractable commitment scheme, then the above protocol realizes with straight-line simulation in the -hybrid model in the presence of a malicious adversary that statically corrupts either party.
Since the protocol is asymmetric, we will prove two lemmas, one for each of the two parties that might be corrupted. The theorem follows by the conjunction of these lemmas. Note that the proofs will employ the specific formalism of the UC framework—specifically, they will quantify over environments—but they can easily be adapted to many other variations on the real-ideal/simulation-based security paradigm.
Lemma 1: If is an -special-sound sigma protocol for language with witness-relation , such that the size of the challenge space is always at most polynomial in , and if is a trapdoor straight-line extractable commitment scheme, then for every malicious PPT adversary that statically corrupts the prover, there exists a PPT straight-line simulator such that for every PPT environment ,
Proof: We will begin by describing the simulator, and then we will argue for the indistinguishability of the real and ideal experiments via a sequence of hybrid experiments.
The simulator runs the adversary internally, and emulates an instance of the real-world experiment toward it. forwards all communications from the environment to , and forwards the responses back to the environment. It corrupts the prover in the ideal experiment and interacts with on the prover's behalf.
When the corrupted prover invokes in Step 1 of the emulated real-world experiment, runs and sends to the prover on behalf of , after which it runs Steps 2-7 of in the emulated real-world experiment by following the code of the verifier exactly. For every , when the corrupted prover has transmitted to the verifier in the emulated real-world experiment, computes . Additionally, for every and , the simulator computes . Let be the smallest value in such that for all . If no such exists, or if there is any such that or , then halts without sending any message to . Otherwise, it computes , sends to , and then halts.
First Hybrid Experiment and Reduction. Now consider a hybrid experiment which is exactly like the real-world experiment, except that in Step 1, uses to sample instead of . By a simple reduction to the trapdoor-indistinguishability property of , we can show that
Second Hybrid Experiment and Reduction. Consider a second hybrid experiment , which is exactly like except that the experiment produces output to the environment on behalf of the verifier only if where for every . Suppose there is a pair that can distinguish from ; they can do so only by contriving to cause for some . We will prove that this event happens with negligible probability via a reduction to the straight-line extractability property of .
The reduction plays the straight-line extractability game for and emulates internally toward . In the emulated experiment, emits its own challenge key as on behalf of in Step 1, and it halts the experiment upon receiving for every in Step 7. Note that at this point, the emulated experiment is identically distributed to both and . guesses and outputs to the straight-line-extractability game for . With probability , it will hold that , and if this occurs at the same time that , then the reduction wins the straight-line-extractability game. By the security of there exists a negligible function that upper-bounds the reduction's probability of a win, which implies that for every PPT ,
which is also negligible, and it follows that .
Ideal-World Experiment and Third Reduction. It remains to show that is indistinguishable from the ideal-world experiment, which is the main challenge in the proof of Lemma 1. Notice that the distributions of these two experiments are identically distributed in all events except for one: in the event that for every but there exists no such that for all , the verifier will produce output in but not in the ideal-world experiment. We will prove that this event happens with at most negligible probability via reduction to the hiding property of .
The reduction is parameterized by a fixed index , and it plays the hiding game for and emulates internally toward . emulates the first three steps of the experiment faithfully, except that emits its own challenge key as on behalf of in Step 2. Next, samples and computes and . The reduction emits to the hiding game, and receives in response, which it sends to the corrupted prover on behalf of the verifier in Step 4 of the emulated experiment as . continues emulating until Step 5 is complete, and then ceases: at this point, the emulated experiment is distributed identially to both and the ideal-world experiment. If there exists and such that and , then the reduction outputs ; otherwise, it outputs a uniformly random bit.
Next, let us calculate the probability that outputs , where is the value sampled uniformly by the hiding game for . Let be the event that . Note that can successfully distinguish from the ideal-world experiment only if occurs. Let be the event that for an arbitrary (and note that since the three values are independently chosen, the specific value of does not matter). Note that always outputs when occurs, but when or occurs, it guesses an output bit uniformly and thus outputs with probability . Thus we have
Recall that and it follows that
and if we define then by combining the last two equations we get
Next we will combine the reductions for the individual values of into a single reduction that also plays the hiding game for . We start by defining
where the inequality follows from a union bound. The reduction samples uniformly and outputs what does. We have
Finally, by the security of there must exist a negligible function such that . This implies that
and since and are both upper-bounded by a polynomial in , it follows that is negligible in . Since have no advantage in distinguishing from the ideal-world experiment when the event occurs, we can conclude that
and Lemma 1 follows by the transitivity of computational indistinguishability.
Lemma 2: If is an SHVZK sigma protocol for language with witness-relation , such that the size of the challenge space is always at most polynomial in , and if is a trapdoor straight-line extractable commitment scheme, then for every malicious PPT adversary that statically corrupts the verifier, there exists a PPT straight-line simulator such that for every PPT environment ,
Proof: We will begin by describing the simulator, and then we will argue for the indistinguishability of the real and ideal experiments via a sequence of hybrid experiments.
The simulator runs the adversary internally, and emulates an instance of the real-world experiment toward it. forwards all communications from the environment to , and forwards the responses back to the environment. It corrupts the prover in the ideal experiment and interacts with on the prover's behalf.
runs the first two steps of the emulated real-world experiment faithfully, except that when the corrupted verifier invokes in Step 2, runs and sends to the verifier on behalf of Upon receiving from , sends to the corrupted verifier on behalf of the prover in Step 3 of the emulated experiment. Upon receiving from the verifer in Step 4, has two possible courses of action:
If , then for and an arbitrary , the simulator samples and for it sets . The simulator emulates Step 5c, 5d, and 6 of using these values, and sends nothing further to the emulated verifier on behalf of the prover.
Otherwise, computes . For , the simulator samples , and for it sets . The simulator emulates the remainder of the real-world experiment using these values, modifying Step 7 to check whether opens to , and it halts when is complete.
First Hybrid Experiment and Reduction. Now consider a hybrid experiment which is exactly like the real-world experiment, except that in Step 2, uses to sample instead of . By a simple reduction to the trapdoor-indistinguishability property of , we can show that
Second Hybrid Experiment and Reduction. Consider a second hybrid experiment , which is exactly like except that the experiment checks whether , and behaves as though the opening is invalid if so. Suppose there is a pair that can distinguish from ; they can do so only by contriving to cause . We will prove that this event happens with negligible probability via a reduction to the straight-line extractability property of .
The reduction plays the straight-line extractability game for and emulates internally toward . In the emulated experiment, emits its own challenge key as on behalf of in Step 2, and it halts the experiment upon receiving in Step 6. Note that at this point, the emulated experiment is identically distributed to both and . outputs to the straight-line-extractability game for , and wins the game precisely when cause the distinguishing condition to occur. By the security of there exists a negligible function that upper-bounds the reduction's probability of a win, which implies that for every PPT ,
and it follows that .
Third Reduction, over a Sequence of Hybrid Experiments. Next, we introduce a sequence of experiments for and , where the latter set is ordered in an arbitrary but deterministic way, which implies a fixed ordering for the experiments, and where denotes the maximal element of . Each is like the previous experiment in the sequence, except that if and , then samples rather than and . By the hybrid lemma [PS10, Lemma 71.6] (see also [Goldreich04, Section 3.2.3]), we know that if there is a pair that can distinguish from with advantage , then we can write a simple reduction that plays the SHVZK game for and achieves advantage .
Specifically, the reduction samples and uniformly, and it emulates the experiment internally toward , except that if , then the reduction outputs to the challenger in the SHVZK game and receives in response, which it embeds the the emulated experiment in the appropriate way. The reduction runs the emulated experiment to completion and outputs whatever the internally-emulated does. Note that if in the SHVZK game, then the experiment emulated within is distributed identically to ; otherwise it is distributed identically to the previous hybrid in the sequence. Thus the advantage of is equal to the expected advantage of over the choice of and .
If we let be the advantage of in distinguishing from the previous experiment in the sequence, then by the triangle inequality,
which implies that the total advantage of is
By the security of , there exists a negligible function that upper-bounds the advantage of , and since and are both upper-bounded by a polynomial in , it follows that is negligible for every , and thus
Fourth Reduction, over a Sequence of Hybrid Experiments. We introduce a second sequence of experiments for and , with the latter set ordered as above. Each is like the previous experiment in the sequence, except that if or , then sets rather than . Note that in the case that this change has an effect on the hybrid's distribution, the commitment will never be opened. Again by the hybrid lemma, we know that if there is a pair that can distinguish from with advantage , then we can write a simple reduction that plays the hiding game for and achieves advantage . This reduction works exactly like , except that it plays the commitment hiding game instead of the SHVZK game, and it emits its own challenge key as on behalf of in Step 1. By the security of , there exists a negligible function that upper-bounds the advantage of this reduction, and since and are both upper-bounded by a polynomial in , it follows that is negligible for every , and thus
Fifth Reduction, over a Sequence Ending in the Ideal World. There remains only one event in which the distribution of differs from that of the ideal-world experiment: if , then the ideal-world experiment uses (where is an arbitrary, fixed value) to sample for every , whereas uses . Note that in both experiments, the corresponding response is set to in this event, and it is committed but never revealed.
We introduce a final sequence of hybrid experiments for , each of which is like the previous experiment in the sequence except that if , then uses to sample rather than . Again by the hybrid lemma, we know that if there is a pair that can distinguish from with advantage , then we can write a simple reduction that plays the SHVZK game for and achieves advantage . This reduction is similar to , but it has the value hardcoded rather than guessing , and it does not need to use anywhere. By the security of , there exists a negligible function that upper-bounds the advantage of this reduction, and since is upper-bounded by a polynomial in , it follows that is negligible for every , and thus
It remains to observe that does not make use of the prover's witness in any way, and it is distributed identically to the ideal-world experiment from the perspective of the environment. Thus Lemma 2 follows by the transitivity of computational indistinguishability.