<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Arush</title>
    <description>The latest articles on DEV Community by Arush (@grandpaarush).</description>
    <link>https://dev.to/grandpaarush</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4250062%2Ffbfb3542-4fd2-48ad-beec-57accdfc9efa.jpeg</url>
      <title>DEV Community: Arush</title>
      <link>https://dev.to/grandpaarush</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/grandpaarush"/>
    <language>en</language>
    <item>
      <title>What is zero-knowledge actually used for?</title>
      <dc:creator>Arush</dc:creator>
      <pubDate>Wed, 18 Nov 2026 15:27:53 +0000</pubDate>
      <link>https://dev.to/grandpaarush/what-is-zero-knowledge-actually-used-for-10l6</link>
      <guid>https://dev.to/grandpaarush/what-is-zero-knowledge-actually-used-for-10l6</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ZK proofs are used for two very different jobs: &lt;strong&gt;privacy&lt;/strong&gt; (hide the data) and &lt;strong&gt;scaling&lt;/strong&gt; (avoid redoing the work). You'll see five real use cases and learn to spot which job each one is doing.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;In &lt;a href="https://dev.to/grandpaarush/how-can-i-prove-i-know-a-secret-without-telling-you-the-secret-zero-knowledge-proofs-78o"&gt;Post 1&lt;/a&gt; we built the intuition: a prover convinces a verifier that a statement is true, without revealing the secret witness. Cool party trick. But ...okay, who needs that?&lt;/p&gt;

&lt;p&gt;It turns out quite a lot of people do. Let's walk through five real places where ZK proofs are doing work right now, and pull out the pattern behind them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Intuition: two superpowers
&lt;/h2&gt;

&lt;p&gt;A ZK proof (more precisely, a modern &lt;strong&gt;zk-SNARK&lt;/strong&gt;) gives you two separate superpowers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hiding.&lt;/strong&gt; The verifier doesn't learn the witness. This is the "zero-knowledge" part.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compression.&lt;/strong&gt; The proof is tiny and quick to check, even if the computation behind it was huge. This is the "succinct" part, the S in SNARK.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A lot of confusion clears up once you notice that some "ZK" systems mostly use superpower #2 and barely care about #1.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdq9o459lid2f034ard44.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdq9o459lid2f034ard44.png" alt=" " width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Private payments
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; On a normal blockchain, every payment is public: sender, receiver, amount, forever. That's like publishing your bank statement on a billboard.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ZK fix:&lt;/strong&gt; Zcash (launched 2016) was the first big deployment of zk-SNARKs. A shielded transaction proves &lt;em&gt;"I own some coins that exist, I haven't spent them before, and the amounts balance"&lt;/em&gt; without revealing which coins, who you are, or how much.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Superpower:&lt;/strong&gt; hiding.&lt;/p&gt;

&lt;p&gt;We'll actually build a mock version of this in 12th Post (foreshadowing), using ideas called &lt;em&gt;notes&lt;/em&gt;, &lt;em&gt;commitments&lt;/em&gt; and &lt;em&gt;nullifiers&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Rollups
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Ethereum can only process a limited number of transactions per second, because every node re-executes every transaction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ZK fix:&lt;/strong&gt; A &lt;strong&gt;ZK rollup&lt;/strong&gt; executes thousands of transactions off-chain, then posts a single proof to Ethereum saying &lt;em&gt;"I ran all these transactions correctly, and here's the new state."&lt;/em&gt; The chain checks one small proof instead of redoing thousands of transactions. zkSync, Starknet, Scroll and Linea all work this way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Superpower:&lt;/strong&gt; compression.&lt;/p&gt;

&lt;p&gt;Fun fact: most rollup data is public, so these "ZK" rollups often aren't hiding anything at all. The name stuck anyway.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Identity
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; To prove you're over 18, you usually show an ID that also reveals your name, address, exact birthday and a very terrible photo (personal experience).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ZK fix:&lt;/strong&gt; Prove &lt;em&gt;"I hold a valid government-signed credential, and the birthday on it is more than 18 years ago"&lt;/em&gt; while revealing nothing else. Projects like zkPassport do this with the chip in real passports, and Semaphore lets you prove &lt;em&gt;"I'm a member of this group"&lt;/em&gt; without saying which member.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Superpower:&lt;/strong&gt; hiding.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Voting
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; We want two things that seem to conflict. Votes should be &lt;strong&gt;anonymous&lt;/strong&gt;, but each person should vote &lt;strong&gt;only once&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ZK fix:&lt;/strong&gt; You prove &lt;em&gt;"I'm on the voter list"&lt;/em&gt; (without saying who you are) and publish a &lt;strong&gt;nullifier&lt;/strong&gt;, a value derived from your secret and the poll ID. If the same nullifier shows up twice, the second vote is rejected. Nobody can link the nullifier back to you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Superpower:&lt;/strong&gt; hiding, plus a clever trick for uniqueness. This exact pattern will be in 9th Post, and it's actually one of my favorite ideas in the whole series.&lt;/p&gt;

&lt;p&gt;I've already built a &lt;a href="https://github.com/04arush/ZKVote" rel="noopener noreferrer"&gt;ZK backed voting system&lt;/a&gt; when I was learning myself. It sure has flaws but the ZK part is good. &lt;/p&gt;

&lt;h2&gt;
  
  
  5. Proof of solvency
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; When an exchange collapses, people discover too late that their deposits weren't backed. Exchanges now publish "proof of reserves", but proving you &lt;em&gt;own&lt;/em&gt; $X is only half the story. You also need to prove you &lt;em&gt;owe&lt;/em&gt; at most $X.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ZK fix:&lt;/strong&gt; The exchange builds a &lt;strong&gt;Merkle sum tree&lt;/strong&gt; of every user's balance and proves &lt;em&gt;"the total of all balances is Y, and every balance is non-negative"&lt;/em&gt;. Each user can check their own balance is included, and nobody learns anyone else's balance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Superpower:&lt;/strong&gt; hiding (balances stay private), plus compression.&lt;/p&gt;

&lt;p&gt;That "every balance is non-negative" part sounds boring. It isn't. Leaving it out is a real, classic bug, and it's the subject of Post 10.&lt;/p&gt;

&lt;p&gt;I've also built a &lt;a href="https://github.com/04arush/ZK-Proof-of-Solvency" rel="noopener noreferrer"&gt;Proof of Solvency&lt;/a&gt; earlier myself, and this one is actually one of my strongest project.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pattern
&lt;/h2&gt;

&lt;p&gt;When I look at a new ZK project now, I ask one question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Who is the verifier, and what are they &lt;em&gt;not&lt;/em&gt; allowed to see (or not willing to redo)?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Private payments: the blockchain can't see who paid whom.&lt;/li&gt;
&lt;li&gt;Rollups: Ethereum doesn't want to re-execute everything.&lt;/li&gt;
&lt;li&gt;Identity: the website can't see your full ID.&lt;/li&gt;
&lt;li&gt;Voting: the tallier can't see who voted for what.&lt;/li&gt;
&lt;li&gt;Solvency: users can't see each other's balances.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-on: spot the superpower
&lt;/h2&gt;

&lt;p&gt;No circuits yet (still on fundamentals). Instead, here's a tiny quiz you can run to check your intuition. Every claim below is real. Decide whether it's mainly hiding, compression, or both:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;claims&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"I paid you, but nobody else can see the amount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;      &lt;span class="s2"&gt;"hiding"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"These 5,000 transactions were executed correctly"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;     &lt;span class="s2"&gt;"compression"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"I'm over 18 (and that's all you'll learn)"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;            &lt;span class="s2"&gt;"hiding"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"I'm one of the 300 people allowed to vote"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;            &lt;span class="s2"&gt;"hiding"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"Our users' balances add up to $Y, none are negative"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="s2"&gt;"both"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;claim&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;answer&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;claims&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;items&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s1"&gt;'"{claim}"\n  hiding / compression / both? '&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"  ✅ yep"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"  ❌ it's mostly {answer}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"\nYou got {score}/{len(claims)}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Gotcha: "ZK" in the name doesn't guarantee privacy
&lt;/h2&gt;

&lt;p&gt;I myself assumed a "ZK rollup" meant my transactions on it were private. They weren't. On most ZK rollups, transaction data is fully public; the proof is used for &lt;strong&gt;correctness&lt;/strong&gt;, not secrecy.&lt;/p&gt;

&lt;p&gt;The lesson: "ZK" in a product name tells you a proof system is involved. It doesn't tell you &lt;em&gt;what is hidden&lt;/em&gt;. Always check what's public and what's private before you trust something with your data. &lt;/p&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;ZK proofs give two superpowers: &lt;strong&gt;hiding&lt;/strong&gt; the witness and &lt;strong&gt;compressing&lt;/strong&gt; verification.&lt;/li&gt;
&lt;li&gt;Real uses: &lt;strong&gt;private payments&lt;/strong&gt;, &lt;strong&gt;rollups&lt;/strong&gt;, &lt;strong&gt;identity&lt;/strong&gt;, &lt;strong&gt;voting&lt;/strong&gt;, &lt;strong&gt;proof of solvency&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;To understand any ZK system, ask: &lt;em&gt;who's the verifier, and what can't they see or redo?&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Next up:&lt;/strong&gt; almost every example above relied on two building blocks: &lt;strong&gt;hashes&lt;/strong&gt; and &lt;strong&gt;Merkle trees&lt;/strong&gt;. In Post 3, we'll build a tiny Merkle tree in Python and see why it shows up everywhere in ZK.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://vitalik.eth.limo/general/2022/11/19/proof_of_solvency.html" rel="noopener noreferrer"&gt;Vitalik: Having a safe CEX: proof of solvency and beyond&lt;/a&gt;: the clearest explanation of proof of solvency I've found.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.semaphore.pse.dev/" rel="noopener noreferrer"&gt;Semaphore docs&lt;/a&gt;: anonymous group membership and signaling, in practice.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://zkhack.dev/" rel="noopener noreferrer"&gt;ZK Hack whiteboard sessions&lt;/a&gt;: short videos on how real systems are built.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Series codebase
&lt;/h2&gt;

&lt;p&gt;All the code from posts in this series will be in this GitHub repo: &lt;a href="https://github.com/04arush/ZK-from-Zero-Knowledge" rel="noopener noreferrer"&gt;Zero-Knowledge from zero knowledge&lt;/a&gt;&lt;/p&gt;

</description>
      <category>zeroknowledge</category>
      <category>blockchain</category>
      <category>web3</category>
      <category>cryptography</category>
    </item>
    <item>
      <title>How can I prove I know a secret without telling you the secret? — Zero-Knowledge Proofs!</title>
      <dc:creator>Arush</dc:creator>
      <pubDate>Wed, 18 Nov 2026 06:55:56 +0000</pubDate>
      <link>https://dev.to/grandpaarush/how-can-i-prove-i-know-a-secret-without-telling-you-the-secret-zero-knowledge-proofs-78o</link>
      <guid>https://dev.to/grandpaarush/how-can-i-prove-i-know-a-secret-without-telling-you-the-secret-zero-knowledge-proofs-78o</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You'll learn what a zero-knowledge proof actually proves, using two analogies you can explain to a friend.&lt;/li&gt;
&lt;li&gt;You'll also learn the three properties every ZK proof needs (completeness, soundness, zero-knowledge) and the difference between interactive and non-interactive proofs.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;If you can read a bit of code, you have basic knowledge of blockchain &amp;amp; cryptography, and you're curious about how "prove without revealing" can possibly work, you're in the right place.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Here's the situation that ZK solves. I know something: a password, a private key, the answer to a puzzle. I want to &lt;strong&gt;convince you&lt;/strong&gt; I know it. But I &lt;strong&gt;don't want to tell you&lt;/strong&gt; what it is.&lt;/p&gt;

&lt;p&gt;That sounds impossible. Usually the only way to prove I know a password is to type it in, and then whoever checks it knows it too.&lt;/p&gt;

&lt;p&gt;A zero-knowledge proof gets around this. At the end, you're convinced, and you've learned &lt;em&gt;nothing&lt;/em&gt; except the fact that my claim is true.&lt;/p&gt;

&lt;h2&gt;
  
  
  Intuition #1: the magic cave
&lt;/h2&gt;

&lt;p&gt;This is the classic analogy, from a 1989 paper with the title &lt;em&gt;"How to Explain Zero-Knowledge Protocols to Your Children."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Picture a cave shaped like a ring. The entrance splits into two paths, &lt;strong&gt;A&lt;/strong&gt; and &lt;strong&gt;B&lt;/strong&gt;, which meet at the back at a locked magic door. Only someone who knows the secret word can open it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F34pitm9lmo6su7rdfdmo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F34pitm9lmo6su7rdfdmo.png" alt=" " width="800" height="803"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Peggy (the prover) claims she knows the word. Victor (the verifier) wants to be convinced, but Peggy refuses to say the word out loud.&lt;/p&gt;

&lt;p&gt;So they play a game:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Victor waits outside. Peggy walks in and picks path A or B at random. Victor can't see which.&lt;/li&gt;
&lt;li&gt;Victor walks to the fork and shouts: "Come out of &lt;strong&gt;B&lt;/strong&gt;!" (he picks A or B at random too).&lt;/li&gt;
&lt;li&gt;If Peggy knows the word, she can always come out the side he asked for. If she's already on that side she just walks back; if not, she opens the door and goes through.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If Peggy is bluffing, she only gets it right when she happened to pick the same side Victor shouts. That's a 50% chance.&lt;/p&gt;

&lt;p&gt;One round proves very little. But repeat it 20 times and a bluffer survives with probability (1/2)^20, which is about &lt;strong&gt;one in a million&lt;/strong&gt;. Victor becomes very confident, yet he never heard the word, and he never even saw the door open.&lt;/p&gt;

&lt;h2&gt;
  
  
  Intuition #2: Where's Waldo
&lt;/h2&gt;

&lt;p&gt;You and I are looking at a giant Where's Waldo page. I claim I found him. You don't believe me, but I don't want to spoil it by pointing.&lt;/p&gt;

&lt;p&gt;So I take a huge sheet of cardboard, much bigger than the page, and cut a small Waldo-shaped hole in it. I lay it over the book so that only Waldo shows through the hole.&lt;/p&gt;

&lt;p&gt;You see Waldo, so you're convinced. But you have no idea &lt;em&gt;where&lt;/em&gt; on the page he is, because the cardboard hides all the context.&lt;/p&gt;

&lt;p&gt;That's the heart of ZK: &lt;strong&gt;prove the statement ("Waldo is on this page"), hide the witness ("he's at the top left, next to the beach ball")&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Vocabulary: the secret thing the prover knows is called the &lt;strong&gt;witness&lt;/strong&gt;. The thing being proven is the &lt;strong&gt;statement&lt;/strong&gt;. You'll see both words in every ZK library.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The three properties
&lt;/h2&gt;

&lt;p&gt;Any zero-knowledge proof system has to give three guarantees. The cave makes them easy to see.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Completeness:&lt;/strong&gt; if the statement is true and the prover is honest, the verifier will be convinced.&lt;br&gt;
&lt;em&gt;Peggy knows the word, so she passes every round.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Soundness:&lt;/strong&gt; if the statement is false, a cheating prover can't convince the verifier (except with tiny probability).&lt;br&gt;
&lt;em&gt;A bluffer fails a round half the time, so 20 rounds makes cheating hopeless.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Zero-knowledge:&lt;/strong&gt; the verifier learns nothing beyond "the statement is true".&lt;br&gt;
&lt;em&gt;Victor only ever sees Peggy walking out of the side he asked for. He could have faked that video himself by hiring an actor and telling them the side in advance, which is exactly why it carries no information about the word.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That last argument is the formal trick behind ZK: if the verifier could have &lt;strong&gt;simulated&lt;/strong&gt; the whole conversation without the secret, then the conversation can't have leaked the secret.&lt;/p&gt;
&lt;h2&gt;
  
  
  Interactive vs non-interactive
&lt;/h2&gt;

&lt;p&gt;The cave game is &lt;strong&gt;interactive&lt;/strong&gt;: Victor has to be there, shouting random challenges. That's annoying in practice. You don't want to keep a live chat open with every person who wants to check your proof.&lt;/p&gt;

&lt;p&gt;Modern ZK systems are mostly &lt;strong&gt;non-interactive&lt;/strong&gt;: the prover produces a single blob of bytes (the proof), and anyone can verify it later, offline, as many times as they like. A blockchain is the perfect "anyone": a smart contract can verify this proof.&lt;/p&gt;

&lt;p&gt;How do we get rid of Victor's random challenges? With the &lt;strong&gt;Fiat–Shamir heuristic&lt;/strong&gt;: the prover generates the "random" challenges by hashing everything said so far. A good hash function is unpredictable, so the prover can't cheat by picking convenient challenges. It's as if Victor's coin flips were replaced by a hash function that nobody controls.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkm5nfkah42lssrjtauls.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkm5nfkah42lssrjtauls.png" alt=" " width="799" height="491"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Hands-on (no code yet!)
&lt;/h2&gt;

&lt;p&gt;This post is about intuition, so there's no circuit yet. But here's a tiny simulation of the cave that you can paste into Python. It shows why repeating rounds makes bluffing hopeless:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run_cave&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;knows_secret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rounds&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rounds&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;peggy_side&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;choice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"AB"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;victor_asks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;choice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"AB"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;peggy_side&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;victor_asks&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;knows_secret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;          &lt;span class="c1"&gt;# stuck on the wrong side of the door&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;

&lt;span class="n"&gt;trials&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100_000&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;rounds&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;wins&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;run_cave&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rounds&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;trials&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{rounds:&amp;gt;2} rounds: bluffer wins {wins / trials:.5%} of the time"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On my machine the bluffer wins about 50% at 1 round, about 3% at 5, about 0.1% at 10, and basically never at 20.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gotcha: "zero-knowledge" doesn't mean "the statement is secret"
&lt;/h2&gt;

&lt;p&gt;I tripped over this early on. I assumed a ZK proof hides &lt;em&gt;everything&lt;/em&gt;. It doesn't.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;statement&lt;/strong&gt; is public. If I prove "I know the password for account X", everyone learns that the password for account X exists and that I know it. Only the &lt;strong&gt;witness&lt;/strong&gt; (the password) stays hidden.&lt;/p&gt;

&lt;p&gt;This matters a lot later. When we write circuits, we'll explicitly mark which inputs are &lt;strong&gt;public&lt;/strong&gt; and which are &lt;strong&gt;private&lt;/strong&gt;, and a lot of real-world bugs come from accidentally making something public that should have been private (or the reverse).&lt;/p&gt;

&lt;p&gt;The other half of my confusion: soundness is &lt;em&gt;probabilistic&lt;/em&gt;. A ZK proof doesn't make cheating impossible, it makes it astronomically unlikely, like guessing a 128-bit key. In practice that's the same thing, but it's worth knowing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A ZK proof convinces a verifier that a statement is true &lt;strong&gt;without revealing the witness&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Completeness:&lt;/strong&gt; honest provers win. &lt;strong&gt;Soundness:&lt;/strong&gt; liars lose. &lt;strong&gt;Zero-knowledge:&lt;/strong&gt; the verifier learns nothing extra.&lt;/li&gt;
&lt;li&gt;Interactive proofs need a live verifier. &lt;strong&gt;Fiat–Shamir&lt;/strong&gt; turns them into a single non-interactive proof that anyone can check.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Next up:&lt;/strong&gt; where is this actually used? In Post 2: "Where ZK is used in the real world" (coming soon) — we'll look at private payments, rollups, identity, voting and proof of solvency, and why each of them needs ZK.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/Zero-knowledge_proof" rel="noopener noreferrer"&gt;Zero-knowledge proof (Wikipedia)&lt;/a&gt;: has the cave story and the history.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://rareskills.io/zk-book" rel="noopener noreferrer"&gt;The RareSkills ZK Book&lt;/a&gt;: a beginner-friendly path from here to the math.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://zk-learning.org/" rel="noopener noreferrer"&gt;ZK MOOC lecture 1&lt;/a&gt;: the university-course version of this post.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Series codebase
&lt;/h2&gt;

&lt;p&gt;All the code from posts in this series will be in this GitHub repo: &lt;a href="https://github.com/04arush/ZK-from-Zero-Knowledge" rel="noopener noreferrer"&gt;Zero-Knowledge from zero knowledge&lt;/a&gt;&lt;/p&gt;

</description>
      <category>zeroknowledge</category>
      <category>cryptography</category>
      <category>blockchain</category>
      <category>zk</category>
    </item>
  </channel>
</rss>
