On-Chain Decentralized Learning and Cost-Effective Inference for DeFi Attack Mitigation
Not on the map. Why?
Abstract (arXiv)
Billions of dollars are lost every year in DeFi platforms by transactions exploiting business logic or accounting vulnerabilities. Existing defenses focus on static code analysis, public mempool screening, attacker contract detection, or trusted off-chain monitors, none of which prevents exploits submitted through private relays or malicious contracts that execute within the same block. We present the first decentralized, fully on-chain learning framework that: (i) performs gas-prohibitive computation on Layer-2 to reduce cost, (ii) propagates verified model updates to Layer-1, and (iii) enables gas-bounded, low-latency inference inside smart contracts. A novel Proof-of-Improvement (PoIm) protocol governs the training process and verifies each decentralized micro update as a self-verifying training transaction. Updates are accepted by textitPoIm only if they demonstrably improve at least one core metric (e.g., accuracy, F1-score, precision, or recall) on a public benchmark without degrading any of the other core metrics, while adversarial proposals get financially penalized through an adaptable test set for evolving threats. We develop quantization and loop-unrolling techniques that enable inference for logistic regression, SVM, MLPs, CNNs, and gated RNNs (with support for formally verified decision tree inference) within the Ethereum block gas limit, while remaining bit-exact to their off-chain counterparts, formally proven in Z3. We curate 298 unique real-world exploits (2020 - 2025) with 402 exploit transactions across eight EVM chains, collectively responsible for 3.74 B in losses.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 33 of its 79 references that are in the map. First posted on arXiv 15 Oct 2025.
Builds on
33 of 79 references.
References · 33
- 2022SoK: Decentralized Finance (DeFi) Attackscited by 28
- 2019A Survey on Ethereum Systems Security: Vulnerabilities, Attacks and Defensescited by 25
- 2025A Survey of Zero-Knowledge Proof Based Verifiable Machine Learningcited by 22
- 2024opML: Optimistic Machine Learning on Blockchaincited by 21
- 2019A scalable verification solution for blockchainscited by 10
- 2023DAppSCAN: Building Large-Scale Datasets for Smart Contract Weaknesses in DApp Projectscited by 9
- 2023Smart Contract and DeFi Security Tools: Do They Meet the Needs of Practitioners?cited by 8
- 2024Blockchain for Large Language Model Security and Safety: A Holistic Surveycited by 8
- 2019Characterizing Code Clones in the Ethereum Smart Contract Ecosystemcited by 7
- 2024DeFiTail: DeFi Protocol Inspection through Cross-Contract Execution Analysiscited by 7
- 2021Agatha: Smart Contract for DNN Computationcited by 6
- 2022Empirical Analysis of EIP-1559: Transaction Fees, Waiting Time, and Consensus Securitycited by 6
21 more
- 2024Trust the Process: Zero-Knowledge Machine Learning to Enhance Trust in Generative AI Interactionscited by 6
- 2019Why and How zk-SNARK Workscited by 5
- 2021Layer 2 Blockchain Scaling: a Surveycited by 4
- 2022ScrawlD: A Dataset of Real World Ethereum Smart Contracts Labelled with Vulnerabilitiescited by 4
- 2018YODA: Enabling computationally intensive contracts on blockchains with Byzantine and Selfish nodescited by 3
- 2022Eliminating Sandwich Attacks with the Help of Game Theorycited by 3
- 2022Reap the Harvest on Blockchain: A Survey of Yield Farming Protocolscited by 3
- 2024LookAhead: Preventing DeFi Attacks via Unveiling Adversarial Contractscited by 3
- 2020A Framework and DataSet for Bugs in Ethereum Smart Contractscited by 2
- 2024ML2SC: Deploying Machine Learning Models as Smart Contracts on the Blockchaincited by 2
- 2024SoK: Attacks on DAOscited by 2
- 2025AI-Based Crypto Tokens: The Illusion of Decentralized AI?cited by 2
- 2023Dissecting Bitcoin and Ethereum Transactions: On the Lack of Transaction Contention and Prioritization Transparency in Blockchainscited by 1
- 2023A Survey on Off-chain Networks: Frameworks, Technologies, Solutions and Challengescited by 1
- 2024Characterizing Ethereum Upgradable Smart Contracts and Their Security Implicationscited by 1
- 2024Vulnerabilities of smart contracts and mitigation schemes: A Comprehensive Surveycited by 1
- 2024A Novel Classification of Attacks on Blockchain Layers: Vulnerabilities, Attacks, Mitigations, and Research Directionscited by 1
- 2025Yoimiya: A Scalable Framework for Optimal Resource Utilization in ZK-SNARK Systemscited by 1
- 2025Protecting DeFi Platforms against Non-Price Flash Loan Attackscited by 1
- 2025Generation of Optimized Solidity Code for Machine Learning Models using LLMscited by 1
- 2025Voting-Bloc Entropy: A New Metric for DAO Decentralizationcited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026CyberChainBench: Can AI Agents Secure Smart Contracts Against Real-World On-Chain Vulnerabilities?
- 2026EvoPoC: Automated Exploit Synthesis for DeFi Smart Contracts via Hierarchical Knowledge Graphs ↗
- 2025Detecting Various DeFi Price Manipulations with LLM Reasoning
- 2025LLM-Powered Detection of Price Manipulation in DeFi
- 2026Proof-Gated Signing: Solver-Checked Transaction Guards that Hold Under State Drift for Onchain AI Agents
- 2026Beyond Detection: Agentic Attack Synthesis and Simulation for Smart Contracts
- 2026When Verified Source Becomes Attack Input: Defending Smart Contracts Against LLM-Based Vulnerability Scanning ↗
- 2025Multi-Agent Collaborative Fuzzing with Continuous Reflection for Smart Contracts Vulnerability Detection