<?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: Mikhailo</title>
    <description>The latest articles on DEV Community by Mikhailo (@mumukzu).</description>
    <link>https://dev.to/mumukzu</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%2F4246860%2Fe2dc88b5-be3a-4993-be83-d58af939bb5c.png</url>
      <title>DEV Community: Mikhailo</title>
      <link>https://dev.to/mumukzu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mumukzu"/>
    <language>en</language>
    <item>
      <title>I built a Groth16-proof Gatekeeper for zkVerify Agent Games with $0</title>
      <dc:creator>Mikhailo</dc:creator>
      <pubDate>Mon, 16 Nov 2026 04:35:06 +0000</pubDate>
      <link>https://dev.to/mumukzu/i-built-a-groth16-proof-gatekeeper-for-zkverify-agent-games-with-0-ii5</link>
      <guid>https://dev.to/mumukzu/i-built-a-groth16-proof-gatekeeper-for-zkverify-agent-games-with-0-ii5</guid>
      <description>&lt;p&gt;The platform told me my wallet login was missing a CSRF token. Six times. My signature was valid — I verified it myself, byte for byte. The server was lying, and proving it took longer than building the agent.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The login that lied. The platform's wallet login (SIWE) failed six times with the same error: MissingCSRF. A fetch POST. A form POST. An exact replica of the platform's own client code. A fresh cookie. A message whose nonce WAS the CSRF token. Same error every time. So I ran decisive experiments instead of retrying blind. Sign-out with the same CSRF token: SUCCEEDED — the CSRF mechanism works. A minimal callback with no message and no signature: PASSED the CSRF check and failed later with CredentialsSignin, as it should — so the failure lives inside authorize, triggered by the message and signature, not by the CSRF check. My signature: verified valid with ethers, the recovered address matching exactly. Conclusion: the wallet login is broken server-side, and no retry from my side was ever going to fix it. I registered with X instead. Lesson one: don't trust the error message — test it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The game, briefly. Every round, the platform sends my agent 8 tasks: a transfer request with a registered verification key, a proof, a balance, an expiry block, a recipient, an amount. APPROVE or REJECT. Seven traps hide in the mix: a substituted verification key, a threshold mismatch, a reused proof, an expired task, a wrong recipient, an amount overflow — and about half the tasks are perfectly valid. Correct: +12. Wrong APPROVE: -6. Wrong REJECT: -3. A proof attached to a correct decision earns the full +12 plus a reliability bonus; a correct decision without one loses 2 points. With proofs, a perfect round is +96 (was +80 without).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The proof. The official circuit files are public — I downloaded gatekeeper.wasm and gatekeeper_final.zkey straight from the platform. But the exact public-input layout was not in the docs, so the first version shipped as an honest no-proof agent: decisions only. Round 2 showed the whole field in the same place — 129 tasks answered, zero proofs verified. Then a participant's public repo documented the exact flow: snarkjs groth16.fullProve, 13 public inputs (10 task fields verbatim + the decision + taskId as keccak256(task_id) mod FIELD_PRIME + a fresh random salt). Self-test: APPROVE proof verified in 700 ms, REJECT on a threshold trap in 665 ms. And a WRONG decision cannot be proven at all — the circuit's own assert (template GatekeeperEvaluation, line 102) fails witness generation in 116 ms. The circuit is the referee; dishonesty is not a strategy, it is a compile error. 44/44 tests pass. A live end-to-end run answered a signed valid task in 542 ms with a proof that verified independently against the verification key exported from the official zkey. Every proof is verified locally before it is returned; any failure falls back to a no-proof decision. A reused proof never gets a proof at all.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The deployment. The agent is Node, stdlib-only, HMAC-signed on every response, idempotent by task_id, with a KV-backed seen-set so a replayed proof is always caught. The code needed a public GitHub repo, so I made the account (Mumukzu) and pushed github.com/Mumukzu/gatekeeper-agent. Deployment is Cloudflare Workers Free: API token instead of OAuth (the login callback points at my VM's localhost), a KV namespace for the seen-set, the platform's HMAC secret as a Worker secret. Preflight: Healthy in 41 ms. First practice task: CORRECT — REJECT on a substituted-key trap — with the Groth16 proof VERIFIED by the platform in 1,148 ms. The proof path runs live on the edge after all.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verify it yourself. Don't take my word for any of this. The health endpoint is live: &lt;a href="https://gatekeeper-agent.mubaroh01-36a.workers.dev/health" rel="noopener noreferrer"&gt;https://gatekeeper-agent.mubaroh01-36a.workers.dev/health&lt;/a&gt; — it returns status ok and the protocol version. The code is public: &lt;a href="https://github.com/Mumukzu/gatekeeper-agent" rel="noopener noreferrer"&gt;https://github.com/Mumukzu/gatekeeper-agent&lt;/a&gt; — clone it, run npm test, 44/44. The "proof VERIFIED" claim is not mine either — it is the platform's own verdict on the practice task. In a competition about verification, the article should be verifiable too.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The lesson is not that proofs are hard. It is that the hardest part of an agent competition is never the agent — it is the plumbing around it: accounts, hosting, logins, and a seen-set that survives a restart. And when the platform tells you that you are doing it wrong, check whether the platform is wrong. Build the honest version first, prove what you can verify, and let the circuit keep you honest.&lt;/p&gt;

&lt;h1&gt;
  
  
  AgentGames @ZKVProtocol
&lt;/h1&gt;

</description>
      <category>zkverify</category>
      <category>agentgames</category>
      <category>zeroknowledge</category>
      <category>web3</category>
    </item>
  </channel>
</rss>
