What is Zero Knowledge Proof in Blockchain?

Back to All Articles

Introduction

Zero Knowledge Proofs (ZKPs) represent one of the most groundbreaking cryptographic innovations in blockchain technology. They allow one party (the prover) to convince another party (the verifier) that a statement is true without revealing any information beyond the validity of the statement itself.

First introduced in 1985 by Shafi Goldwasser, Silvio Micali, and Charles Rackoff, this concept has profound implications for privacy, scalability, and security in blockchain systems. Today, ZKPs power everything from privacy-preserving transactions to Layer 2 scaling solutions processing billions of dollars in volume.

The Ali Baba Cave: Understanding ZKPs Intuitively

The most famous explanation of zero-knowledge proofs is the “Ali Baba cave” analogy, described by Jean-Jacques Quisquater in 1989.

Imagine a circular cave with a single entrance that forks into two paths (Path A and Path B) that meet at a locked door deep inside. Only someone who knows the secret password can open the door.

  1. Setup: Peggy (the prover) claims she knows the password. Victor (the verifier) wants confirmation without Peggy revealing it.
  2. Step 1: Victor waits outside. Peggy enters and randomly takes Path A or Path B. Victor doesn’t see which.
  3. Step 2: Victor walks to the fork and shouts which path he wants Peggy to emerge from — chosen at random.
  4. Step 3: If Peggy knows the password, she can always comply. If she took the other path, she simply unlocks the door and walks through.
  5. Repeated trials: Each round, a faker has a 50% chance of guessing correctly. After 20 rounds, the probability of faking drops to roughly 1 in 1,048,576.

The critical insight: Victor learns nothing about the password itself. He only learns that Peggy can consistently demonstrate knowledge of it.

The Three Properties of Zero-Knowledge Proofs

Every ZKP must satisfy three fundamental properties:
  • Completeness: If the statement is true and both parties follow the protocol honestly, the verifier will always be convinced. A valid proof of a true statement is never rejected.
  • Soundness: If the statement is false, no cheating prover can convince the verifier it is true (except with negligibly small probability, e.g., 1 in 2128). Invalid proofs are always rejected.
  • Zero-Knowledge: The verifier learns nothing beyond the fact that the statement is true. In blockchain terms: a transaction proof can demonstrate validity without revealing sender, recipient, or amount.

Interactive vs. Non-Interactive Proofs

Interactive Zero-Knowledge Proofs

The original ZKP formulation requires multiple rounds of communication: the prover sends a commitment, the verifier sends a random challenge, and the prover responds. This cycle repeats until confidence is established.

Limitations for blockchain: both parties must be online simultaneously, the proof is only convincing to the specific verifier, and multiple rounds create latency.

Non-Interactive Zero-Knowledge Proofs (NIZKPs)

Non-interactive proofs require only a single message from prover to verifier. The breakthrough enabling this is the Fiat-Shamir heuristic (1986): instead of the verifier supplying random challenges, the prover generates them by hashing their commitments using a cryptographic hash function, effectively simulating a random oracle.

This is what makes ZKPs practical for blockchain — a proof can be generated once, posted on-chain as a single transaction, and verified by any node independently.

zk-SNARKs: Succinct Non-Interactive Arguments of Knowledge

zk-SNARK stands for Zero-Knowledge Succinct Non-interactive ARgument of Knowledge. They are the most widely adopted form of ZKPs in blockchain.

Key Properties

The Trusted Setup Ceremony

zk-SNARKs require a one-time trusted setup that generates public parameters using secret random values (“toxic waste”). If anyone retains these values, they could forge proofs.

To mitigate this, setups use Multi-Party Computation (MPC) ceremonies where multiple independent participants each contribute randomness and destroy their secret input. The guarantee is “1-of-N honest”: as long as at least one participant is honest, the parameters are secure. Zcash’s “Powers of Tau” ceremony involved hundreds of public participants.

How a zk-SNARK Proof Is Generated

The process transforms a computational problem through several mathematical representations:

  1. Computation → Arithmetic Circuit: The program is “flattened” into a DAG of addition and multiplication gates over a finite field. Every operation (comparisons, conditionals, hashes) must be expressed as field operations.
  2. Arithmetic Circuit → R1CS: The circuit becomes a Rank-1 Constraint System — equations of the form (a · s) × (b · s) = (c · s) where s is the witness vector.
  3. R1CS → QAP: Using Lagrange interpolation, the constraint system is transformed into a Quadratic Arithmetic Program — a polynomial divisibility problem.
  4. QAP → Proof: The prover evaluates polynomials at a secret point embedded in the proving key and constructs the proof as elliptic curve points.
  5. Verification: The verifier checks a small number of elliptic curve pairing equations in constant time.
zk-SNARK Trade-offs:
  • Pros: Tiny proof size (~200 bytes), millisecond verification, mature ecosystem, battle-tested (Zcash since 2016)
  • Cons: Trusted setup required, not quantum-resistant (relies on elliptic curves vulnerable to Shor’s algorithm), computationally expensive proof generation

zk-STARKs: Scalable Transparent Arguments of Knowledge

Developed primarily by Eli Ben-Sasson at StarkWare, zk-STARKs address the two main limitations of SNARKs:

No Trusted Setup (Transparency)

All randomness is publicly generated via hash functions. There is no “toxic waste,” no MPC ceremony needed, and the security assumptions are simpler.

Post-Quantum Security

zk-STARKs derive security from collision-resistant hash functions rather than elliptic curves. Hash functions are believed resistant to quantum attacks, making STARKs a future-proof choice.

SNARK vs. STARK Comparison

Featurezk-SNARKszk-STARKs
Trusted SetupRequiredNot required
Proof Size~200-300 bytes~40-200 KB
Verification Gas (Ethereum)~200K-300K~1M-2.5M
Quantum ResistantNoYes
Underlying CryptoElliptic curve pairingsHash functions + FRI

The primary trade-off is proof size. Mitigations include proof recursion (aggregating many proofs into one), STARK-to-SNARK wrapping (generating a STARK then wrapping it in a SNARK for on-chain verification), and Ethereum’s EIP-4844 blob transactions reducing data costs.

Bulletproofs and PLONK

Bulletproofs

Introduced in 2017, Bulletproofs require no trusted setup and produce logarithmic-size proofs (~1-2 KB). However, verification time is linear, making them unsuitable for complex on-chain verification. They excel at range proofs — proving a value lies within a range without revealing it. Monero adopted Bulletproofs in 2018, reducing transaction sizes by ~80%.

PLONK

PLONK (2019) introduced a universal and updatable trusted setup that works for any circuit up to a maximum size. This was a major advance — no more circuit-specific ceremonies. PLONK and its variants (TurboPLONK, UltraPLONK, fflonk) have become the proof system of choice for many zk-rollups, including Polygon zkEVM, Scroll, and zkSync Era.

Real-World Blockchain Applications

zk-Rollups for Ethereum Scaling

zk-Rollups execute transactions off-chain but post validity proofs on Ethereum L1. Instead of re-executing every transaction, Ethereum only verifies a compact proof. This provides inherited L1 security, immediate finality (no 7-day challenge period like optimistic rollups), and massive throughput improvements.

Major zk-Rollup Projects:
  • zkSync Era (Matter Labs) — PLONK-based proof system (Boojum), supports Solidity/Vyper, native account abstraction, “ZK Chains” framework
  • StarkNet (StarkWare) — Uses zk-STARKs, custom Cairo language, SHARP shared prover aggregating proofs across multiple dApps
  • Polygon zkEVM — PLONK-based, targets Type 2 EVM equivalence (bytecode-level), part of the Polygon 2.0 / AggLayer vision
  • Scroll — PLONK-based with KZG commitments, close to bytecode-level EVM compatibility, community-first approach

Privacy Coins: Zcash

Zcash (launched 2016) pioneered ZKPs in blockchain. Shielded transactions use zk-SNARKs to prove that inputs equal outputs, the sender has sufficient balance, and no double spending occurs — all without revealing addresses or amounts. Zcash evolved from Groth16 (requiring trusted setup) to Halo 2 (2022), which eliminates the trusted setup entirely through recursive proof composition.

Decentralized Identity

ZKPs enable selective disclosure of credentials. Examples: prove you are over 18 without revealing your birthdate, prove citizenship without revealing your passport number, prove a credit score threshold without the exact number. Projects like Polygon ID (now Privado ID) and Worldcoin (World ID) use ZKPs for privacy-preserving identity verification.

Private DeFi

ZKPs enable DeFi where users can trade, lend, and provide liquidity without exposing strategies or balances. This addresses front-running/MEV, competitive strategy concealment, and personal financial privacy. Projects include Aztec Network (privacy-focused L2 with the Noir programming language), Railgun (private DeFi interactions on Ethereum), and Penumbra (privacy in the Cosmos ecosystem).

Current Limitations

The Future of ZKPs

The field is evolving rapidly across several fronts:

Zero Knowledge Proofs are transitioning from cryptographic curiosity to essential infrastructure for the next generation of blockchain applications, enabling a future where privacy and transparency coexist.