Table of Contents
Fetching ...

SmartIntentNN: Towards Smart Contract Intent Detection

Youwei Huang, Sen Fang, Jianwen Li, Bin Hu, Tao Zhang

TL;DR

This work introduces \textsc{SmartIntentNN} (Smart Contract Intent Neural Network), a deep learning-based tool designed to automate the detection of developers' intent in smart contracts.

Abstract

Smart contracts on the blockchain offer decentralized financial services but often lack robust security measures, leading to significant economic losses. While substantial research has focused on identifying vulnerabilities in smart contracts, 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 categories of unsafe intent. Evaluations on 10,000 real-world smart contracts demonstrate that \textsc{SmartIntentNN} surpasses all baselines, achieving an F1-score of 0.8633. A demo video is available at \url{https://youtu.be/otT0fDYjwK8}.

SmartIntentNN: Towards Smart Contract Intent Detection

TL;DR

This work introduces \textsc{SmartIntentNN} (Smart Contract Intent Neural Network), a deep learning-based tool designed to automate the detection of developers' intent in smart contracts.

Abstract

Smart contracts on the blockchain offer decentralized financial services but often lack robust security measures, leading to significant economic losses. While substantial research has focused on identifying vulnerabilities in smart contracts, 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 categories of unsafe intent. Evaluations on 10,000 real-world smart contracts demonstrate that \textsc{SmartIntentNN} surpasses all baselines, achieving an F1-score of 0.8633. A demo video is available at \url{https://youtu.be/otT0fDYjwK8}.
Paper Structure (13 sections, 4 equations, 3 figures, 1 table)

This paper contains 13 sections, 4 equations, 3 figures, 1 table.

Figures (3)

  • Figure 1: Examples of a smart contract with negative intents. BSC address: 0xDDa7f9273a092655a1cF077FF0155d64000ccE2A.
  • Figure 2: Example of intent highlighting applied to a smart contract. BSC address: 0xE97CBB39487a4B06D9D1dd7F17f7fBBda4c2b9c4.
  • Figure 3: Illustration of intent detection within a smart contract. BSC address: 0xc4F082963E78deAaC10853a220508135505999E6.