BlockScan: Detecting Anomalies in Blockchain Transactions

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Yu, Jiahao, Wu, Xian, Liu, Hao, Guo, Wenbo, Xing, Xinyu
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866909859053568000
author Yu, Jiahao
Wu, Xian
Liu, Hao
Guo, Wenbo
Xing, Xinyu
author_facet Yu, Jiahao
Wu, Xian
Liu, Hao
Guo, Wenbo
Xing, Xinyu
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2410_04039
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle BlockScan: Detecting Anomalies in Blockchain Transactions
Yu, Jiahao
Wu, Xian
Liu, Hao
Guo, Wenbo
Xing, Xinyu
Cryptography and Security
Artificial Intelligence
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.
title BlockScan: Detecting Anomalies in Blockchain Transactions
topic Cryptography and Security
Artificial Intelligence
url https://arxiv.org/abs/2410.04039