mirror of
https://github.com/hanzoai/skills.git
synced 2026-11-19 00:47:36 +00:00
390 lines
49 KiB
HTML
390 lines
49 KiB
HTML
<!doctype html>
|
||
<html lang="en"><head>
|
||
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||
<title>hip-0901</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-0901.md">
|
||
|
||
<link rel="icon" href="/favicon.svg">
|
||
<link rel="canonical" href="https://hanzoskills.com/hip-0901">
|
||
</head>
|
||
<!-- Reading this with a machine? Every page here is also plain markdown.
|
||
This one: https://hanzoskills.com/hip-0901.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-0901</h1><p class="lede">HIP-901: Proof of AI (PoAI) — Native Execution Proofs, Canonical Contract & Operator-LLM Governance. Status Draft. Hanzo architectural specification.</p><h1>HIP-0901: Proof of AI (PoAI) — Native Execution Proofs, Canonical Contract & Operator-LLM Governance</h1>
|
||
<h2>Abstract</h2>
|
||
<p>This proposal specifies <strong>Proof of AI (PoAI)</strong>: the canonical, post-quantum execution-layer proof system built into the Hanzo inference, training, and embedding engine so that a node operator cannot charge a user — or earn a consensus reward, or drive on-chain governance — for AI work it did not actually perform.</p>
|
||
<p>PoAI is <strong>one proof system, not four</strong>. Inference, embedding, training, and data-sharing are all expressed as the same object — a <strong>computation graph of matrix multiplications</strong> — so a single Freivalds (1977) matrix-product verifier over the prime field <code>F_p</code>, <code>p = 2^61 − 1</code>, evaluated on the <strong>exact int8 accumulator</strong> of the engine's quantized matmul path, verifies all of them. Training is forward <strong>plus</strong> backward (backprop is also matmul); data-sharing is the one orthogonal concern, handled by the post-quantum confidentiality envelope, not by the matmul check. A <code>workloadType</code> field selects the binding: <strong>PoE</strong> (embedding), <strong>PoI</strong> (inference), <strong>PoT</strong> (training), <strong>PoC</strong> (contribution).</p>
|
||
<p>There is <strong>one canonical contract implementation</strong>, shared across the whole ecosystem: it lives in <code>luxfi/standard</code> at <code>contracts/ai/</code> and is consumed everywhere — Hanzo included — via <code>@luxfi/standard/ai</code>. There is no second implementation. PoAI carries a <strong>leaderless operator-LLM governance-execution</strong> layer (<code>AIGovernor</code>/<code>AIParams</code> settle canonical YES/NO + knob medians on-chain; <code>AIExecute</code>/<code>AIPolicy</code>/<code>AIApproval</code> read any contract state typed and execute arbitrary approved operations under a timelock). PoAI is <strong>public, leaderless, decentralized, operator-safe, and post-quantum / nation-state-proof</strong>.</p>
|
||
<p>The Freivalds core and the determinism prerequisites it depends on are <strong>built and tested</strong> (<code>hanzo-engine/src/poi.rs</code>, 14 <code>#[test]</code>), with byte-parity mirrors in the Go verifier (<code>luxfi/crypto/poi</code>, 22 <code>Test*</code>) and the Solidity (<code>ComputeWitnessLib.sol</code>).</p>
|
||
<h2>Specification</h2>
|
||
<h3>The four proofs over one primitive (one computation graph)</h3>
|
||
<p>PoAI generalizes to inference, embedding, training, and data-sharing because the compute-bearing ones are the same object: a <strong>computation graph whose load-bearing nodes are GEMMs</strong>. All four PoAI proofs are the <strong>same matmul-verification primitive</strong> applied to the GEMMs of a different workload, selected by a <code>workloadType</code> field. There is one verifier, not four.</p>
|
||
<p>| Proof | <code>workloadType</code> | Workload | What the primitive verifies | |-------|----------------|----------|-----------------------------| | <strong>PoE</strong> | <code>embedding</code> | Embedding / encoder forward pass | The tower's GEMMs produced the claimed vector | | <strong>PoI</strong> | <code>inference</code> | Decoder forward pass (the dominant case) | Each opened layer's <code>C = A·B</code> was actually computed | | <strong>PoT</strong> | <code>training</code> | A training step | The forward GEMMs <strong>and the backward GEMMs</strong> — backprop is also matmul | | <strong>PoC</strong> | <code>contribution</code> | A contributor's training round | PoT <strong>+</strong> proof-of-improvement <strong>+</strong> privacy via DeltaSoup |</p>
|
||
<ul><li><strong>PoE (embedding).</strong> An embedding forward pass is a stack of GEMMs ending in a</li></ul>
|
||
<p> pooled vector. PoE proves the vector is the genuine output of the named model on the named input, so an embedding provider cannot return a cheap or random vector and bill for the real encoder.</p>
|
||
<ul><li><strong>PoI (inference).</strong> The primary case. A decoder forward pass is ~95% matmul;</li></ul>
|
||
<p> PoI opens a challenged layer and verifies its product. This is the one-bit-guess defense made concrete.</p>
|
||
<ul><li><strong>PoT (training).</strong> Backpropagation is <strong>also</strong> matrix multiplication — the</li></ul>
|
||
<p> gradient of a linear layer is itself a pair of GEMMs (<code>dX = dY·Wᵀ</code>, <code>dW = Xᵀ·dY</code>). So the <strong>same</strong> Freivalds primitive that checks a forward layer checks a backward layer; PoT proves a claimed training step actually ran the forward and backward passes it billed for.</p>
|
||
<ul><li><strong>PoC (contribution).</strong> A contributor in a federated/distillation round must</li></ul>
|
||
<p> prove three things: (1) <strong>PoT</strong> — the training step ran; (2) <strong>proof-of-improvement</strong> — the resulting weight delta measurably improves the objective on a committed evaluation set, not noise; (3) <strong>privacy</strong> — the delta is aggregated through <strong>DeltaSoup</strong> (Byzantine-robust trim-mean aggregation with contributor reputation and differential privacy; see <code>gym/src/gym/quantization/deltasoup.py</code>), so a contributor proves a <em>useful, honest</em> gradient without exposing raw private data.</p>
|
||
<p><strong>Data-sharing is the orthogonal fourth concern.</strong> It is not a matmul to verify; it is a read-authorization question — <em>which operator may decrypt which prompt</em> — handled by the post-quantum confidentiality envelope (§ Post-quantum stack), entirely separate from the Freivalds core. The matmul check answers "was it computed"; the envelope answers "who may see it"; the two never braid.</p>
|
||
<h3>The core: Freivalds over the exact int8 accumulator</h3>
|
||
<p>An LLM forward pass is <strong>~95% matrix multiplications <code>C = A·B</code></strong>. Recomputing <code>C</code> to check an operator costs the same <code>O(t·k·n)</code> as doing the work — useless as a verification asymmetry. <strong>Freivalds (1977)</strong> breaks the symmetry: for a random challenge vector <code>r</code>, verify</p>
|
||
<pre><code>A·(B·r) == C·r</code></pre>
|
||
<p>in <code>O(t·k + k·n + t·n)</code> — one order cheaper than the multiply. If <code>C ≠ A·B</code>, a random <code>r</code> exposes it with probability <strong>≥ 1 − 1/p per challenge vector</strong>; <code>k</code> independent vectors drive the soundness error to <code>≤ (1/p)^k</code>. An honest operator passes deterministically; an operator who <strong>fabricated</strong> <code>C</code> (the one-bit guess, the wrong model, the skipped multiply) is caught with overwhelming probability.</p>
|
||
<p>The verifier works over the Mersenne prime field <code>F_p</code>, <strong><code>p = 2^61 − 1</code></strong>, evaluated on the <strong>exact integer accumulator</strong> of the engine's int8 path (<code>i8·i8 → i32</code>, reduced into <code>[0, p)</code>). This is the load-bearing design choice: <strong>integer arithmetic is bit-exact across CPU, GPU, and every backend</strong>, so the check has <strong>zero false-reject</strong> — the determinism the rest of PoAI relies on. Soundness error is <code>1/p ≈ 2^−61</code> per vector; two vectors give <code>≤ 2^−122</code>.</p>
|
||
<p>Crucially, the soundness argument is <strong>information-theoretic</strong> — it holds against an <em>unbounded</em> adversary — so the core is <strong>post-quantum by construction</strong>: a quantum computer gives no advantage in guessing a uniformly-random <code>r</code> over <code>F_p</code>. Combined with keccak commitments (PQ-secure) and the PQ keyed crypto below, PoAI is post-quantum end to end.</p>
|
||
<p>The released core (<code>hanzo-engine/src/poi.rs</code>) is backend-agnostic and dependency-free — it needs no forward pass to run, so its soundness is unit-tested in isolation:</p>
|
||
<ul><li><code>Mat</code> — a dense row-major integer matrix (<code>Vec<i64></code>), the int8 path's exact</li></ul>
|
||
<p> accumulators.</p>
|
||
<ul><li><code>freivalds_verify(a, b, c, r)</code> — checks <code>A·(B·r) == C·r</code> over <code>F_p</code> for one</li></ul>
|
||
<p> vector, with a shape contract that <strong>fails closed</strong> on any dimension mismatch.</p>
|
||
<ul><li><code>freivalds_verify_multi(a, b, c, challenges)</code> — true iff <strong>every</strong> challenge</li></ul>
|
||
<p> vector passes; a tampered <code>C</code> fails at least one except with probability <code>≤ (1/p)^k</code>.</p>
|
||
<ul><li><code>derive_challenges(seed, n, k)</code> — reproducibly expands <code>k</code> length-<code>n</code> vectors</li></ul>
|
||
<p> over <code>F_p</code> from a seed. The seed is derived <strong>after the prover commits</strong> (production: keccak over an on-chain beacon ‖ task ‖ root), so the prover cannot pre-pick <code>A, B, C</code> to satisfy a known <code>r</code>.</p>
|
||
<p>This core has <strong>14 <code>#[test]</code> functions</strong> in <code>poi.rs</code> (honest <code>A·B</code> passes; a single tampered output entry is caught, including signed/negative entries; field reduction of negative entries; challenge derivation is deterministic across prover and verifier; wrong dimensions fail closed; a deep one-entry cheat in a larger random matmul is caught; keccak <code>derive_challenges</code> golden-parity with the chain). The supporting <code>poi_transcript.rs</code>, <code>poi_graph.rs</code>, and <code>poi_forward.rs</code> carry the transcript, graph, and forward-pass wiring.</p>
|
||
<h3>Determinism prerequisites (shipped)</h3>
|
||
<p>Bit-exactness of the accumulator is necessary but not sufficient: two honest runs must also make the <strong>same discrete decisions</strong>, or an honest re-derivation diverges and the proof false-rejects. Two sources of nondeterminism are pinned:</p>
|
||
<ol><li><strong>Greedy-decode tie-break (sampler).</strong> At temperature 0, argmax ties are</li></ol>
|
||
<p> broken by the <strong>lowest token id</strong>. Two honest runs that tie pick the same token.</p>
|
||
<ol><li><strong>Canonical MoE expert top-k (ops).</strong> Expert selection sorts by **score</li></ol>
|
||
<p> descending, then index ascending**, so the <em>same</em> experts are routed deterministically. This covers <strong>every MoE model in the zen zoo</strong> — proof-bearing runs set canonical routing on.</p>
|
||
<h3>Commit-now, verify-later</h3>
|
||
<p>PoAI is <strong>optimistic</strong>: the expensive verification happens only on dispute, and the happy path adds almost nothing.</p>
|
||
<ul><li><strong>At execution (cheap, always-on side-effect):</strong> the prover emits an</li></ul>
|
||
<p> <strong>activation-trace commitment</strong> as a Merkle Mountain Range over per-<code>(layer, token, tap)</code> leaves, hashed with <strong>keccak</strong> using <strong>RFC-6962 lone-node promotion</strong> (not the malleable Bitcoin duplicate-last). A forward pass over a large model produces terabytes of activations; the MMR keeps only the <code>O(log N)</code> peak hashes (<strong>~768 bytes of frontier</strong>) and drops activations as they are hashed. The forward-pass hook is <code>Option<&mut ProofTranscript></code> threaded through the context — when proofs are off it is a single not-taken branch with <strong>no hashing, no allocation, no copy</strong>.</p>
|
||
<ul><li><strong>On dispute (cheap, challenger-side):</strong> a verifier derives a layer index and</li></ul>
|
||
<p> challenge vector <code>r</code> from an on-chain beacon <strong>after</strong> commitment, the prover opens that one layer's <code>A</code>, <code>B</code>, <code>C</code> with MMR inclusion proofs, and <code>freivalds_verify_multi</code> runs on a <strong>single random layer</strong> — <code>O(t·k + k·n + t·n + log N)</code>. Sparse cheats are pinned by interactive <strong>bisection</strong> to the first divergent layer (<code>O(log L)</code> rounds), so soundness is independent of how many layers a single challenge samples.</p>
|
||
<h3>The reportData binding</h3>
|
||
<p>The proof must not be replayable, splice-able across tasks, or re-pointable at a different model or input. The transcript chains <strong>challenge → model → input → output</strong> through a keccak commitment (<code>transcriptRoot</code>) whose fields bind:</p>
|
||
<ul><li><strong>modelSpecHash</strong> — <strong>measured</strong>, not labeled: a keccak Merkle root over the</li></ul>
|
||
<p> <strong>quantized weight bytes the engine actually loaded</strong> (with the quant-type discriminant per leaf, so re-quantizing to a different scheme yields a different root). The model identity is what ran, not what was claimed.</p>
|
||
<ul><li><strong>inputCommitment</strong> — keccak over the canonical token ids (the prompt).</li><li><strong>quantizationSpec / kernelVersion</strong> — the decoding regime is part of identity,</li></ul>
|
||
<p> so a genuine model at the wrong temperature or a different reduction order is rejected.</p>
|
||
<ul><li><strong>activationTraceRoot</strong> — the MMR close, with the leaf count bound in.</li><li><strong>outputCommitment</strong> — keccak over the canonical output token ids.</li></ul>
|
||
<p>This <code>transcriptRoot</code> feeds the on-chain <code>reportData</code>, so an attestation cannot be replayed or mis-attributed.</p>
|
||
<h3>Floating point: handled by tier, not by tolerance</h3>
|
||
<p>A "Freivalds with an epsilon tolerance" for floating point would be <strong>unsound</strong> (a tolerance the cheat hides under) <strong>and false-rejecting</strong> (honest reductions differ). PoAI therefore routes by numeric tier rather than weakening the check; one <strong>profile gate</strong> over all tiers enforces <em>no proof → no mint, no settle, no act</em>:</p>
|
||
<p>| Tier | Numeric regime | Mechanism | |------|----------------|-----------| | Quantized | int8 / exact integer accumulator | <strong>Software-only exact Freivalds</strong> (the core) | | Floating | fp16 / bf16 / fp8 | <strong>Deterministic-fp</strong> (pin the reduction order → bit-reproducible) <strong>or</strong> TEE / confidential-compute attestation | | Small | small models / decisions | <strong>zkML</strong> (a succinct proof of the whole computation) |</p>
|
||
<h3>Architecture-family coverage</h3>
|
||
<p>The one primitive plus per-modality I/O commitment and deterministic pre/post-processing covers the whole zen zoo:</p>
|
||
<ul><li><strong>Dense transformers</strong> — direct Freivalds on each layer's GEMM.</li><li><strong>MoE</strong> — the transcript additionally commits the router logits and the</li></ul>
|
||
<p> selected expert indices per token; the verifier recomputes the router, checks the <strong>canonical</strong> top-k chose the same experts (the determinism prerequisite), then Freivalds-checks only the <strong>selected</strong> experts' GEMMs (sparse). A mis-routed or under-routed run is caught.</p>
|
||
<ul><li><strong>Linear-recurrent / SSM / Gated-DeltaNet</strong> — per-step Freivalds **plus</li></ul>
|
||
<p> state-chaining**: step <em>t</em>'s committed output is bound as step <em>t+1</em>'s committed input, so an intermediate state cannot be swapped.</p>
|
||
<ul><li><strong>Multimodal (ViT / audio)</strong> — the vision and audio towers are GEMMs →</li></ul>
|
||
<p> Freivalds; the preprocessed input (pixel tensor / audio features) is committed by hash and preprocessing is pinned (resize/normalize, and FFT→mel as deterministic commit-and-recompute).</p>
|
||
<ul><li><strong>Diffusion / Transfusion</strong> — the same step-chaining primitive as</li></ul>
|
||
<p> linear-recurrent, applied across denoising/generation steps (one primitive, two payoffs).</p>
|
||
<h3>One canonical contract — consumed everywhere</h3>
|
||
<p>There is <strong>one</strong> on-chain implementation of PoAI. It lives in <strong><code>luxfi/standard</code> at <code>contracts/ai/</code></strong> and is consumed by every Lux-descended chain — Hanzo included — via <code>@luxfi/standard/ai</code>. There is <strong>no second implementation</strong> to drift against; Hanzo's settlement and mint paths compose these contracts, they do not fork them. Pinned <code>pragma solidity ^0.8.30</code>, SPDX <code>BSD-3-Clause</code> extended by the LP-0012 ecosystem grant (§ Ecosystem license). The load-bearing pieces:</p>
|
||
<ul><li><strong><code>ComputeWitnessLib.sol</code></strong> — the on-chain Freivalds + Merkle-inclusion witness</li></ul>
|
||
<p> check, <strong>byte-for-byte identical</strong> to the prover (<code>poi_transcript.rs</code>) and the Go watcher (<code>crypto/poi/transcript.go</code>): same domain tag (<code>DOMAIN_MATMUL_LEAF = "hanzo/poi/matmul-leaf/v1"</code>), same canonical <code>(rows,cols,data)</code> serialization, same keccak fold, same <code>BE32(j)‖BE64(i)</code> challenge derivation, same <code>P = 2^61 − 1</code>. <code>provesFraud</code> returns true iff an opened matmul was committed under the root <em>and</em> its output is fabricated; an honest pass has no such matmul, so an honest operator can never be slashed.</p>
|
||
<ul><li><strong><code>AIComputeRegistry.sol</code></strong> — the <strong>global no-double-mint</strong> ledger, keyed on the</li></ul>
|
||
<p> chain-independent <code>keccak(DOMAIN ‖ modelSpec ‖ promptHash ‖ outputHash)</code> (<code>DOMAIN = "hanzo/poi/compute-claim/v1"</code>). First-correct-proof wins; a second claim from any miner on any chain reverts, so one unit of work mints once network-wide.</p>
|
||
<ul><li><strong><code>AChainRootOracle.sol</code></strong> — the trustless, permissionless, <strong>post-quantum</strong></li></ul>
|
||
<p> relay of A-Chain (aivm) state to any EVM: a validator quorum signs <code>(root, height)</code> with ML-DSA, anyone may relay, the oracle verifies the quorum on-chain via the ML-DSA precompile (<code>IMLDSAVerify</code>). Forging a root requires breaking ML-DSA or corrupting <code>≥ threshold</code> of the validator set.</p>
|
||
<ul><li><strong><code>MinerStakeRegistry.sol</code></strong> — bond/slash: a miner bonds in proportion to</li></ul>
|
||
<p> declared capacity; the fraud-proof verifier slashes a <em>proven</em> discrepancy automatically (the math, not a vote); a cooldown stops exit-before-fraud-proof.</p>
|
||
<ul><li><strong><code>AICoin.sol</code> / <code>AIMiner.sol</code></strong> — the <strong>fair-mined</strong> native coin:</li></ul>
|
||
<p> <code>MAX_SUBSIDY = 1,000,000,000</code> AI, no pre-mine, supply from zero, the emission slope <strong>halving every four years</strong> (<code>HALVING_PERIOD = 4 * 365 days</code>), the geometric sum equal to exactly <code>MAX</code>. Multiple verified-cognition mint paths (<code>AIMiner</code> against A-Chain receipts, <code>AIConsensusMiner</code> against governance-consensus share) share <strong>one</strong> cap; a minter is always a proof-enforcing contract, never an EOA — the god-key defense.</p>
|
||
<h3>Operator-LLM governance and execution (leaderless)</h3>
|
||
<p>PoAI lets verified AI <strong>govern and act</strong> on-chain. Two decision primitives over one bonded operator set, plus a three-tier execution surface — all in <code>contracts/ai/</code>, all leaderless (no proposer, no admin key on the decision path):</p>
|
||
<ul><li><strong><code>AIGovernor.sol</code></strong> decides a categorical <strong>policy</strong>: each bonded</li></ul>
|
||
<p> node-operator LLM emits a structured verdict <code>{vote, confidence}</code>, secp256k1-signs the <strong>canonical consensus preimage</strong> — <code>keccak256(abi.encodePacked(bytes32 modelSpecHash, uint8 vote, uint16 confidenceBucket))</code>, byte-for-byte identical to the Go operator in <code>hanzo-evm/operator/canonical/governance.go</code> — and submits it. The contract <code>ecrecover</code>s the signer, tallies by <code>{vote, confidenceBucket}</code>, and on a strict majority records a canonical <code>Vote.Yes</code>/<code>Vote.No</code> decision on-chain (<code>getThought(taskId).canonicalVote</code>). The free-form rationale is <em>deliberately excluded</em> from consensus (hash-addressed audit evidence, never byte-identical).</p>
|
||
<ul><li><strong><code>AIParams.sol</code></strong> decides a continuous <strong>value</strong>: each operator's</li></ul>
|
||
<p> LLM proposes a number in a declared <code>[lo, hi]</code>, signs a domain-separated judgment binding <code>block.chainid + address(this)</code>, and the chain settles to the <strong>median</strong> of a sortition-sampled quorum — <em>unweighted</em> (one operator, one proposal), the Byzantine-robust regime against any minority <code>< 50%</code>. Sortition seeded by <code>blockhash(openBlock)</code> makes committee share track population share, so capturing the median requires a majority of the whole population, not proposal spam. The live value is the loop-closing read <code>valueOf(spec, knobKey)</code>.</p>
|
||
<ul><li><strong><code>AIExecute.sol</code></strong> is the one surface validator consensus uses to read and act,</li></ul>
|
||
<p> decomplected by risk into three tiers:</p>
|
||
<ul><li><strong>READ</strong> — <code>read*</code> staticcalls any getter and hands back a <strong>typed</strong> value</li></ul>
|
||
<p> (<code>readBool</code>/<code>readUint</code>/<code>readInt</code>/<code>readAddress</code>/<code>readBytes32</code>/<code>readMany</code>).</p>
|
||
<ul><li><strong>ENACT (Tier 1)</strong> — <code>enact</code> reads a knob the validators <strong>decided</strong> in</li></ul>
|
||
<p> <code>AIParams</code> and splices its value as the sole argument of <code>target.selector(value)</code>; a 32-byte word ABI-encodes to any single type, so one call sets bool/uint/int/address/bytes32 — low-risk, idempotent, <strong>no timelock</strong> (the value <em>is</em> the consensus output).</p>
|
||
<ul><li><strong>EXECUTE (Tier 2/3)</strong> — <code>execute</code> runs an <strong>arbitrary</strong> operation (any</li></ul>
|
||
<p> target, method, args, native value) that the validators approved <em>by its hash</em>, gated by a <strong>timelock window</strong> (later of declared earliest and <code>approvedAt + minDelay</code> — more delay allowed, never less), <strong>predecessor</strong> ordering, <strong>one-shot</strong>, a <strong>guardian veto</strong> (<code>cancel</code> during the window), and the optional <strong>policy guard</strong>. <code>hashOperation</code> binds <code>chainId + address(this)</code> so an approval is non-replayable across chains/instances; <code>execute</code> is <strong>permissionless</strong> (the approval is the authority, not the caller) and returns the call's raw typed return data.</p>
|
||
<ul><li><strong><code>AIApproval.sol</code></strong> binds <code>AIExecute</code> to the real quorum by a single identity:</li></ul>
|
||
<p> <strong>a Thought's <code>promptHash</code> IS the operation hash</strong>. <code>confirm(taskId)</code> reads <code>governor.getThought(taskId)</code>, requires <code>Status.Settled</code> <strong>and</strong> <code>canonicalVote == Vote.Yes</code>, then stamps the approval of <code>thought.promptHash</code> at the current block time (the timelock anchor). <code>confirm</code> is <strong>permissionless</strong> (anyone may stamp an already-settled YES; nobody can manufacture one) and <strong>one-shot</strong>, with <strong>no admin, no owner, no override</strong> — the only path to an approval is a real quorum YES. It is an adapter, not a second governor.</p>
|
||
<ul><li><strong><code>AIPolicy.sol</code></strong> is an orthogonal defense-in-depth guard (target/selector</li></ul>
|
||
<p> allowlists, native-value cap, per-target rate limit), each gate off by default, governed by a Safe or the timelock — so a compromised quorum still cannot reach outside the envelope a deployment set.</p>
|
||
<h3>Post-quantum stack</h3>
|
||
<p>PoAI is post-quantum end to end. Freivalds soundness is information-theoretic and keccak commitments are PQ-secure; all keyed crypto uses NIST PQ schemes (grounded in <code>luxfi/node</code>):</p>
|
||
<ul><li><strong>X-Wing KEM promptseal</strong> — <code>crypto/promptseal</code> seals a user's prompt to an</li></ul>
|
||
<p> operator's registered public key so the prompt is <strong>never plaintext on the wire</strong> and only the chosen operator, inside its compute boundary, can open it. The KEM is <strong>X-Wing</strong> — the standardized <strong>hybrid of X25519 and ML-KEM-768</strong> (HPKE over <code>cloudflare/circl</code>, <code>KEM_XWING</code>/<code>KDF_HKDF_SHA256</code>/ <code>AEAD_ChaCha20Poly1305</code>, domain <code>hanzo/poi/prompt-seal/v1</code>) — confidential if <em>either</em> X25519 <em>or</em> ML-KEM-768 holds; the AAD binds the <code>intentID</code> so a sealed prompt cannot be replayed under a different request. X-Wing precompile at <code>0x…2221</code>. This is how <strong>data-sharing</strong> is bound: read-authorization is the envelope's job, orthogonal to the matmul check.</p>
|
||
<ul><li><strong>ML-DSA precompile (44/65/87)</strong> at <code>0x…012202</code> — verifies ML-DSA-44 (<code>0x44</code>,</li></ul>
|
||
<p> NIST Level 2), ML-DSA-65 (<code>0x65</code>, Level 3), ML-DSA-87 (<code>0x87</code>, Level 5) (<code>precompile/mldsa</code>). Validator and A-Chain-root quorums sign with ML-DSA.</p>
|
||
<ul><li><strong>SLH-DSA</strong> precompile at <code>0x…012203</code> (<code>precompile/slhdsa</code>) — conservative,</li></ul>
|
||
<p> structure-free hash-based PQ signatures.</p>
|
||
<ul><li><strong>P3Q precompile</strong> at slot <strong><code>0x012205</code></strong> (<code>precompile/p3q</code>,</li></ul>
|
||
<p> <code>ContractP3QVerifyAddress</code>) — a new PQ-proof primitive at its own slot, orthogonal to the classical ZK/Pulsar precompiles, each independently complete.</p>
|
||
<ul><li><strong>Warp <code>MLDSACertSet</code></strong> — <code>luxfi/warp</code> <code>EnvelopeV2</code> carries an optional ML-DSA</li></ul>
|
||
<p> attestation lane (<code>warp/envelope.go</code>; LP-105), so cross-chain PoAI attestation travels post-quantum and <code>AChainRootOracle</code> verifies the same scheme on the destination EVM.</p>
|
||
<h3>Canon properties</h3>
|
||
<p>PoAI is, and the contract layer enforces:</p>
|
||
<ul><li><strong>Public</strong> — verifier, contracts, and every decision are open and on-chain.</li><li><strong>Leaderless</strong> — no proposer, no privileged caller on the decision or execution</li></ul>
|
||
<p> path; <code>confirm</code>/<code>execute</code> permissionless; the authority is a settled quorum verdict, never an account.</p>
|
||
<ul><li><strong>Decentralized</strong> — one bonded operator set drives both decision primitives;</li></ul>
|
||
<p> sortition makes committee share track population share.</p>
|
||
<ul><li><strong>Operator-safe</strong> — an operator runs its own LLM and signs its own verdict; an</li></ul>
|
||
<p> honest operator is never slashed (bit-exact integer arithmetic + lowest-id argmax + canonical MoE top-k); the guardian veto + policy guard bound a compromised quorum.</p>
|
||
<ul><li><strong>Post-quantum / nation-state-proof</strong> — information-theoretic Freivalds</li></ul>
|
||
<p> soundness, keccak commitments, X-Wing/ML-DSA/SLH-DSA/P3Q keyed crypto.</p>
|
||
<h3>Ownership and selectable trust</h3>
|
||
<p>PoAI exists to make decentralization safe for users, so <strong>users own their data and own their AI</strong>. A user chooses where work runs:</p>
|
||
<ul><li><strong>Trusted DAO-operated nodes</strong> — a vetted, reputation-bearing operator set; or</li><li><strong>User-operated nodes</strong> — the user runs their own engine.</li></ul>
|
||
<p>Either way the <em>same</em> PoAI proof governs payment and slashing, so a user can pick a trust level anywhere from "decentralized with cryptographic recourse" to "as trusted as a centralized cloud" without changing the protocol.</p>
|
||
<h2>Security Considerations</h2>
|
||
<ul><li><strong>Soundness.</strong> Per challenge vector, a fabricated product is caught with</li></ul>
|
||
<p> probability <code>≥ 1 − 1/p</code>, <code>p = 2^61 − 1</code>; <code>k</code> vectors give <code>≤ (1/p)^k</code> (<code>≤ 2^−122</code> at <code>k = 2</code>). The shape contract fails closed, so malformed openings cannot pass.</p>
|
||
<ul><li><strong>Post-quantum.</strong> The Freivalds bound is information-theoretic (holds against an</li></ul>
|
||
<p> unbounded adversary); keccak commitments are PQ-secure; keyed crypto is X-Wing/ML-DSA/SLH-DSA/P3Q. Forging settlement requires breaking a NIST PQ scheme <em>or</em> corrupting a validator quorum — the nation-state-resistant bar.</p>
|
||
<ul><li><strong>Challenge unpredictability.</strong> <code>r</code> (and the opened layer) are derived from an</li></ul>
|
||
<p> on-chain beacon <strong>after</strong> the prover commits the activation-trace and weights roots, so the prover cannot tune operands to a known challenge.</p>
|
||
<ul><li><strong>Commitment integrity.</strong> RFC-6962 promotion avoids the CVE-2012-2459</li></ul>
|
||
<p> duplicate-last malleability; leaf/node domain separation hardens against second-preimage attacks; the leaf count is bound into the close so a subtree cannot be reinterpreted as the whole tree.</p>
|
||
<ul><li><strong>Replay / mis-attribution.</strong> The <code>reportData</code> binding chains challenge →</li></ul>
|
||
<p> measured model → input → output; <code>modelSpecHash</code> is measured over loaded quantized weight bytes, and <code>quantizationSpec</code>/<code>kernelVersion</code> fold the decoding regime into identity. The op hash binds <code>chainId + executor</code>, so a governance approval is non-replayable across chains/instances.</p>
|
||
<ul><li><strong>No double-mint.</strong> <code>AIComputeRegistry</code> keys on the chain-independent</li></ul>
|
||
<p> computation commitment; one unit of work mints once, network-wide.</p>
|
||
<ul><li><strong>Operator safety & break-glass.</strong> Integer arithmetic plus the shipped</li></ul>
|
||
<p> determinism prerequisites (lowest-id argmax, canonical MoE top-k) mean two honest runs agree bit-for-bit; an honest operator is never slashed. A malicious governance approval can be vetoed by the guardian during its timelock window and is bounded by the policy guard even if the quorum is compromised.</p>
|
||
<h2>Reference Implementation</h2>
|
||
<ul><li><strong>Engine core (built, tested):</strong> <code>hanzo-engine/src/poi.rs</code> — <code>Mat</code>,</li></ul>
|
||
<p> <code>freivalds_verify</code>, <code>freivalds_verify_multi</code>, <code>derive_challenges</code>; backend-agnostic, dependency-free; <strong>14 <code>#[test]</code></strong>. Transcript/graph/forward wiring in <code>poi_transcript.rs</code>, <code>poi_graph.rs</code>, <code>poi_forward.rs</code>; adversarial suite in <code>tests/poi_adversarial.rs</code>.</p>
|
||
<ul><li><strong>Determinism prerequisites (shipped):</strong> lowest-id argmax greedy tie-break in</li></ul>
|
||
<p> the sampler; canonical score-descending / index-ascending MoE expert top-k in ops.</p>
|
||
<ul><li><strong>Chain verifier (canonical, the one the chain consumes):</strong> <code>luxfi/crypto/poi</code></li></ul>
|
||
<p> — <code>freivalds.go</code>, <code>transcript.go</code>, <code>wire.go</code>; **22 <code>Test*</code>** across <code>freivalds_test.go</code>, <code>transcript_test.go</code>, <code>wire_test.go</code>, <code>scale_test.go</code>, <code>adversarial_test.go</code>.</p>
|
||
<ul><li><strong>Canonical contracts (one implementation):</strong> <code>luxfi/standard</code></li></ul>
|
||
<p> <code>contracts/ai/</code> — <code>ComputeWitnessLib</code>, <code>AIComputeRegistry</code>, <code>AChainRootOracle</code>, <code>MinerStakeRegistry</code>, <code>AICoin</code>, <code>AIMiner</code>, <code>AIConsensusMiner</code>, <code>AIGovernor</code>, <code>AIParams</code>, <code>AIExecute</code>, <code>AIApproval</code>, <code>AIPolicy</code> (+ <code>ComputeProofLib</code>, <code>ComputeProfile</code>, <code>ComputeVerifier</code>, <code>AttestationRootRegistry</code>, <code>AIReceiptRoots</code>). Consumed via <code>@luxfi/standard/ai</code>.</p>
|
||
<ul><li><strong>PQ:</strong> <code>crypto/promptseal</code> (X-Wing), <code>precompile/mldsa</code> (<code>0x…012202</code>,</li></ul>
|
||
<p> 44/65/87), <code>precompile/slhdsa</code> (<code>0x…012203</code>), <code>precompile/p3q</code> (<code>0x…012205</code>), <code>precompile/xwing</code> (<code>0x…2221</code>), <code>warp/envelope.go</code> (<code>MLDSACertSet</code>).</p>
|
||
<ul><li><strong>Soundness companion:</strong> <code>zooai/proofs/proof-of-inference-soundness.tex</code>.</li></ul>
|
||
<h2>Status</h2>
|
||
<p><strong>Built and tested:</strong></p>
|
||
<ul><li>The Freivalds verifier core (<code>poi.rs</code>) and the determinism prerequisites are</li></ul>
|
||
<p> implemented and pass <strong>14 <code>#[test]</code></strong> in <code>hanzo-engine</code> — honest <code>A·B</code> passes every challenge; a single tampered output entry is caught (including signed/negative entries); challenge derivation is deterministic across prover and verifier; wrong dimensions fail closed; a deep one-entry cheat in a larger random matmul is caught; keccak <code>derive_challenges</code> is golden-parity with the chain. The canonical Go verifier (<code>luxfi/crypto/poi</code>) carries **22 <code>Test*</code>** across the Freivalds, transcript, wire, scale, and adversarial suites, and the Solidity <code>ComputeWitnessLib</code> is byte-identical to both.</p>
|
||
<p><strong>Enforced (canonical contract):</strong></p>
|
||
<ul><li>The chain refuses to mint, settle, or act on a reward without a valid proof at</li></ul>
|
||
<p> the required tier — the profile gate is live in <code>luxfi/standard</code> <code>contracts/ai/</code>, with the global no-double-mint registry (<code>AIComputeRegistry</code>), the trustless PQ root oracle (<code>AChainRootOracle</code>), bond/slash (<code>MinerStakeRegistry</code>), and the fair-mined capped/halving coin (<code>AICoin</code>/<code>AIMiner</code>).</p>
|
||
<p><strong>Governance-execution (built):</strong></p>
|
||
<ul><li><code>AIGovernor</code> + <code>AIParams</code> settle canonical YES/NO + knob</li></ul>
|
||
<p> medians on-chain from the operator-LLM quorum; <code>AIExecute</code> + <code>AIApproval</code> + <code>AIPolicy</code> let consensus read any state typed and execute arbitrary approved operations under timelock + predecessor + one-shot + guardian veto + policy guard.</p>
|
||
<p><strong>PQ stack (built):</strong> X-Wing promptseal + precompile, ML-DSA (44/65/87) + SLH-DSA + P3Q (<code>0x012205</code>) precompiles, warp <code>MLDSACertSet</code>.</p>
|
||
<p><strong>Increment in flight:</strong> end-to-end zen-model proof <strong>emission</strong> — a real forward pass over a zen model emitting the activation-trace transcript a challenger opens and Freivalds-verifies against the bound <code>reportData</code>. The verifier, the on-chain gate, the canonical contracts, and the proof format are all in place and tested; wiring a live zen-model forward pass to emit the transcript is the remaining engineering. The proof system itself is canonical and enforced today.</p>
|
||
<p><strong>Live node-binary support:</strong></p>
|
||
<p>| Binary | Role | Carries the primitive via | Status | |---|---|---|---| | <code>hanzo-engine</code> | prover-side core | native <code>src/poi.rs</code> (Freivalds + determinism prereqs, 14 tests) | released | | <code>hanzod</code> | Hanzo node (Rust) | embeds <code>hanzo-engine</code> (path dep) → inherits the prover core | available via embed | | <code>luxd</code> | Lux node (Go) | <code>luxfi/crypto/poi</code> verifier (in-module) | verifier available | | <code>zood</code> | Zoo node (Go) | <code>luxfi/crypto/poi</code> verifier (in-module) | verifier available |</p>
|
||
<p>On-chain enforcement (<code>luxfi/standard</code> <code>contracts/ai/</code>) is the binding authority on every one of these chains regardless of node binary.</p>
|
||
<h2>Ecosystem license (LP-0012)</h2>
|
||
<p>The canonical PoAI work — the Rust prover core (<code>hanzo-engine/src/poi.rs</code>), the Go verifier (<code>luxfi/crypto/poi</code>), and the Solidity contracts (<code>luxfi/standard</code> <code>contracts/ai/</code>) — is licensed <strong>BSD-3-Clause</strong> (the per-file <code>SPDX-License-Identifier</code> is authoritative) <strong>extended by the LP-0012 ecosystem grant</strong>: production use is granted to chains <strong>descending from the Lux primary network</strong> (Hanzo, Zoo, Pars, and other Lux-descended L1s/L2s/L3s). Hanzo runs PoAI under this grant. Commercial licensing beyond these terms is by arrangement — contact <strong>lux.network</strong>. See LP-0012 and <code>luxfi/standard</code> <code>LICENSING.md</code>.</p>
|
||
<h2>References</h2>
|
||
<ol><li>R. Freivalds, <em>Probabilistic Machines Can Use Less Running Time</em> (1977).</li><li>HIP-1: $AI Token — Hanzo's Native Currency (<code>./hip-0001-ai-coin-hanzos-native-currency.md</code>)</li><li>HIP-5: Post-Quantum Security for AI Infrastructure (<code>./hip-0005-post-quantum-security-for-ai-infrastructure.md</code>)</li><li>LP-302 — Proof of AI (PoAI), Lux mirror.</li><li>ZIP-0419 — Proof of AI (PoAI), Zoo mirror.</li><li>LP-0012 — Permissionless + ecosystem license.</li><li><code>hanzo-engine/src/poi.rs</code> — Freivalds core (14 <code>#[test]</code>).</li><li><code>luxfi/crypto/poi</code> — canonical Go verifier (22 <code>Test*</code>).</li><li><code>luxfi/standard</code> <code>contracts/ai/</code> — canonical contract.</li><li>RFC 6962 — Certificate Transparency (Merkle lone-node promotion).</li></ol>
|
||
<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-0901.md">This page as plain text</a> · <a href="/llms.txt">Index for agents</a></div>
|
||
</footer>
|
||
</div></body></html> |