# SmartIntentNN: Towards Smart Contract Intent Detection

**Authors:** Youwei Huang, Tao Zhang, Sen Fang, Youshuai Tan  
**arXiv:** [2211.13670](https://arxiv.org/abs/2211.13670)  
**Date:** 2022-11-24  
**Summary page:** https://www.summarizepaper.com/en/paper/2211.13670v2/

## Key points

- Smart contracts are popular but pose significant security risks
- Malicious smart contracts can cause financial losses to users
- Manual audits are currently the only way to identify unfriendly smart contracts
- SmartIntentNN is a deep learning-based tool that automates the process of detecting developers' intent in smart contracts
- SmartIntentNN predicts functions' intent and displays high-probability intent labels in red background and low-probability ones in green font
- SmartIntentNN achieved an f1-score of 0.8212, which was 5% higher than that of BiLSTM and 9% higher than that of CNN
- The researchers used a BiLSTM layer to understand the context of smart contracts both forward and backward and further strengthened those code representations with strong intent using an intent highlight model
- All variants of SmartIntentNN achieved an f1-score of more than 0.8 except for the model using an intent highlight scale of 10×, which was slightly lower than the best variant but still higher than other models.
- SmartIntentNN is a promising automated tool based on deep learning techniques that detects malicious intents in smart contracts accurately
- It saves human resources by automating the process while providing better results compared to traditional methods like manual audits or typical baseline models like LSTM or CNN
- This tool can help prevent significant financial losses to users caused by malicious smart contracts

## Summary

Smart contracts have become increasingly popular in recent years, but they also pose significant security risks. While researchers have focused on detecting vulnerabilities in smart contracts, the more pressing concern is the intent of developers who write them. Malicious smart contracts can cause substantial financial losses to users, and manual audits are currently the only way to identify unfriendly ones. To address this issue, a team of researchers has proposed SmartIntentNN (Smart Contract Intent Neural Network), a deep learning-based tool that automates the process of detecting developers' intent in smart contracts. The tool uses a text area where users can input or copy the real smart contract source code. SmartIntentNN then predicts functions' intent and displays high-probability intent labels in red background and low-probability ones in green font. The researchers evaluated SmartIntentNN's performance against typical baselines such as LSTM, BiLSTM, and CNN models. They found that SmartIntentNN achieved an f1-score of 0.8212, which was 5% higher than that of BiLSTM and 9% higher than that of CNN. The researchers used a BiLSTM layer to understand the context of smart contracts both forward and backward and further strengthened those code representations with strong intent using an intent highlight model. There were two variants of the intent highlight model: 4×scale (µ = 4) and 10×scale (µ = 10). All variants of SmartIntentNN achieved an f1-score of more than 0.8 except for the model using an intent highlight scale of 10×, which was slightly lower than the best variant but still higher than other models. In conclusion, SmartIntentNN is a promising automated tool based on deep learning techniques that detects malicious intents in smart contracts accurately. It saves human resources by automating the process while providing better results compared to traditional methods like manual audits or typical baseline models like LSTM or CNN. This tool can help prevent significant financial losses to users caused by malicious smart contracts.
