freecoding.school100% FREE · NO SIGNUP
Proof PeaksISSUE #22 of 38

starks · transparent · post-quantum

ZeekaVSThe Collision
Zeeka saysSTARKs are transparent (no trusted setup) and hash-based (post-quantum). They lay a computation out as an execution trace and prove a transition constraint vanishes across it.

STARKs trade SNARK-sized proofs for two big wins: no trusted setup (randomness comes from public hashing — "transparent") and hash-based security believed to resist quantum computers. A computation is written as an execution trace, a table whose rows are successive machine states, and correctness is captured by a transition constraint that must hold between consecutive rows.

Prove that the constraint vanishes across the whole trace (via FRI, next lesson) and you have proven the computation ran correctly. The demo builds a Fibonacci trace and checks the transition t[i+2] − t[i+1] − t[i] = 0 everywhere, then shows it breaks when one cell is tampered. STARKs power Starknet and many high-throughput provers.

Power-ups you unlock

The Collision attacks — common mistakes

Boss battleBuild a Fibonacci execution trace and show the transition constraint holds everywhere, then breaks when you tamper one cell.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre id="o"></pre>
<script>
// STARK: a TRACE plus a transition constraint that must vanish across it.
const F=97, mod=(n)=>((n%F)+F)%F;
const trace=[1,1]; for(let i=2;i<10;i++) trace.push(mod(trace[i-1]+trace[i-2]));  // Fibonacci mod 97
const viol=(t)=>{ const v=[]; for(let i=0;i<t.length-2;i++) if(mod(t[i+2]-t[i+1]-t[i])!==0) v.push(i); return v; };
const bad=[...trace]; bad[5]=mod(bad[5]+1);
document.getElementById('o').textContent = [
  'execution trace (Fibonacci mod 97): ' + trace.join(', '),
  'transition t[i+2]−t[i+1]−t[i]=0 holds everywhere? ' + (viol(trace).length===0),
  'tamper trace[5] → constraint violated at steps: [' + viol(bad).join(', ') + ']',
  'STARK proves the trace satisfies the constraint — transparent, post-quantum'
].join('\n');
</script></body></html>
▶ Open the interactive comic issue
‹ Halo2 · Recursive AccumulationFri · Low-Degree Testing ›