Skip to content

ZK Proof Lab

Zero-Knowledge Proofs · Interactive · Fiat-Shamir · SNARK

Walk interactive proofs (Ali Baba cave, graph 3-coloring, Schnorr) through commit-challenge-response, then collapse them into non-interactive Fiat-Shamir and SNARK-shaped pipelines with real in-browser hashing and modular arithmetic.

Zero-knowledge proofs power private blockchain transactions, identity checks, and verifiable computation without leaking sensitive data.

This lab starts with intuitive stories, then graduates into real browser-side arithmetic and hashing so the jump from idea to implementation is visible in one sitting.

Cryptographic honesty: the modular-arithmetic checks and Web Crypto primitives in Exhibits 02, 03, 04, and 05 are real (real SHA-256 commitments and Schnorr/Fiat-Shamir verification). Exhibits 01 and 06 are clearly-labelled conceptual models. Parameters are intentionally small for educational clarity and browser performance, not production security levels.
EXHIBIT 01⬡ CONCEPTUAL MODEL

The Ali Baba Cave Protocol

Someone proves they know the secret word for the cave door without ever saying the word.

EXHIBIT 02⬡ REAL SHA-256 COMMITMENTS

Graph 3-Coloring ZKP

Someone shows a map is colored correctly without revealing the full color pattern.

EXHIBIT 03● REAL MODULAR ARITHMETIC

Schnorr Identification Protocol

Someone proves they know a secret number by passing a math check without revealing it.

EXHIBIT 04● REAL SHA-256 · window.crypto.subtle

Hash Commit-Reveal

Someone locks in a hidden bid first, then reveals it later to prove they never changed it.

EXHIBIT 05● REAL HASH-DERIVED CHALLENGE

Fiat-Shamir (Non-Interactive)

Convert challenge-response into a single verifiable proof by deriving the challenge from a hash.

EXHIBIT 06⬡ PEDAGOGICAL SNARK MODEL

zk-SNARK Intuition

See setup, proving, and verification flow with public/private input separation in one toy pipeline.