AI Grounds

Open AI Grounds on a desktop

These interactive lessons need a larger screen. Please continue on a desktop or laptop computer.

Guided discovery

Zero-Knowledge Proofs

Commit colors, open one edge, and separate a local check from repeated evidence.

Your proof round

A coloring gives each vertex one of three colors. Valid edges join different colors. A commitment hides a value and prevents changing it after the challenge. This visual simulation makes no cryptographic commitments; both roles and their example colors live in this browser.

No round committed

Commit before choosing a challenge. Open only one edge per round. Open random edge samples uniformly with replacement after commitment; selecting an edge is a controlled example.

No round committed; no colors opened.

Current verifier view: no colors opened; press Commit round first.

Node values and public edges
Only this round’s opened colors. Every vertex and all nine edges are public.
VertexVerifier view
ANot committed
BNot committed
CNot committed
DNot committed
ENot committed
FNot committed
GNot committed
HNot committed

Edges: A-B, B-C, C-D, D-E, E-F, F-G, G-H, H-A, A-E.

Transcript · completed openings

0 completed openings in this view. Only the most recent 20 are retained. Switching prover or restarting an exercise clears history.

Actual completed illustration rounds; prepared exercise openings are marked Starting example. No future rounds are listed.
RoundEdgeEndpoint colorsVerdictChallengeOrigin

Theory · repeated random checks

The fixed cheating coloring has seven passing edges and two invalid edges (C-D, A-E). One uniform random edge passes with probability 7/9 and catches it with probability 2/9. The honest coloring passes every edge under this idealized model.

This changes a theoretical probability, never runs rounds or adds transcript rows. Use arrow keys on the slider. Press Enter or leave the number field to apply an exact edit.

P(all k checks pass | this fixed invalid coloring) = (7/9)^6 = 0.22137735.

About 22.1377% escape. This is not a probability that the prover is honest.

Assume uniform independent edge challenges, with replacement, and fresh commitments each round. The same edge may repeat. A manually selected sequence, sampling without replacement, or a different malicious strategy needs a different calculation.

Fixed cheater’s all-pass probability0.22137735 = (7/9)^6

Points are integer round counts; segments connect them for reading. At k=0, no checks means all-pass probability 1. Exact values are in the optional table.

Exact integer-round probabilities
Independent uniform challenges of this fixed invalid coloring, including k=0.
kAll-pass probability
01
10.77777778
20.60493827
30.47050754
40.36595031
50.28462802
60.22137735
70.17218238
80.13391963
90.10415971
100.08101311
110.063010197
120.049007931
130.03811728
140.029646773
150.023058601
160.017934468
170.01394903
180.010849246
190.0084383023
200.006563124
What this model includes

Eight vertices, nine public edges and two fixed supplied colorings. The graph is colorable; the cheating example supplies an invalid coloring, not a graph with no valid coloring. A global color permutation preserves all equality/difference checks. Real commitments must hide and bind, and opening checks must match the original commitments; grey boxes only illustrate these constraints.

New rounds independently sample one of six color permutations. A repeated visible color pair can occur by chance. A round number is an identifier, not the permutation or a secrecy measurement. Opening many edges of one committed coloring would leak that coloring, so each commitment can be opened once. Randomness does not make the page itself a secure protocol: the source contains the example colorings, both roles execute together and no cryptographic commitments or formal simulator run here.

Under ideal hiding commitments, an honest edge’s six ordered distinct color pairs are equally likely after a uniform permutation. They can be simulated without its original coloring; that is the intuition for zero knowledge. A complete cryptographic proof, arbitrary adversarial strategies and modern proof systems are outside this illustration.

Yuval Ishai’s graph-coloring protocol explanation · Yale cryptography notes: commitments and graph coloring