Papers1 provider · 1 record
December 8, 2025· Journal of Computer Science and Frontier Technologies
article
Open access

Vulnerability Detection of Blockchain Smart Contracts Based on GNN with Multi-Head Attention Mechanism

Authors:Xin Du *

Abstract

Smart contracts have been widely applied in various fields. Due to the immuta-bility of data on the blockchain, it is of great significance to conduct smart con-tract vulnerability detection before data is uploaded to the chain. To address the problems of low accuracy and single vulnerability type in traditional detection methods, a blockchain smart contract vulnerability detection method based on Graph Neural Network (GNN) is proposed. This method abstracts the functions and key code segments in smart contracts into nodes in a graph, and constructs edges by leveraging data and control dependencies during code execution, thereby accurately depicting the specific graph structures of reentrancy attacks and timestamp-dependent vulnerabilities. To further enhance the model’s sensi-tivity to key vulnerability patterns, the multi-head attention mechanism is in-novatively introduced, which can effectively screen out the nodes and edges that contribute the most to vulnerability detection, suppress irrelevant or noisy information, and significantly improve the accuracy and robustness of vulnera-bility detection. Experimental results show that the proposed method achieves an accuracy of 85.19% in reentrancy vulnerability detection and 82.37% in timestamp-dependent vulnerability detection, demonstrating excellent vulner-ability identification capability.

Community

0 comments
Use Connect Wallet in the navigation

No discussion yet

Be the first to share a question or observation.