Zero-knowledge proof or zero-knowledge protocol is a technique/method where you prove to someone that you know something without revealing to them what you actually know. If that sounds a bit non-sensical, let me clarify.
Let us say that you know a secret about something. You wish to convince your friend that you know this secret without actually revealing the secret to them. How would you do this? This is where the business of zero-knowledge proofs comes in handy. It turns out that this concept finds very useful applications in the field of cryptography (including cryptocurrencies).
In this essay, I will be covering the intuition behind the notion of zero-knowledge proofs using a couple of illustrated examples. Following this, I will proceed to cover the formal requirements for establishing zero-knowledge proofs. At the end of this essay, you should ideally have an intuitive understanding of the concept as well as the formal requirements for implementing it. Let us begin.
This essay is supported by Generatebg
Zero-Knowledge Proof Using a Safe
Suppose that you know the combination to a state-of-the-art safe. This particular safe secures its contents using three different locking technologies. So, it is quite something to have access to.
You now wish to prove to your friend that you know the safe’s combination without actually revealing the combination to her. Your method to do so is quite simple. You first ask your friend to write something down on a piece of paper and fold it without revealing the text to you.
Then, you ask your friend to place the folded piece of paper into the open safe (which features a jumbled combination when the door is open). Following this, you ask your friend to shut the safe close. At this point, both of you verify that the safe is locked and cannot be opened by force.
Now, you turn the safe to your point of view such that your friend cannot see you entering the combination. You enter the combination, open the safe, unfold the piece of paper, and read the text. Once you have noted the text in your mind, you fold the piece of paper back, place it inside the safe and lock it once again. You then go on to reveal to your friend the text that she had written on the piece of paper.
If your friend does not find this act convincing, you repeat the process with different pieces of paper/texts enough times to prove to her that you actually know the safe’s combination. Even though you prove your knowledge, note that your friend never got any information about the combination itself. This example is useful to build an initial intuition, but let us take it up a notch with the next example.
Zero-Knowledge Proof Using the Ali Baba Cave
The example we are about to cover now was originally published by Jean-Jacques Quisquater et al. in a paper titled “How to Explain Zero-Knowledge Protocols to Your Children” (linked in the reference section at the end of this essay).
In this hypothetical example, the old Ali Baba cave has been discovered in reality. It was not just fiction, all along! The cave features one entrance and two possible paths around a toroidal geometry with a magical door at the opposite side of the entrance. The door just completes the toroidal circuit when opened.
Peggy has come to learn about the magic words that open the door, and wants to prove to Victor that she can perform the magic without revealing the magic words to him. To do this, she first goes inside the cave without Victor’s knowledge of which path (of the two) she took.
After this, Victor stands before the fork and shouts out “A” for the clockwise path and “B” for the anti-clockwise path. If Victor shouts “A” and Peggy took path “B”, all she needs to do is open the magic door, and appear from the other side. Assuming that Victor has a 50% chance of calling the same path that Peggy took, Victor needs more convincing.
If the duo repeats this game 40 times in the honour of the 40 thieves, the probability that Peggy would get all of the instances right purely by luck would be 1 in 2²⁰. In other words, the duo can repeat the game as many times as necessary until Victor is convinced. With this example covered, let us now proceed to examine some of the formal requirements for establishing zero-knowledge proofs.
Formal Requirements for Zero-Knowledge Proof
By formal requirement, any zero-knowledge proof has to satisfy three conditions:
1. Completeness
2. Soundness
3. Zero-Knowledge
Completeness requires that both players stick to the protocol and no one cheats. One interesting thing to note here is that incomplete zero-knowledge proofs explain a lot of magic tricks. The prover (Peggy) uses some kind of deception to convince the verifier (Victor) to perform the magic trick. In an ideal zero-knowledge proof, deception and rule-breaking are not allowed (hence completeness).
Soundness requires that it is improbable (not impossible!) for a cheating prover to convince an honest verifier. This is what Victor and Peggy achieved by repeating the same game 40 times to achieve a probability of pure luck of 1 in 2²⁰.
Finally, zero-knowledge requires that Victor would never get to know the secret albeit he is convinced that Peggy knows the magic words. Even if an eavesdropper were to listen in on their conversation, the eavesdropper would hear either “A” or “B”. This would give no useful information about the magic words themselves.
However, if Victor used coin-tosses to call out “A” or “B” (to ensure 50% chance of either), and recorded the whole adventure using a video-camera, it would break the zero-knowledge requirement. As to why this is the case, check out the paper I’ve linked at the end of this essay.
Final Remarks
Did you know that I did not choose the names “Peggy” and “Victor” just randomly? It is actually convention in the field of zero-knowledge proofs to refer to the prover as Peggy and to refer to the verifier as Victor.
Furthermore, it is important to note that zero-knowledge “proofs” are unlike mathematical proofs. They just aim to convince the verifier by ensuring that the probability of luck/cheating is negligible. To achieve this, a typical zero-knowledge proof would need to satisfy the formal requirements of completeness, soundness, and zero-knowledge.
This concept finds a wide array of both technological and ethical applications. Anything that requires an authentication system could benefit from zero-knowledge proofs, provided that it is possible to meet the three necessary conditions of completeness, soundness, and zero-knowledge.
Reference and credit: Quisquater et al.
If you’d like to get notified when interesting content gets published here, consider subscribing.
Further reading that might interest you: How To Benefit From Computer Science In Real Life? and How To Really Deal With The Friendship Paradox?
If you would like to support me as an author, consider contributing on Patreon.
Comments