论文标题
使用AWD-LSTM的智能合约中漏洞的多类分类,并从自然语言处理中启发了预训练的编码器
Multi-Class classification of vulnerabilities in Smart Contracts using AWD-LSTM, with pre-trained encoder inspired from natural language processing
论文作者
论文摘要
智能合约的脆弱性检测和安全性至关重要,因为它们的性质不变。 Oyente和Maian等符号工具通常用于智能合约中的脆弱性预测。由于这些工具在计算上很昂贵,因此它们通常用于检测漏洞,直到一些预定义的调用深度为止。随着调用深度的增加,这些工具需要更多的搜索时间。由于智能合约的数量呈指数增长,因此很难使用这些传统工具来分析合同。最近,一种称为长期记忆(LSTM)的机器学习技术已被用于二进制分类,即预测智能合约是否脆弱。随着调用深度的增加,此技术几乎需要持续的搜索时间。在本文中,我们展示了多级分类,在该分类中,我们将自杀,浪子,贪婪或普通类别的智能合约分类。我们使用平均随机梯度下降权重降低了LSTM(AWD-LSTM),该LSTM是LSTM的变体,用于执行分类。我们通过仅考虑正常合同的独特的OpCode组合来减少类不平衡(与其他类别相比,大量正常合同)。我们的加权平均FBETA得分为90.0%。因此,这种技术可用于分析大量智能合约,并有助于提高这些合同的安全性。
Vulnerability detection and safety of smart contracts are of paramount importance because of their immutable nature. Symbolic tools like OYENTE and MAIAN are typically used for vulnerability prediction in smart contracts. As these tools are computationally expensive, they are typically used to detect vulnerabilities until some predefined invocation depth. These tools require more search time as the invocation depth increases. Since the number of smart contracts is increasing exponentially, it is difficult to analyze the contracts using these traditional tools. Recently a machine learning technique called Long Short Term Memory (LSTM) has been used for binary classification, i.e., to predict whether a smart contract is vulnerable or not. This technique requires nearly constant search time as the invocation depth increases. In the present article, we have shown a multi-class classification, where we classify a smart contract in Suicidal, Prodigal, Greedy, or Normal categories. We used Average Stochastic Gradient Descent Weight-Dropped LSTM (AWD-LSTM), which is a variant of LSTM, to perform classification. We reduced the class imbalance (a large number of normal contracts as compared to other categories) by considering only the distinct opcode combination for normal contracts. We have achieved a weighted average Fbeta score of 90.0%. Hence, such techniques can be used to analyze a large number of smart contracts and help to improve the security of these contracts.