Interactive Proofs

When we think of proofs made by Euclid, Gauss, Euler and such, we think of proofs where we are trying to show that given some axioms and declarations, you can show that some claim is true. These are classical proofs.

There is a much more powerful proof system, called interactive proofs, we must think of proofs more interactively such as:

sequenceDiagram
	actor P as Prover
	actor V as Verifier

	note over P, V: claim
	P ->> V: proof
	note over V: accept/reject

Efficiently Verifiable Proofs (NP-Proofs)

For efficiently verifiable proofs (aka NP-Proofs) we have the following setting:

sequenceDiagram
	actor P as Prover
	actor V as Verifier

	note over P, V: claim = x
	note over P: works hard to generate proof w
  note over P: unbounded time
	P ->> V: short proof w s.t |w| = poly in |x|
	note over V: find V(x, w), takes poly time in |x|
	note over V: accept if it is 1, reject otherwise

Let us check some example claims.

Example: is a product of 2 large primes

A trivial proof of this would be the following:

  • Prover sends as a proof.
  • Verifier would check for , and if true it will accept. In doing so, the Verifier learned about , which is not good for us!

Example: is a quadratic residue mod

What this means is that, such that . It turns out that finding such an is a very hard problem, as hard as factoring problem actually.

Even so, our prover is unbounded and can find such an in the end. A trivial proof for this would be:

  • Prover sends as a proof.
  • Verifier calculates and check if , accepts if true and rejects otherwise.

Example: Two graphs are isomorphic

Consider two graphs, as a set of edges and . We say that if there is an isomorphism that maps an edge to such that .

In layman terms, these two graphs are the same graph, but they are drawn a bit differently. Again, a trivial proof here would be to simply send the isomorphism itself to the Verifier. However, finding the proof itself is a very hard problem, although checking if it is correct is not!

NP-Languages

Definition: is an NP-language (or NP-decision problem) if there is a time verifier where:

  • Completeness: true claims have short proofs, meaning that if then there is a sized witness such that .
  • Soundness: false theorems have no proofs, meaning that if then there is no witness, so we have .

The main question of this course is not focused on this subject though. Instead, we are trying to see if there is another way to convince a verifier, for example considering the questions given above.

Zero-Knowledge Interactive Proofs

The main idea of ZKP, although very informally, is that a Prover "will prove that they can indeed prove the claim if they wanted to", but they are not doing that so that information is kept private.

sequenceDiagram
	actor P as Prover
	actor V as Verifier

	note over P: proves "I could prove it if I felt like it"
  P ->> V: sends a ZKP
	note over V: wow, ok I believe that

We need to extend our proof model to work with ZK. We will need two more ingredients:

  • Interaction: rather than passively reading a proof, the verifier engages in a non-trivial interaction with the prover.
  • Randomness: verifier is randomized, i.e. coin tossing is allowed as a primitive operation. Furthermore, the verifier can have an error in accepting/rejecting but with a small negligible probability.

With this, our proof model becomes as follows:

sequenceDiagram
	actor P as Prover
	actor V as Verifier

	note over P, V: claim x
	loop i = 1, 2, ...
		P ->> V: a_i
		V ->> P: q_i
	end
	note over V: accept/reject

Here, the Prover is computationally unbounded but the Verifier must be efficient, i.e. runs in probabilistic polynomial-time (PPT).

Example: Two Colors

Consider a string x="🔴🔵". We claim that there are two colors in this string. However, our verifier is color-blind! How can we prove that indeed this string has two colors?

sequenceDiagram
	actor P as Prover
	actor V as Verifier

	note over P, V: claim: x="🔴🔵" has 🔴 and 🔵
	loop i = 1, 2, ...
		P ->> V: x
		note over V: b ← {0, 1}
		alt b = 1
			note over V: x' := flip(x)
		else
			note over V: x' := x
		end
		V ->> P: x'
		alt x' = flip(x)
			note over P: b' := 1
		else
			note over P: b' := 0
		end
		P ->> V: b'
		note over V: if [b != b'] then reject
	end
	note over V: accept


Let us describe what happens in this interactive proof:

  • The prover sends x to the verifier, say = "🔴🔵".
  • The verifier tosses a coin, and flips if it is heads meaning = "🔵🔴". Otherwise, stays the same, meaning = "🔴🔵". Verifier sends this to the prover.
  • Prover will then compare to , and since he can see colors, he will be able to tell whether is flipped or not. Based on this, he will say = heads or tails, depending on the flip. Prover sends to the verifier.
  • Verifier looks at , and says "wow this guy can actually guess whether I got heads or tails, he must be seeing colors then!". If and does not match, she rejects.
  • This interaction is repeated polynomially many times, until finally the Verifier accepts.

Let us analyze this formally. If there are 2 colors, then verifier will accept. If there is a single color only, for all provers for a single interaction. Repeating this interaction times would mean that which becomes a tiny probability for large . So, it is very unlikely that a prover can keep faking it for that many interactions.

Example: is a quadratic residue mod

Here, the claim is the language .

sequenceDiagram
	actor P as Prover
	actor V as Verifier

	note over P, V: claim: ∃x s.t. y ≡ x^2 (mod N)

	loop i = 1, 2, ...
		note over P: choose r where 1 ≤ r ≤ N and gcd(r,N)=1
		note over P: s := r^2 mod N
		P ->> V: s

		note over V: b ← {0, 1}
    V ->> P: b

	  alt b = 1
			note over P: z := r * sqrt(y) mod N
		else
			note over P: z := r
		end
		note over V: if [z^2 != s * y^c mod N] then reject
	end

	note over V: accept

So basically what the prover is doing is,

  • generates a random quadratic residue
  • asks for the verifier to make a coin toss
    • if heads , it sends
    • if tails , it sends
  • the verifier checks if . if not, it rejects
  • after many interactions, if the verifier hasn't rejected so far, it accepts

Similar to the previous example, if the prover had not known , he would not be able to win many interactions.

So what made this whole thing possible? Let's recap:

  • The statement to be proven has many possible proofs of which the prover chooses one at random.
  • Each such proof is made up of exactly 2 parts: seeing either part on its own gives the verifier no knowledge; seeing both parts imply 100% correctness.
  • Verifier chooses at random which of the two parts of the proof he wants the prover to give him. The ability of the prover to provide either part, convinces the verifier.

Interactive Proofs for a Language

Definition: is an interactive proof for , if is probability polynomial () time, and:

  • Completeness: if then always accepts. Formally: .
  • Soundness: if then for all cheating prover strategies, will not accept except with negligible probability. Formally: for such cheater provers , it holds that
  • In a good scenario, we would except and where is a negligible function. However, we might also show that or equivalently: .

Definition: Class of languages IP = .


What is Zero-Knowledge?

For true statements, we want the following to be true: what the verifier could have computed before the interaction IS EQUAL TO what the verifier can compute after the interaction.

So basically, these interactions had no effect whatsoever on the computational power of the verifier! That is what zero-knowledge means. Now, let's be more formal.

sequenceDiagram
	actor P as Prover
	actor V as Verifier

	note over P, V: theorem T
	loop i = 1, 2, ...
		P ->> V: a_i
		V ->> P: q_i
	end
	note over V: accept/reject

After an interactive proof, the verifier has learned:

  • that the claim/theorem is true
  • a view of interactions, i.e. the transcript of answers and queries, and the coins that has tossed.

A view is formally defined as a random variable from the probability distribution over coins of and interactions with :

The Simulation Paradigm

's view gives him nothing new, if he could have simulated that view on it's own. In other words, the simulated view and real view are computationally indistinguishable!

In cryptography, we have the notion of computational indistinguishability, where there are two distributions and , and a distinguisher that tries to distinguish these two. In doing so, he will sample both distributions at random, and will try to guess from which distribution that sample is taken from. If the probability of distinguishing this sample is at most then and are indistinguishable!

That is a rather heavy paragraph, so let me give an example. A vendor is selling watches, and they have a set of real Rolex watches, and a set of fake Rolex watches. You go to the shop, and ask for a sample. The vendor secretly flips a coin,

  • if heads, vendor gives you a real Rolex watch
  • if tails, vendor gives you a fake Rolex watch

You try to guess whether the flip was heads or tails. If the probability that you guess correctly is at most then the set of fake Rolex watches are indistinguishable from the set of real Rolex watches! Good for the vendor 🙂

Definition: An interactive protocol is honest-verifier zero-knowledge for a language if there exists a PPT algorithm (a simulator) such that the following two probability distributions are poly-time indistinguishable:

  • , here is for technical reasons and for large you can just ignore it.

A caveat about is that we allow it to run in expected-poly-time. Meaning that there may be some very unlucky cases where the algorithm takes a long time, but in expectation it is poly-time.

Also notice that this is for honest verifiers, and we would like the proof to hold for all verifiers. So, our final definition should cover all verifiers.

Definition: An interactive protocol is zero-knowledge for a language if for every PPT , there exists a PPT algorithm (a simulator) such that :

Flavors of Zero-Knowledge

Again, consider the real distribution and simulated distribution . Based on these, there are flavors of ZK:

  • Computationally Indistinguishable Distributions (CZK), where the two distributions are computationally indistinguishable.
  • Perfectly Identical Distributions (PZK), where the two distributions are the same.
  • Statistically Close Distributions (SZK), where the two distributions are statistically close.

A Simulation for Quadratic-Residue (QR) Proof

Consider the QR proof from above, where we were able to prove with zero-knowledge that we know there exists some such that . Check that interactive proof again, what is the here? We see that the verifier learns about , it also generates some coin toss value and finally it learns .

So, . A simulator should output the same view on its own! Can we do it? Yes, in fact, we can do it perfectly!

Simulator works as follows:

  1. First, pick a random bit .
  2. Then, pick random .
  3. Compute .
  4. Output .

This is identical to what the honest verifier had viewed in the actual interactive proof. Notice that the simulator did not have to know about , but thanks to that division on 3rd step, it could produce a valid for the view.

What about an adversarial verifier, for example, one that does not pick at random? Well, we can still construct a simulator:

  1. First, pick a random bit .
  2. Then, pick random .
  3. Compute .
  4. If then output , otherwise go to step 1 and repeat!

With this setting, even if we don't know what is doing behind the scenes, we should expect that our randomly picked should match their fixed and adversarially computed . In fact, in expectation this takes 2 attempts, since it is just a coin flip!

ZK Proof of Knowledge (ZKPOK)

Notice that prover has prove not only that the claim is correct, but also that they know a square root modulo . This is more than just a proof of the claim! So, consider the language for poly-time relation .

Definition: is a proof of knowledge (POK) for if PPT knowledge extractor algorithm such that , in expected poly-time outputs such that .

Here, means that may run repeatedly on the same randomness, possibly asking different questions in every execution. This is called the Rewinding Technique.

A ZKPOK for Quadratic-Residue (QR) Proof

We have seen the ZKP for a prover that knows such that . Let's construct the Extractor for this proof.

sequenceDiagram
	actor P as Prover
	actor E as Extractor

	note over P, E: claim: ∃x s.t. y ≡ x^2 (mod N)
	note over P: choose r where 1 ≤ r ≤ N and gcd(r,N)=1
	note over P: s := r^2 mod N
	P ->> E: s
	E ->> P: 1 (heads)
  P ->> E: z = r
	note over P, E: rewind
	P ->> E: s
	E ->> P: 0 (tails)
	P ->> E: z = rx
	note over E: output rx/r = x mod N

Notice the rewind there, hence the Rewinding Technique. What this trick does is that it allows us to access again! In the interactive proof, we would normally have a new random every time the prover sent us something, but here we can have access to the same again and again. As such, we were able to obtain and , and thus find via division.

Example: Graph Isomorphism

Consider the graph isomorphism problem from the examples at the beginning. The proof is similar to how it works for quadratic residues. So, the claim is that there is an isomorphism between and .

  • The prover produces a random graph and sends it to verifier.
  • The prover finds an isomorphism from to .
  • The prover also finds an isomorphism from to .
  • The verifier sends a coin toss (bit) to prover, and prover returns .
  • Verifier checks if .
  • These steps happen repetitively, until some poly-time later if the verifier did not reject so far, it accepts.

Notice that since then . So, the prover indeed knows . However, since both isomorphisms are never given to the verifier at the same time, the verifier can't find that isomorphism!

This ZKP is actually of flavor PZK, so the two distributions of real view and simulator view are identical! Furthermore, there is a ZKPOK that prover knowns an isomorphism from to . Formal proofs left to the reader.


Graph 3-Colorability

Do all NP Languages have ZK Interactive Proofs? Proven in [Goldwasser-Micali-Widgerson'86], the answer is YES! They show that if one-way functions exist, then every in NP has computational zero-knowledge interactive proofs. The proof will come from an NP-complete problem known as Graph 3-Colorability, hence the title of this section.

The ideas of the proof are as follows:

  1. Show that an NP-complete problem has a ZK interactive proof. [GMW87] showed a ZK interactive proof for (graph 3-colorability problem). For any other in NP, due to NPC reducibility. Every instance can be reduced to a graph such that if then is 3-colorable, and if then is not 3-colorable.
  2. Existence of one way functions imply a hiding & binding bit commitment protocol.

What is a Commitment Scheme?

In a commitment scheme, there are two functions:

  • takes an input , let us think of it as a bit in , and produces a commitment . Once committed, the commitment does not reveal whether is 0 or 1.
  • allows a receiver of a commitment to open it, and reveal what is in there. In this case, some bit that is either 0 or 1.

For a commitment scheme,

  • Binding means that if you have committed to some , then the decommit procedure on that commitment may only reveal , not something else.
  • Hiding means that from outside, you can't guess the bit with more than 1/2 probability.

An example commitment scheme would be to use a semantically secure probabilistic encryption scheme.

  • where sender chooses some random and sends .
  • where sender send the same random and , and receiver rejects unless .

Proving a graph is

Suppose there is a graph as in the set of vertices and set of edges, and the prover knows some coloring which is a mapping that maps a vertex to a color.

  1. Prover picks a random permutation of colors and the colors the graph with this permutation. It still is valid because its just different colors for the same graph. We show this as for . Then, the prover commits to each newly colored vertex by running protocol.
  2. Verifier selects a random edge and sends it to prover.
  3. Prover runs on the colors of edge points and reveals and .
  4. Verifier rejects if , otherwise it repeats steps 1-3 and accepts after iterations.

Now, let's look at the properties of this interactive proof:

  • Completeness: if is 3-colorable, then the honest prover uses a proper 3-coloring & the verifier always accepts.
  • Soundness: if is not 3-colorable, then for all it holds for (meaning that we have iterations as many as the square of number of edges) that,

  • Zero-Knowledge: Easy to see informally, messy to prove formally.

Honest-Verifier Computational ZK Simulator

First, let us examine the view of this interactive proof.

  • We have an edge
  • We have the commitments to each vertex coloring as .
  • We have the decommit of colors .

Let us show the honest-verifier CZK simulator. For the graph the simulator will choose a random edge . Then, it will pick random colors such that . For all other vertices , it will set to some fixed color, and commit to all .

The output of simulated view is:

  • We have an edge
  • We have the commitments to each vertex coloring .
  • We have the decommit of colors .

As we can see, the views are kind of indistinguishable! They are not the same though, as the commitments to vertices other than are illegal colors, the simulation had no idea how to color the graph anyways. However, since the distinguisher can't see what is under the commitment (hiding property) they are computationally indistinguishable.

The simulator for all verifiers is also given in the lecture, but not noted here.


Practical Applications of ZK

So far, we have seen some ZK proofs of claims:

  • is the product of two primes .
  • is a square .
  • Two graphs are isomorphic.

There are a lot more proofs in the domain of Interactive Proofs, for example see the following claims:

  • Any SAT Boolean Formula has satisfying assignment.
  • Given encrypted inputs , and some program , the program has output such that .
  • Given encrypted inputs , and some encrypted program , the program has output such that .

These are all provable in ZK, and when you think about the last example that is pretty awesome. Let's talk a bit more general:

  • You can prove properties about some message , without revealing itself but only showing or .
  • You can prove relationships between messages without revealing them, such as or . In fact, you can show that there is some value that when used with a poly-time function , you have .

In general idea: you can use ZK as a tool to enforce honest behavior in protocols without revealing any information. To do that, imagine that a protocol player sends a message and along with that new message, it sends a ZKP that for some history and randomness . Furthermore, they will commit to this randomness as . This makes honest behavior with ZK possible since is in NP.

Some more real-world applications are:

  • Computation Delegation
  • ZK and Nuclear Disarmament
  • ZK and Forensics
  • ZCash: Bitcoin with Privacy and Anonymity
  • ZK and Verification Dilemmas in Law

Complexity Theory: Randomized Analogue to NP

No RandomizationsWith Randomizations (Coin toss)
Efficiently SolvableP (Polynomial time)BPP (Bounded-error Probabilistic Polynomial time)
Efficiently VerifiableNP (Non-deterministic Polynomial time)IP (Interactive Polynomial time)

Is IP greater than NP?

The answer is YES! Let's go over an example. Suppose that you have two graphs that are NOT isomorphic. The shortest classical proof of this would be to go over all possible isomorphisms (takes time in the order of factorials!) and show that none of them work.

However, there is an efficient interactive proof!

sequenceDiagram
	actor P as Prover
	actor V as Verifier

	note over P, V: claim : G_0 and G_1 not isomorphic
	loop i = 1, 2, ..., k
		note over V: flip coin: b = {0, 1}
		note over V: pick random isomorphism γ
		V ->> P: H := γ(G_b)
		alt H isomorphic to G_0
		note over P: b' = 0
	  else
		note over P: b' = 1
		end
		P ->> V: b'
		note over V: reject if b' != b
	end
	note over V: accept

Here is the idea of this proof: if and are indeed isomorphic, then the prover would have no idea whether is isomorphic to or , because it would be isomorphic to both of them! So, he would have at most 1/2 chance in guessing the correct bit. After iterations, the possibility of not being rejected by the verifier becomes , which is negligible.

Also, how does prover find isomorphisms like that so easily? Well, remember that the prover is all-powerful and computationally unbounded, so they are very well allowed to find such hard stuff.

Here is what is different about this IP though; here, the Verifier is doing more than just tossing coins. Here, it actually picks a random isomorphism, and creates the graph from that!

Completeness and soundness hold for this proof; however, it is not zero-knowledge! This is because if the verifier is not honest, and it's just someone that wants to find out whether some graph is isomorphic to , they can very well find it by sending to the honest prover! Therefore, there is knowledge that is learned about depending on what the prover replies to that.

The solution to this problem is rather straightforward: have the verifier send a ZKP that they know the isomorphism , this way the reply from prover does not change the knowledge of verifier.

Arthur-Merlin Games & is AM = IP?

In the Interactive Proof's so far, the Verifier was hiding the result of coin tosses and also was able to do some extra computations, it was a PPT Verifier so it could do anything that the time allows. However, in an Arthur-Merlin game [Babai-Moran'88], the Verifier will only acts as two things:

  • A public coin tosses
  • A decision function

So, the prover will see in clear the result of coin tosses!

sequenceDiagram
	actor P as Prover (Merlin)
	actor V as Verifier (Arthur)

	note over P, V: claim "x in L"
	loop i = 1, 2, ..., k
	V ->> P: coins_i
	P ->> V: answer_i
	note over V: reject if bad
	end
	note over V: accept

The question here: is Interactive-Proofs more powerful (i.e. can prove more claims) than Arthur-Merlin Games? Is coin privacy necessary?

The answer turns out to be no, AM = IP actually [Goldwasser-Sipser'86]!

Fiat-Shamir Paradigm

You can remove the interaction in AM protocols via Fiat-Shamir Paradigm [Fiat-Shamir'87]. Let that sink in, you are literally removing the interaction from an interactive proof, more specifically, you are removing the coin tossing machine. How is that possible?

Let be a cryptographic Hash function, meaning that you can use this function as a random oracle that when you feed any string it gives you back random string of length , essentially an output of coin tosses.

The idea is the following:

  • Normally, we had a Prover that sent some answer and got back from the Verifier.
  • Now, the Prover will send but instead of waiting for coins by the Verifier, it will generate its own coins simply via .

What if the Prover needs coins before sending any answer? In that case, the first message of coins is posted "publicly" for all to see, and then Fiat-Shamir heuristics is applied to the rest.

However, Fiat-Shamir does not mean you can make all interactive proof's into non-interactive proofs! Yet, many specific AM protocols with an efficient prover can benefit from this heuristic.

Efficient Verification

Problem ClassObjective IdeaClassical ProofsInteractive Proofs
NP a solutionYESYES
Co-NP0 solutions?YES
#P many solutions?YES
PSPACE?YES

It was shown by [Fortnow-Karloff-Lund-Nissan'89] and [Shamir'89], that IP can be used to prove many many more problems than what classical proofs are able to! In fact, this brought the question: what if we have something more powerful than IP, for example, what if there is a second prover?

Indeed, as shown in [Benor-Goldwasser-Kilian-Wigderson'88], you can prove a lot more with two provers! In fact, you now have unconditional PZK for NP problems. [Babai-Fortnow-Lund'91] has shown that you can even prove NEXPTIME (non-deterministic exponential time) problems with interactive proofs.

Going even further, [Reichardt-Unger-Vazirani'13] has shown that a classical verifier can verify the computation of two entangled but non-communicating polynomial time quantum algorithms. Finally, a recent work [Ji-Natarajan-Vidick-Wright-Yuen'20] has shown that with two not necessarily efficient quantum provers, and a classical verifier, you can prove all Recursively Enumerable Languages. Kind of meaning like everything; that's one bizarre result!