Journal on Communications ›› 2023, Vol. 44 ›› Issue (9): 161-172.doi: 10.11959/j.issn.1000-436x.2023178

• Papers • Previous Articles    

Honeypot contract detection method for Ethereum based on source code structure and graph attention network

Youwei WANG1, Yudong HOU1, Lizhou FENG2   

  1. 1 School of Information, Central University of Finance and Economics, Beijing 102206, China
    2 School of Statistics, Tianjin University of Finance and Economics, Tianjin 300222, China
  • Revised:2023-09-04 Online:2023-09-01 Published:2023-09-01
  • Supported by:
    The Ministry of Education of Humanities and Social Science Project(19YJCZH178);The National Natural Science Foundation of China(61906220);The National Social Science Foundation of China(18CTJ008)

Abstract:

To address the problems of low accuracy and poor generalization of current honeypot contract detection methods, a honeypot contract detection method for Ethereum based on source code structure and graph attention network was proposed.Firstly, in order to extract the structural information of the Solidity source code of the smart contract, the source code was parsed and converted into an XML parsing tree.Then, a set of feature words that could express the structural and content characteristics of the contract was selected, and the contract source code structure graph was constructed.Finally, in order to avoid the impact of dataset imbalance, the concepts of teacher model and student model were introduced based on the ensemble learning theory.Moreover, the graph attention network model was trained from the global and local perspectives, respectively, and the outputs of all models were fused to obtain the final contract detection result.The experiments demonstrate that CSGDetector has higher honeypot detection capability than the existing method KOLSTM, with increments of 1.27% and 7.21% on F1 measurement in two-class classification and multi-class classification experiments, respectively.When comparing with the existing method XGB, the average recall rate of CSGDetector in the masked honeypot detection experiments for different types of honeypot contracts is improved by 7.57%, which verifies the effectiveness of the method in improving the generalization performance of the algorithm.

Key words: Ethereum, honeypot contract, source code structure, graph attention network, ensemble learning

CLC Number: 

No Suggested Reading articles found!