Zero Knowledge Proofs, explained.

Thinkin Clear
5 min readJun 24, 2021

--

Grab a cup of tea.

In this article, I’ll walk you through the basics of Zero Knowledge Proofs with 2 examples and a bunch of illustrations. This will show you how you can verify some data without actually revealing it!

Zero-Knowledge Proofs allow data to be verified without revealing that data. Because they don’t reveal the actual data they are trying to verify, they have the potential to revolutionize the way data is collected, used and transacted.

So let’s consider a simple example to begin with. Consider the following puzzle. The goal of this puzzle is to find Waldo (wearing glasses, red-and-white sweater, blue jeans and a beanie cap). Let’s say I wanted to prove to you that I know where Waldo is.

How can I prove it without *actually revealing* his exact position? Here’s the way: I will ask you to close your eyes, and cover the entire puzzle with a *black paper*, much larger than the actual puzzle. Then I would make a *small cutout* in it, revealing Waldo.

Then I’ll ask you to open your eyes. The tiny cutout allows you to see Waldo and verify that I actually know where Waldo was. But how have I *concealed* the actual position of Waldo from you?

Well here’s the thing: Since the size of black-paper is much larger than the actual puzzle, I have also *not revealed the actual position* of Waldo to you.

A true Zero Knowledge Proof needs to satisfy these 3 criteria:

  1. Completeness: it should convince the verifier that the prover knows what they claim they know
  2. Soundness: if the claim is false, it cannot convince the verifier that the prover’s claim is true
  3. Zero-knowledge-ness: it should reveal nothing else to the verifier.

Let’s consider another example:

Imagine you have a friend, Adam, who is colorblind and can’t see the difference between green and red ball. To him, both balls are the same color and you want to prove to him that they are in fact, 2 differently colored balls.

How can you prove to him that they are differently colored balls, without revealing the colors of the balls?

Here’s how: You give both balls to Adam and take note which ball is in which hand. Then Adam will put the balls behind his back and chooses to either swap them or not. Then he shows them to you and you have to tell whether Adam has switched them or not.

If you are not color-blind, this is very easy to do. But your friend is suspicious, because he cannot see the difference and thinks that you are guessing. We cannot blame him, since you have 1/2 chance of guessing it correctly.

How can Adam be sure of your claim? He can repeat the same process again. If you do answer correctly the second time, then the chances of your claim being false is 1/4 (1/2*1/2).

If Adam continues this process again, the chances of false claim drop to 1/8. If Adam keeps repeating this experiment 7 more times, the probability that you are cheating drops to 0.09%. Such a low probability is good enough to convince Adam that your claim is true.

Eureka! We have proven to Adam that the balls are differently colored, without actually revealing the colors! This was another example of a Zero Knowledge Proof.

This was a simple example of zero-knowledge proof (ZKP). There are 2 types of ZKPs : Interactive and non-interactive. Both examples were interactive since every time I need to prove my claim to someone, I need to redo all the work.

In a non-interactive proof, I can deliver a proof that anyone can verify for themselves. So in what way might ZKP’s can change the world? Well, here are a few:

  • You can actually prove some piece of information (your ID, Social Security Number, salary) without revealing it. This puts people back in control of their data.
  • A good use-case is that you can get a loan by verifying your salary claim, without revealing it.
  • The most prominent use of ZKPs thus far is Z-Cash, a cryptocurrency that allows for private transactions.
  • The AdEx Network allows for ZKP auctions in which a user can bid for the price of placing an ad without revealing that price to others.
  • ZKP’s will have a huge impact in finance, health-care and other industries, by enabling transactions while protecting data privacy.

Before ending this article, I wanted to add that zero knowledge proof is *not* a new concept. It was first introduced in the article “Knowledge and complexity of interactive proof systems” in *1985*.

It is getting more traction now, as some blockchain projects are implementing it.

If you liked this article, consider following me & clapping for this post. Also follow me on Twitter, where I am much more active. I also write exclusively on Thinkin Clear.

END CREDITS — The illustrations in this thread were taken from the following video.

--

--