Smart contracts on the blockchain offer decentralized financial services but often lack robust security measures, resulting in significant economic losses. Although substantial research has focused on identifying vulnerabilities, a notable gap remains in evaluating the malicious intent behind their development. To address this, we introduce \textsc{SmartIntentNN} (Smart Contract Intent Neural Network), a deep learning-based tool designed to automate the detection of developers' intent in smart contracts. Our approach integrates a Universal Sentence Encoder for contextual representation of smart contract code, employs a K-means clustering algorithm to highlight intent-related code features, and utilizes a bidirectional LSTM-based multi-label classification network to predict ten distinct types of high-risk intent. Evaluations on a dataset of 10,000 smart contracts demonstrate that \textsc{SmartIntentNN} surpasses all baselines, achieving an F1-score of up to 0.8633. A demo video is available at \url{https://youtu.be/otT0fDYjwK8}.
翻译:区块链上的智能合约为去中心化金融服务提供了可能,但往往缺乏稳健的安全措施,导致重大经济损失。尽管已有大量研究专注于识别漏洞,但在评估智能合约开发背后的恶意意图方面仍存在显著空白。为此,我们提出了SmartIntentNN(智能合约意图神经网络),这是一种基于深度学习的工具,旨在自动化检测智能合约中开发者的意图。我们的方法结合了通用句子编码器以获取智能合约代码的上下文表示,采用K-means聚类算法来突出与意图相关的代码特征,并利用基于双向LSTM的多标签分类网络来预测十种不同类型的高风险意图。在包含10,000个智能合约的数据集上的评估表明,SmartIntentNN超越了所有基线方法,实现了高达0.8633的F1分数。演示视频可在\url{https://youtu.be/otT0fDYjwK8}获取。