The whole modelis 32 bytes.

Werracle is a zero-memory AI decision oracle that lives in a single EVM storage slot. Powered by the WERR™ Sovereign Core, it returns allow, veto and dynamic-fee verdicts inside the same transaction for about 19,400 gas, with no off-chain dependency, and its kernel is machine-checked in Lean 4.

This storage word is the entire model. Point at a byte.bytes32

~19,400gas per decision
1,000 / 1,000sealed tests passed
40Lean 4 theorems, 0 sorry
Auroralive on testnet
c = −0.743644 + 0.131826i
background: the seed, rendered live
GBof weights

A neural network can't fit in a block.

Millions of float weights would need more than 15 million gas for one inference. So today's AI stays off-chain, and contracts trust a signed message that arrives a block too late.

KBof proofs

ZK-ML proves it, slowly.

The model still runs off-chain. A prover spends 10 to 300 seconds, then the chain pays around 350,000 gas to verify. Correct, but never inside the attack's own transaction.

32bytes

The 32-Byte Secret Formula: WERR™ Sovereign Core.

Instead of gigabytes of neural weights or slow ZK proofs, the WERR™ Sovereign Core encodes decision intelligence into a single 32-byte storage slot. Decisions are evaluated in deterministic on-chain integer math in <1 ms. One SLOAD reads the whole brain for 100 gas.

Run the contract in your browser.

This is WerracleTripodZMod9.previewDecision(), the v2.0 core, ported integer for integer. It probes 12 points around its seed, runs z → z² + c for up to 9 steps on each, and measures how long they stay inside |z| ≤ 2. That boundedness pushes back against the caller's risk score. Above the threshold the call goes through; below it, the whole transaction reverts.

Decision state trajectory

|z| ≤ 2

wide plane, 0.6× focus plane, 1× deep plane, 1.6× left |z| ≤ 2 probability level threshold

Incoming call

Allowed
confidence—
  1. boundedness
  2. bias
  3. logit = bias − risk
  4. sigmoid

15.0kgas, previewDecision (measured)
20.7kgas, decideNoul with event
18×less gas than a ZK-ML verify
1 slotno off-chain server or key

Gas measured on solc 0.8.20 with the optimizer at 200 runs, execution only. Scenario risk scores are examples; in production the calling protocol computes them.

It stops the attack inside the attack.

A flash loan borrows, manipulates and repays in one transaction. An oracle that answers next block is already too late. Werracle answers in the middle, and a revert undoes everything before it.

Uniswap v4 dynamic fee hook

Deep liquidity, calm0.05–0.15%
Normal volatility0.25–0.30%
Turbulence or MEV0.40–0.45%
Flash crash, capped0.50%

WerracleFeeHook.sol

One transactionblock #—
1Borrow from lending pool
2Swap to move the price
3Protocol asks Werracle~19.4k gas
4Liquidate, swap back, repay

The size and impact thresholds here are an illustrative policy; on-chain, the verdict comes from decideNoul().

Gas for one inference.

Log scale. Every extra step to the right costs ten times more.

Neural net on EVMexceeds a block
>15,000,000
ZK-ML verifierplus 10–300 s off-chain
~350,000
Werraclesame transaction
~19,400
10k100k1M10M
Traditional ML on EVMZK-MLWerracle
LatencyCannot run in a block10–300 s proof< 1 ms, same transaction
On-chain footprintGigabytes of tensorsKilobytes of keysOne 32-byte slot
Flash-loan defenseImpossibleProof arrives too lateAtomic revert
External dependencyRequiredOff-chain proverNone
Formal verificationNoneCircuit only40 Lean 4 theorems

Guarding NEAR Intents before they are signed.

Werracle sits in front of NEAR chain signatures as a pre-signing reflex. Clean intents pass through to Base or Ethereum; sandwich and flash-loan patterns are vetoed before a signature exists. Built for NEAR Hackathon 2026, tracks Unstoppable DeFi and AI Security.

NOUL = 1

Clean swap intent

Volatility 25 bps. Approved in 12.6 µs and 21,438 gas; the chain signature is broadcast.

NOUL = 0

Predatory sandwich

Risk 75%. Vetoed in 13.1 µs; the signature is never produced and no funds move.

NOUL = 1

Agent-to-agent payment

A sub-cent API micropayment between autonomous agents, approved in 6.1 µs.

Deployed on Aurora testnet (chain 1313161555)

Werracle.sol v1.0 reference kernel0x4085673F1e45bf26682CA704b2d09C03d1212cd4Explorer
WerracleTripodZMod9.sol v2.0 flagship, runs in the simulator0x1d7Ae9E1dDDA805539d9e225425804Ef8B9caBaFExplorer
cast call 0x4085673F1e45bf26682CA704b2d09C03d1212cd4 "owner()(address)" --rpc-url https://testnet.aurora.dev

Proved, not just tested.

The Lean 4 kernel checks that every escape loop halts, that Q16.16 squares can never overflow int64, and that gas stays under a fixed ceiling. No sorry, and no axioms beyond Lean's standard three.

40theorems, machine-checked
0sorry, 0 custom axioms
1,000sealed tests, 1,000 passed
≤ 12escape steps per point, proven

    

Add it to a contract.

One import, one call, one require. The guard runs before your sensitive logic, in the same transaction.

forge install pCwOrM/werracle
ProtectedVault.sol
// SPDX-License-Identifier: BSL-1.1
pragma solidity ^0.8.20;

import "werracle/contracts/IWerracle.sol";

contract ProtectedVault {
    IWerracle public immutable werracle;

    constructor(address oracle) { werracle = IWerracle(oracle); }

    function withdraw(bytes32 state, int64 riskQ16) external payable {
        // same-transaction decision; v2.0 flagship: ~20.7k gas
        (bool allowed, ) = werracle.decideNoul{value: msg.value}(state, riskQ16);
        require(allowed, "Werracle: hostile pattern");
        // ... protected logic
    }
}

Werracle devnet (chain 4242, api.answerr.me)

WerracleTripodZMod9 v2.00x0a95887dBa2783E1E445bB4D3A9a1f7cB3152d0422.5k gas
Werracle v1.00x5FbDB2315678afecb367f032d93F642f64180aa3
WerracleFeeHook0xdef5Ad647Af159D27cd111007e4CCD1fDE9d4006Uniswap v4

Paper, data and code.

Support the research.

Receiving address for Ethereum Foundation ESP, Base, NEAR Foundation, Arbitrum and other ecosystem grants.

USDT, TRC20 (TRON network)
TLMhaDJTVYBHBSGJ9nCQGLvqnYFPSBgLJu

ITOUCH Bilişim Sistemleri Ltd. Şti.
Çukurova Teknokent, Adana, Türkiye

Lead builder: pcworm.near
Patent pending: TR 2026/016285 & TR 2026/016633

[email protected]
[email protected]
[email protected]

Werracle v2.0 • Classic v1.0 Archive