A zero-knowledge proof lets you convince someone that a statement is true without revealing any information beyond the truth of the statement itself.

Imagine you have a friend, Alice, who claims she can solve a Rubik’s Cube in under 30 seconds. You don’t know how she does it, and you want to verify her claim without her actually showing you her solving process, which might reveal her secret algorithms. Here’s how a zero-knowledge proof could work:

  1. Setup: Alice scrambles a Rubik’s Cube. She then puts it in a box that you can’t see into, but you can verify its contents without her seeing what you’re doing (e.g., a box with a one-way mirror or a sensor that detects the cube’s state).
  2. The Challenge: You then present Alice with two identical, opaque boxes. You tell her that one box contains a solved Rubik’s Cube, and the other contains a scrambled one. You ask her to pick a box, and you’ll open it to reveal its contents.
  3. The Proof:
    • If Alice truly knows how to solve the cube quickly, she can look at the scrambled cube she prepared, decide which of your boxes must contain the solved cube (based on her knowledge of how she scrambled it and how you presented the options), and pick that box.
    • If she just guessed, there’s a 50% chance she’ll pick the correct box.
  4. Verification: You open the box she chose. If it contains a solved cube, it doesn’t prove much. But if she picks the wrong box (the scrambled one), you know she was guessing.
  5. Repetition: To increase your confidence, you repeat this process many times. If Alice successfully picks the solved cube box every single time after, say, 20 rounds, the probability of her guessing correctly each time becomes astronomically small ($1/2^{20}$). You can then be highly confident she knows how to solve the cube, without ever seeing her solve it or knowing her specific algorithms.

This is the essence of zero-knowledge proofs: a prover (Alice) convinces a verifier (you) of a fact without revealing any auxiliary information.

How It Works Under the Hood

Zero-knowledge proofs rely on a few core principles:

  • Completeness: If the statement is true, an honest prover can always convince an honest verifier.
  • Soundness: If the statement is false, a dishonest prover cannot convince an honest verifier (except with a very small probability).
  • Zero-Knowledge: If the statement is true, the verifier learns nothing other than the fact that the statement is true. They gain no knowledge about why it’s true or any secret information related to it.

The Rubik’s Cube example is a simplified illustration. In practice, zero-knowledge proofs are often cryptographic protocols involving mathematical challenges and responses. A common type is the zk-SNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge).

  • zk-SNARKs: These are particularly efficient. "Succinct" means the proof is very small, and "Non-Interactive" means the prover can generate the proof and send it to the verifier without a back-and-forth conversation.

Let’s look at a more technical, albeit still simplified, conceptual example using a cryptographic primitive called a hash function. A hash function takes an input and produces a fixed-size output (the hash) in such a way that it’s practically impossible to find two different inputs that produce the same output (collision resistance) or to reverse the process to find the input from the output.

Suppose you want to prove you know a secret number, S, without revealing S.

  1. The Setup: You choose a secret number, say S = 12345. You then compute its hash: H = hash(S). Let’s say H = "a1b2c3d4e5f6...". You reveal H to the verifier, but keep S private.
  2. The Challenge: The verifier can then challenge you by providing a random number, R.
  3. The Proof: You compute hash(S + R) (where + means concatenation or some other defined operation). You send this new hash, H_new = hash(S + R), back to the verifier.
  4. Verification: The verifier can independently compute hash(S + R) if they knew S. Since they don’t know S, they can’t do this. However, a common zero-knowledge scheme would involve generating a proof that attests to the correctness of H_new without revealing S.

A more practical cryptographic application is proving you have enough funds in a cryptocurrency wallet to make a transaction without revealing your total balance or the specific transaction details that would link back to your identity.

Consider a scenario where you want to prove you are over 18 years old to access a service, without revealing your exact birthdate.

  • Prover (You): You have a digital identity document containing your birthdate.
  • Verifier (Service): Wants to confirm you’re over 18.

Using a zero-knowledge proof, you could generate a proof that mathematically demonstrates your birthdate falls before a specific date (18 years ago from today) without revealing the actual date. The verifier receives this proof and can cryptographically check its validity. If valid, they know you meet the age requirement.

The complexity lies in constructing the cryptographic circuits and proofs that can represent arbitrary computations (like "is this number greater than X?"). This is where zk-SNARKs and similar technologies shine, enabling them to prove the execution of complex algorithms.

The most surprising aspect for many is how these proofs are constructed to be non-interactive. Early ZKPs required a back-and-forth between prover and verifier. The development of zk-SNARKs, which involves a trusted setup phase (where a "toxic waste" is generated and discarded), allows for a single proof to be generated and verified without further interaction, making them highly scalable for applications like blockchain.

The next frontier in zero-knowledge proofs involves making the setup phase for zk-SNARKs truly trustless and reducing the computational overhead for proof generation, making them accessible for even more complex computations and widespread adoption.

Want structured learning?

Take the full Cryptography course →