With the booming development of blockchain technology, smart contracts have been widely used in finance, supply chain, Internet of things and other fields in recent years. However, the security problems of smart contracts become increasingly prominent. Security events caused by smart contracts occur frequently, and the existence of malicious codes may lead to the loss of user assets and system crash. In this paper, a simple study is carried out on malicious code detection of intelligent contracts based on machine learning. The main research work and achievements are as follows: Feature extraction and vectorization of smart contract are the first step to detect malicious code of smart contract by using machine learning method, and feature processing has an important impact on detection results. In this paper, an opcode vectorization method based on smart contract text is adopted. Based on considering the structural characteristics of contract opcodes, the opcodes are classified and simplified. Then, N-Gram (N=2) algorithm and TF-IDF algorithm are used to convert the simplified opcodes into vectors, and then put into the machine learning model for training. In contrast, N-Gram algorithm and TF-IDF algorithm are directly used to quantify opcodes and put into the machine learning model training. Judging which feature extraction method is better according to the training results. Finally, the classifier chain is applied to the intelligent contract malicious code detection.


翻译:随着区块链技术的蓬勃发展,近年来智能合约在金融、供应链、物联网等领域得到了广泛应用。然而,智能合约的安全问题日益突出,由其引发的安全事件频发,恶意代码的存在可能导致用户资产损失与系统崩溃。本文基于机器学习对智能合约恶意代码检测进行了初步研究。主要研究工作与成果如下:智能合约的特征提取与向量化是利用机器学习方法检测其恶意代码的首要步骤,特征处理对检测结果具有重要影响。本文采用了一种基于智能合约文本的操作码向量化方法。在考虑合约操作码结构特征的基础上,对操作码进行分类与简化。随后,利用N-Gram(N=2)算法与TF-IDF算法将简化后的操作码转化为向量,再输入机器学习模型进行训练。作为对比,直接使用N-Gram算法与TF-IDF算法对操作码进行量化并投入机器学习模型训练。根据训练结果判断何种特征提取方法更优。最后,将分类器链应用于智能合约恶意代码检测。

0
下载
关闭预览

相关内容

《基于动态图神经网络的恶意软件检测》
专知会员服务
14+阅读 · 1月28日
《深度学习代码智能》综述、基准和工具集
专知会员服务
56+阅读 · 2024年1月2日
《使用静态污点分析检测恶意代码》CMU最新30页slides
专知会员服务
21+阅读 · 2023年10月11日
人工智能的逆向工程--反向智能研究综述
专知会员服务
53+阅读 · 2023年1月22日
专知会员服务
19+阅读 · 2021年6月10日
专知会员服务
34+阅读 · 2021年5月8日
深度学习赋能的恶意代码攻防研究进展
专知会员服务
30+阅读 · 2021年4月11日
《人工智能安全测评白皮书》,99页pdf
专知
36+阅读 · 2022年2月26日
智能合约的形式化验证方法研究综述
专知
16+阅读 · 2021年5月8日
【智能金融】机器学习在反欺诈中应用
产业智能官
35+阅读 · 2019年3月15日
智能时代如何构建金融反欺诈体系?
数据猿
12+阅读 · 2018年3月26日
动手写机器学习算法:异常检测 Anomaly Detection
七月在线实验室
11+阅读 · 2017年12月8日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员