A novel method using LSTM-RNN to generate smart contracts code templates for improved usability

Recently, the development of blockchain technology has given us an opportunity to improve the security and trustworthiness of multimedia. With the applications of blockchain technology, smart contracts have been widely used in many industries. However, the current development of smart contracts face...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:Multimedia tools and applications 2023-11, Vol.82 (27), p.41669-41699
Hauptverfasser: Hao, Zhihao, Zhang, Bob, Mao, Dianhui, Yen, Jerome, Zhao, Zhihua, Zuo, Min, Li, Haisheng, Xu, Cheng-Zhong
Format: Artikel
Sprache:eng
Schlagworte:
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:Recently, the development of blockchain technology has given us an opportunity to improve the security and trustworthiness of multimedia. With the applications of blockchain technology, smart contracts have been widely used in many industries. However, the current development of smart contracts faces many challenges. One of the challenges is that the coding process is complicated for developers, leading to unnormalized code and can cause development and maintenance issues. Also, this is an important limitation factor in the development of smart contracts. To solve this problem, this paper proposes a method of generating contract templates based on the Long Short-Term Memory Recurrent Neural Network (LSTM-RNN) to simplify the coding process. First, the contracts available online were crawled, before detecting the vulnerabilities of these contracts. Contracts with less vulnerabilities are used as training data. For better generation effects, the Abstract Syntax Tree (AST) and the word2vec are used to extract the lexical unit sequence features to obtain a word vector in order to analyze the semantics of the code. Afterwards, the generated sequence vector features are fed to LSTM-RNN for template generation. The efficiency of four types of vectorization method models were tested and the results showed that the Skip-Gram+ HS used in this paper achieved the highest performance. In addition, a security test was conducted based on the contracts before and after using the contract templates for normalized coding. The results show that the proposed method is not only a beneficial attempt to combine deep learning with blockchain technology, but also provides an effective guidance for improving the security of smart contracts.
ISSN:1380-7501
1573-7721
DOI:10.1007/s11042-023-14592-x