Files
skills/public/hip-0113.html
zeekayandHanzo Dev 9e10c1c10e Each llms index points at the other two
hanzoskills.com/llms.txt now opens with the install line, the API
reference index and the company index, so an agent that lands on any
one of the three can find the rest.

robots.txt claimed 537 documents while llms.txt counts 920. The number
is gone from robots.txt; llms.txt derives it.

public/ is regenerated from scripts/site.py, which it had fallen
behind: the copy-prompt menu and agent bar were in the generator and
not in the committed pages. tests/site.mjs passes against the result.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-11 00:27:59 -07:00

496 lines
58 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="en"><head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>hip-0113</title>
<meta name="color-scheme" content="dark">
<style>
/* Committed to one visual world: a dark instrument panel. No light variant —
the dot field and the hairline rules only read on black, and a naive
inversion would wash both out. Every colour is painted explicitly so the page
never borrows a host background. */
@font-face{font-family:'Zen';src:url('/fonts/Zen-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
@font-face{font-family:'Zen';src:url('/fonts/Zen-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
@font-face{font-family:'Zen Pixel Square';src:url('/fonts/ZenPixel-Square.woff2') format('woff2');font-style:normal;font-display:swap}
:root{
--ink:#f4f4f2; --soft:#9c9c98; --faint:#6a6a66; --ground:#000; --panel:#0a0a0a;
--line:#232323; --line-hi:#3a3a3a; --accent:#f4f4f2;
--font-zen-sans:'Zen',-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
--font-zen-mono:'Zen Mono',ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
--font-zen-pixel-square:'Zen Pixel Square',monospace;
--mono:var(--font-zen-mono);
--sans:var(--font-zen-sans);
/* Controls are pills and surfaces are soft, as on hanzo.ai. */
--r:999px; --r-soft:14px;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--sans);
font-size:16px;line-height:1.65;-webkit-font-smoothing:antialiased}
.wrap{max-width:60rem;margin:0 auto;padding:0 1.75rem}
/* The dot field. A halftone made of one repeating radial-gradient, faded out
along the diagonal by a mask so it reads as a wave rather than wallpaper. */
/* No overflow clip here: the dot field is inset to the box already, and a clip
would cut off the copy-prompt menu. */
.hero{position:relative;border-bottom:1px solid var(--line)}
.hero::before{content:"";position:absolute;inset:0;
background-image:radial-gradient(var(--line-hi) 1px, transparent 1px);
background-size:7px 7px;
-webkit-mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
pointer-events:none}
.hero .wrap{position:relative;padding-top:5.5rem;padding-bottom:4rem}
nav{border-bottom:1px solid var(--line)}
nav .in{max-width:60rem;margin:0 auto;padding:1.1rem 1.75rem;display:flex;
justify-content:space-between;align-items:center;gap:1rem}
.brand{font-family:var(--mono);font-size:.85rem;letter-spacing:.14em;
text-transform:uppercase;color:var(--ink);text-decoration:none;
display:inline-flex;align-items:center;gap:.6rem}
.brand i{font-style:normal;color:var(--faint)}
.mark{width:1.15em;height:1.15em;display:block;flex:0 0 auto}
nav a.up{font-family:var(--mono);font-size:.72rem;letter-spacing:.14em;
text-transform:uppercase;color:var(--soft);text-decoration:none}
nav a.up:hover{color:var(--ink)}
h1{font-family:var(--mono);font-size:clamp(2rem,5.4vw,3.4rem);line-height:1.12;
letter-spacing:-.02em;margin:0 0 1.1rem;font-weight:500;text-wrap:balance}
h1 em{font-style:normal;color:var(--faint)}
.lede{color:var(--soft);font-size:1.05rem;max-width:52ch;margin:0 0 2.25rem}
.btns{display:flex;flex-wrap:wrap;gap:.7rem;margin:0 0 .5rem;align-items:center}
.btn{display:inline-flex;align-items:center;gap:.5rem;font-family:var(--mono);
font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;
padding:.8rem 1.4rem;border:1px solid var(--line-hi);border-radius:var(--r);
color:var(--ink);text-decoration:none;background:transparent;cursor:pointer;
line-height:1.2;font-weight:400}
.btn:hover{background:#141414;text-decoration:none;border-color:var(--soft)}
.btn.solid{background:var(--ink);color:#000;border-color:var(--ink)}
.btn.solid:hover{background:#d8d8d4}
.btn .chev{width:.7em;height:.7em;flex:0 0 auto;transition:transform .15s ease}
.btn[aria-expanded="true"] .chev{transform:rotate(180deg)}
/* Copy-prompt selector. Each row copies the prompt for its own target. */
.copy{position:relative;display:inline-flex}
.menu{position:absolute;top:calc(100% + .5rem);left:0;z-index:20;min-width:21rem;
background:var(--panel);border:1px solid var(--line-hi);border-radius:var(--r-soft);
padding:.4rem;display:flex;flex-direction:column;
box-shadow:0 12px 32px rgba(0,0,0,.75)}
.menu[hidden]{display:none}
.mi{display:flex;align-items:center;gap:.7rem;width:100%;text-align:left;
padding:.62rem .8rem;border:0;border-radius:calc(var(--r-soft) - .35rem);
background:transparent;color:var(--ink);font-family:var(--mono);font-size:.76rem;
letter-spacing:.04em;text-decoration:none;cursor:pointer;line-height:1.3;
white-space:nowrap}
.mi:hover,.mi:focus-visible{background:#181818;outline:none}
.mi .mark{width:1.05rem;height:1.05rem;color:var(--soft)}
.mi:hover .mark{color:var(--ink)}
.mi u{margin-left:auto;color:var(--faint);text-decoration:none;font-size:.68rem;
letter-spacing:.1em;text-transform:uppercase}
/* Works-with bar: one scrolling row, name and mark per agent. */
.strip{border-bottom:1px solid var(--line);background:var(--panel)}
.strip .in{max-width:60rem;margin:0 auto;padding:.9rem 1.75rem;display:flex;
align-items:center;gap:1.25rem;font-family:var(--mono);font-size:.72rem;
letter-spacing:.1em;text-transform:uppercase;color:var(--faint)}
.strip b{color:var(--soft);font-weight:400;flex:0 0 auto;
border-right:1px solid var(--line);padding-right:1.25rem;align-self:stretch;
display:flex;align-items:center}
.bar{display:flex;align-items:center;gap:.5rem;flex:1 1 auto;min-width:0;
overflow-x:auto;scrollbar-width:none;scroll-snap-type:x proximity;
-webkit-overflow-scrolling:touch;
-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent);
mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent)}
.bar::-webkit-scrollbar{display:none}
.agent{display:inline-flex;align-items:center;gap:.45rem;flex:0 0 auto;
padding:.4rem .85rem;border:1px solid var(--line);border-radius:var(--r);
color:var(--soft);white-space:nowrap;scroll-snap-align:start;
text-decoration:none;background:var(--ground)}
.agent:hover{color:var(--ink);border-color:var(--line-hi);text-decoration:none}
.agent .mark{width:.95rem;height:.95rem}
h2{font-family:var(--mono);font-size:1.1rem;letter-spacing:-.01em;margin:2.75rem 0 .75rem;font-weight:500}
h3{font-size:1rem;margin:2rem 0 .5rem;font-weight:600}
h4,h5,h6{font-size:.94rem;margin:1.5rem 0 .5rem;font-weight:600}
p{margin:0 0 1rem;max-width:70ch}
ul,ol{margin:0 0 1rem;padding-left:1.35rem;max-width:70ch}
li{margin:.22rem 0}
a{color:var(--ink);text-decoration:underline;text-underline-offset:3px;
text-decoration-color:var(--line-hi)}
a:hover{text-decoration-color:var(--ink)}
a:focus-visible{outline:1px solid var(--ink);outline-offset:3px}
code{font-family:var(--mono);font-size:.85em;background:var(--panel);
border:1px solid var(--line);border-radius:5px;padding:.1em .36em}
pre{background:var(--panel);border:1px solid var(--line);padding:1rem 1.1rem;
border-radius:var(--r-soft);overflow-x:auto;margin:0 0 1.25rem}
pre code{background:none;border:0;padding:0;font-size:.82rem;line-height:1.7}
blockquote{margin:0 0 1rem;padding-left:1rem;border-left:1px solid var(--line-hi);color:var(--soft)}
hr{border:0;border-top:1px solid var(--line);margin:2.5rem 0}
table{border-collapse:collapse;width:100%;margin:0 0 1.25rem;font-size:.92rem;
display:block;overflow-x:auto}
th,td{border:1px solid var(--line);padding:.5rem .7rem;text-align:left}
.curl{display:block;background:var(--panel);border:1px solid var(--line);
border-radius:var(--r-soft);padding:.95rem 1.1rem;font-family:var(--mono);
font-size:.8rem;color:var(--soft);overflow-x:auto;margin:0 0 2.5rem;
white-space:pre;line-height:1.9}
.curl b{color:var(--ink);font-weight:400}
.curl i{font-style:normal;color:var(--faint)}
/* index */
#q{width:100%;padding:.85rem 1.2rem;font-family:var(--mono);font-size:.85rem;color:var(--ink);
background:var(--panel);border:1px solid var(--line);border-radius:var(--r);margin:0 0 .6rem}
#q::placeholder{color:var(--faint);text-transform:uppercase;letter-spacing:.1em;font-size:.72rem}
#q:focus{outline:none;border-color:var(--soft)}
#count{color:var(--faint);font-family:var(--mono);font-size:.72rem;letter-spacing:.1em;
text-transform:uppercase;margin:0 0 2rem}
.cat{margin:2.5rem 0 .5rem;font-family:var(--mono);font-size:.7rem;letter-spacing:.16em;
text-transform:uppercase;color:var(--faint);border-bottom:1px solid var(--line);
padding-bottom:.45rem}
.row{display:block;padding:.6rem .9rem;margin:0 -.9rem;border-bottom:1px solid var(--line);
border-radius:var(--r-soft);text-decoration:none}
.row:hover{background:#0a0a0a}
.nm{font-family:var(--mono);font-size:.84rem;color:var(--ink);display:block}
.ds{color:var(--soft);font-size:.9rem;display:block;margin-top:.12rem}
footer{margin-top:4rem;padding:2rem 0 4rem;border-top:1px solid var(--line);
color:var(--faint);font-size:.85rem}
footer a{color:var(--soft)}
.fmap{display:grid;gap:1.75rem;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));
margin:0 0 2rem;font-size:.85rem}
.fmap b{display:block;font-family:var(--mono);font-size:.68rem;letter-spacing:.16em;
text-transform:uppercase;color:var(--faint);font-weight:400;margin:0 0 .6rem;
border-bottom:1px solid var(--line);padding-bottom:.4rem}
.fmap a{display:inline-block;color:var(--ink);text-decoration:none;margin:.3rem .35rem 0 0}
.fmap a:hover{text-decoration:underline}
.fmap div{color:var(--faint);line-height:1.5}
.fend{border-top:1px solid var(--line);padding-top:1.25rem;font-size:.82rem}
@media (max-width:640px){
.hero .wrap{padding-top:3.25rem;padding-bottom:2.75rem}
.btns{gap:.5rem}
.btn{padding:.75rem 1.15rem;font-size:.68rem}
.copy,.copy .btn{width:100%;justify-content:center}
.menu{left:0;right:0;min-width:0}
.strip .in{flex-direction:column;align-items:flex-start;gap:.6rem;padding:.9rem 1.75rem}
.strip b{border-right:0;padding-right:0}
.bar{width:100%}
}
</style>
<link rel="alternate" type="text/markdown" href="/hip-0113.md">
<link rel="icon" href="/favicon.svg">
<link rel="canonical" href="https://hanzoskills.com/hip-0113">
</head>
<!-- Reading this with a machine? Every page here is also plain markdown.
This one: https://hanzoskills.com/hip-0113.md
Index: https://hanzoskills.com/llms.txt
Corpus: https://hanzoskills.com/all.md
Append .md to any path for the markdown twin. -->
<body>
<nav><div class="in">
<a class="brand" href="/"><svg class="mark" viewBox="0 0 67 67" fill="currentColor" aria-hidden="true"><path d="M22.21 67V44.6369H0V67H22.21Z"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z"/><path d="M22.21 0H0V22.3184H22.21V0Z"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z"/></svg> HANZO<i>SKILLS</i></a>
<a class="up" href="/">All skills</a>
</div></nav>
<div class="wrap">
<h1>hip-0113</h1><p class="lede">HIP-113: Cognitive Sidecar &amp; Hanzo Engine Provider Runtime for Thinking Chains. Status Final. Hanzo architectural specification.</p><h1>HIP-0113: Cognitive Sidecar &amp; Hanzo Engine Provider Runtime for Thinking Chains</h1>
<h2>Abstract</h2>
<p>This HIP specifies Hanzo&#x27;s two roles in a <strong>Thinking Chain</strong> — a deterministic chain paired with a verifiable cognitive layer, where thought informs state but never mutates consensus directly.</p>
<p>First, the <strong>Hanzo Engine</strong> is the off-chain <strong>Tier-2</strong> inference runtime that a bonded provider quorum runs. Providers load registered models through the engine&#x27;s C ABI (<code>hanzo_ffi_infer</code> / <code>hanzo_ffi_embed</code>), turn the deterministic result into a <code>output_hash</code> / <code>embedding_hash</code>, and settle agreement through a commit-reveal quorum on the Lux A-Chain, earning a <strong>Proof-of-Thought (PoT)</strong> receipt. The engine is NEVER on the C-Chain consensus path.</p>
<p>Second, every node MAY run a node-local <strong>Cognitive Sidecar</strong>: a thinking agent (Hanzo Engine runtime + ZAP tools + proposal analyzer + simulation client + red-team agent + vote recommender) that sits <em>behind a signer firewall</em>. The agent produces artifacts — <code>ProposalDraft</code>, <code>VoteRecommendation</code>, <code>ConfigPatch</code>, <code>RiskReport</code>, <code>SimulationRequest</code>, <code>OperatorAction</code>, <code>BridgeHealthAlert</code> — but MUST NOT hold validator keys or mutate consensus. A separate signer/policy layer, governed by a node-local <code>[ai.autonomy]</code> policy and bounded by <strong>human-in-the-loop levels 0–5</strong>, decides what (if anything) becomes a transaction.</p>
<p>This HIP composes with — does not replace — HIP-0020 (the node that schedules the compute swarm and supplies provider GPUs) and HIP-0024 (the Hanzo sovereign L1 that hosts the precompiles). It is one of four sibling artifacts sharing one canon: the Lux <em>Thinking Chains</em> proposal (the L0/consensus-layer primitive and bridge precompiles), the Zoo <em>Beluga L3 Thinking-Chain Architecture</em> ZIP (the first deployment), and the Zoo <em>Thinking Chains</em> paper (the conceptual treatment and Subsampled Cognitive Consensus analysis).</p>
<h2>Motivation</h2>
<p>Two distinct needs drive this HIP, and conflating them is the mistake prior &quot;AI-on-chain&quot; designs made.</p>
<p><strong>Need 1 — large-model cognition a chain can settle on.</strong> Governance and application logic want judgments only a frontier model can make (summarize a 200-page report, rank grant applications, multi-criteria proposal analysis). A live LLM call is nondeterministic across hardware and model versions and unbounded in latency — any of which forks a network. The resolution is to run the large model <em>off-chain</em> and return a <em>settlement object</em> whose validity is checked by re-deriving a hash, not by re-running a model. Hanzo already ships the runtime that does exactly this: the native engine over a stable C ABI, plus a Go operator that turns engine output into the commit/reveal payloads an on-chain quorum precompile settles (<code>chains/hanzo-evm/operator</code>, <code>chains/hanzo-evm/precompile/aiquorum</code>). This HIP specifies that runtime as the canonical <strong>Tier-2 provider</strong>.</p>
<p><strong>Need 2 — a node that can reason about its own operation without ever touching consensus.</strong> Operators want a validator that can read a governance proposal and draft an analysis, notice a bridge health regression, recommend a vote, or propose a config change — but they MUST NOT let a model hold a validator key or steer block production. The resolution is the <strong>Cognitive Sidecar</strong>: the agent is a pure <em>producer of artifacts</em>; a deterministic signer/policy layer is the only thing that can turn an artifact into a transaction, and only within an explicit autonomy policy and human-loop level. This is the decomplecting move — separating <em>what cognition produces</em> from <em>when the node may act on it</em>.</p>
<h2>Specification</h2>
<p>The keywords MUST, MUST NOT, SHALL, SHOULD, MAY are used per RFC 2119. All hashing is keccak-256 unless stated. &quot;Structured output&quot; means a fixed-shape value (class label, ranked ID list, vote+confidence bucket, or fixed-width embedding/hash) — <strong>never prose</strong>.</p>
<h3>1. Roles and shared canon</h3>
<p>This HIP uses the shared role vocabulary of the Thinking Chains canon:</p>
<p>| Role | Meaning | |------|---------| | C | contracts / escrow / bridge (the requesting domain) | | A | AI inference / quorum / model-registry (the settling domain) | | D | DEX / market | | S | simulation | | R | reputation | | G | governance | | M | memory |</p>
<p>Hanzo&#x27;s Tier-2 provider runtime operates in role <strong>A</strong>. The Cognitive Sidecar is a node-local actor that <em>produces inputs for</em> C/G/S/R but is never itself a consensus participant.</p>
<p>A <strong>Thinking Chain</strong> is the pair <em>(deterministic chain, verifiable cognitive layer)</em> such that (i) the state transition is deterministic and reproducible from committed inputs alone; (ii) cognition MAY produce inputs to the state transition, but only structured, hash-addressed outputs that are themselves committed; (iii) no state transition reads a live, uncommitted cognitive result. Thought <em>informs</em> state; thought never <em>is</em> the consensus mechanism.</p>
<h3>2. The two tiers</h3>
<p>There are exactly two inference tiers, and Hanzo&#x27;s engine lives in Tier 2.</p>
<p><strong>Tier 1 — deterministic int8 in-consensus.</strong> A small model runs byte-identically inside block execution through the Lux inference precompile at <code>0x0300…0003</code> (the <code>0x0303</code> shorthand in the canon; a pure-Go, CGO=0 int8 transformer evaluator in the AI-reserved <code>0x0300…00xx</code> range). Every validator computes the identical <code>output_hash</code> / <code>embedding_hash</code>; no GPU, no Hanzo Engine. Tier 1 is the <em>only</em> inference that may directly produce a state-transition input, precisely because it is deterministic. <strong>Tier 1 is out of scope for this HIP</strong> beyond the boundary it defines: a Tier-1 call MUST NOT recursively invoke Tier 2 within the same transaction.</p>
<p><strong>Tier 2 — large-model off-chain provider quorum.</strong> Models that cannot be made byte-identical on-chain run <em>off-chain</em>, on a bonded provider set, through the <strong>Hanzo Engine</strong>. Providers run <code>hanzo_ffi_infer</code> / <code>hanzo_ffi_embed</code>, produce <code>output_hash</code> / <code>embedding_hash</code>, and commit-reveal into the A-Chain quorum. The A-Chain settles agreement and exports a PoT receipt. <strong>This is where the Hanzo Engine lives. The Hanzo Engine is NEVER on the C-Chain consensus path.</strong></p>
<h3>3. The Bridge Law (binding)</h3>
<blockquote><p><strong>C-Chain consensus state MUST NOT depend on a live query whose result is not already committed and certified.</strong></p></blockquote>
<p>The A-Chain settles the provider quorum; the C-Chain (or an L3 such as Beluga) imports the settled receipt by Merkle proof against a committed <code>receipt_root</code>, in a <em>separate</em> transaction. C consensus never blocks on, or branches on, an uncommitted A-Chain value. The slogan, identical across all four artifacts:</p>
<blockquote><p><strong>ZAP transports; proofs commit; receipts settle; VMs execute.</strong></p></blockquote>
<p>ZAP (HIP-0114) carries intents, receipts, and agent/operator messages; it is a transport and never a proof. A message carries no consensus weight until a committed proof or receipt certifies it.</p>
<h3>4. The Hanzo Engine as Tier-2 provider runtime</h3>
<h4>4.1 The engine FFI surface (the cdylib providers run)</h4>
<p>The provider runtime is <code>libhanzo_engine_ffi</code> — a C ABI over the native engine, built once (lazily, from environment) holding every configured model, so a non-Rust caller (the Go operator over cgo) can drive any loaded model in-process. The full ABI is fixed (<code>engine/hanzo-engine-ffi/include/hanzo_engine_ffi.h</code>, <code>engine/hanzo-engine-ffi/src/lib.rs</code>):</p>
<p>| Symbol | Purpose | Return contract | |--------|---------|-----------------| | <code>hanzo_ffi_ready()</code> | Load all <code>HANZO_FFI_MODELS</code> if needed | <code>1</code> ready, <code>0</code> fail | | <code>hanzo_ffi_infer(model, prompt, &amp;out, &amp;out_len)</code> | Text generation (greedy) | <code>0</code> ok; <code>-1</code> bad args, <code>-2</code> engine unavailable, <code>-3</code> inference failed | | <code>hanzo_ffi_embed(model, text, &amp;out, &amp;out_count)</code> | Native-dimension embedding | <code>0</code> ok; errors as above | | <code>hanzo_ffi_load(name, kind, source)</code> | Add a model to the live engine | <code>0</code> ok; <code>-3</code> bad spec / conflict | | <code>hanzo_ffi_unload(name)</code> | Remove a model (refuses to go empty) | <code>0</code> ok; <code>-3</code> not found / last model | | <code>hanzo_ffi_list(&amp;out, &amp;out_len)</code> | Newline-joined routable ids | <code>0</code> ok | | <code>hanzo_ffi_free</code> / <code>hanzo_ffi_free_f32</code> | Release returned buffers | — |</p>
<p>Model configuration is the <code>HANZO_FFI_MODELS</code> spec: a <code>;</code>-separated list of <code>name=kind:source</code>, <code>kind ∈ {gguf, plain, embedding}</code>. The first entry is the default model; <code>HANZO_FFI_TOK_DIR</code> resolves a GGUF tokenizer. Example:</p>
<pre><code>HANZO_FFI_MODELS=&quot;zen-nano=gguf:/models/zen-5-flash.gguf;zen-embed=embedding:/models/zen-embedding-0.6B&quot;
HANZO_FFI_TOK_DIR=/models/zen-nano-fused</code></pre>
<p>A provider MUST use greedy decoding for any consensus-relevant job: greedy decoding on a fixed engine build is bit-identical for the same <code>(model, prompt)</code> on the same host, which is the property that lets two honest providers produce the same hash.</p>
<h4>4.2 ModelSpec discipline (registration is mandatory for consensus models)</h4>
<p>A governance- or consensus-relevant model MUST be registered. The registration record is the <strong>ModelSpec</strong>, whose keccak digest (<code>model_spec_hash</code>) is the only thing stored on-chain; the preimage is reproduced by every operator. The canonical fields and hash are byte-identical between the off-chain operator (<code>chains/hanzo-evm/operator/canonical/modelspec.go</code>) and the on-chain precompile (<code>aiquorum.ComputeModelSpecHash</code>):</p>
<pre><code>ModelSpec {
model_id string // routable model name (the HANZO_FFI_MODELS key, e.g. &quot;zen-nano&quot;)
model_hash bytes32 // pins exact weights (e.g. keccak/sha of the .gguf)
tokenizer_hash bytes32 // pins the fused tokenizer dir
runtime_version string // pins the engine build (e.g. &quot;hanzo-engine/ffi-greedy-v1&quot;)
sampling_hash bytes32 // pins the decoding policy (greedy / temperature 0)
prompt_template_hash bytes32 // pins the chat/prompt template
embedding_model_hash bytes32 // pins the embedding model (zero if none)
}
model_spec_hash = keccak256(
u32be(len(model_id)) || model_id ||
model_hash(32) || tokenizer_hash(32) ||
u32be(len(runtime_version)) || runtime_version ||
sampling_hash(32) || prompt_template_hash(32) || embedding_model_hash(32) )</code></pre>
<p>Field order is canonical and load-bearing: reordering any two adjacent fields changes the digest while leaving every value unchanged — exactly the bug this one shared definition exists to prevent. Two operators with different weights, a drifted tokenizer, or a different engine build hash to <em>different</em> specs and never quorum together. The on-chain <code>engine_build_hash</code> and <code>quantization</code> are folded into <code>runtime_version</code> and <code>model_hash</code> respectively (an operator publishes the exact engine build string and the quantized weight hash it runs); a verifier that wants them broken out reads the published ModelSpec record off-chain.</p>
<h4>4.3 The Tier-2 provider flow: sample → infer → commit → reveal → settle</h4>
<p>For a job whose on-chain record carries <code>(job_id, model_spec_hash, prompt_hash, N, threshold, reward)</code>:</p>
<ol><li><strong>Sample (select).</strong> The A-Chain quorum precompile selects an <code>N</code>-member</li></ol>
<p> committee from an eligible set strictly larger than <code>N</code> (margin <code>E ≥ N + max(2, N/2)</code>) via a deterministic, replayable beacon. A selected provider proceeds; others do not. Selection is replayable by any verifier (<code>isSelected</code>), so no provider can predict or pin membership.</p>
<ol><li><strong>Infer.</strong> The selected provider runs the registered model through the engine —</li></ol>
<p> <code>hanzo_ffi_infer(model, prompt)</code> for the causal output and, if the job carries an embedding, <code>hanzo_ffi_embed(model, text)</code>. The provider computes the consensus <code>output_hash</code> per mode (§4.4) and <code>embedding_hash</code> (§4.5).</p>
<ol><li><strong>Commit.</strong> The provider draws a fresh 256-bit CSPRNG nonce and submits an</li></ol>
<p> <strong>operator-bound</strong> commit (<code>commitResponse</code>). The commit binds the provider&#x27;s own 20-byte address (§4.6), so a peer who observes the commit on the wire cannot replay it as their own.</p>
<ol><li><strong>Reveal.</strong> Inside the reveal window the provider reveals</li></ol>
<p> <code>(output_hash, embedding_hash, nonce)</code> (<code>revealResponse</code>). The precompile recomputes the commit from the revealed fields and the <em>committing</em> operator and rejects any mismatch.</p>
<ol><li><strong>Settle.</strong> After the reveal window, <code>settle</code> tallies by <code>output_hash</code>: if</li></ol>
<p> <code>≥ threshold</code> providers revealed the identical <code>output_hash</code>, that value is canonical; agreeing providers are paid from the job reward, the result is exported as a PoT receipt under the A-Chain <code>receipt_root</code>, and value is conserved. Withholders are slashed (§7); honest minority answers are not.</p>
<p>The capstone proof (<code>chains/hanzo-evm/operator/capstone</code>) drives this entire pipeline against the <strong>real</strong> engine (cgo FFI) and the <strong>real</strong> <code>aiquorum</code> precompile and asserts that the on-chain canonical hash is byte-identical to the engine output the honest providers produced — no fabricated hashes anywhere.</p>
<h4>4.4 output_hash — two modes</h4>
<p>The chain treats <code>output_hash</code> as an opaque 32-byte value and only decides whether <code>≥ threshold</code> operators submitted the same bytes. The <em>meaning</em> of those bytes is defined off-chain (<code>chains/hanzo-evm/operator/canonical/output.go</code>):</p>
<ul><li><strong>RAW mode</strong> — free-text jobs:</li></ul>
<p> <code>output_hash = keccak256( deterministic UTF-8 model output )</code>. The bytes are exactly what <code>hanzo_ffi_infer</code> returns. A single different token yields a different hash and excludes that operator — the chain counts byte-agreement, not semantic agreement.</p>
<ul><li><strong>GOVERNANCE mode</strong> — the consensus hash covers ONLY the structured decision,</li></ul>
<p> never the prose rationale: ``<code> canonical_output_bytes = model_spec_hash(32) || vote_byte(1) || u16be(bucket_bps)(2) // 35 bytes output_hash = keccak256(canonical_output_bytes) </code>`<code> </code>vote_byte ∈ {yes=1, no=2, abstain=3}<code> (0 is reserved/invalid); </code>bucket_bps<code> is the model&#x27;s confidence snapped to a coarse grid (default 1000 bps, 11 buckets) by integer round-half-to-even, so small numeric wobble between operators collapses to the same bucket. Binding </code>model_spec_hash` into the preimage means a decision can only equal another decision made under the identical spec.</p>
<p>The model is constrained to emit exactly one strict-schema JSON object (<code>{&quot;vote&quot;,&quot;confidence_bps&quot;,&quot;rationale&quot;,&quot;citations&quot;,&quot;model_spec&quot;}</code>); the parser rejects unknown fields, trailing data, and a <code>model_spec</code> that does not echo the job&#x27;s spec. On an invalid decision the operator retries inference once, then <strong>abstains</strong> (a real abstain vote at zero confidence) — fail-secure, never a guess. <code>rationale</code> and <code>citations</code> are non-consensus audit metadata, retained hash-addressed (RFC 8785 canonical JSON), never gating the quorum.</p>
<h4>4.5 embedding_hash — int8 quantization</h4>
<p>When a job carries an embedding, the float32 vector from <code>hanzo_ffi_embed</code> is deterministically quantized to int8 and hashed (<code>chains/hanzo-evm/operator/canonical/embedding.go</code>):</p>
<pre><code>scale = max(|v_i|) / 127 (all-zero vector =&gt; scale = 1)
q_i = round_half_to_even(v_i / scale) clamped to [-127, 127]
canonical_serialized = u32be(dim) || int8[dim] || f32be(scale)
embedding_hash = keccak256(canonical_serialized)</code></pre>
<p>Symmetric int8 (range <code>[-127, 127]</code>, not <code>-128</code>) keeps the grid centered on zero; the scale is serialized as the same float32 used in the division so a verifier reconstructs the identical grid. A non-finite component (NaN/±Inf) is rejected <strong>before</strong> any arithmetic (fail-closed) — a <code>float→int8</code> conversion of a non-finite value is implementation-defined and disagrees across architectures (arm64 FCVTZS saturates, amd64 CVTTSD2SI yields integer-indefinite), so an unchecked ±Inf would silently split the embedding quorum. The operator declines such a job rather than committing a host-dependent hash.</p>
<blockquote><p><strong>Cross-hardware caveat (binding policy).</strong> Bit-identical embedding floats are guaranteed only for the <em>same engine build on the same host</em>. Across heterogeneous hosts the low bits can differ (different BLAS, FMA contraction, GPU vs CPU), which can flip a boundary-rounded int8 or shift the whole grid. Therefore operators in one embedding quorum MUST run matching engine builds on matching hardware (pinned by <code>runtime_version</code> + <code>embedding_model_hash</code>), OR the embedding is carried as non-consensus metadata. This is the single most fragile point in the wire spec and is called out explicitly for the reviewer.</p></blockquote>
<h4>4.6 Operator binding (defense in depth)</h4>
<p>A provider is bound to its result two independent ways (<code>chains/hanzo-evm/operator/operator.go</code>):</p>
<ul><li><strong>Commit binds the address (on-chain).</strong></li></ul>
<p> ``<code> commit = keccak256( job_id(32) || model_spec_hash(32) || prompt_hash(32) || output_hash(32) || embedding_hash(32) || operator(20) || nonce(32) ) </code>`<code> The precompile enforces this at reveal: a peer cannot replay another operator&#x27;s commit because recomputation with their own address differs. In GOVERNANCE mode </code>output_hash` has only a few dozen possible values, so the nonce MUST be a fresh 256-bit CSPRNG value or an observer could brute-force the preimage and break hiding before reveal.</p>
<ul><li><strong>Reveal is key-signed (off-chain).</strong> The reveal payload is secp256k1-signed over</li></ul>
<p> a domain-separated digest (<code>&quot;hanzo/aiquorum/reveal/v1&quot;</code>); the operator address is recovered from the signature, so a relay or gateway cannot forge a reveal. The signature library emits canonical low-S; a malleated copy is refused.</p>
<p>Together: address-in-commit (on-chain) + key-signed-reveal (off-chain). An attacker needs both the address and the key to impersonate an operator.</p>
<h4>4.7 Committee diversity (anti-monoculture)</h4>
<p>To avoid a model monoculture in which a single bad model, build, or operator silently captures a quorum, committee composition for governance-class jobs MUST enforce diversity caps, expressed as fractions of the committee <code>N</code>:</p>
<p>| Cap | Meaning | Default | |-----|---------|---------| | <code>max_per_operator</code> | most committee seats one operator address may hold | 1 | | <code>max_per_vendor</code> | most seats sharing one declared model vendor/source | ⌈N/3⌉ | | <code>max_per_hardware</code> | most seats sharing one declared hardware class | ⌈N/2⌉ | | <code>max_per_runtime</code> | most seats sharing one <code>runtime_version</code> | ⌈N/2⌉ |</p>
<p>A committee that cannot be filled within these caps from the eligible set means the job&#x27;s spec is under-diversified; the request fails closed rather than settling on a monoculture. (The exact registry-level realization is the A-Chain&#x27;s; this HIP states the requirement Hanzo providers register the metadata for: declared vendor, hardware class, and <code>runtime_version</code>.)</p>
<h3>5. The Cognitive Sidecar</h3>
<h4>5.1 Architecture and the signer firewall</h4>
<p>Each Hanzo node runs three cooperating but isolated components:</p>
<pre><code>┌──────────────────────────── node process boundary ──────────────────────────┐
│ │
│ consensus engine VM (EVM / precompiles) Cognitive Sidecar │
│ (block production, (state transition, (thinking agent) │
│ validator keys) Tier-1 0x0300…0003) │
│ │ │ │ │
│ │ │ ┌────────┴─────────┐ │
│ │ │ │ Hanzo Engine rt │ │
│ │ │ │ ZAP tools │ │
│ │ │ │ proposal analyzer│ │
│ │ │ │ simulation client│ │
│ │ │ │ red-team agent │ │
│ │ │ │ vote recommender │ │
│ │ │ └────────┬─────────┘ │
│ │ │ │ artifacts │
│ │ │ ╔════════▼═════════╗ │
│ │ │ ║ SIGNER FIREWALL ║ │
│ │ │ ║ (policy engine) ║ │
│ │ │ ╚════════╤═════════╝ │
│ ▼ ▼ │ (maybe) tx │
│ [validator keys] ◄── NEVER reachable by the agent ──────────┘ │
└──────────────────────────────────────────────────────────────────────────────┘</code></pre>
<p>The <strong>signer firewall</strong> is the load-bearing boundary. It is an in-process trust boundary with these binding invariants:</p>
<ul><li><strong>SF1 — Key isolation.</strong> The agent MUST NOT have read access to validator</li></ul>
<p> signing keys, nor to any KMS handle that can sign on the node&#x27;s behalf. Keys live with the consensus engine / signer; the agent address space never holds them.</p>
<ul><li><strong>SF2 — Artifacts, not transactions.</strong> The agent&#x27;s only output is a typed</li></ul>
<p> <em>artifact</em> (§5.2). It cannot construct, sign, or broadcast a transaction. The signer/policy layer is the sole component that can turn an artifact into a tx.</p>
<ul><li><strong>SF3 — One-way data flow at the boundary.</strong> The agent emits artifacts to the</li></ul>
<p> firewall; the firewall never hands the agent a signing capability in return. The channel is a queue of artifacts, not an RPC into the signer.</p>
<ul><li><strong>SF4 — Policy is the gate.</strong> The firewall admits an artifact toward signing only</li></ul>
<p> if the node&#x27;s <code>[ai.autonomy]</code> policy permits that artifact type at its human-loop level (§6), it is not in <code>[ai.forbidden]</code>, and any <code>[human_required]</code> condition is satisfied.</p>
<ul><li><strong>SF5 — No consensus mutation.</strong> Nothing the agent produces can alter block</li></ul>
<p> production, validator selection, or the state transition except by becoming a <em>normal transaction</em> that the signer chose to send and that the chain validates like any other.</p>
<h4>5.2 Artifact types</h4>
<p>The agent produces exactly these typed artifacts. Each is a structured object (never free prose used as a state input); prose fields within an artifact are evidence only.</p>
<p>| Artifact | Produced by | Carries | Typical level | |----------|-------------|---------|---------------| | <code>ProposalDraft</code> | proposal analyzer | a draft governance proposal (title, body hash, parameter changes) for human review | 1 | | <code>VoteRecommendation</code> | vote recommender | <code>{proposal_id, vote, confidence_bucket, rationale_hash}</code> | 1 | | <code>ConfigPatch</code> | operator/agent | a proposed node/operator config delta (bounded set of keys) | 2–3 | | <code>RiskReport</code> | red-team agent | findings on a proposal/upgrade/bridge state; severity-ranked | 0–1 | | <code>SimulationRequest</code> | simulation client | a request to S-role to simulate a proposed action before enacting | 0 | | <code>OperatorAction</code> | operator/agent | a bounded local operator action (e.g. restart a provider model via <code>hanzo_ffi_load</code>/<code>unload</code>) | 2–3 | | <code>BridgeHealthAlert</code> | bridge monitor | a <code>receipt_root</code>/intent backlog or proof-failure alert | 0–1 |</p>
<p>An artifact MAY reference a Tier-2 PoT receipt (e.g. a <code>VoteRecommendation</code> derived from a Governance Thought Receipt). When it does, the <em>structured field</em> of the receipt is what the artifact carries; the receipt&#x27;s prose rationale stays hash-addressed evidence.</p>
<h4>5.3 The agent&#x27;s tools</h4>
<p>The agent&#x27;s toolset is fixed and side-effect-scoped:</p>
<ul><li><strong>Hanzo Engine runtime</strong> — local Tier-1-class inference for the agent&#x27;s own</li></ul>
<p> reasoning (drafting, classification, ranking) via the same FFI (§4.1). This is the agent <em>thinking</em>; it is not a consensus path.</p>
<ul><li><strong>ZAP tools (HIP-0114)</strong> — read node-local/inter-VM messages (intents, receipts,</li></ul>
<p> operator messages) and emit agent messages. ZAP transports only; an agent message carries no consensus weight.</p>
<ul><li><strong>Proposal analyzer</strong> — reads committed governance proposals and produces</li></ul>
<p> <code>ProposalDraft</code> / <code>RiskReport</code> / <code>VoteRecommendation</code>.</p>
<ul><li><strong>Simulation client (S-role)</strong> — issues <code>SimulationRequest</code> and reads simulation</li></ul>
<p> results to inform a recommendation before any action.</p>
<ul><li><strong>Red-team agent</strong> — adversarially analyzes a proposal, upgrade, or bridge state</li></ul>
<p> and produces a <code>RiskReport</code>.</p>
<ul><li><strong>Vote recommender</strong> — combines proposal analysis, simulation, and (optionally) a</li></ul>
<p> Tier-2 Governance Thought Receipt into a <code>VoteRecommendation</code>.</p>
<h3>6. Autonomy policy and human-in-the-loop levels</h3>
<h4>6.1 Human-in-the-loop levels 0–5</h4>
<p>Every agent pathway is bounded by an explicit level. Raising a level is itself a gated authority expansion (constitutional rule C7).</p>
<p>| Level | Name | Meaning on a Hanzo node | |-------|------|-------------------------| | 0 | Observe | The agent records artifacts as evidence; no signer interaction, no on-chain effect. | | 1 | Recommend | An artifact becomes an on-chain <em>recommendation</em>; a human/DAO must enact it. | | 2 | Bounded local autonomy | The signer may act within a pre-approved, bounded <em>local</em> policy (e.g. restart a model, apply a whitelisted config key) with NO external value movement and NO consensus effect. | | 3 | Policy-gated tx | The signer may send a transaction that satisfies a registered policy predicate (e.g. route a sub-threshold operation), within rate and value caps. | | 4 | Human approval | An artifact triggers a transaction that requires explicit human approval before the signer broadcasts it. | | 5 | Constitutional | Changes to the constitution or to the levels themselves — DAO vote + timelock, never autonomous. |</p>
<p><code>RiskReport</code>, <code>SimulationRequest</code>, and <code>BridgeHealthAlert</code> default to Level 0–1 (evidence/recommend). <code>ConfigPatch</code> and <code>OperatorAction</code> default to Level 2 and MAY be raised to Level 3 only for registered, bounded predicates under C7. Governance transactions (enacting a vote) are never below Level 4 unless an explicit, bounded Level-3 policy is registered.</p>
<h4>6.2 The <code>[ai.*]</code> policy schema (TOML)</h4>
<p>The node&#x27;s autonomy is configured in a node-local TOML block. The signer firewall reads it; the agent does not get to edit it (editing it is itself a <code>ConfigPatch</code> gated at Level ≥ 4).</p>
<pre><code class="lang-toml">[ai]
# Master switch. When false, the sidecar runs at Level 0 regardless of the rest.
enabled = true
# The cap that no per-artifact setting may exceed. A per-artifact level higher
# than this is clamped down to it.
max_level = 3
[ai.autonomy]
# Per-artifact-type human-loop level (0..5). Absent =&gt; 0 (observe).
proposal_draft = 1
vote_recommendation = 1
risk_report = 1
simulation_request = 0
config_patch = 2
operator_action = 2
bridge_health_alert = 1
[ai.autonomy.bounds]
# Hard caps the signer enforces for any agent-originated tx (Levels 2–3).
max_tx_per_hour = 6
max_value_wei = &quot;0&quot; # &quot;0&quot; = no value movement permitted at all
allowed_config_keys = [&quot;engine.model&quot;, &quot;engine.threads&quot;, &quot;log.level&quot;]
allowed_operator_actions = [&quot;model_reload&quot;, &quot;model_unload&quot;, &quot;cache_flush&quot;]
# Registered policy predicates that gate Level-3 txs (by id; defined on-chain/DAO).
policy_predicates = [&quot;route_subthreshold_v1&quot;]
[ai.forbidden]
# Absolute denials. The signer rejects these even if a level would otherwise allow.
touch_validator_keys = true # always true; stated for auditability
mutate_consensus = true # always true
send_value = true # this node never lets the agent move value
modify_ai_policy = true # agent cannot raise its own autonomy
deregister_operator = true
[human_required]
# Conditions that force Level-4 human approval regardless of per-artifact level.
governance_enact = true # enacting any governance vote needs a human
upgrade_or_migration = true # any chain upgrade / migration needs a human
above_value_wei = &quot;0&quot; # any value-moving tx needs a human
unregistered_model = true # acting on output from an unregistered model</code></pre>
<p>Enforcement rules (binding):</p>
<ul><li>The effective level of an artifact is <code>min(ai.autonomy.&lt;type&gt;, ai.max_level)</code>,</li></ul>
<p> and <code>0</code> if <code>ai.enabled = false</code>.</p>
<ul><li>Any <code>[ai.forbidden]</code> flag that is <code>true</code> is an absolute denial; it overrides every</li></ul>
<p> level and every bound. <code>touch_validator_keys</code> and <code>mutate_consensus</code> are structurally always true (they restate SF1/SF5) and are listed for auditability.</p>
<ul><li>Any <code>[human_required]</code> condition that matches forces Level 4 (human approval)</li></ul>
<p> before the signer may broadcast, regardless of the per-artifact level.</p>
<ul><li><code>[ai.autonomy.bounds]</code> are hard caps the signer checks at sign time: a tx</li></ul>
<p> exceeding <code>max_tx_per_hour</code>, <code>max_value_wei</code>, an unlisted config key, or an unlisted operator action is rejected by the signer, not the agent.</p>
<h3>7. Constitutional rules and slashing</h3>
<h4>7.1 Constitutional rules (binding)</h4>
<p>A Hanzo node participating in a Thinking Chain MUST enforce the shared constitution. These restate the canon verbatim:</p>
<ul><li><strong>C1 — Deterministic consensus.</strong> The state transition is deterministic and</li></ul>
<p> reproducible from committed inputs alone.</p>
<ul><li><strong>C2 — No live thought in state transition.</strong> No state transition reads a live,</li></ul>
<p> uncommitted inference result (the Bridge Law, §3).</p>
<ul><li><strong>C3 — Cross-chain effects require committed proofs.</strong> Any effect derived from</li></ul>
<p> another chain&#x27;s cognition requires a verified proof against a committed root.</p>
<ul><li><strong>C4 — Structured outputs only.</strong> Consensus inputs are structured and</li></ul>
<p> hash-addressed. Prose is evidence only, never a consensus input.</p>
<ul><li><strong>C5 — Bounded recursion.</strong> Cognitive calls are bounded by recursion depth and</li></ul>
<p> resource budget; unbounded or self-triggering chains of thought are rejected (§7.3).</p>
<ul><li><strong>C6 — Replay-protected receipts.</strong> Receipts are bound to <code>intent_id</code> and a</li></ul>
<p> settlement height; a receipt is consumable at most once.</p>
<ul><li><strong>C7 — Authority expansion gated.</strong> Raising a human-loop level, or widening a</li></ul>
<p> model&#x27;s permitted actions, requires a human/DAO decision plus timelock.</p>
<ul><li><strong>C8 — Bounded cognition budget.</strong> Tier-1 in-consensus inference is gas-metered</li></ul>
<p> and depth-bounded; Tier-2 requests carry an explicit fee and committee budget.</p>
<ul><li><strong>C9 — Preserve dissent.</strong> The confidence and dissent distribution of a cognitive</li></ul>
<p> judgment is preserved on-chain, not collapsed to a single value.</p>
<ul><li><strong>C10 — Governance models registered.</strong> Any model used for a governance decision</li></ul>
<p> MUST be ModelSpec-registered by weight-commitment hash (§4.2); an unregistered model cannot produce a consensus input.</p>
<ul><li><strong>C11 — Inspectable without an LLM.</strong> Every committed cognitive input is verifiable</li></ul>
<p> by re-deriving a hash or checking a Merkle proof — a validator or auditor confirms validity without running any model.</p>
<h4>7.2 Slashing — objective protocol violations only</h4>
<p>A provider&#x27;s bond is slashed ONLY for objective, on-chain-detectable protocol violations, never for honest dissent:</p>
<p>| Slashable (objective) | Detected by | |-----------------------|-------------| | Commit-then-withhold (commit, never reveal) | reveal window expiry with a prior commit | | Double-reveal / reveal inconsistent with commit | commit recompute mismatch at reveal | | Wrong-runtime (output under a spec the operator did not commit) | <code>model_spec_hash</code> binding in commit | | Forged receipt / forged reveal signature | secp256k1 recovery ≠ operator, or commit does not bind revealed fields | | Replay (re-using a committed receipt or another&#x27;s commit) | <code>intent_id</code> / operator-bound commit |</p>
<p><strong>Honest dissent is NOT slashable.</strong> A provider whose structured output is a minority-but-honest answer — that committed and revealed correctly — keeps its bond. Its dissent is preserved in the distribution (C9). Punishing dissent would collapse the confidence distribution and incentivize herding; punishing withholding targets the only behavior that actually denies the chain an answer.</p>
<h4>7.3 Recursion and resource budgets</h4>
<ul><li>A Tier-1 call MUST NOT invoke Tier 2 within the same transaction (no</li></ul>
<p> in-consensus escalation to off-chain cognition).</p>
<ul><li>The Cognitive Sidecar MUST enforce a per-trigger recursion budget: an agent</li></ul>
<p> pathway that would re-trigger itself (an artifact whose enactment produces the same artifact) is bounded by a depth counter and a per-hour rate cap (<code>[ai.autonomy.bounds].max_tx_per_hour</code>), and self-triggering chains are rejected (C5).</p>
<ul><li>A Tier-2 request carries an explicit fee and committee budget (C8); a provider</li></ul>
<p> that cannot run within budget declines rather than partially computing.</p>
<h2>Rationale</h2>
<p><strong>Why the signer firewall is in-process, not a separate trust domain.</strong> The agent needs low-latency access to the same committed state the node already holds (to analyze proposals and bridge health). Putting it in-process keeps that cheap; the firewall provides the isolation that a process boundary would, by making <em>key access</em> and <em>tx construction</em> unreachable from the agent rather than relying on network segmentation. The boundary that matters is the capability boundary (no keys, no tx), not the address-space boundary.</p>
<p><strong>Why artifacts, not direct action.</strong> Decomplecting <em>what cognition produces</em> from <em>when the node acts on it</em> is the whole design. An artifact is inert; a transaction is not. Keeping the agent on the inert side of that line means a compromised or hallucinating model can at worst produce a bad <em>recommendation</em>, which the policy layer and (at Level ≥ 4) a human must still ratify.</p>
<p><strong>Why ModelSpec registration is mandatory for consensus models.</strong> Without pinning weights, tokenizer, runtime, sampling, and template, two &quot;honest&quot; operators can silently diverge and no quorum forms — or worse, a quorum forms around a model nobody can reproduce. The single shared <code>model_spec_hash</code> definition (identical off-chain and on-chain) is what makes agreement <em>mean</em> &quot;same model, same inputs.&quot;</p>
<p><strong>Why structured-outputs-only.</strong> Prose is not reproducible, not comparable, and not safely hashable into a decision. Constraining consensus inputs to structured outputs (and demoting prose to hash-addressed evidence) is what makes Subsampled Cognitive Consensus and C11 (inspectable without an LLM) possible at once.</p>
<p><strong>Why this composes with HIP-0020 and HIP-0024.</strong> HIP-0020 (compute swarm) supplies and schedules the GPUs a Tier-2 provider runs on; this HIP defines what a provider <em>does</em> with that GPU to settle a quorum. HIP-0024 (sovereign L1) hosts the precompiles and the AI-COIN economics; this HIP defines the off-chain runtime and the node-local agent that feed them. Neither is replaced.</p>
<h2>Security Considerations</h2>
<h3>Signer-firewall isolation and key safety</h3>
<p>The agent never holds validator keys (SF1) and cannot construct or broadcast a transaction (SF2). The only path from cognition to chain is an artifact that the signer/policy layer chose to enact (SF3–SF5). A fully compromised agent therefore cannot sign a block, move value (<code>[ai.forbidden].send_value</code>), deregister the operator, or raise its own autonomy (<code>modify_ai_policy</code>). The worst case is a flood of artifacts, bounded by <code>max_tx_per_hour</code> and rejected at the signer. KMS handles that can sign are out of the agent&#x27;s address space.</p>
<h3>Prompt and model manipulation</h3>
<p>A malicious proposal or input could attempt prompt injection to steer the agent&#x27;s recommendation. Mitigations: (i) the agent&#x27;s output is a <em>recommendation</em>, gated by human-loop level (manipulation cannot directly cause an action below Level 2, and never a value-moving or governance-enacting one without a human); (ii) GOVERNANCE mode constrains the model to a strict JSON schema and rejects unknown fields, trailing data, and a wrong <code>model_spec</code>, so injected free-text cannot become a consensus input; (iii) acting on output from an <em>unregistered</em> model forces Level-4 human approval (<code>[human_required].unregistered_model</code>).</p>
<h3>Model monoculture</h3>
<p>If one model, build, vendor, or operator captured a committee, a single systematic error or a single compromised operator could forge agreement. The diversity caps of §4.7 (<code>max_per_operator</code> / <code>vendor</code> / <code>hardware</code> / <code>runtime</code>) and the eligible-set margin <code>E ≥ N + max(2, N/2)</code> make a committee that is structurally diverse and not predictable by any withholding subset. A spec that cannot fill a diverse committee fails closed rather than settling on a monoculture.</p>
<h3>Determinism boundary (the fragile point)</h3>
<p>Bit-identical engine output is guaranteed only for the same engine build on the same host (greedy decoding). The embedding path is the most fragile: cross-hardware low-bit float differences can flip a boundary-rounded int8 (§4.5). The mitigations are policy, not code — pin <code>runtime_version</code> + <code>embedding_model_hash</code> within an embedding quorum, fail closed on non-finite components, or carry embeddings as non-consensus metadata. This is surfaced explicitly for the reviewer and the red team.</p>
<h3>Autonomy-policy enforcement</h3>
<p>Enforcement lives in the signer, not the agent, so an agent cannot evade it. Every <code>[ai.forbidden]</code> flag is an absolute denial that overrides any level; every <code>[human_required]</code> condition forces Level-4 human approval; <code>[ai.autonomy.bounds]</code> are checked at sign time. The policy itself is immutable to the agent (<code>modify_ai_policy</code> forbidden); changing it is a <code>ConfigPatch</code> gated at Level ≥ 4 and, for level changes, C7 (human/DAO + timelock).</p>
<h3>Recursion budgets</h3>
<p>A self-triggering chain of thought (an artifact whose enactment reproduces the same artifact) is bounded by a depth counter and <code>max_tx_per_hour</code>, and rejected per C5. Tier-1 cannot escalate to Tier-2 in one transaction. Tier-2 requests are fee-bounded and committee-bounded (C8).</p>
<h3>Replay and front-running</h3>
<p>The operator-bound commit (address in the preimage) blocks a peer from replaying an observed commit; the 256-bit CSPRNG nonce keeps GOVERNANCE-mode commits hiding despite the small output space; the secp256k1-signed reveal blocks a relay from forging a reveal; <code>intent_id</code> and once-only receipt consumption block receipt replay.</p>
<h2>Reference Implementation</h2>
<p>| Component | Path | Role | |-----------|------|------| | Engine FFI cdylib (the provider runtime) | <code>hanzo/engine/hanzo-engine-ffi</code> (<code>src/lib.rs</code>, <code>include/hanzo_engine_ffi.h</code>) | <code>hanzo_ffi_infer</code> / <code>embed</code> / <code>ready</code> / <code>load</code> / <code>unload</code> / <code>list</code> over the native engine | | Off-chain operator | <code>hanzo/chains/hanzo-evm/operator/operator.go</code> | engine→reveal: run, hash, nonce, operator-bound commit, signed reveal | | Canonical wire spec (shared truth) | <code>hanzo/chains/hanzo-evm/operator/canonical/</code> (<code>modelspec.go</code>, <code>commit.go</code>, <code>output.go</code>, <code>embedding.go</code>, <code>governance.go</code>) | ModelSpec hash, commit, output_hash (raw/governance), int8 embedding_hash | | A-Chain quorum precompile | <code>hanzo/chains/hanzo-evm/precompile/aiquorum</code> (<code>0x0300…0012</code>) | register / request / commit / reveal / settle / pay / slash | | End-to-end capstone proof | <code>hanzo/chains/hanzo-evm/operator/capstone</code> | real engine (cgo) + real precompile; canonical hash == engine output, value conserved | | Tier-1 boundary (not this HIP) | <code>lux/precompile/inference</code> (<code>0x0300…0003</code>) | deterministic int8 transformer, CGO=0 |</p>
<p>Build and run the live quorum against the real engine:</p>
<pre><code class="lang-bash">HANZO_FFI_MODELS=&quot;zen-nano=gguf:/models/zen-5-flash.gguf;zen-embed=embedding:/models/zen-embedding-0.6B&quot; \
HANZO_FFI_TOK_DIR=/models/zen-nano-fused \
GOWORK=off CGO_ENABLED=1 SDKROOT=$(xcrun --show-sdk-path) CPATH=$SDKROOT/usr/include \
go run ./cmd/capstone # human-readable trace
go test ./capstone -run Capstone -v</code></pre>
<h2>References</h2>
<ul><li><em>Thinking Chains</em> (Lux Proposal) — the L0/consensus-layer primitive and the</li></ul>
<p> C→A bridge precompiles; the protocol Hanzo providers serve.</p>
<ul><li><em>Beluga L3 Thinking-Chain Architecture</em> (Zoo ZIP) — the first deployment of a</li></ul>
<p> Thinking Chain; names this HIP as the Tier-2 provider runtime and ModelSpec registration source.</p>
<ul><li><em>Proof-of-Thought Receipts on Zoo</em> (Zoo ZIP) — the <code>AInferenceReceipt</code></li></ul>
<p> settlement object Hanzo&#x27;s Tier-2 quorum exports.</p>
<ul><li><em>Thinking Chains</em> (Zoo paper) — the conceptual treatment and Subsampled</li></ul>
<p> Cognitive Consensus analysis.</p>
<ul><li><a href="./hip-0114-zap-inter-vm-cognitive-transport.md">HIP-0114: ZAP — Inter-VM Cognitive Transport</a></li><li><a href="./hip-0020-blockchain-node-standard.md">HIP-0020: Blockchain Node Standard</a></li><li><a href="./hip-0024-hanzo-sovereign-l1-chain-architecture.md">HIP-0024: Hanzo Sovereign L1 Chain Architecture</a></li><li><a href="./hip-0043-llm-inference-engine-standard.md">HIP-0043: LLM Inference Engine Standard</a></li></ul>
<h2>Copyright</h2>
<p>Copyright and related rights waived via <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a>.</p>
<footer>
<div class="fmap">
<div><b>Build</b>
<a href="https://hanzo.app">hanzo.app</a> app builder
<a href="https://hanzo.codes">hanzo.codes</a> code with an agent
<a href="https://hanzoskills.com">hanzoskills.com</a> what an agent reads</div>
<div><b>Run</b>
<a href="https://console.hanzo.ai">console.hanzo.ai</a> cloud console
<a href="https://api.hanzo.ai">api.hanzo.ai</a> the API</div>
<div><b>Account</b>
<a href="https://hanzo.id">hanzo.id</a> sign in
<a href="https://pay.hanzo.ai">pay.hanzo.ai</a> top up
<a href="https://billing.hanzo.ai">billing.hanzo.ai</a> invoices and usage</div>
<div><b>Company</b>
<a href="https://hanzo.ai">hanzo.ai</a> canonical
<a href="https://hanzo.ventures">hanzo.ventures</a> ventures</div>
</div>
<div class="fend"><a href="/hip-0113.md">This page as plain text</a> · <a href="/llms.txt">Index for agents</a></div>
</footer>
</div></body></html>