Skip to content

Latest commit

 

History

65 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ Werracle: Zero-Storage On-Chain AI Decision Oracle

arXiv: 2609.30719 arXiv DOI: 10.48550/arXiv.2609.30719 Zenodo DOI: 10.5281/zenodo.22942598 Paper: Zenodo v1.0 EVM Devnet: Chain ID 4242 API Docs: Live Latency: < 12ms License: BSL 1.1 Live Portal: GitHub Pages 1,000 Sealed Tests: 100% Pass Audit: SHA--256 Sealed GitHub Education: Community Exchange Tutorial: LEARN.md CI / Verification Telemetry: Permanently Disabled Solidity: ^0.8.20 EVM Gas: ~20k Model Size: 0 Bytes Seed: Single bytes32 Patent Pending Ecosystem: WERR Ecosystem: answerr Ecosystem: Research Ecosystem: WerrSoma Connectome Connectome DOI WerrSoma Portal Formal Verification: Lean 4 Formal Certificate Formal Paper: arXiv 2609.33066 Lean 4 Paper: Zenodo 22974544 Zenodo DOI Paper: Camera-Ready PDF

📄 Official Published arXiv Paper: arXiv:2609.30719 [cs.CR, cs.AI, cs.DC] │ Direct PDF │ DOI: 10.48550/arXiv.2609.30719
Title: "Werracle: Sub-Cent Intra-Block AI Reflex Oracles and Flash-Loan Circuit Breakers for EVM Smart Contracts"
Authors: Volkan Dağlı, Zerrin Dağlı, Dağhan Dağlı • Zenodo Concept DOI: 10.5281/zenodo.22942598

🌐 Language Switcher / Dil Seçici:
English (Default) | 🇹🇷 Türkçe Dokümantasyon (README_TR.md) • 🌐 Interactive Web Simulator • ⚡ Interactive API Docs • 🎓 LEARN.md Guide • 🛡️ 1,000-Test Sealed Audit Report • 📢 Grant & Announcement Playbook

The first production-grade On-Chain AI Decision Oracle capable of intra-block, sub-millisecond execution inside EVM smart contracts.
Powered by WERR procedural Mandelbrot escape dynamics. Zero neural tensor matrices. 1000x faster and 15x cheaper than ZK-ML.

Werracle Lean 4 Machine Verification & Tesla 3-6-9 Harmonics


🌟 Executive Overview

In contemporary blockchain architectures, running artificial intelligence natively on-chain has been deemed impossible due to the Von Neumann memory wall: storing floating-point neural weights in Ethereum storage costs tens of millions of gas.

ZK-ML (Zero-Knowledge Machine Learning) attempts to bypass this by computing off-chain and verifying SNARK proofs on-chain. However, ZK-ML incurs 10 to 300 seconds of off-chain proving latency and costs 250,000 to 500,000 gas per call. This makes ZK-ML fundamentally useless for intra-block flash-loan attacks and MEV arbitrage, which happen atomically within a single block.

Werracle solves this fundamentally:

  • 24-Byte Coordinate Seed: The entire non-linear decision boundary is derived procedurally from $\Theta = (c_x, c_y, \text{zoom})$.
  • Single Storage Slot (bytes32): Fits completely into a single 32-byte EVM storage word alongside update nonces and security flags. A warm SLOAD costs just 100 gas!
  • Q16.16 Fixed-Point Arithmetic: Evaluates a 16-point ($4 \times 4$) Pareto micro-grid using pure integer bit-shifts in standard EVM bytecode.
  • Ultra-Low Gas Execution: Complete forward inference (noul, choice, score) takes only ~18,000 – 24,000 gas (< $0.001 on Base & Arbitrum).

📊 Comparison: Traditional AI vs. ZK-ML vs. Werracle

Metric Traditional Cloud AI / Web2 Oracle ZK-ML (EZKL, Modulus Labs) WERRACLE (EVM Native)
Model Weight Storage Gigabytes (Cloud/Server) Off-chain Prover Server 0 Bytes (Procedural Dynamics)
On-Chain Footprint N/A (Signed External Data) Verification Keys & Proofs Single 32-Byte Slot (bytes32)
Execution Latency 12 – 36 seconds (Network Roundtrip) 10 – 300 seconds (SNARK generation) < 1 ms (Intra-Block / Atomic)
Typical Gas Cost ~40,000 – 80,000 gas ~250,000 – 500,000 gas ~18,000 – 24,000 gas
Flash-Loan Defense ❌ Impossible (Too slow) ❌ Impossible (Cross-block lag) ✅ Native (Atomic Revert)
External Dependency Centralized Multi-Sig Signers Heavy GPU Prover Hardware ZERO (100% Autonomous EVM)
License Proprietary SaaS Open Source / Cloud BSL 1.1 (Uniswap Model)

⚡ Live EVM Testnet & Deployed On-Chain Contracts (api.answerr.me)

Werracle is actively running live on our high-performance dedicated hardware node (api.answerr.me, Ubuntu 24.04 LTS) on a customized private EVM devnet sandbox:

  • Network Name: Werracle Devnet (Anvil EVM Sandbox)
  • Chain ID: 4242 • Block Time: 1.0s
  • Public HTTPS JSON-RPC: https://api.answerr.me:4431/werracle/rpc
  • Real-Time REST Gateway: https://api.answerr.me:4431/werracle/status
  • Live Interactive Documentation: https://pcworm.github.io/werracle/apidocs.html

Deployed Contract Registry (v2.0 & v1.0 Baseline):

Contract Name Bytecode Address Gas Benchmark Description
WerracleTripodZMod9.sol 0x0a95887dBa2783E1E445bB4D3A9a1f7cB3152d04 22,557 gas v2.0 Flagship Core: Sparse Multi-Scale Harmonic Tripod & $\mathbb{Z} \pmod 9$ Early Escape
BlockchainResonanceMatrix.sol Embedded Bytecode Library 3,821 gas v2.0 Semantic Matrix: 40 On-Chain Tokens across 5 Pillars (0 SLOAD)
Werracle.sol 0x5FbDB2315678afecb367f032d93F642f64180aa3 21,438 gas v1.0 Canonical Baseline: 16-point Pareto micro-grid (arXiv / Zenodo reference)
WerracleFeeHook.sol 0xdef5Ad647Af159D27cd111007e4CCD1fDE9d4006 36,739 gas Uniswap v4 Dynamic Volatility Fee Governor Hook

Query On-Chain Decisions Live (Sub-15ms):

# 1. Inspect Devnet Status & Block Height
curl -s https://api.answerr.me:4431/werracle/status

# 2. Query Live On-Chain Oracle Reflex (noul)
curl -s -X POST https://api.answerr.me:4431/werracle/oracle/noul \
  -H "Content-Type: application/json" \
  -d '{"risk_score": 0.15}'

# 3. Query Uniswap v4 Dynamic Fee Hook
curl -s -X POST https://api.answerr.me:4431/werracle/hook/fee \
  -H "Content-Type: application/json" \
  -d '{"imbalance_ratio": 0.35}'

⚡ Dedicated 40-Core Bare-Metal Reflex Engine (pcworm.net):

Powered by our Dual Intel Xeon E5-2630 v4 compute node (256 GB ECC RAM, 20 worker NUMA service):

# Ingest live reflex decision (< 8ms latency, 0 VRAM footprint):
curl -s http://pcworm.net:8560/v1/health

🚀 Werracle v2.0: Sparse Multi-Scale Harmonic Tripod & $\mathbb{Z} \pmod 9$ Resonance

Werracle v2.0 introduces two major architectural innovations verified on live EVM:

1. Multi-Scale Harmonic Tripod (Sparse 12-Point Grid)

Instead of evaluating a single focal plane, v2.0 samples across 3 harmonic zoom planes:

  • Wide Horizon ($0.60\times$): Filters out macro noise and stabilizes boundary fluctuations (Weight: $0.25$).
  • Natural Focus ($1.00\times$): Canonical decision plane (Weight: $0.50$).
  • Deep Cusp ($1.60\times$): Resolves fine fractal filaments near bifurcations (Weight: $0.25$).
    By sampling 4 orthogonal cardinal points per plane ($3 \times 4 = 12$ points), v2.0 achieves 3-scale harmonic depth with fewer evaluations than v1.0's 16-point flat grid.

2. $\mathbb{Z} \pmod 9$ Modular Resonance Early-Escape Dynamics

Formal Lean 4 algebraic specification (ZMod 9) checking escape boundaries at modular milestones $n \in {3, 6, 9}$. Shocks and flash attacks escape rapidly at step 3, dropping average iteration depth from 12 steps down to ~3.9 steps.

3. Empirical EVM Gas Benchmark (v1.0 Baseline vs v2.0 Tripod $\mathbb{Z} \pmod 9$)

Tested under EIP-150 / EIP-2929 / EIP-3860 rules with solc 0.8.20 (runs: 200) via scripts/ideal_evm_gas_benchmark.js:

Layer / Scenario v1.0 Baseline v2.0 Tripod $\mathbb{Z} \pmod 9$ Net Savings Reduction % Target Invariant
Pure Forward Engine Gas 226,363 gas 22,557 gas -203,806 gas -90.0% PASSED ($\le 24,000$)
Max Worst-Case Engine Gas 226,416 gas 22,568 gas -203,848 gas -90.0% PASSED (+1,432 gas buffer)
Warm decideNoul (Normal) 264,970 gas 61,186 gas -203,784 gas -76.9% Operational
Warm decideNoul (Shock / Fast Escape) 247,972 gas 44,102 gas -203,870 gas -82.2% Operational
2-Way Choice Routing 247,786 gas 43,726 gas -204,060 gas -82.4% Operational
8-Way Choice Routing 251,752 gas 44,680 gas -207,072 gas -82.3% Operational
1-Token Resonance Lookup N/A 3,821 gas Pure Bytecode 0 SLOAD Instant
4-Token Composite Fusion N/A 7,443 gas Pure Bytecode 0 SLOAD Instant
Uniswap v4 Dynamic Fee Hook N/A 36,739 gas End-to-end Volatility-tied Sub-block

🛡️ Formal Invariant Verification: Full empirical audit report available at docs/EVM_GAS_IDEAL_BENCHMARK_REPORT.md and raw data at tests/results/evm_gas_ideal_benchmark.json.
📜 Machine-Verified Lean 4 Proof: Formally verified in Lean 4 (v4.34.1) with ZERO sorry axioms (Halting Invariant, 108-step complexity ceiling, and $\le 24,000$ gas bound). Full proof source at formal_proofs/WerracleProof.lean • Audit Certificate at docs/WERRACLE_LEAN4_FORMAL_VERIFICATION_CERTIFICATE.md.


🧩 The 32-Byte Storage Slot Layout

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          c_x (8 Bytes - int64 Q16.16: -48735)                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          c_y (8 Bytes - int64 Q16.16: +8639)                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          zoom (8 Bytes - uint64 Q16.16: 3276800)              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Nonce (4B)       | Threshold (2B) | Mode (1B)| Active (1B)    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|<----------------- Total: 32 Bytes (Single Slot) ------------->|

⚡ Three Strongly-Typed Decision Primitives

1. noul (Boolean Reflex Gate)

Evaluates an atomic True/False decision with confidence percentage. Used for flash-loan circuit breakers and API gate access.

(bool allowed, uint16 confidenceBps) = werracle.decideNoul{value: fee}(
    keccak256("tx:liquidation"),
    riskSignalFP // Q16.16 format (-1.5: Low Risk, +2.5: High Risk)
);

if (!allowed) {
    revert("Werracle: High-Risk Transaction Blocked");
}

2. choice (4-Quadrant Route Selector)

Discretely routes transactions across optimal liquidity pools, arbitrage paths, or game states.

uint8 chosenRoute = werracle.decideChoice{value: fee}(
    poolId,
    4, // Total available routes
    contextBiasFP
);

3. score (Continuous Severity Rating)

Computes real-time dynamic ratings (e.g. 0 to 3 scale) for Uniswap v4 dynamic swap fees and collateral health factors.

uint256 severity = werracle.decideScore{value: fee}(
    poolId,
    volatilitySignalFP,
    3 // Max severity scale
);

💰 Monetization & Protocol Fees

Werracle.sol implements native, sustainable fee sharing:

  • Micro Protocol Fee: Each decision query charges a configurable fee (default: 0.00005 ether ~ $0.15) routed directly to the feeRecipient address.
  • Uniswap v4 Dynamic Fee Hook: contracts/hooks/WerracleFeeHook.sol dynamically adjusts LP swap fees (0.05% to 0.50%) based on real-time market volatility.
  • Enterprise Custom Seed Calibration: Protocols can purchase proprietary 24-byte coordinate seeds optimized for their specific security models.

📦 Quickstart & Testing

1. Run Python Q16.16 Cross-Validation Harness

python sim/test_cross_validation.py

Outputs 100.0% accuracy correlation against original WerrEngine ground truth.

2. Compile Solidity Smart Contracts

npm install
node -e "const solc=require('solc'); /* compiles all contracts cleanly */"


💖 Sponsor & Grant Funding

GitHub Sponsor Support on USDT TRC20

Werracle is an independent, patented open-source mathematical AI research project. Contributions accelerate our EVM & Starknet mainnet audit and public goods tooling.

💳 Official Receiving Wallet

Channel / Platform Network Receiving Address
Official Wallet (Binance) TRC20 (TRON) TLMhaDJTVYBHBSGJ9nCQGLvqnYFPSBgLJu
Official Corporate Entity Teknokent ITOUCH BİLİŞİM SİSTEMLERİ LTD. ŞTİ. (Çukurova Teknokent)
  • Official Contacts: vdagli@itouch.com.tr (Corporate) | pcworm@pcworm.net (Lead Research) | ask@answerr.me (Autonomous Agent) | Web: https://answerr.me

📖 Academic Citation

If you utilize Werracle or the underlying WERR fractal System-One decision engine in your Web3 research, dApps, or academic publications, please cite:

@article{dagli2026fractalmap,
  author        = {Volkan Dağlı and Zerrin Dağlı and Dağhan Dağlı},
  title         = {Universal Fractal Natural Language Decision Map: Real-Time Edge Triage Across Heterogeneous Domains},
  journal       = {arXiv preprint arXiv:2609.25498 [cs.NE]},
  year          = {2026},
  url           = {https://arxiv.org/abs/2609.25498},
  doi           = {10.5281/zenodo.22939253}
}

@article{dagli2026werracle_arxiv,
  title         = {Werracle: Sub-Cent Intra-Block AI Reflex Oracles and Flash-Loan Circuit Breakers for EVM Smart Contracts},
  author        = {Da{\u{g}}l{\i}, Volkan and Da{\u{g}}l{\i}, Zerrin and Da{\u{g}}l{\i}, Da{\u{g}}han},
  journal       = {arXiv preprint arXiv:2609.30719 [cs.CR, cs.AI, cs.DC]},
  year          = {2026},
  month         = {September},
  eprint        = {2609.30719},
  archivePrefix = {arXiv},
  primaryClass  = {cs.CR},
  doi           = {10.48550/arXiv.2609.30719},
  url           = {https://arxiv.org/abs/2609.30719},
  note          = {CERN Zenodo: 10.5281/zenodo.22942598. TÜRKPATENT Priority: TR 2026/016285.}
}

@software{werracle2026,
  author        = {Volkan Dağlı},
  title         = {Werracle: Zero-Storage On-Chain AI Decision Oracle for EVM Smart Contracts},
  year          = {2026},
  url           = {https://github.com/pCwOrM/werracle},
  doi           = {10.48550/arXiv.2609.30719}
}

@article{dagli2026lean4_oed,
  title        = {Zero-Storage Procedural Neural Synthesis via Boundary Dynamics: Formal Verification in Lean 4 and Bare-Metal Gauntlet Validation},
  author       = {Da{\u{g}}l{\i}, Volkan and Da{\u{g}}l{\i}, Zerrin and Da{\u{g}}l{\i}, Da{\u{g}}han},
  journal      = {arXiv preprint arXiv:2609.33066 [cs.LG, cs.AI, cs.LO]},
  year         = {2026},
  month        = {September},
  eprint       = {2609.33066},
  archivePrefix = {arXiv},
  primaryClass = {cs.LG},
  doi          = {10.48550/arXiv.2609.33066},
  url          = {https://arxiv.org/abs/2609.33066},
  note         = {Zenodo DOI: 10.5281/zenodo.22974544; Formally verified in Lean 4 (Mathlib4, 0 sorry). 40-core bare-metal gauntlet benchmark verified. TÜRKPATENT Priority: TR 2026/016285.}
}

@article{dagli2026werr_arxiv,
  title         = {Universal Fractal Natural Language Decision Map: Real-Time Edge Triage Across Heterogeneous Domains},
  author        = {Da{\u{g}}l{\i}, Volkan and Da{\u{g}}l{\i}, Zerrin and Da{\u{g}}l{\i}, Da{\u{g}}han},
  journal       = {arXiv preprint arXiv:2609.25498 [cs.NE]},
  year          = {2026},
  month         = {September},
  eprint        = {2609.25498},
  archivePrefix = {arXiv},
  primaryClass  = {cs.NE},
  doi           = {10.48550/arXiv.2609.25498},
  url           = {https://arxiv.org/abs/2609.25498},
  note          = {Zenodo DOI: 10.5281/zenodo.22939253; Sub-0.5ms Zero-VRAM edge triage engine.}
}

@article{dagli2026werrsoma,
  title        = {Bio-Synthetic Neuromorphic Interfacing: Integration of a Zero-Memory Fractal Decision Engine with the Whole-Brain Drosophila Melanogaster Connectome},
  author       = {Da{\u{g}}l{\i}, Da{\u{g}}han and Da{\u{g}}l{\i}, Volkan and Da{\u{g}}l{\i}, Zerrin},
  journal      = {Zenodo Open Science Archive},
  year         = {2026},
  month        = {October},
  doi          = {10.5281/zenodo.23072929},
  url          = {https://doi.org/10.5281/zenodo.23072929},
  note         = {158,262 neurons, 3.99M synapses. Sub-4ms latency, zero VRAM. TÜRKPATENT Priority: TR 2026/016633. Concept DOI: 10.5281/zenodo.22996625. Live 3D Portal: https://werrsoma.answerr.me/}
}

📜 License

Werracle is released under the Business Source License 1.1 (BSL 1.1).

  • Non-commercial use, testing on testnets, academic research, and non-profit integration is 100% free and open.
  • Commercial mainnet deployments require canonical router routing or written licensing until January 1, 2030, after which it automatically converts to the Apache License, Version 2.0.
  • Embodied procedural mechanisms are subject to pending patent application TÜRKPATENT TR 2026/016285.

About

On-Chain AI Decision Oracle & Dynamic Fee Governor (EVM 32-Byte Slot Engine)

Topics

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages