Zero knowledge: basics


Cryptography 2019-05-25

This post introduces the notion of a zero knowledge protocol. It is rudimentary. (I should have posted this earlier for the previous posts to make more sense. 🤣)


Zero Knowledge

The name Zero Knowledge sounds absolutely chic, but what is it?

The tutorial1 by Oded Goldreich described it as follows,

Zero-knowledge proofs, introduced by Goldwasser, Micali and Rackoff2, are fascinating and extremely useful constructs. Their fascinating nature is due to their seemingly contradictory definition; zero-knowledge proofs are both convincing and yet yield nothing beyond the validity of the assertion being proved.

So how are such proofs possible? One crucial component is the concept of interactive proof, which will be demonstrated in the following simple scenario (introduced in a lecture in Theory of Computation by Prof. Ran Duan at IIIS, possibly related to ‘‘Showing without telling’’3).

An example

Suppose you are trying to convince a color-blinded friend that two apples are of different colors (e.g. green and red). We can perform the following protocol, in which we use to denote the prover and to denote the verifier.

Apples in a color-blinded view
(w:en:User:Limbicsystem- English Wikipedia, src )

The protocol

  1. holds the apples in the hands and turn back.
  2. flips a coin, if the result is heads he switch the apples; otherwise he does nothing.
  3. now asks whether he had switched the apple.

Analysis

By the above example, we have demonstrated that interaction may really add something to the more traditional concept of proof. One thing to note is that the above protocol is automatically zero-knowledge; the prover does not need to tell which apple is of which color: he only needs to tell whether the apples are switched.

Use cases of ZK

Proving certain assertions is very important when it comes to protocol executions. However, revealing the proof directly and publicly is usually not the best option, e.g. when you want to show something like ‘‘you know the password of an account’’. And even worse, revealing in an relation will make anyone seeing the proof capable of proving it to others, raising a lot of concerns when malicious verifiers are present.

ZK finds usages in the following scenarios (from ‘‘Demonstrate how zero-knowledge proofs work without using math’’4).

  1. Ownership: prove that you own a private key.
  2. Account Balance: prove that your account has enough available balance for some transaction.
  3. Sealed Bid Auctions: prove who won, without revealing any bid.
  4. Any problem in admits ZK proof systems.

One can see that Ownership and Account Balance are important tasks when it comes to anonymous payments in digital currency applications (and in fact Zcash uses ZKs). And Sealed Bid Auctions are important to guarantee the auctioneer is not cheating in an online auction.

An arguably very important use case of ZK is the GMW compiler (conceived in GMW19875), which uses ZK to ensure parties involved in a protocol to act according to the predetermined protocol, by requiring the parties to publish ZKs on their action, but without revealing it.

A formal definition

A zero-knowledge protocol for any relation is defined by two PPT (Probabilistic Polynomial Time) interactive algorithms, a prover and a verifier . Initially the prover is given the statement and a witness if , and the verifier is given only the claimed statement .

Definition (The simulation paradigm)

(Zero-Knowledge proof) The protocol is is a zero-knowledge proof protocol for the relation if it satisfies the following requirements:

  1. Completeness: If and both players are honest then the verifier always accepts.
  2. Soundness: For every malicious and computationally unbounded prover , there is a negligible function such that if is a false statement (i.e. for all ), the interaction of with on input rejects except with probability.
  3. Zero-knowledge: For every malicious PPT verifier there is a PPT simulator such that the view of interacting with on inputs for which , is computationally indistinguishable from the output distribution of .
    That is, there exists a negligible function such that for every efficient non-uniform distinguisher and every such that we have

    where denotes the view of , i.e.its input , its coin-tosses and its incoming messages.

Intuitively, the zero-knowledge requirement states that, instead of running the protocol, the verifier can run instead to generate the views. So the verifier can ‘‘simulate’’ an execution of the protocol using only and random coins. Therefore what the verifier sees during the protocol does not increase the knowledge of .


This post is a modification from a course project with Yuanhao Wang, on zero knowledge during the Fundamentals of Cryptography, Fall 2018 taught by Prof Wenfei Wu from IIIS.


Reference:

  1. Oded Goldreich. Zero-Knowledge: a tutorial, 2010. tutorial

  2. Shafi Goldwasser, Silvio Micali and Charle Rackoff. The Knowledge Complexity of Interactive Proof Systems. 

  3. Oded Goldreich. Showing without telling, 2003. [Online, accessed 9-January-2019] Oded Goldreich’s page

  4. Konstantinos Chalkias. Demonstrate how zero-knowledge proofs work without usingmaths, 2017. [Online, accessed 9-January-2019], LikedIn 

  5. Oded Goldreich, Silvio Micali, and A. Wigderson. How to play any mental game or a com-pleteness theorem for protocols with honest majority. InProceedings of the NineteenthAnnual ACM Symposium on Theory of Computing, New York, NY, USA, 1987. ACM,ACM