What is a Zero-Knowledge Proof?
Say a friend tells you they solved a really hard puzzle, but they won't show you how.
You don't fully believe them. Maybe they're bluffing.
So you say, okay, prove it.
The problem is that the obvious way to prove it is to show you the answer, and once they
do that, the secret is gone. Anyone standing nearby just learned it too.
A zero-knowledge proof is a way around this. It lets your friend convince you they know the answer while still keeping the answer to themselves.
Prove It Without Revealing It
You're not trying to find what the secret is, you want to know whether they actually know it without them telling you the sceret.
You probably depend on this kind of thing already:
- When you log into a website, you want to prove you know your password without the site (or anyone watching the connection) getting to read the password itself.
- When you vote in an election, people don't know who you voted, but the vote is casted and results will depend on it.
Each of these has a secret, some claim you're making about that secret, and a way for the other person to check the claim without ever seeing the secret. That last part is the whole trick, and it's what the rest of this site is about.
Two Roles: Prover and Verifier
Most zero-knowledge proofs come down to two people. We'll call them Peggy, who does the proving, and Victor, who does the checking.
- Peggy has a secret. It could be a password, the solution to a puzzle, a private key, whatever. She wants Victor to believe her when she says she knows it.
- Victor doesn't know the secret, and he doesn't want to. He just needs to walk away sure that Peggy is telling the truth.
So the two of them go back and forth. Peggy sends over some evidence, Victor looks at it and asks her something else, she answers, and so on. After enough rounds Victor is convinced, even though the secret itself never showed up anywhere in the conversation.
What's Ahead
Zero-knowledge proofs can get pretty mathematical once you dig in, This guide starts with the intuition, and demos and games you can click around in, and leaves the heavier math for whenever you feel like it.
- The Three Rules, which lay out what any honest ZKP has to guarantee.
- Ali Baba Cave, the story that usually makes the whole thing click, with a demo.
- Try It Yourself, where you play both sides using graph coloring and Sudoku.
- Schnorr Protocol, which is where the actual math shows up.
- zkSNARKs, a quick look at what's running under a lot of today's privacy apps.
You don't need anything to start except some curiosity. If you can work through a logic puzzle, the first half of this site will make sense.