Today we’re going to talk about a cybersecurity idea in blockchain known as “Zero-Knowledge Proofs”.
Zero-knowledge proof is the ability to prove a secret without revealing what the secret is.
Let’s review an example:
Let’s say there are two toy cars, identical in shape and size, except, one is red and one is blue. Jimmy, who is color-blind, holds the toy cars behind his back. Jimmy then shows one of the cars to David. Jimmy then hides that car behind his back and shows David the other car. David can consistently detect the switch because the cars are different colors, but he never has to reveal the color of the cars to Jimmy in order to prove the secret.
That is exactly what Zero-Knowledge Proofs is about, they allow me to prove to another party that I have a certain piece of knowledge without revealing what that knowledge is.
Zero-Knowledge Proofs are often referred to as zk-SNARKs, which stand for “Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge”, or zk-SNARKs for short, but, if you want to be simple, we can just call them Zero-Knowledge Proofs.
A great example of a Zero-Knowledge Proof is what is called the cave door analogy.
Pretend that there’s a circular cave, with only one entrance or exit and at the back of this circular cave there’s a door which can be unlocked using a secret code entered onto a keypad.
If I want to prove to you that I know the unlock code without revealing that unlock code to you, all I need to show is that I can walk into one end of the cave, open the door, and come out the other end.
If I’ve successfully demonstrated that, then you know without a doubt I’ve been able to unlock that door, but yet I haven’t revealed that unlock code to you.
This simple cave door analogy is a Zero-Knowledge proof, and if you can remember this cave door analogy, then you’ll understand why Zero-Knowledge Proofs are so important in blockchain.
For example, a user may make a request to send another user some money.
The blockchain naturally wants to make sure, before it commits this transaction, that the user sending the money has enough to send.
However, the blockchain doesn’t really need to know or care who is spending the money, or how much total money they have.
Being able to answer a question of “Does a user have enough money to send to another user” without knowing who the user is, or exactly how much they have, is one of the primary use cases for Zero-Knowledge Proofs in blockchain.
So from now on, when you hear about zk-SNARKs, don’t get intimidated.
It’s not a complex idea. Just think of Zero-Knowledge Proofs and the cave door, think about how important it is in blockchain to be able to prove a claim without actually revealing the information behind that claim, and you’ll understand Zero-Knowledge Proofs.
One of the blockchain-based system using Zero-Knowledge Proofs is ZCash.