1. 中山大学软件工程学院,广东 珠海 519082
2. 中山大学计算机学院,广东 广州 510006
[ "林丹(1996- ),女,广东揭阳人,中山大学博士生,主要研究方向为区块链、加密货币、网络科学的理论和应用" ]
[ "林凯欣(2000- ),女,广东广州人,中山大学硕士生,主要研究方向为区块链、智能合约以及加密“货币”" ]
[ "吴嘉婧(1989- ),女,江西吉安人,中山大学副教授,主要研究方向为网络科学、区块链交易网络、网络表示学习" ]
[ "郑子彬(1982- ),男,广东潮州人,中山大学教授,主要研究方向为区块链、大数据、服务计算、机器学习、软件可靠性" ]
网络首发:2022-10,
纸质出版:2022-10-15
移动端阅览
林丹, 林凯欣, 吴嘉婧, 等. 基于字节码的以太坊智能合约分类方法[J]. 网络与信息安全学报, 2022,8(5):111-120.
Dan LIN, Kaixin LIN, Jiajing WU, et al. Bytecode-based approach for Ethereum smart contract classification[J]. Chinese Journal of Network and Information Security, 2022, 8(5): 111-120.
林丹, 林凯欣, 吴嘉婧, 等. 基于字节码的以太坊智能合约分类方法[J]. 网络与信息安全学报, 2022,8(5):111-120. DOI: 10.11959/j.issn.2096-109x.2022046.
Dan LIN, Kaixin LIN, Jiajing WU, et al. Bytecode-based approach for Ethereum smart contract classification[J]. Chinese Journal of Network and Information Security, 2022, 8(5): 111-120. DOI: 10.11959/j.issn.2096-109x.2022046.
近年来,区块链技术已在金融、医疗和政务等领域得到了广泛应用和关注。然而,由于智能合约的不易篡改性和运行环境的特殊性,各类安全问题频繁出现。一方面是合约开发者在编写合约时出现的代码安全问题,另一方面是以太坊出现不少高风险智能合约,普通用户很容易被高风险合约提供的高回报所吸引,但对合约的风险却无从知晓。然而,关于智能合约安全的研究主要集中于代码安全方面,对合约功能识别的研究相对较少。假如能对智能合约功能进行准确分类,将有助于人们更好地理解智能合约的行为,同时保障智能合约生态安全,减少或挽回用户的损失。已有的智能合约分类方法通常依赖于对智能合约开源代码的分析,但以太坊发布的合约仅强制要求部署字节码,且只有极少数合约公布了其开源代码。因此,提出了一种基于字节码的以太坊智能合约分类方法。收集以太坊智能合约字节码和对应类别标签,然后提取操作码频率特征以及控制流图特征;通过实验对特征重要性进行分析,获取适合的图向量维度及最优的分类模型;在交易所、金融、赌博、游戏和高风险5个类别的智能合约多分类任务中进行实验验证,使用XGBoost分类器时的F1值达到0.913 8。实验结果表明所提方法能较好地完成以太坊智能合约的分类任务,并且能够应用于现实中的智能合约类别预测。
In recent years
blockchain technology has been widely used and concerned in many fields
including finance
medical care and government affairs.However
due to the immutability of smart contracts and the particularity of the operating environment
various security issues occur frequently.On the one hand
the code security problems of contract developers when writing contracts
on the other hand
there are many high-risk smart contracts in Ethereum
and ordinary users are easily attracted by the high returns provided by high-risk contracts
but they have no way to know the risks of the contracts.However
the research on smart contract security mainly focuses on code security
and there is relatively little research on the identification of contract functions.If the smart contract function can be accurately classified
it will help people better understand the behavior of smart contracts
while ensuring the ecological security of smart contracts and reducing or recovering user losses.Existing smart contract classification methods often rely on the analysis of the source code of smart contracts
but contracts released on Ethereum only mandate the deployment of bytecode
and only a very small number of contracts publish their source code.Therefore
an Ethereum smart contract classification method based on bytecode was proposed.Collect the Ethereum smart contract bytecode and the corresponding category label
and then extract the opcode frequency characteristics and control flow graph characteristics.The characteristic importance is analyzed experimentally to obtain the appropriate graph vector dimension and optimal classification model
and finally the multi-classification task of smart contract in five categories of exchange
finance
gambling
game and high risk is experimentally verified
and the F1 score of the XGBoost classifier reaches 0.913 8.Experimental results show that the algorithm can better complete the classification task of Ethereum smart contracts
and can be applied to the prediction of smart contract categories in reality.
沈鑫 , 裴庆祺 , 刘雪峰 . 区块链技术综述 [J ] . 网络与信息安全学报 , 2016 , 2 ( 11 ): 11 - 20 .
SHEN X , PEI Q Q , LIU X F . Survey of block chain [J ] . Chinese Journal of Network and Information Security , 2016 , 2 ( 11 ): 11 - 20 .
贺海武 , 延安 , 陈泽华 . 基于区块链的智能合约技术与应用综述 [J ] . 计算机研究与发展 , 2018 , 55 ( 11 ): 2452 - 2466 .
HE H W , YAN A , CHEN Z H . Survey of smart contract technology and application based on blockchain [J ] . Journal of Computer Research and Development , 2018 , 55 ( 11 ): 2452 - 2466 .
付梦琳 , 吴礼发 , 洪征 , 等 . 智能合约安全漏洞挖掘技术研究 [J ] . 计算机应用 , 2019 , 39 ( 7 ): 1959 - 1966 .
FU M L , WU L F , HONG Z , et al . Research on vulnerability mining technique for smart contracts [J ] . Journal of Computer Applications , 2019 , 39 ( 7 ): 1959 - 1966 .
陈伟利 , 郑子彬 . 区块链数据分析:现状、趋势与挑战 [J ] . 计算机研究与发展 , 2018 , 55 ( 9 ): 1853 - 1870 .
CHEN W L , ZHENG Z B . Blockchain data analysis:a review of status,trends and challenges [J ] . Journal of Computer Research and Development , 2018 , 55 ( 9 ): 1853 - 1870 .
NAKAMOTO S . Bitcoin:a peer-to-peer electronic cash system [R ] . 2009 .
张亮 , 刘百祥 , 张如意 , 等 . 区块链技术综述 [J ] . 计算机工程 , 2019 , 45 ( 5 ): 1 - 12 .
ZHANG L , LIU B X , ZHANG R Y , et al . Overview of blockchain technology [J ] . Computer Engineering , 2019 , 45 ( 5 ): 1 - 12 .
BUTERIN V . A next-generation smart contract and decentralized blockchain platform [EB ] .
WU J J , YUAN Q , LIN D , et al . Who are the phishers? phishing scam detection on ethereum via network embedding [J ] . IEEE Transactions on Systems,Man,and Cybernetics:Systems , 2022 , 52 ( 2 ): 1156 - 1166 .
HUANG T , LIN D , WU J J . Ethereum account classification based on graph convolutional network [J ] . IEEE Transactions on Circuits and Systems II:Express Briefs , 2022 , 69 ( 5 ): 2528 - 2532 .
LIN D , WU J J , YUAN Q , et al . Modeling and understanding ethereum transaction records via a complex network approach [J ] . IEEE Transactions on Circuits and Systems II:Express Briefs , 2020 , 67 ( 11 ): 2737 - 2741 .
吴嘉婧 , 刘洁利 , 林丹 , 等 . 区块链交易网络研究综述 [J ] . 中山大学学报(自然科学版) , 2021 , 60 ( 5 ): 1 - 12 .
WU J J , LIU J L , LIN D , et al . Blockchain transaction networks:a survey [J ] . Acta Scientiarum Naturalium Universitatis Sunyatseni , 2021 , 60 ( 5 ): 1 - 12 .
黄步添 , 刘琦 , 何钦铭 , 等 . 基于语义嵌入模型与交易信息的智能合约自动分类系统 [J ] . 自动化学报 , 2017 , 43 ( 9 ): 1532 - 1543 .
HUANG B T , LIU Q , HE Q M , et al . Towards automatic smart-contract codes classification by means of word embedding model and transaction information [J ] . Acta Automatica Sinica , 2017 , 43 ( 9 ): 1532 - 1543 .
SHI C , XIANG Y , DOSS R , et al . A bytecode-based approach for smart contract classification [J ] . arXiv preprint arXiv:2106.15497 , 2021 .
CHEN W L , ZHENG Z B , CUI J H , et al . Detecting ponzi schemes on Ethereum:towards healthier blockchain technology [C ] // Proceedings of the 2018 World Wide Web Conference . 2018 : 1409 - 1418 .
HU T , LIU X L , CHEN T , et al . Transaction-based classification and detection approach for Ethereum smart contract [J ] . Information Processing & Management , 2021 , 58 ( 2 ): 102462 .
ZHENG P L , ZHENG Z B , WU J J , et al . XBlock-ETH:extracting and exploring blockchain data from Ethereum [J ] . IEEE Open Journal of the Computer Society , 2020 , 1 : 95 - 106 .
CONTRO F , CROSARA M , CECCATO M , et al . EtherSolve:computing an accurate control-flow graph from Ethereum bytecode [C ] // Proceedings of 2021 IEEE/ACM 29th International Conference on Program Comprehension (ICPC) . 2021 : 127 - 137 .
NARAYANAN A , CHANDRAMOHAN M , VENKATESAN R , et al . Graph2vec:learning distributed representations of graphs [J ] . arXiv preprint arXiv:1707.05005 , 2017 .
LAU J H , BALDWIN T . An empirical evaluation of doc2vec with practical insights into document embedding generation [J ] . arXiv preprint arXiv:1607.05368 , 2016 .
SHERVASHIDZE N , SCHWEITZER P , VAN LEEUWEN E J , et al . Weisfeiler-Lehman graph kernels [J ] . Journal of Machine Learning Research , 2011 , 12 ( 9 ).
CHEN T , HE T , BENESTY M , et al . XGBoost:extreme gradient boosting [J ] . R Package Version 0.4-2 , 2015 , 1 ( 4 ): 1 - 4 .
SAFAVIAN S R , LANDGREBE D . A survey of decision tree classifier methodology [J ] . IEEE Transactions on Systems,Man,and Cybernetics , 1991 , 21 ( 3 ): 660 - 674 .
BELGIU M , DRĂGUŢ L , . Random forest in remote sensing:a review of applications and future directions [J ] . ISPRS Journal of Photogrammetry and Remote Sensing , 2016 , 114 : 24 - 31 .
RISH I , . An empirical study of the naive bayes classifier [C ] // IJCAI 2001 Workshop on Empirical Methods in Artificial Intelligence . 2001 : 41 - 46 .
SCHULDT C , LAPTEV I , CAPUTO B . Recognizing human actions:a local SVM approach [C ] // Proceedings of the 17th International Conference on Pattern Recognition . 2004 : 32 - 36 .
RAO H D , SHI X Z , RODRIGUE A K , et al . Feature selection based on artificial bee colony and gradient boosting decision tree [J ] . Applied Soft Computing , 2019 , 74 : 634 - 642 .
0
浏览量
454
下载量
0
CSCD
关联资源
相关文章
相关作者
相关机构
京公网安备11010802024621