IEEE Access (Jan 2020)

Smart Contract Classification With a Bi-LSTM Based Approach

  • Gang Tian,
  • Qibo Wang,
  • Yi Zhao,
  • Lantian Guo,
  • Zhonglin Sun,
  • Liangyu Lv

DOI
https://doi.org/10.1109/ACCESS.2020.2977362
Journal volume & issue
Vol. 8
pp. 43806 – 43816

Abstract

Read online

With the number of smart contracts growing rapidly, retrieving the relevant smart contracts quickly and accurately has become an important issue. A key step for recognizing the related smart contracts is able to classify them accurately. Different from traditional text, the smart contract is composed of several parts: source code, code comments and other useful information like account information. How to make good use of those different kinds of features for effective classification is a problem need to be solved. Inspired by this, we proposed a smart contract classification approach based on Bi-LSTM model and Gaussian LDA, which can use a variety of information as inputs of the model, including source code, comments, tags, account and other content information. Bi-LSTM is utilized to capture grammar rules and context information in source code, while Gaussian LDA model is employed to generate comments feature where the semantics of the comments are enriched by embeddings. We also use attention mechanism to focus on the more relevant features in smart contracts for tags and fuse account information to provide additional information for classification. The experimental results show that the classification performance of the proposed model is superior to other baseline models.

Keywords