zero knowledge: Nonlinear Function
Created: October 23, 2022
Modified: October 23, 2022

zero knowledge

This page is from my personal notes, and has not been specifically reviewed for public consumption. It might be incomplete, wrong, outdated, or stupid. Caveat lector.

A zero-knowledge proof allows a prover to demonstrate that it possesses certain information, without revealing that information to the verifier.

Formally, the prover PP must convince a verifier VV that some object xx is in a set (formal language) L\mathcal{L}. The prover possesses information, a witness ww, that demonstrates this. For example, xx may be a graph which the prover wants to demonstrate belongs to the set L\mathcal{L} of three-colorable graphs. To do this it would serve to exhibit a three-coloring of xx: this is the witness ww. A zero-knowledge proof scheme allows the prover to demonstrate their claim without revealing ww.

We model the prover and verifier PP and VV as probabilistic polynomial-time algorithms that send a sequence of messages back and forth, ending with the verifier outputting either ACCEPT or REJECT.

Such a scheme is required to have three properties:

  1. Completeness: if xLx\in\mathcal{L} and ww is the correct witness, then VV outputs ACCEPT.
  2. Soundness: if x∉Lx \not\in \mathcal{L}, then a 'dishonest' prover (any probabilistic polynomial-time algorithm P^\hat{P}) will convince the verifier to ACCEPT only with some probability that goes to zero at a faster-than-polynomial rate (i.e., a negligible function of the interaction length).
  3. Zero-knowledge: the verifier doesn't learn anything except that xLx \in \mathcal{L}. Formally, there must exist some probabilistic polynomial time algorithm SS, the 'simulator', such that for any xLx\in \mathcal{L}, the simulator can generate a trace τ\tau' whose distribution is polynomial-time indistinguishable from that of a real prover-verifier interaction trace τ\tau.

Note that the simulator doesn't have access to the witness ww (and being a poly-time algorithm, doesn't have the computational capability to discover it), so its traces cannot leak any information about ww. If these traces are indistinguishable from those of real interactions, then the real traces can't leak anything either. But since the interaction was supposed to prove access to ww, how is it possible to produce an indistinguishable trace without access to ww? The key is that it's the interaction itself that is convincing, not the trace that it produces. The verifier knows that it is producing its challenges honestly, not colluding with the prover, but a third party viewing the trace will not know this. Because the simulator controls both sides of the trace, the simulated 'verifier' can generate 'random' challenges that always happen to correspond to what the simulated 'prover' is prepared to answer; equivalently, the prover can anticipate the verifier's challenges and prepare accordingly.

Given the crucial role of interaction in classic zero-knowledge proofs, it is somewhat surprising that non-interactive zero-knowledge proofs (zk-SNARKs) are possible, but they are, and this also turns out to be practically very impactful.

Zero-knowledge proofs for NP

We can show that all languages in NP admit zero-knowledge proofs by demonstrating a proof scheme for a particular NP-Complete problem: three-colorability of a graph.

Let ww be a three-coloring of a graph xx; note that by permuting the colors one can actually generate six equivalent such colorings w1,,w6w_1, \ldots, w_6. A single round of the protocol works as follows:

  1. The prover secretly chooses one of the permutations w1,,w6w_1, \ldots, w_6 at random, and uses a commitment scheme to commit to the color of each vertex in the graph without revealing these colors to the verifier.
  2. The verifier chooses a pair of adjacent vertices at random, and challenges the prover to reveal the colors of just those vertices.
  3. The prover reveals that the adjacent vertices have different colors.

It is easy to see that this scheme is complete: if the prover really does possess a three-coloring of the graph, they can go for as many rounds as the verifier requires. To see that the scheme is sound, consider a dishonest prover without access to a three-coloring: then the coloring it commits to has at least one edge pair with identical colors, so the chance that it 'gets lucky' and fools the verifier at each step is at most (E1)/E(|E| - 1)/|E|. The probability of fooling the verifier over nn independent rounds thus goes to zero exponentially quickly.

The fact that the proof is zero-knowledge follows from the hiding property of the commitment scheme --- so the verifier learns nothing other than the colors of the edge it asks about --- and from the random permutation of colors at each step, which prevents the verifier from building up a larger picture across multiple steps.

References