Accurate Identification of Smart Contract Attack Paths Based on Large Language Models
摘要
With the widespread adoption of blockchain technology, smart contract security issues have become increasingly prominent, making precise identification of attack paths a critical challenge for blockchain system security. Existing methods struggle to efficiently locate key attack paths when dealing with complex contract interactions and large-scale transaction data. This research proposes a precise attack path identification method based on large language models (LLMs), integrating semantic analysis of smart contract code with dynamic transaction data association, constructing a multi-layer architecture that utilizes pre-trained LLMs for deep semantic encoding of contract code and transaction sequences, combines graph structure modeling of contract call relationships, and captures cross-transaction temporal dependencies through attention mechanisms. Experimental results across ten representative attack cases show the LLM-based method achieves 87.2% accuracy and 81.5% recall, outperforming traditional graph analysis methods by 21.9% and 24.1% respectively, reducing analysis time from an average of 210 to 68 s, providing efficient technical support for smart contract security auditing and vulnerability remediation. This research establishes a new paradigm for applying LLMs in blockchain security, contributing to more robust smart contract protection systems.