What a zero-knowledge proof is
A zero-knowledge proof lets one party, the prover, convince another, the verifier, that a statement is true without revealing anything beyond the fact that it is true. You could prove you know a password without sending it, or prove you are over 18 without showing your date of birth.
Shafi Goldwasser, Silvio Micali and Charles Rackoff introduced the idea in their 1985 paper "The Knowledge Complexity of Interactive Proof Systems". It stayed mostly theoretical for decades. Since the 2010s it has been used in practice, mainly in cryptocurrencies, and more recently in digital identity systems.
The three properties
A protocol counts as a zero-knowledge proof if it has all three:
- Completeness. If the statement is true and both sides follow the protocol, the verifier is convinced. Someone who really knows the password can always prove it.
- Soundness. If the statement is false, a cheating prover can convince the verifier only with a negligibly small probability.
- Zero knowledge. The verifier learns nothing except that the statement is true. Formally, everything the verifier sees could have been produced without the secret.
The cave example
The best-known illustration comes from Jean-Jacques Quisquater and colleagues, in a 1989 paper titled "How to Explain Zero-Knowledge Protocols to Your Children".
A cave has one entrance. Inside, the path splits into two tunnels, A and B, which meet again at the far end at a door that opens only with a secret word. Peggy wants to prove to Victor that she knows the word, without telling him what it is.
- Victor waits outside while Peggy walks in and takes tunnel A or B at random.
- Victor comes to the fork and calls out which tunnel he wants Peggy to come back through.
- If Peggy knows the word, she can always come out of the tunnel he named, going through the door if she has to.
- If she doesn't know it, she can only come out the right way if she happened to pick that tunnel, which happens half the time.
- They repeat this many times.
After 20 successful rounds, the chance that Peggy was guessing every time is 1 in 220, which is 1 in 1,048,576. Victor is convinced, but he has learned nothing about the word. He can't even convince anyone else: a video of the 20 rounds could have been staged by agreeing the tunnel choices in advance.
How they work in practice
Interactive and non-interactive proofs
The cave is an interactive proof: the verifier sends random challenges and the prover answers them, round after round. That needs both sides online at the same time, and the proof convinces only the person asking the questions.
A non-interactive proof is a single piece of data that anyone can check at any time. A common technique, the Fiat-Shamir heuristic, replaces the verifier's random challenges with the output of a hash function. Non-interactive proofs are what blockchains use, because one proof can be checked by thousands of nodes. They need more complex mathematics, and some kinds need a trusted setup, described below.
The mathematics underneath
- Discrete logarithms. Given gx = y in a suitable group, finding x is hard. Classic protocols such as Schnorr's let you prove you know x without revealing it. The same problem underlies Diffie-Hellman, explained in Public key cryptography explained.
- Hash functions. A commitment scheme lets you lock in a value, for example by publishing its SHA-256 hash with a random salt, and reveal it later; nobody can see it early and you can't change it afterwards.
- Polynomials. Modern systems turn a computation into a set of polynomial equations, so checking the polynomial at a few random points shows, with overwhelming probability, that the whole computation was done correctly.
zk-SNARKs and zk-STARKs
Two families of non-interactive proofs dominate practical use.
zk-SNARKs
SNARK stands for succinct non-interactive argument of knowledge. The proofs are only a few hundred bytes and take milliseconds to verify, which makes them cheap to check on a blockchain. Generating a proof is much slower, often seconds or more, and needs a lot of memory.
Many SNARKs need a trusted setup: a one-off ceremony that generates public parameters from secret random values. If anyone kept those secret values, sometimes called toxic waste, they could create convincing proofs of false statements, for example to create coins out of nothing. Projects reduce the risk with ceremonies in which many independent participants each add randomness; the result is safe as long as at least one of them destroyed their share. Newer designs such as PLONK and Marlin use one universal setup that works for any program, instead of a new ceremony for each one. Most SNARKs rely on elliptic curve pairings, which a large quantum computer could break.
zk-STARKs
STARK stands for scalable transparent argument of knowledge. They need no trusted setup and are built only on hash functions, which are believed to resist quantum computers. Proving scales well to very large computations. The price is size: STARK proofs typically run to tens or hundreds of kilobytes, and verifying them costs more.
| zk-SNARK | zk-STARK | |
|---|---|---|
| Proof size | A few hundred bytes | Tens to hundreds of kilobytes |
| Verification | Very fast | Slower |
| Proving large computations | Slower | Scales better |
| Trusted setup | Often needed | Not needed |
| Quantum resistance | No, for pairing-based designs | Believed yes |
Bulletproofs are a third option with no trusted setup and short proofs, used mainly to prove that a hidden number lies in a range, as the Monero cryptocurrency does for transaction amounts.
Where zero-knowledge proofs are used
Private cryptocurrency
Zcash, launched in 2016, was the first large deployment of zk-SNARKs. In a shielded Zcash transaction the sender, receiver and amount are hidden. The sender attaches a proof that they own the coins being spent, that those coins haven't been spent before, and that no money was created. The network checks the proof without learning who paid whom.
Scaling blockchains
Zero-knowledge rollups such as ZKsync and Starknet take a batch of thousands of Ethereum transactions, execute them elsewhere, and post a single proof that the whole batch was processed correctly. Ethereum only has to check the proof, not rerun every transaction, which makes transactions much cheaper. Mina goes further with recursive proofs, proofs that verify other proofs, and says this keeps the data needed to verify its whole chain at about 22 KB.
Identity and credentials
- Age checks: a digital ID can contain a signed commitment to your birth date, and you prove that it is more than 18 years ago without revealing the date.
- Credentials: prove you hold a valid degree, licence or membership without revealing which one or your name.
- Compliance: a bank could prove to a regulator that it meets a capital requirement without handing over customer data.
Voting and business
Research voting systems use zero-knowledge proofs so voters can prove they are eligible and that their encrypted ballot is valid, anyone can check the count, and nobody can prove to a third party how they voted. In business, EY released Nightfall, a protocol that uses zk-SNARKs so companies can make private transactions on the public Ethereum network without revealing prices to competitors.
Privacy and transparency
Zero-knowledge proofs make it possible to share only what a check actually needs, which protects financial privacy, reduces what a data breach can expose, and limits tracking. The same technology also makes it harder to trace money laundering, tax evasion and the financing of crime, and regulators have pushed back on some privacy tools for that reason.
Systems are trying to offer both. Zcash has viewing keys that let a user show their transactions to an auditor or tax authority. Compliance proofs can show that a transaction meets a rule, such as not involving a sanctioned address, without revealing anything else.
Limitations
- Cost. Generating a proof can take seconds to minutes and gigabytes of memory, far more than the computation it proves. That is hard on phones and in browsers, although graphics cards and specialized hardware are bringing the time down.
- Difficult programming. Statements have to be written as arithmetic circuits. A circuit that forgets a constraint can accept false proofs, and many published bugs in zero-knowledge systems are of exactly this kind.
- Trusted setups, where used, remain a point of trust.
- Quantum computers would break pairing-based SNARKs, though not hash-based STARKs.
- Usability. Errors are hard to explain to users, and the secret inputs (the witness) need careful handling.
Trying it yourself
For developers, Circom is a common language for writing circuits, with snarkjs to generate and verify proofs in JavaScript. Other options include arkworks in Rust, gnark in Go, and Cairo for STARK-provable programs. The ZKProof community initiative publishes reference material and security guidance. As with all cryptography, use audited libraries, and get production circuits reviewed by people who specialize in them.
Zero-knowledge proofs build on the same hash functions and public key mathematics as the rest of modern cryptography. Digital signatures explained covers a closely related idea: proving who you are with a key you never reveal.
Further reading
- Public Key Cryptography: The Math, Explained Simply How two strangers agree on a secret over a public line.
- Digital Signatures Explained: How They Prove Authenticity How a key pair proves who sent a file and that nobody changed it.
- Hash Functions Explained: Why MD5 Isn't Secure What a hash is for, and why MD5 no longer does the job.