Lune

NeurIPS2025Top-tier venue

BlockScan: Detecting Anomalies in Blockchain Transactions

Jiahao Yu, Xian Wu, Hao Liu, Wenbo Guo, Xinyu Xing

Abstract

We propose BlockScan, a customized Transformer for anomaly detection in blockchain transactions. Unlike existing methods that rely on rule-based systems or directly apply off-the-shelf large language models (LLMs), BlockScan introduces a series of customized designs to effectively model the unique data structure of blockchain transactions. First, a blockchain transaction is multi-modal, containing blockchain-specific tokens, texts, and numbers. We design a novel modularized tokenizer to handle these multi-modal inputs, balancing the information across different modalities. Second, we design a customized masked language modeling mechanism for pretraining the Transformer architecture, incorporating RoPE embedding and FlashAttention for handling longer sequences. Finally, we design a novel anomaly detection method based on the model outputs. We further provide theoretical analysis for the detection method of our system. Extensive evaluations on Ethereum and Solana transactions demonstrate BlockScan's exceptional capability in anomaly detection while maintaining a low false positive rate. Remarkably, BlockScan is the only method that successfully detects anomalous transactions on Solana with high accuracy, whereas all other approaches achieved very low or zero detection recall scores. This work sets a new benchmark for applying Transformer-based approaches in blockchain data analysis.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • LongLoRA: Efficient Fine-tuning of Long-Context Large Language Models cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on9

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
  2. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra et al.NeurIPS 2022 · 5,493 citations
  3. Deberta: decoding-Enhanced Bert with Disentangled AttentionPengcheng He, Xiaodong Liu, Jianfeng Gao, Weizhu ChenICLR 2021 · 3,729 citations
  4. Anomaly Detection in Time Series: A Comprehensive EvaluationSebastian Schmidl, Phillip Wenig, Thorsten PapenbrockVLDB 2022 · 578 citations
  5. LongLoRA: Efficient Fine-tuning of Long-Context Large Language ModelsYukang Chen, Shengju Qian, Haotian Tang, Xin Lai et al.ICLR 2024 · 254 citations

Related papers

  1. Can LLMs Find a Needle in a Haystack? A Look at Anomaly Detection Language ModelingLeslie Barrett, Vikram Sunil Bajaj, Robert J. KinganEMNLP Findings 2025 · 1 citation
  2. OctopusGuard: K-Line Enhanced Token Scam Detector Powered by Multimodal LLMsLitong Sun, YangTian Mi, Xiapu Luo, Weigang WuICSE 2026
  3. GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program AnalysisYuqiang Sun, Daoyuan Wu, Yue Xue, Han Liu et al.ICSE 2024 · 131 citations
  4. ZipZap: Efficient Training of Language Models for Large-Scale Fraud Detection on BlockchainSihao Hu, Tiansheng Huang, Ka-Ho Chow, Wenqi Wei et al.WWW 2024 · 33 citations
  5. BERT4ETH: A Pre-trained Transformer for Ethereum Fraud DetectionSihao Hu, Zhen Zhang, Bingqiao Luo, Shengliang Lu et al.WWW 2023 · 97 citations
Dusk over the sea between two cliffs drawn in fine vertical lines