Zero-knowledge proofs, explained
Zcash lets you prove a payment is valid without showing who sent it, who received it, or how much moved. The idea that makes this possible is called a zero-knowledge proof. This page explains it in plain language. No math required.
The big idea
A zero-knowledge proof lets one person (the prover) convince another (the verifier) that something is true, without revealing anything except the fact that it's true.
Imagine proving you know a password without saying it, or proving you're over 18 without showing your birth date. In everyday life we usually prove things by handing over the evidence. A zero-knowledge proof gives the verifier certainty while the evidence stays with you.
A puzzle you can try: find the zebra
Picture a busy page from a Where's Waldo book. You've found Waldo, and you want to prove it to a friend without showing them where he is. Pointing at him would give it away.
Here's the trick: take a sheet of cardboard much bigger than the page, cut a small hole in it, and slide it over the page so the hole sits right on Waldo. Your friend sees Waldo through the hole, so they know you found him. The cardboard hides the rest of the page and its edges, so they have no idea where on the page he is.
Try it below with a zebra instead of Waldo.
Try a new picture and prove it again: your friend's view looks exactly the same every time, wherever the zebra is. They learn that you found it, and nothing else. That's a zero-knowledge proof. Notice too that it took one look, with no back-and-forth. Zcash's proofs work the same way.
Three promises every zero-knowledge proof keeps
β Complete
If the statement is true and you follow the rules, the verifier will always be convinced.
π‘οΈ Sound
If the statement is false, a cheater can't convince the verifier, except with a chance so small it can be ignored.
π Zero-knowledge
The verifier learns that the statement is true, and nothing else. No secrets leak out of the proof.
From puzzles to payments: zk-SNARKs
Real proofs use math instead of cardboard. Thousands of computers around the world need to check every transaction, often long after the sender has gone offline, so the proof has to be one message that anyone can check on their own.
Zcash uses a kind of proof called a zk-SNARK: a Zero-Knowledge Succinct Non-interactive ARgument of Knowledge. Each part of the name means something simple:
Succinct
The proof is small, and any computer can check it in a few milliseconds.
Non-interactive
No back-and-forth. The sender makes the proof once and attaches it to the transaction. Anyone can check it later.
Argument of knowledge
It proves the sender actually knows the secrets involved, such as the key that controls the money.
What a shielded Zcash transaction proves
Think of shielded ZEC as sealed envelopes, called notes. Each note holds an amount and the address it belongs to. The blockchain never stores the envelopes themselves, only a unique fingerprint of each one (a note commitment) that reveals nothing about what's inside.
When you spend shielded ZEC, your wallet builds a zk-SNARK proving all of the following, without opening any envelope:
- The money exists. Each note you spend is one of the fingerprints already recorded on the blockchain, without revealing which one.
- It's yours. You hold the secret key that controls those notes.
- It hasn't been spent before. You publish a nullifier, a one-time "spent" tag calculated from the note. Every node checks that the tag has never appeared before. Nobody else can tell which note a tag belongs to.
- The amounts add up. What goes in equals what comes out plus the fee. No ZEC is created out of thin air.
Every Zcash node checks this proof before accepting the transaction. If the proof doesn't check out, the transaction is rejected. So the network can enforce all the usual rules of money while seeing none of the details.
Try it: be the network
Alice is paying Bob 4 ZEC from two shielded notes she owns. On the left is what Alice's wallet knows. On the right is everything the network gets to see. Pick a way to cheat and watch which check catches it.
π€ What Alice's wallet knows
π What the network sees
Switch between the options and look at the right-hand side: it's random-looking data every time. The network never learns the amounts, Alice, Bob, or the memo, and it still catches every cheat.
What the blockchain shows, and what stays private
ποΈ Public on the blockchain
- That a shielded transaction happened, and in which block
- The transaction fee
- The proof itself, plus the random-looking fingerprints and "spent" tags
- Encrypted notes that only the recipient can open
- Any ZEC entering or leaving a shielded pool, and the transparent addresses on that side
π Kept private
- Who sent the payment
- Who received it
- How much moved inside the shielded pool
- The memo attached to the payment
- Which earlier payments the money came from
Where privacy can leak: the moment ZEC moves between a transparent address and a shielded pool. Those amounts are public. The Privacy Check shows what that looks like on real deshielding transactions, and how to avoid revealing patterns.
Hidden amounts, but no hidden inflation
If amounts are hidden, how do we know nobody is secretly creating ZEC? Two safeguards work together. First, every proof shows the amounts add up. Second, every ZEC that enters or leaves a shielded pool is public, so anyone can add it up and know exactly how much is in each pool.
Zcash's rules (ZIP 209) also forbid any pool's total from going below zero. Even in the worst case, where someone found a way to fake proofs, they could not withdraw more ZEC from a pool than was ever put into it. You can watch every pool's total on the Shielded Pools page.
Viewing keys: private by default, shareable by choice
Shielded addresses come with viewing keys. A viewing key lets someone see the payments to an address, and with a "full" viewing key the payments from it too, but it can never spend the money. You can hand one to an accountant, an auditor, or a tax preparer, and nobody else learns anything. Privacy is the default, and disclosure is your choice.
How Zcash's proofs have evolved
Each shielded pool is a generation of this technology. Each one made proofs faster, safer, or both.
-
October 2016
Sprout: the first private money using zk-SNARKs
A world first. But creating a proof took around 40 seconds and about 3 GB of memory, too heavy for phones. Sprout no longer accepts new deposits.
-
October 2018
Sapling: private payments on your phone
A new proof system (Groth16) cut proof creation to a few seconds and about 40 MB of memory, which made shielded wallets on phones practical. Each proof is only 192 bytes.
-
May 2022
Orchard: no trusted setup
Orchard uses Halo 2, a proof system that needs no trusted setup at all (see below). It also bundles each spend and payment together into a single "action", which hides even more about the shape of a transaction.
What's a "trusted setup"? Sprout and Sapling proofs rely on public settings that were created once, in a ceremony. Each participant contributed a secret and then destroyed it. If every participant had secretly kept theirs and combined them, they could fake proofs and create counterfeit ZEC in that pool, though they still couldn't see anyone's private payments. The ceremony is safe as long as just one participant destroyed their secret. Sapling's ceremony had dozens of participants around the world. Orchard's Halo 2 removes the need for a ceremony entirely.
Go deeper
- What are zk-SNARKs? z.cash
- The Halo 2 Book for developers
- Zcash Protocol Specification the precise rules (PDF)
- More Zcash references guides, wallets, and the organizations behind Zcash
Simplified for clarity. Spot something unclear or wrong? .