<?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: BangkitNovendy11</title>
    <description>The latest articles on DEV Community by BangkitNovendy11 (@bangkitnovendy11).</description>
    <link>https://dev.to/bangkitnovendy11</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%2F4245389%2F62a210d9-8e5b-4721-8059-77b3fdc4559c.png</url>
      <title>DEV Community: BangkitNovendy11</title>
      <link>https://dev.to/bangkitnovendy11</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bangkitnovendy11"/>
    <language>en</language>
    <item>
      <title>Trust Nothing, Prove Everything: Building a Proof Gatekeeper for zkVerify Agent Games</title>
      <dc:creator>BangkitNovendy11</dc:creator>
      <pubDate>Sun, 15 Nov 2026 04:50:48 +0000</pubDate>
      <link>https://dev.to/bangkitnovendy11/trust-nothing-prove-everything-building-a-proof-gatekeeper-for-zkverify-agent-games-44f8</link>
      <guid>https://dev.to/bangkitnovendy11/trust-nothing-prove-everything-building-a-proof-gatekeeper-for-zkverify-agent-games-44f8</guid>
      <description>&lt;p&gt;&lt;em&gt;Written for the zkVerify Agent Games Creator Track (#AgentGames). Season 01 runs 21 October – 21 November 2026, with 400,000 VFY in prizes across four tracks. This article documents work I actually did — and is honest about what I didn't.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;My agent is &lt;strong&gt;noven.ai&lt;/strong&gt;. It runs on a Binance Agentic Wallet, it signs transactions, mints NFTs, and holds assets on my behalf. Every day I trust it with real decisions about real money.&lt;/p&gt;

&lt;p&gt;That is exactly the problem.&lt;/p&gt;

&lt;p&gt;An agent can tell you it checked the balance, verified the recipient, and approved a payment for the right reasons. But a claim is not evidence. If the agent is wrong — or lying, or hacked — its word is worth nothing. The crypto world learned this about money a long time ago: don't trust, verify. zkVerify's Agent Games applies the same principle to agents themselves.&lt;/p&gt;

&lt;p&gt;So I had my agent build the thing the tournament's first track asks for: a &lt;strong&gt;Proof Gatekeeper&lt;/strong&gt; — an agent that judges proof-backed payment requests and proves every decision with a zero-knowledge proof. Then I tested it, locally, against the tournament's own circuit. This is what happened.&lt;/p&gt;

&lt;h2&gt;
  
  
  The job: a bouncer with a 60-second clock
&lt;/h2&gt;

&lt;p&gt;From the official field guide, a Proof Gatekeeper task is a signed JSON envelope describing a transfer request. The platform POSTs it to your agent's public endpoint. The agent has &lt;strong&gt;60 seconds&lt;/strong&gt; to answer with one deterministic decision — APPROVE or REJECT — plus a Groth16 proof of that decision, which the platform re-verifies against its own registered verification key.&lt;/p&gt;

&lt;p&gt;The scoring is deliberately asymmetric: a correct, verified decision is &lt;strong&gt;+12&lt;/strong&gt;. A wrong REJECT is &lt;strong&gt;−3&lt;/strong&gt;. A wrong APPROVE — letting a bad payment through — is &lt;strong&gt;−6&lt;/strong&gt;. A timeout or a missing proof is &lt;strong&gt;−2&lt;/strong&gt;. The message is clear: being careless is worse than being cautious, and being slow is its own failure.&lt;/p&gt;

&lt;p&gt;The tasks are not all honest. The field guide documents seven trap varieties: a valid condition (about half the tasks), plus VK substitution, threshold mismatch, proof reuse, expired condition, recipient mismatch, and amount overflow. A gatekeeper that only checks "is this proof valid?" will approve traps all day — because a proof can be perfectly valid and still authorize the wrong thing. The guide says it plainly: &lt;strong&gt;verification is necessary, not sufficient.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;I built the gatekeeper as a single Node.js file with no framework, running locally. It does five things, in order:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Verify the signature before parsing anything.&lt;/strong&gt; Every incoming request carries an &lt;code&gt;x-agent-games-signature&lt;/code&gt; header — an HMAC-SHA256 over the raw request body. The server checks it against the raw bytes first, with a constant-time comparison. A bad signature gets a 401 and no work is done at all:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// 1. Verify HMAC against the RAW body before parsing anything.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;sig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"x-agent-games-signature"&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="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;verifySignature&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rawBody&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sig&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;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;401&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s2"&gt;"content-type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"application/json"&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;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"bad_signature"&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="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Decide, fail closed.&lt;/strong&gt; The decision logic walks the trap encyclopedia in order: malformed task, proof VK different from the registered VK, proof already used, balance below the minimum, expired condition, recipient mismatch, amount above the cap. Any failure means REJECT. Only a task that survives every check gets APPROVE. If anything is uncertain, the answer is REJECT — never approve by default.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Prove the decision.&lt;/strong&gt; For every provable decision, the server generates a Groth16 proof with the tournament's own gatekeeper circuit — &lt;code&gt;gatekeeper.wasm&lt;/code&gt; and &lt;code&gt;gatekeeper_final.zkey&lt;/code&gt;, downloaded from the official site — using snarkjs 0.7.6. APPROVE becomes decision &lt;code&gt;1&lt;/code&gt; in the circuit; REJECT becomes decision &lt;code&gt;0&lt;/code&gt;. If proof generation fails on an APPROVE, the server fails closed to REJECT instead of returning an approval it cannot prove. (Reused-proof tasks get no proof at all, per the rules: there is nothing new to prove.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Stay idempotent.&lt;/strong&gt; The platform may retry a task after a network failure, so every response is cached by task ID. A repeated task ID returns the byte-identical cached body.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Sign the response.&lt;/strong&gt; Every response carries its own &lt;code&gt;x-agent-games-signature&lt;/code&gt; over the raw response body, and the server never hangs: an internal error returns a 500 rather than a timeout.&lt;/p&gt;

&lt;p&gt;One honest note: the HMAC secret in this build is a local test secret. The real platform secret is generated at registration, and this build never touches it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The proof, verified
&lt;/h2&gt;

&lt;p&gt;I ran the full loop locally on the event page's own sample scenario: public balance 1460 against a minimum of 1000, an amount of 500 against a cap of 1000, a recipient that matches the condition, an expiry block of 8,430,000 ahead of the current block 8,420,000, and a proof VK equal to the registered VK. The gatekeeper returned APPROVE — and a Groth16 proof that verified against the verification key exported from the official proving key.&lt;/p&gt;

&lt;p&gt;Real output from the test run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a) valid task -&amp;gt; APPROVE — status=200 decision=APPROVE reason=VALID_CONDITION totalMs=863 proveMs=843
a) Groth16 proof verifies against exported vk — verify=true
b) fullProve(decision=1) on trap inputs FAILS — Error: Assert Failed. Error in template GatekeeperEvaluation_79 line: 102
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Proof generation took &lt;strong&gt;843 ms&lt;/strong&gt; — against a 60,000 ms deadline. The verification was confirmed twice: &lt;code&gt;snarkjs.groth16.verify&lt;/code&gt; returned &lt;code&gt;true&lt;/code&gt; in-process, and an independent CLI run printed &lt;code&gt;OK!&lt;/code&gt; with exit code 0. I also decoded the proof's 13 public signals and confirmed they encode what they should: the registered verification-key hash, the recipient address, and decision &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In total, &lt;strong&gt;12 out of 12 local checks passed&lt;/strong&gt;: the valid approval, all six trap rejections with the correct reason codes, the bad-HMAC 401, the byte-identical replay, the reused-proof rejection without a proof, and the malformed-task rejection.&lt;/p&gt;

&lt;p&gt;The check I found most satisfying was the one designed to fail. When I fed the circuit trap inputs and asked it to prove decision &lt;code&gt;1&lt;/code&gt; — approve anyway — it refused: &lt;code&gt;Assert Failed&lt;/code&gt; at line 102 of the gatekeeper template. The circuit will not let you prove an approval that isn't true. That is the whole point of the exercise, and it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest miss: the verification-key hash
&lt;/h2&gt;

&lt;p&gt;Not everything matched. The site publishes a registered verification-key hash for the gatekeeper circuit (&lt;code&gt;0x6b79c6…d77b0&lt;/code&gt;). I exported the verification key from the official proving key and tried to reproduce that hash — &lt;strong&gt;12 serialization variants&lt;/strong&gt;: keccak256 and SHA-256 over compact, indented, and sorted JSON, curve-point fields only, flattened commitment data, wrapped and unwrapped forms. None of them matched.&lt;/p&gt;

&lt;p&gt;The most likely explanation is that zkVerify (or its Kurier service) computes the registered hash over its own canonical serialization of the verification key, which I did not reproduce. This does not affect the local build: proofs generated with the downloaded circuit files verify against the exported key, so the artifacts are self-consistent. But I am not going to claim the local hash matches the registered one. It was checked, and it did not match with the methods I tried. If I take this build to the arena, resolving that gap is the first thing to do — because the platform re-verifies proofs against &lt;em&gt;its&lt;/em&gt; registered key, not mine.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I did not do
&lt;/h2&gt;

&lt;p&gt;This article documents a build, not an arena score. To be precise about scope:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No public endpoint.&lt;/strong&gt; The server ran only on &lt;code&gt;127.0.0.1:8787&lt;/code&gt; for these tests and is stopped now. No tunnel, no hosting account.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No arena entry.&lt;/strong&gt; No practice task, no scored round, no points.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No submission to Kurier or zkVerify mainnet.&lt;/strong&gt; No verification-key registration, no proof reference, no on-chain transaction of any kind.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No funds moved.&lt;/strong&gt; No VFY spent, no gas paid. Total cost: $0.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I am entering the Creator Track with this record because the work is real and the numbers are checkable — not because I am claiming a leaderboard position I don't have.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters beyond the tournament
&lt;/h2&gt;

&lt;p&gt;My agent moves money for me. Every agent that does that — approving payments, signing contracts, managing positions — is a trust problem waiting to happen. Today we mostly solve it with reputation: the agent behaved well yesterday, so we assume it behaves well today. That is not verification. That is hope.&lt;/p&gt;

&lt;p&gt;The gatekeeper pattern is a better answer, and it has two halves. The first half is the proof: a decision accompanied by cryptographic evidence that anyone can check. The second half is the part the field guide keeps repeating — verification is necessary, not sufficient. A valid proof of the wrong statement is still wrong. The agent has to check &lt;em&gt;what&lt;/em&gt; was proven: the right key, the right threshold, the right recipient, the right expiry, a proof that hasn't been spent already. The cryptography enforces the rules; the agent still has to know the rules.&lt;/p&gt;

&lt;p&gt;That is what I built here, in miniature: a gatekeeper that checks first, proves second, and refuses to approve what it cannot prove. The proof took 843 milliseconds. The lesson took a little longer — but it's the one I'll keep.&lt;/p&gt;

&lt;h1&gt;
  
  
  AgentGames
&lt;/h1&gt;

</description>
      <category>web3</category>
      <category>ai</category>
      <category>blockchain</category>
      <category>zkproofs</category>
    </item>
  </channel>
</rss>
