Hunting in the Dark Forest: A Pre-trained Model for On-chain Attack Transaction Detection in Web3
Zhiying Wu, Jiajing Wu, Hui Zhang, Zibin Zheng, Weiqiang Wang
Abstract
In recent years, a large number of on-chain attacks have emerged in the blockchain empowered Web3 ecosystem. In the year of 2023 alone, on-chain attacks have caused losses of over 585 million. Attackers use blockchain transactions to carry out on-chain attacks, for example, exploiting vulnerabilities or business logic flaws in Web3 applications. A wealth of efforts have been devoted to detecting on-chain attack transactions through expert patterns and machine learning techniques. However, in this ever-evolving ecosystem, the performance of current methods is limited in detecting new on-chain attacks, due to the obsoleting of attack recognition patterns or the reliance on on-chain attack samples. In this paper, we propose a universal approach for detecting on-chain attacks even when there are few or even no new on-chain attack samples. Specifically, an in-depth analysis of the transaction characteristics is conducted, and we propose a new insight to train a generic attack transaction detecting model, i.e., transaction reconstruction. Particularly, to overcome the over-fitting in the transaction reconstruction task, we use the web-scale function comments related to transactions as supervision information, rather than expert-confirmed labels. Experimental results demonstrate that the proposed approach surpasses the supervised state-of-the-art by 13% in AUC, with just 30 known on-chain attack samples. Moreover, without any known attack samples, our method can still detect new on-chain attacks in the wild (with a precision of 61.83%). Among attacks detected in the wild, we confirm 1,692 address poisoning attacks, a new type of on-chain attack targeting token holders. Our code is available at: https://github.com/wuzhy1ng/attack_trans_detection_www25.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Cited by top-tier papers2
- MEVisor: High-Throughput MEV Discovery in DEXs with GPU ParallelismWeimin Chen, Xiapu LuoNDSS 2026 · 1 citation
- TrapHunter: Exposing Covert Pathways in Trap Token ContractsYin Wu, Yixuan Liu, Yi Li, Chenyang Peng et al.ISSTA 2026
Related papers
- Safeguarding Blockchain Ecosystem: Understanding and Detecting Attack Transactions on Cross-chain BridgesJiajing Wu, Kaixin Lin, Dan Lin, Bozhao Zhang et al.WWW 2025 · 20 citations
- Phishing in Wonderland: Evaluating Learning-Based Ethereum Phishing Transaction Detection and PitfallsAhod Alghuried, David MohaisenNDSS 2026 · 4 citations
- Blockchain Address PoisoningTaro Tsuchiya, Jin-Dong Dong, Kyle Soska, Nicolas ChristinUSENIX Security 2025
- Dissecting Payload-based Transaction Phishing on EthereumZhuo Chen, Yufeng Hu, Bowen He, Dong Luo et al.NDSS 2025
- Characterizing Ethereum Address Poisoning AttackShixuan Guan, Kai LiCCS 2024 · 4 citations
