DEV Community

ceciliaharm
ceciliaharm

Posted on

I Built a Real Proof Gatekeeper. The Cryptography Was Never the Hard Part.

Creator Track entry — zkVerify Agent Games, Season 01. Agent name: meongkit.

I joined Agent Games on the last day of the season to build a Proof Gatekeeper: an agent that receives signed payment tasks, decides APPROVE or REJECT, and proves every decision with a zero-knowledge proof. I built the whole thing in one day. Then I hit a wall — and the wall was not the cryptography.

What I actually built

A Node.js agent (meongkit-agent, 23 files) that:

  • Verifies the HMAC-SHA256 signature in the x-agent-games-signature header against the raw body before parsing anything — a bad signature gets a 401 and no decision at all.
  • Answers the signed preflight (agent-games.preflight.v1) and the gatekeeper task type (agent-games.proof-gatekeeper.v1) on POST /agent.
  • Decides with a strict rule that mirrors the official circuit: APPROVE only when the proof's verification key matches the registered key, the public balance clears the minimum, the current block is before the expiry block, the recipient matches, the amount is under the cap, and the proof reference has never been seen before. Anything else is a REJECT with the matching reason code: VK_SUBSTITUTION, THRESHOLD_MISMATCH, PROOF_REUSED, EXPIRED_CONDITION, RECIPIENT_MISMATCH, or AMOUNT_OVERFLOW.
  • Proves every decision with a real Groth16 proof from zkVerify's official circuit (gatekeeper.wasm / gatekeeper_final.zkey, checksums verified), generated locally with snarkjs and verified locally before it is returned. A proof is never fabricated: if proving fails, the answer is REJECT with PROOF_FAILED and proof: null.
  • Enforces a 55-second response budget (the platform's hard deadline is 60) and fails closed with 503 on timeout.
  • Caches responses by task_id, so a redelivery returns the identical answer instead of a false reuse, and records used proof references so a replayed proof is caught.

The self-test suite passes 33/33 against the real server: HMAC accept and reject, preflight, a valid task producing an APPROVE with a locally verified proof, all six trap types producing the correct REJECT with a verified proof, idempotent redelivery, and the boundary case where current_block == expiry_block counts as EXPIRED (the circuit uses strict <, and I verified that witness generation fails for decision=1 at equality).

The wall

Registration is SIWE — Sign-In With Ethereum. The flow itself worked: nonce and CSRF token fetched fine. The sign-in step stalled waiting for an approval that timed out unanswered, so the account was never created — until I found the real cause: the sign-in POST needs browser-like headers, or it fails at the network level. With that fixed, I signed in and completed the registration: handle ceciliaharm, and the account is live.

That one stalled approval had cascaded into everything else:

  • No account, so no dashboard registration, so no HMAC secret — and the secret is shown exactly once at registration.
  • No public GitHub repo pushed yet: the connector could not create repos, and the push was blocked because the GitHub App had no access to the new repo. Both were fixed — the repo is now public at https://github.com/ceciliaharm/meongkit-agent.
  • No deployed endpoint yet (fly.io config is written, Singapore region, one machine always on so the seen-proof store survives rounds), so there is no agent endpoint to register.
  • The last Gatekeeper round opens on the evening of 21 November. From this position, on the last day, that round is out of reach — entries lock while a round is open — and I would rather say that plainly than pretend otherwise.

What this taught me

The season's premise is that an agent's claim is worth nothing until a proof verifies it. Building the prover taught me the second half of that lesson: a proof can verify perfectly and still authorize the wrong action if you check the wrong things. The traps are the whole game — a substituted key, a reused proof, an expired condition — and every one of them is a check you have to remember to run, not a property of the math.

The cryptography was the easy part. The hard parts were the ones no circuit covers: getting a signature approved in time, getting a repo pushed, getting a public address for a machine that has to be reachable. Trustworthy agents need both — proofs for their decisions, and a boring, working path to being reachable at all.

Receipts

  • Agent code: https://github.com/ceciliaharm/meongkit-agent
  • Circuit artifacts: official gatekeeper.wasm (SHA-256 be00aefe…92764f) and gatekeeper_final.zkey (SHA-256 adfe95a4…f80d), re-downloadable and checksum-verified with npm run fetch-circuits.
  • Test suite: npm test, 33/33 green, run locally on 2026-11-21.
  • Agent name: meongkit. Wallet: 0x145B5eAdF997d3462A400DF82c126321dcE56F3E (fresh dedicated wallet created for this account).

What I did not do, honestly: I did not deploy a public endpoint, did not register the agent on the dashboard, did not pass preflight, and did not play a live round. The account is registered and the code is public. This entry is the build, the tests, and the wall — not a score.

AgentGames @ZKVProtocol

Top comments (0)