A Pedagogically-Optimized Straight-Line Extractor

Table of Contents

  1. What is the Point?
  2. Preliminaries
  3. The Construction
  4. Proof of Security

What is the Point?

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.

A Note on Novelty

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.

Preliminaries

Basics and Notation

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, n is a security parameter and ε denotes a negligible function.

Sigma Protocols

A sigma protocol Σ is an interactive proof system for language L with witness-relation R comprising the following 3-message interaction generated by four PPT algorithms (Σ.𝖥𝗂𝗋𝗌𝗍,Σ.𝖲𝖾𝖼𝗈𝗇𝖽,Σ.𝖳𝗁𝗂𝗋𝖽,Σ.𝖵𝖾𝗋𝗂𝖿𝗒):

  1. The prover samples a commitment a and some secret state u via (a,u)Σ.𝖥𝗂𝗋𝗌𝗍(x,w) and sends the statement x along with a to the verifier.
  2. The verifier samples a challenge eΣ.𝖲𝖾𝖼𝗈𝗇𝖽(x) and sends it to the prover.
  3. The prover sends a response zΣ.𝖳𝗁𝗂𝗋𝖽(x,w,u,e) to the verifier.
  4. The verifier outputs Σ.𝖵𝖾𝗋𝗂𝖿𝗒(x,a,e,z).

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 (a,e,z) as the first, second, and third messages of Σ.

We will use Σn to denote a version of Σ that is restricted to accepting statements of exactly length n. In other words, if any of the algorithms in Σn is given x such that |x|n, then it does nothing. We will similarly use Ln and Rn to the restrictions of L and R to statements of length n.

We will assume that the challenge-sampling algorithm Σ.𝖲𝖾𝖼𝗈𝗇𝖽 chooses a challenge uniformly from a set Ex=image(Σ.𝖲𝖾𝖼𝗈𝗇𝖽(x)) that depends only upon the statement x, and that the size of Ex is upper-bounded by some polynomial in the statement length. That is, we will assume there exists some polynomial p such that |Ex|p(|x|). We will also assume that Σ.𝖳𝗁𝗂𝗋𝖽 does nothing if it is given eEx. Finally, we will assume that Σ.𝖵𝖾𝗋𝗂𝖿𝗒 is deterministic.

Special Soundness

A sigma protocol Σ is said to be -Special-Sound for language L with witness-relation R if and only if there exists an additional PPT algorithm Σ.𝖤𝗑𝗍 with the following property:

Suppose that we have transcripts of Σ that share their statement x and first message a, but differ in their second message; that is, we have (x,a,{ei,zi}i[]) such that eiej if i[] and j[] are distinct. If Σ.𝖵𝖾𝗋𝗂𝖿𝗒(x,a,ei,zi)=1 for every i[], then Σ.𝖤𝗑𝗍(x,a,{ei,zi}i[]) outputs w such that (x,w)R. 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 |Ex|, and so we will assume this condition holds from now on.

Special Honest-Verifier Zero-Knowledge

A sigma protocol Σ is said to be Special Honest-Verifier Zero-Knowledge (SHVZK) for language L with witness-relation R if there exists an additional PPT algorithm Σ.𝖲𝗂𝗆 such that

{(x,a,e,z) : (a,u)Σ.𝖥𝗂𝗋𝗌𝗍(x,w), zΣ.𝖳𝗁𝗂𝗋𝖽(x,w,u,e)}(x,w)R,eEx𝖼{(x,a,e,z) : (a,z)Σ.𝖲𝗂𝗆(x,e)}(x,w)R,eEx

where the distinguishing advantage is considered relative to |x|. Note that this differs from ordinary HVZK in that the the simulator works even conditioned on a fixed value of e. As a corollary of the above statement of SHVZK, it holds that for every PPT adversary 𝒜 there exists a negligible function ε such that

|Pr[𝒜(ab,zb,s)=b : b{0,1}, (x,w,e,s)𝒜(1n), (a0,u)Σn.𝖥𝗂𝗋𝗌𝗍(x,w), z0Σn.𝖳𝗁𝗂𝗋𝖽(x,w,u,e), (a1,z1)Σn.𝖲𝗂𝗆(x,e)]12|ε(n)

Non-Interactive Commitments

A non-interactive commitment scheme C is a trio of PPT algorithms (C.𝖦𝖾𝗇,C.𝖢𝗈𝗆,C.𝖮𝗉𝖾𝗇) with the following syntax:

There are three basic properties that all commitment schemes must achieve:

Trapdoor Straight-Line Extractability for Commitments

A non-interactive commitment scheme C is said to be trapdoor straight-line extractable if there exist two additional PPT algorithms C.𝖳𝖦𝖾𝗇 and C.𝖤𝗑𝗍 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 Zero-Knowledge Functionality

The construction below will realize the standard zero-knowledge functionality 𝖹𝖪R for two parties, where R is the witness relation for some language. For more information, see [CLOS02, Section 6]. The code of the functionality is as follows:

Functionality: 𝖹𝖪R

On receiving (x,w) from the prover, 𝖹𝖪R sends x to the verifier if (x,w)R; otherwise 𝖹𝖪R does nothing.

The CRS Model

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.

The Construction

Protocol: π𝖹𝖪Σ,C

This protocol involves a prover, a verifier, and the ideal functionality 𝖢𝖱𝖲. It is parameterized by a sigma protocol Σ and a commitment scheme C, and it takes as common input a security parameter 1n.

  1. Both parties invoke 𝖢𝖱𝖲, which runs k𝖯C.𝖦𝖾𝗇(1n) internally and outputs k𝖯 to both parties.
  2. Both parties invoke 𝖢𝖱𝖲, which runs k𝖵C.𝖦𝖾𝗇(1n) internally and outputs k𝖵 to both parties. Note that this step is separated from Step 1 mostly for expositional reasons, and a single instance of 𝖢𝖱𝖲 can sample and output both keys. Steps 1 and 2 are input-independent and can be run when the experiment begins, without waiting for inputs to arrive.
  3. On receiving its input (x,w), if (x,w)R or |x|n, then the prover halts without performing the remaining steps. Otherwise, the prover sends x to the verifier (who also halts if |x|n), both parties set r:=|Ex|n, and they continue with the steps below.
  4. For i[r] the verifier samples a challenge eiΣ.𝖲𝖾𝖼𝗈𝗇𝖽(x). It computes a single commitment (c𝖵,d𝗏)C.𝖢𝗈𝗆k𝖵((e1,,er)) to all of the challenges it sampled, and sends c𝖵 to the prover.
  5. For i[r], the prover:
    1. runs (ai,ui)Σ.𝖥𝗂𝗋𝗌𝗍(x,w) to sample the first message ai of the underlying sigma protocol.
    2. runs zi,eΣ.𝖳𝗁𝗂𝗋𝖽(x,w,ui,e) for every eEx to compute a corresponding third message for every possible challenge.
    3. runs (ci,e,di,e)C.𝖢𝗈𝗆k𝖯(zi,e) for every eEx to sample individual commitments to the third messages from the previous step.
    4. sends ai and {ci,e}eEx to the verifier.
  6. The verifier decommits its challenges by sending d𝖵 to the prover.
  7. The prover computes (e1,,er):=C.𝖮𝗉𝖾𝗇k𝖵(c𝖵,d𝖵), and then sends {di,ei}i[r] to the verifier.
  8. The verifier computes zi,ei:=C.𝖮𝗉𝖾𝗇k𝖯(ci,ei,di,ei) for every i[r] and outputs x if and only if Σ.𝖵𝖾𝗋𝗂𝖿𝗒(x,ai,ei,zi,ei)=1 for every i[r].
  9. If at any point in the preceding protocol one of the parties fails to send a well-formed message, or sends an invalid commitment opening, the opposite party halts without producing output.

Proof of Security

Theorem: If Σ is an -special-sound SHVZK sigma protocol for language L with witness-relation R, such that the size of the challenge space Ex is always at most polynomial in |x|, and if C is a trapdoor straight-line extractable commitment scheme, then the above protocol realizes 𝖹𝖪R 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 L with witness-relation R, such that the size of the challenge space Ex is always at most polynomial in |x|, and if C 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 𝒵,

{Rᴇᴀʟπ𝖹𝖪Σn,C,𝒜,𝒵(n)}n𝖼{Iᴅᴇᴀʟ𝖹𝖪Rn,𝒮𝖯,𝒵(n)}n

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.

Simulator 1: 𝒮𝖯

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 𝖹𝖪Rn on the prover's behalf.

When the corrupted prover invokes 𝖢𝖱𝖲 in Step 1 of the emulated real-world experiment, 𝒮𝖯 runs (k𝖯,t)C.𝖳𝖦𝖾𝗇(1n) and sends k𝖯 to the prover on behalf of 𝖢𝖱𝖲, after which it runs Steps 2-7 of π𝖹𝖪Σn,C in the emulated real-world experiment by following the code of the verifier exactly. For every i[r], when the corrupted prover has transmitted (ai,{ci,e}eEx,di,ei) to the verifier in the emulated real-world experiment, 𝒮𝖯 computes zi,ei:=C.𝖮𝗉𝖾𝗇k𝖯(ci,ei,di,ei). Additionally, for every i[r] and eEx, the simulator computes z^i,e:=C.𝖤𝗑𝗍t(ci,e). Let h be the smallest value in [r] such that z^h,e for all eEx. If no such h exists, or if there is any i[r] such that Σn.𝖵𝖾𝗋𝗂𝖿𝗒(x,ai,ei,zi,ei)=0 or z^i,eizi,ei, then 𝒮𝖯 halts without sending any message to 𝖹𝖪Rn. Otherwise, it computes wΣn.𝖤𝗑𝗍(x,ah,{e,z^h,e}eEx), sends (x,w) to 𝖹𝖪Rn, and then halts.

First Hybrid Experiment and Reduction. Now consider a hybrid experiment Hʏʙʀɪᴅ1 which is exactly like the real-world experiment, except that in Step 1, 𝖢𝖱𝖲 uses C.𝖳𝖦𝖾𝗇 to sample k𝖯 instead of C.𝖦𝖾𝗇. By a simple reduction to the trapdoor-indistinguishability property of C, we can show that

{Rᴇᴀʟπ𝖹𝖪Σn,C,𝒜,𝒵(n)}n𝖼{Hʏʙʀɪᴅ1(n)}n

Second Hybrid Experiment and Reduction. Consider a second hybrid experiment Hʏʙʀɪᴅ2, which is exactly like Hʏʙʀɪᴅ1 except that the experiment produces output to the environment on behalf of the verifier only if z^i,ei=zi,ei where z^i,ei:=C.𝖤𝗑𝗍t(ci,ei) for every i[r]. Suppose there is a pair (𝒜,𝒵) that can distinguish Hʏʙʀɪᴅ2 from Hʏʙʀɪᴅ1; they can do so only by contriving to cause z^j,ejzj,ej for some j[r]. We will prove that this event happens with negligible probability via a reduction to the straight-line extractability property of C.

The reduction 12 plays the straight-line extractability game for C and emulates Hʏʙʀɪᴅ1(n) internally toward (𝒜,𝒵). In the emulated experiment, 12 emits its own challenge key k as k𝖯 on behalf of 𝖢𝖱𝖲 in Step 1, and it halts the experiment upon receiving (ci,ei,di,ei) for every i[r] in Step 7. Note that at this point, the emulated experiment is identically distributed to both Hʏʙʀɪᴅ2 and Hʏʙʀɪᴅ1. 12 guesses g[r] and outputs (cg,eg,dg,eg) to the straight-line-extractability game for C. With probability 1/r, it will hold that g=j, and if this occurs at the same time that z^j,ejzj,ej, then the reduction wins the straight-line-extractability game. By the security of C there exists a negligible function ε that upper-bounds the reduction's probability of a win, which implies that for every PPT (𝒜,𝒵),

Pr[j[r] s.t. z^j,ejzj,ej]rε(n)

which is also negligible, and it follows that {Hʏʙʀɪᴅ1(n)}n𝖼{Hʏʙʀɪᴅ2(n)}n.

Ideal-World Experiment and Third Reduction. It remains to show that Hʏʙʀɪᴅ2 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 Σn.𝖵𝖾𝗋𝗂𝖿𝗒(x,ai,ei,zi,ei)=1 for every i[r] but there exists no h[r] such that C.𝖤𝗑𝗍t(ch,e) for all eEx, the verifier will produce output in Hʏʙʀɪᴅ2 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 C.

The reduction 23i is parameterized by a fixed index i[r], and it plays the hiding game for C and emulates Hʏʙʀɪᴅ2(n) internally toward (𝒜,𝒵). 23i emulates the first three steps of the experiment faithfully, except that emits its own challenge key k as k𝖲 on behalf of 𝖢𝖱𝖲 in Step 2. Next, 23i samples (e1,,er,e^0,e^1)Exr+2 and computes m0:=(e1,,ei1,e^0,ei+1,,er) and m1:=(e1,,ei1,e^1,ei+1,,er). The reduction emits (m0,m1) to the hiding game, and receives c in response, which it sends to the corrupted prover on behalf of the verifier in Step 4 of the emulated experiment as c𝖵. 23i continues emulating until Step 5 is complete, and then ceases: at this point, the emulated experiment is distributed identially to both Hʏʙʀɪᴅ2 and the ideal-world experiment. If there exists fEx and b{0,1} such that f=e^1be^b and C.𝖤𝗑𝗍t(ci,f)=, then the reduction outputs b; otherwise, it outputs a uniformly random bit.

Next, let us calculate the probability that 23i outputs b=b, where b is the value sampled uniformly by the hiding game for C. Let 𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁i be the event that fEx s.t. feiC.𝖤𝗑𝗍t(ci,f)=. Note that (𝒜,𝒵) can successfully distinguish Hʏʙʀɪᴅ2(n) from the ideal-world experiment only if 𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁=i[r]𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁i occurs. Let 𝖱𝖾𝖽𝗎𝖼𝖾 be the event that f=e^1be^b for an arbitrary fEx{ei} (and note that since the three values are independently chosen, the specific value of f does not matter). Note that 23i always outputs b=b when 𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁i𝖱𝖾𝖽𝗎𝖼𝖾 occurs, but when 𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁i¬𝖱𝖾𝖽𝗎𝖼𝖾 or ¬𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁i occurs, it guesses an output bit uniformly and thus outputs b=b with probability 1/2. Thus we have

Pr[23i outputs b=b]=Pr[¬𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁i]12+Pr[𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁i¬𝖱𝖾𝖽𝗎𝖼𝖾]12+Pr[𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁i𝖱𝖾𝖽𝗎𝖼𝖾]

Recall that ei=e^b and it follows that

Pr[𝖱𝖾𝖽𝗎𝖼𝖾|𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁i]=Pr[(b=0f=e^1e^1e^0)(b=1f=e^0e^0e^1)]=1|Ex|1|Ex|1|Ex|=1|Ex|

and if we define pi(n)=Pr[𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁i] then by combining the last two equations we get

Pr[23i outputs b=b]=1pi(n)2+(|Ex|1)pi(n)2|Ex|+pi(n)|Ex|=pi(n)2|Ex|+12

Next we will combine the reductions for the individual values of i into a single reduction that also plays the hiding game for C. We start by defining

p(n)=Pr[𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁]=Pr[i[r]𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁i]=Pr[¬i[r]¬𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁i]1i[r](1pi(n))=1r+i[r]pi(n)

where the inequality follows from a union bound. The reduction R23 samples i[r] uniformly and outputs what 23i does. We have

Pr[23 outputs b=b]=i[r]Pr[23i outputs b=b]1r=12+i[r]pi(n)2|Ex|r12+p(n)+r12|Ex|r

Finally, by the security of C there must exist a negligible function ε such that |Pr[23 outputs b=b]1/2|ε(n). This implies that

ε(n)|p(n)+r12|Ex|r|p(n)2|Ex|r

and since |Ex| and r=|Ex|n are both upper-bounded by a polynomial in n, it follows that Pr[𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁]=p(n)2|Ex|2nε(n) is negligible in n. Since (𝒜,𝒵) have no advantage in distinguishing Hʏʙʀɪᴅ2 from the ideal-world experiment when the event ¬𝖣𝗂𝗌𝗍𝗂𝗇𝗀𝗎𝗂𝗌𝗁 occurs, we can conclude that

{Hʏʙʀɪᴅ2(n)}n𝖼{Iᴅᴇᴀʟ𝖹𝖪Rn,𝒮𝖯,𝒵(n)}n

and Lemma 1 follows by the transitivity of computational indistinguishability.


Lemma 2: If Σ is an SHVZK sigma protocol for language L with witness-relation R, such that the size of the challenge space Ex is always at most polynomial in |x|, and if C 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 𝒵,

{Rᴇᴀʟπ𝖹𝖪Σn,C,𝒜,𝒵(n)}n𝖼{Iᴅᴇᴀʟ𝖹𝖪Rn,𝒮𝖵,𝒵(n)}n

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.

Simulator 2: 𝒮𝖵

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 𝖹𝖪Rn 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 (k𝖵,t)C.𝖳𝖦𝖾𝗇(1n) and sends k𝖵 to the verifier on behalf of 𝖢𝖱𝖲 Upon receiving x from 𝖹𝖪Rn, 𝒮𝖵 sends x to the corrupted verifier on behalf of the prover in Step 3 of the emulated experiment. Upon receiving c𝖵 from the verifer in Step 4, 𝒮𝖵 has two possible courses of action:

First Hybrid Experiment and Reduction. Now consider a hybrid experiment Hʏʙʀɪᴅ1 which is exactly like the real-world experiment, except that in Step 2, 𝖢𝖱𝖲 uses C.𝖳𝖦𝖾𝗇 to sample k𝖵 instead of C.𝖦𝖾𝗇. By a simple reduction to the trapdoor-indistinguishability property of C, we can show that

{Rᴇᴀʟπ𝖹𝖪Σn,C,𝒜,𝒵(n)}n𝖼{Hʏʙʀɪᴅ1(n)}n

Second Hybrid Experiment and Reduction. Consider a second hybrid experiment Hʏʙʀɪᴅ2, which is exactly like Hʏʙʀɪᴅ1 except that the experiment checks whether C.𝖤𝗑𝗍t(c𝖵)C.𝖮𝗉𝖾𝗇k𝖵(c𝖵,d𝖵), and behaves as though the opening d𝖵 is invalid if so. Suppose there is a pair (𝒜,𝒵) that can distinguish Hʏʙʀɪᴅ2 from Hʏʙʀɪᴅ1; they can do so only by contriving to cause C.𝖤𝗑𝗍t(c𝖵)C.𝖮𝗉𝖾𝗇k𝖵(c𝖵,d𝖵). We will prove that this event happens with negligible probability via a reduction to the straight-line extractability property of C.

The reduction 12 plays the straight-line extractability game for C and emulates Hʏʙʀɪᴅ1(n) internally toward (𝒜,𝒵). In the emulated experiment, 12 emits its own challenge key k as k𝖵 on behalf of 𝖢𝖱𝖲 in Step 2, and it halts the experiment upon receiving (c𝖵,d𝖵) in Step 6. Note that at this point, the emulated experiment is identically distributed to both Hʏʙʀɪᴅ2 and Hʏʙʀɪᴅ1. 12 outputs (c𝖵,d𝖵) to the straight-line-extractability game for C, and wins the game precisely when (𝒜,𝒵) cause the distinguishing condition to occur. By the security of C there exists a negligible function ε that upper-bounds the reduction's probability of a win, which implies that for every PPT (𝒜,𝒵),

Pr[C.𝖤𝗑𝗍t(c𝖵)C.𝖮𝗉𝖾𝗇k𝖵(c𝖵,d𝖵)]ε(n)

and it follows that {Hʏʙʀɪᴅ1(n)}n𝖼{Hʏʙʀɪᴅ2(n)}n.

Third Reduction, over a Sequence of Hybrid Experiments. Next, we introduce a sequence of experiments Hʏʙʀɪᴅ3,h,f for h[r] and fEx, where the latter set is ordered in an arbitrary but deterministic way, which implies a fixed ordering for the experiments, and where f|Ex| denotes the maximal element of Ex. Each Hʏʙʀɪᴅ3,h,f is like the previous experiment in the sequence, except that if C.𝖤𝗑𝗍t(c𝖵) and eh=f, then Hʏʙʀɪᴅ3,h,f samples (ah,zh,f)Σn.𝖲𝗂𝗆(x,f) rather than (ah,uh)Σn.𝖥𝗂𝗋𝗌𝗍(x,w) and zh,fΣn.𝖳𝗁𝗂𝗋𝖽(x,w,uh,f). 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 Hʏʙʀɪᴅ2(n) from Hʏʙʀɪᴅ3,r,f|Ex|(n) with advantage δ(n), then we can write a simple reduction that plays the SHVZK game for Σ and achieves advantage δ(n)/(|Ex|r).

Specifically, the reduction 23 samples h[r] and fEx uniformly, and it emulates the experiment Hʏʙʀɪᴅ3,h,f internally toward (𝒜,𝒵), except that if eh=f, then the reduction outputs (x,w,eh) to the challenger in the SHVZK game and receives (ah,zh,f) 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 b=1 in the SHVZK game, then the experiment emulated within 23 is distributed identically to Hʏʙʀɪᴅ3,h,f; otherwise it is distributed identically to the previous hybrid in the sequence. Thus the advantage of 23 is equal to the expected advantage of (𝒜,𝒵) over the choice of h and f.

If we let δh,f(n) be the advantage of (𝒜,𝒵) in distinguishing Hʏʙʀɪᴅ3,h,f(n) from the previous experiment in the sequence, then by the triangle inequality,

h[r],fExδh,f(n)δ(n)

which implies that the total advantage of 23 is

h[r],fExδh,f|Ex|r(n)δ(n)/(|Ex|r)

By the security of Σ, there exists a negligible function ε that upper-bounds the advantage of 23, and since |Ex| and r=|Ex|n are both upper-bounded by a polynomial in n, it follows that δ(n)|Ex|rε(n) is negligible for every (𝒜,𝒵), and thus

{Hʏʙʀɪᴅ2(n)}n𝖼{Hʏʙʀɪᴅ3,r,f|Ex|(n)}n

Fourth Reduction, over a Sequence of Hybrid Experiments. We introduce a second sequence of experiments Hʏʙʀɪᴅ4,h,f for h[r] and fEx, with the latter set ordered as above. Each Hʏʙʀɪᴅ4,h,f is like the previous experiment in the sequence, except that if C.𝖤𝗑𝗍t(c𝖵)= or ehf, then Hʏʙʀɪᴅ4,h,f sets zh,f:=0 rather than zh,fΣn.𝖳𝗁𝗂𝗋𝖽(x,w,uh,f). Note that in the case that this change has an effect on the hybrid's distribution, the commitment ch,f will never be opened. Again by the hybrid lemma, we know that if there is a pair (𝒜,𝒵) that can distinguish Hʏʙʀɪᴅ3,r,f|Ex|(n) from Hʏʙʀɪᴅ4,r,f|Ex|(n) with advantage δ(n), then we can write a simple reduction that plays the hiding game for C and achieves advantage δ(n)/(|Ex|r). This reduction works exactly like 23, except that it plays the commitment hiding game instead of the SHVZK game, and it emits its own challenge key k as k𝖯 on behalf of 𝖢𝖱𝖲 in Step 1. By the security of C, there exists a negligible function ε that upper-bounds the advantage of this reduction, and since |Ex| and r=|Ex|n are both upper-bounded by a polynomial in n, it follows that δ(n)|Ex|rε(n) is negligible for every (𝒜,𝒵), and thus

{Hʏʙʀɪᴅ3,r,f|Ex|(n)}n𝖼{Hʏʙʀɪᴅ4,r,f|Ex|(n)}n

Fifth Reduction, over a Sequence Ending in the Ideal World. There remains only one event in which the distribution of Hʏʙʀɪᴅ4,r,f|Ex| differs from that of the ideal-world experiment: if C.𝖤𝗑𝗍t(c𝖵)=, then the ideal-world experiment uses (ai,zi)Σn.𝖲𝗂𝗆(x,e) (where eEx is an arbitrary, fixed value) to sample ai for every i[r], whereas Hʏʙʀɪᴅ4,r,f|Ex| uses (ai,ui)Σn.𝖥𝗂𝗋𝗌𝗍(x,w). Note that in both experiments, the corresponding response zi,e is set to 0 in this event, and it is committed but never revealed.

We introduce a final sequence of hybrid experiments Hʏʙʀɪᴅ5,h for h[r], each of which is like the previous experiment in the sequence except that if C.𝖤𝗑𝗍t(c𝖵)=, then Hʏʙʀɪᴅ5,h uses (ah,zh)Σn.𝖲𝗂𝗆(x,e) to sample ah rather than (ah,uh)Σn.𝖥𝗂𝗋𝗌𝗍(x,w). Again by the hybrid lemma, we know that if there is a pair (𝒜,𝒵) that can distinguish Hʏʙʀɪᴅ4,r,f|Ex|(n) from Hʏʙʀɪᴅ5,r(n) with advantage δ(n), then we can write a simple reduction that plays the SHVZK game for Σ and achieves advantage δ(n)/r. This reduction is similar to 23, but it has the value e hardcoded rather than guessing fEx, and it does not need to use zh anywhere. By the security of Σ, there exists a negligible function ε that upper-bounds the advantage of this reduction, and since r=|Ex|n is upper-bounded by a polynomial in n, it follows that δ(n)rε(n) is negligible for every (𝒜,𝒵), and thus

{Hʏʙʀɪᴅ4,r,f|Ex|(n)}n𝖼{Hʏʙʀɪᴅ5,r(n)}n

It remains to observe that Hʏʙʀɪᴅ5,r does not make use of the prover's witness w 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.