The whole modelis 32 bytes.

Werracle is an AI decision oracle that runs inside the EVM. It stores no weights. It derives them from one point on the Mandelbrot boundary, then answers allow, route or score in about 19,400 gas, inside the same transaction that asked.

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

Werracle stores a coordinate, not a model.

Weights are recomputed on demand from the escape dynamics of z → z² + c, in Q16.16 integers. One SLOAD reads the whole brain for 100 gas. Nothing leaves the chain.

Run the contract in your browser.

A line-for-line port of Werracle.previewDecision() and WerrMath.sol: the same Q16.16 integers, the same floor shifts, the same 16-point micro-grid and piecewise sigmoid. Click the map to move the seed, then push the risk until the contract says no.

The whole set. Click or drag to choose c.
The 16 sample points around c, shaded by how many of the 12 steps each survives. Tap one to trace it.
Allowed
confidence—
probability
fractal bias
loop steps run

Same inputs give the same answer on every node. No randomness, no floats, no external call.

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.sol0x4085673F1e45bf26682CA704b2d09C03d1212cd4Explorer
WerracleTripodZMod9.sol0x1d7Ae9E1dDDA805539d9e225425804Ef8B9caBaFExplorer
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, ~19.4k 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]