<?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: Hiếu Hoàng</title>
    <description>The latest articles on DEV Community by Hiếu Hoàng (@hieuhoang).</description>
    <link>https://dev.to/hieuhoang</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%2F4278993%2F46e85ec6-50e5-427b-bcdc-60ed053ad819.jpg</url>
      <title>DEV Community: Hiếu Hoàng</title>
      <link>https://dev.to/hieuhoang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hieuhoang"/>
    <language>en</language>
    <item>
      <title>Proving a bank batch balances without showing it: a block-mode terminal built with Kiro.</title>
      <dc:creator>Hiếu Hoàng</dc:creator>
      <pubDate>Wed, 02 Dec 2026 17:21:16 +0000</pubDate>
      <link>https://dev.to/hieuhoang/proving-a-bank-batch-balances-without-showing-it-a-block-mode-terminal-built-with-kiro-56fg</link>
      <guid>https://dev.to/hieuhoang/proving-a-bank-batch-balances-without-showing-it-a-block-mode-terminal-built-with-kiro-56fg</guid>
      <description>&lt;p&gt;&lt;em&gt;This post is written as part of the Kiroween 2026 hackathon.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Banks settle batches of postings every day. A partner on the other side (a card network, a correspondent bank, an insurer) wants to know two things: do the debits equal the credits, and did every posting stay within the agreed limit? The answer is sitting in the batch file. So is every account number and amount, which is exactly why the file cannot be sent.&lt;/p&gt;

&lt;p&gt;For Kiroween I built &lt;strong&gt;CryptTerm&lt;/strong&gt;: a green-phosphor, 80 by 24 block-mode terminal in the browser that proves those two facts with a zero-knowledge proof, and a verifier screen that checks the proof without ever seeing a posting.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Live: &lt;a href="https://cryptterm.netlify.app" rel="noopener noreferrer"&gt;https://cryptterm.netlify.app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Code (MIT): &lt;a href="https://github.com/hoanghieu512/CryptTerm" rel="noopener noreferrer"&gt;https://github.com/hoanghieu512/CryptTerm&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Demo video (2:24):&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/G0BzdxRdoVA" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a terminal
&lt;/h2&gt;

&lt;p&gt;The Resurrection category asks you to bring dead tech back. Back-office banking ran on block-mode terminals for decades: fixed screens, typed fields, PF keys, a status line at the bottom. It is a calm, keyboard-first interface for people who do the same careful job every day. That is a good home for a proof system, which should feel boring and certain, not magical.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the app does
&lt;/h2&gt;

&lt;p&gt;You load a sample batch signed by a simulated core ledger, look at it with the accounts masked, press PF5, and a Web Worker generates a Noir proof (UltraHonk, through bb.js). You get a link. Whoever opens it sees six checks run in order: FORMAT, SIGNATURE, DIGEST_MATCH, POLICY, CIRCUIT, PROOF. Then VERIFIED, or REJECTED AT the first step that failed.&lt;/p&gt;

&lt;p&gt;The part I like most is the second tamper case. Move one cent from one debit to another: the batch still balances, so the math is fine and a proof is generated. But the proof commits to a Merkle root that no longer matches what the ledger signed, so the verifier stops at DIGEST_MATCH. The proof alone would not catch that edit. The signature binding does.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Kiro built it
&lt;/h2&gt;

&lt;p&gt;Every line of code in the repo was written by Kiro. My job was to decide, review and say no. Here is what actually mattered.&lt;/p&gt;

&lt;h3&gt;
  
  
  Start with a spike spec
&lt;/h3&gt;

&lt;p&gt;Before any UI, the first spec asked one question: can a browser prove and verify this circuit, fast enough, with every asset served from the app's own origin? It answered yes (about 2.8 seconds to prove in Node, a 14,656-byte proof, a 2^15-point SRS shipped with the app). It also cost about 3.5 times the credits I had planned. I would do it again, because of what the design phase found.&lt;/p&gt;

&lt;p&gt;While writing the design, Kiro ran experiments and found that Noir 1.0.0 keeps its Poseidon2 sponge private, and that its sponge disagrees with the bb.js &lt;code&gt;poseidon2Hash&lt;/code&gt; for inputs whose length is a multiple of 3. My leaf hash takes six fields. Without that experiment, the JavaScript root and the circuit root would have silently differed and no proof would ever have verified. The design recorded the decision (write the sponge in the repo on top of the public permutation) and pinned it with known-answer tests on both sides.&lt;/p&gt;

&lt;h3&gt;
  
  
  Seven specs, small groups, fresh chats
&lt;/h3&gt;

&lt;p&gt;After the spike came &lt;code&gt;ledger-format&lt;/code&gt;, &lt;code&gt;zk-core&lt;/code&gt;, &lt;code&gt;terminal-ui&lt;/code&gt;, &lt;code&gt;verifier&lt;/code&gt;, &lt;code&gt;release&lt;/code&gt; and, late, &lt;code&gt;verify-error&lt;/code&gt;. Each spec had EARS requirements, a short design, and tasks in groups of three or four with a one-line "Done when" check, with the test tasks before the implementation tasks.&lt;/p&gt;

&lt;p&gt;The single most useful habit: &lt;strong&gt;one fresh chat per task group.&lt;/strong&gt; My longest chat ran two hours on one group, cost 323 credits and garbled about half of its file writes. The next group, in a fresh chat, cost 18.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steering that earns its keep
&lt;/h3&gt;

&lt;p&gt;Two steering rules changed the outcome more than any prompt:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Look up, don't recall.&lt;/strong&gt; Noir and bb.js move fast. This rule made Kiro check the npm registry, which exposed a package rename (&lt;code&gt;@aztec/bb.js&lt;/code&gt; stops at 5.3.0; the current name is &lt;code&gt;@aztec-foundation/bb.js&lt;/code&gt;). Funny detail: the first lookup still concluded the version did not exist. It took applying the same rule a second time to get it right, and now &lt;code&gt;noir.md&lt;/code&gt; keeps a version-quirks log.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evidence before status.&lt;/strong&gt; I added this after one task group was reported done with a commit hash that did not exist. Now a task is complete only when its check ran in the session and the report quotes the real output. That stopped false "done" reports.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  A custom agent that can only read
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;circuit-auditor&lt;/code&gt; is a Kiro custom agent with one tool, &lt;code&gt;read&lt;/code&gt;, and permission rules that deny writes and shell. Its prompt is a checklist for ZK soundness (unconstrained values, range checks before comparisons, padding binding, public inputs) and for parity between the circuit and its TypeScript twin. I ran it headless with the Kiro CLI. It raised four findings, none of them a real break, and each closed with a reason. Tip: use &lt;code&gt;--v3&lt;/code&gt;, or the headless run cannot load a V3 agent file even though &lt;code&gt;kiro-cli agent list&lt;/code&gt; shows it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Property-based testing found a real bug
&lt;/h3&gt;

&lt;p&gt;The repo has 48 fast-check property files, each property with a fixed seed. One of them, &lt;code&gt;prove_error_display&lt;/code&gt;, found that a synchronous throw from the prove service was routed through a promise, so for one turn after PF5 the screen kept saying "proving" with no error. A unit test with a mocked async failure would have passed. The fix and the regression example are logged in &lt;code&gt;tests/PBT-LOG.md&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  MCP, with a grain of salt
&lt;/h3&gt;

&lt;p&gt;Context7 gave Kiro current docs for Noir, bb.js, Vite and Playwright. It was great for call shapes, and stale on the package name (its Noir examples follow &lt;code&gt;master&lt;/code&gt;). The rule we settled on: Context7 for syntax, the npm registry for names and versions, and the registry wins.&lt;/p&gt;

&lt;h3&gt;
  
  
  The rest of the toolbox
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;IDE and CLI.&lt;/strong&gt; Everything was built in the Kiro IDE: Spec mode for the seven specs, short Vibe chats for small reviewed fixes. The CLI was for the one job that should run the same way every time, the read-only audit, with tool trust given on the command line instead of clicked. I did not use Kiro Web or Kiro Crew.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A save hook.&lt;/strong&gt; &lt;code&gt;ledger-save&lt;/code&gt; runs the ledger and zk tests whenever a file in &lt;code&gt;src/ledger&lt;/code&gt; or &lt;code&gt;src/zk&lt;/code&gt; is saved, where the parser, the Merkle root and the verifier live. Its path matcher is pinned by its own test. I did not track how often it fired, so I will not claim it caught a specific break.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Netlify power.&lt;/strong&gt; It set the deploy policy: check &lt;code&gt;netlify status&lt;/code&gt; first, deploy drafts only, never production from the agent. I published production myself in the Netlify UI after the e2e suite passed against the draft.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  A late spec for an honest error
&lt;/h3&gt;

&lt;p&gt;During release testing against the deployed draft, a verify timeout on a loaded machine showed &lt;code&gt;PROOF INVALID&lt;/code&gt; for a proof that was never checked. That is a lie, even if it fails closed. A tiny &lt;code&gt;verify-error&lt;/code&gt; spec gave the proof check three outcomes (valid, invalid, not completed), and the screen now says &lt;code&gt;REJECTED: VERIFIER ERROR&lt;/code&gt; when the check did not finish.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would tell you before your first Kiro spec
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Spike the riskiest thing first, in its own spec, with a yes or no question.&lt;/li&gt;
&lt;li&gt;Keep task groups small and start each in a fresh chat.&lt;/li&gt;
&lt;li&gt;Write the rules you keep repeating into steering, and make the agent quote its evidence.&lt;/li&gt;
&lt;li&gt;Use a read-only custom agent as a second pair of eyes on the code that must be right.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Thanks for reading. Try the tamper demo yourself: load the CLEAN batch, press PF12 on the batch screen, and move a cent between two debits.&lt;/p&gt;

</description>
      <category>kiro</category>
      <category>zeroknowledge</category>
      <category>noir</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
