Skip to content
Integer-only BNN · on-chain inference

Run the model
on‑chain

onchAIn runs an integer-only binary neural network inside the contract itself, reading authenticated model bytes from chain. The same verdict gates a Uniswap v4 swap on Sepolia and a risk-gated agent action on Hedera.

Testnet prototype · synthetic admitted inputs · off-chain agent for signing, scheduling & audit

Explore live demos

Where it runs

Three surfaces, one verdict.

The same admitted packed input evaluates to the same margin and score everywhere — no backend, no floating point, no feature oracle.

Ethereum Sepolia

A Uniswap v4 beforeSwap hook calls the local BNN. Only an allow verdict passes; risk or defer reverts the whole swap atomically.

How the gate works

Hedera agent

An off-chain agent, gated by the same integer BNN, executes a bounded SaucerSwap action — with spend caps, allowlisted routes, and operator approval.

Agent guardrails

ENS + HCS

testnet

ENS records resolve the live contracts and endpoints; HCS records every decision, receipt, and cost. Discovery drives the app — nothing hardcoded.

Discovery & audit

How inference works

The same bytes, everywhere.

Inference is XNOR plus popcount over packed weights — pure integer math. Identical model bytes and identical instructions produce identical results on every chain.

Weights are packed bipolar and compared with the input by XNOR; counting the set bits (popcount) gives each hidden unit's score against a signed threshold.

The signed margin maps to a score from 0 to 1000. Allow is at or below 488, risk is at or above 552, and anything between defers — the same cutoffs on every chain.

42TOKENIZATIONthecatsaton43embedding💡embedding

artifact 192→256→96→1 · one STOP-prefixed data contract · integer-only

Read the spec →

By design

Guardrails, audit, honest scope.

A deterministic verdict isn't a security proof. onchAIn is explicit about what it does and doesn't claim.

Spend caps

The Hedera agent is bounded — fixed inventory, per-action and epoch budgets, allowlisted routes, and operator approval for large actions.

Guardrails

HCS audit

Every decision, receipt, and cost is written to Hedera Consensus Service — ordered and tamper-evident, with receipt links, not claims.

The ledger

Synthetic scope

Inputs are synthetic and admitted on-chain. This is a testnet prototype, not a trained real-market oracle.

What this isn’t

Built with

Uniswap v4HederaENSLayerZeroHCSSaucerSwapFoundryviem

FAQ

Frequently asked questions.

Yes. The classifier is integer-only and evaluates packed inputs inside the contract, reading authenticated model bytes stored on-chain. No server or floating point is needed to reproduce a verdict.

There is one: an off-chain agent handles scheduling, transaction signing, feature preparation, quotes, and HCS submissions. The inference itself runs on-chain.

On Sepolia the Uniswap v4 hook reverts the entire swap atomically when the verdict isn’t allow. On Hedera the agent simply doesn’t execute the action.

No. Inputs are synthetic and admitted on-chain; it’s a deterministic prototype on testnet, not a trained real-market oracle.

Live discovery. ENS records resolve the current contracts, chain-specific addresses, and endpoints — the app reads them at runtime instead of hardcoding.

On Hedera Consensus Service: decisions, receipts, and costs are recorded with explorer links.