Blockchain Large Language Models
Authors:
Preprint
Abstract
This paper presents a dynamic, real-time approach to detecting anomalous blockchain transactions. The proposed tool, BlockGPT, generates tracing representations of blockchain activity and trains from scratch a large language model to act as a real-time Intrusion Detection System. Unlike traditional methods, BlockGPT is designed to offer an unrestricted search space and does not rely on predefined rules or patterns, enabling it to detect a broader range of anomalies. We demonstrate the effectiveness of BlockGPT through its use as an anomaly detection tool for Ethereum transactions. In our experiments, it effectively identifies abnormal transactions among a dataset of 68M transactions and has a batched throughput of 2284 transactions per second on average. Our results show that, BlockGPT identifies abnormal transactions by ranking 49 out of 124 attacks among the top-3 most abnormal transactions interacting with their victim contracts. This work makes contributions to the field of blockchain transaction analysis by introducing a custom data encoding compatible with the transformer architecture, a domain-specific tokenization technique, and a tree encoding method specifically crafted for the Ethereum Virtual Machine (EVM) trace representation.Keywords
All Related Versions
This publication has 14 references indexed in Scilit:
- SoK: Decentralized Finance (DeFi) Attacks2023
- On the Just-In-Time Discovery of Profit-Generating Transactions in DeFi Protocols2021
- Oracle-Supported Dynamic Exploit Generation for Smart ContractsIEEE Transactions on Dependable and Secure Computing, 2020
- Blockchain without Waste: Proof-of-StakeThe Review of Financial Studies, 2020
- Detecting nondeterministic payment bugs in Ethereum smart contractsProceedings of the ACM on Programming Languages, 2019
- Slither: A Static Analysis Framework for Smart Contracts2019
- MadMax: surviving out-of-gas conditions in Ethereum smart contractsProceedings of the ACM on Programming Languages, 2018
- The Bayesian information criterion: background, derivation, and applicationsWIREs Computational Statistics, 2011
- ScalaTrace: Scalable compression and replay of communication traces for high-performance computingJournal of Parallel and Distributed Computing, 2009
- Maximum Likelihood from Incomplete Data Via the EM AlgorithmJournal of the Royal Statistical Society Series B: Statistical Methodology, 1977