Skip to main navigation Skip to search Skip to main content

The Impact of Input Types on Smart Contract Vulnerability Detection Performance Based on Deep Learning: A Preliminary Study

  • Cleveland State University
  • Beihang University
  • University of Science and Technology Beijing

Research output: Contribution to journalArticlepeer-review

6 Scopus citations

Abstract

Stemming vulnerabilities out of a smart contract prior to its deployment is essential to ensure the security of decentralized applications. As such, numerous tools and machine-learning-based methods have been proposed to help detect vulnerabilities in smart contracts. Furthermore, various ways of encoding the smart contracts for analysis have also been proposed. However, the impact of these input methods has not been systematically studied, which is the primary goal of this paper. In this preliminary study, we experimented with four common types of input, including Word2Vec, FastText, Bag-of-Words (BoW), and Term Frequency–Inverse Document Frequency (TF-IDF). To focus on the comparison of these input types, we used the same deep-learning model, i.e., convolutional neural networks, in all experiments. Using a public dataset, we compared the vulnerability detection performance of the four input types both in the binary classification scenarios and the multiclass classification scenario. Our findings show that TF-IDF is the best overall input type among the four. TF-IDF has excellent detection performance in all scenarios: (1) it has the best F1 score and accuracy in binary classifications for all vulnerability types except for the delegate vulnerability where TF-IDF comes in a close second, and (2) it comes in a very close second behind BoW (within 0.8%) in the multiclass classification.
Original languageEnglish
Article number302
JournalInformation (Switzerland)
Volume15
Issue number6
DOIs
StatePublished - Jun 1 2024

Keywords

  • Bag-of-Words
  • FastText
  • Term Frequency–Inverse Document Frequency
  • Word2Vec
  • blockchain
  • smart contract
  • vulnerability detection

Cite this