Return
Smart contract vulnerability detection using opcode sequences with variable length
DOI:10.1007/s10115-026-02867-2.png)
Abstract
En 中文
Smart contracts represent a cornerstone of blockchain technology, enabling key applications in cryptocurrencies and decentralized finance (DeFi). Nevertheless, the inherent complexity in developing smart contracts frequently introduces severe security vulnerabilities. Compounding this issue, smart contracts become immutable upon deployment, exposing users and participants to substantial financial losses and risks. Consequently, vulnerability detection and security auditing emerge as imperative tasks. Existing deep learning-based vulnerability detection approaches are constrained to fixed-length input sequences, offering no effective mechanism for handling the variable-length opcode sequences derived from transaction executions. This limitation often results in data truncation, which compromises detection accuracy by discarding critical information. To overcome this challenge, a novel neural network model is proposed that accommodates variable-length input sequences. Opcode sequences are acquired through transaction replay as the dataset. Variable-length opcode sequences are processed using the ChordMixer architecture to preserve complete sequence information and extract global features. Additionally, a retention mechanism is integrated into the network to identify salient local features. This combined emphasis on global and local sequence information facilitates more precise security analysis and vulnerability prediction in smart contracts. Extensive experimental validation confirms the model’s efficacy, attaining 93.5% accuracy and 90.6% F1-score across seven vulnerability types. The approach advances the state-of-the-art by enabling truncation-free processing of long sequences, demonstrating superior performance over baselines reliant on fixed inputs.
Keywords:
Blockchain
Vulnerability detection
Smart contracts
Opcode sequences
Deep learning
Journal
IF:
3.1
Papers:
568
Citations:
5.2K

