Modern Cryptography ยท 6.5

๐ŸŽญ Zero-Knowledge Proofs

Proving you know a secret without revealing the secret itselfโฑ ~3 min

๐Ÿ—บ๏ธProving you know the treasure location without showing the map

Imagine Ali Baba's cave โ€” a circular tunnel with one entrance. The path splits left and right inside, connected in the back. Peggy claims to know the magic word that opens the inner door. Victor wants to verify without learning the word. Peggy enters the tunnel while Victor stays outside. Victor shouts which path to exit from. If Peggy always appears from the right path regardless of which way she went in, she must know the magic word โ€” after 20 rounds, the probability she's just lucky is 1 in 2^20. No word was ever revealed.

What Is a Zero-Knowledge Proof?

A Zero-Knowledge Proof (ZKP) is a cryptographic protocol where a prover convinces a verifier that a statement is true, without revealing any information beyond the truth of the statement. Three properties must hold:

PropertyWhat It Means
CompletenessIf the statement is true, an honest prover can always convince the verifier
SoundnessIf the statement is false, no cheating prover can convince the verifier (except with negligible probability)
Zero-KnowledgeThe verifier learns nothing about the witness (secret) beyond the fact that the statement is true

Modern ZKP Systems

TypeFull NameKey PropertyUsed In
zk-SNARKsSuccinct Non-interactive Arguments of KnowledgeTiny proof size, fast verification, requires trusted setupZcash privacy coin, Ethereum rollups
zk-STARKsScalable Transparent Arguments of KnowledgeNo trusted setup, post-quantum secure, larger proofsStarkNet, validity rollups
Bulletproofsโ€”No trusted setup, small proofs for range proofsMonero, Confidential Transactions

Real-World Applications

  • โ€ขPrivacy-preserving authentication โ€” prove you're over 18 without revealing your birthdate or ID
  • โ€ขBlockchain privacy โ€” Zcash's shielded transactions prove a transaction is valid without revealing sender, receiver, or amount
  • โ€ขEthereum Layer 2 scaling โ€” zkEVM rollups (zkSync, Polygon zkEVM) prove thousands of transactions are valid in a single proof, posted to Ethereum mainchain
  • โ€ขPrivate credentials โ€” prove you have a valid driver's license without showing the license; prove you pass a background check without revealing the check details
  • โ€ขVerifiable computation โ€” prove a machine learning model was trained on specific data without revealing the data or the model weights
โ˜… FactThe Fiat-Shamir heuristic (1986) transforms interactive ZKPs into non-interactive ones by replacing the verifier's random challenges with a hash function. This is how zk-SNARKs and zk-STARKs become non-interactive โ€” the prover uses the hash of their own commitment as the challenge, eliminating the need for a back-and-forth with the verifier.
๐Ÿ’ก TipZKPs are an active research area exploding in practical use. If you're interested in the math: start with the discrete log identification protocol (Schnorr protocol), then study the Fiat-Shamir transform, then look at Groth16 (zk-SNARK) or FRI (zk-STARK). The cryptography is real โ€” not magic.
๐Ÿง Quick Checkfirst try = +5 XP

A zero-knowledge proof lets you proveโ€ฆ

โญ 0 XP๐Ÿ”ฅ 0 days