Javascript must be enabled to continue!
Smart contract generation model based on code annotation and AST-LSTM tuning
View through CrossRef
Abstract
With the wide application of smart contracts in many fields, the number, types, and complexity of smart contracts are showing a rapidly increasing trend. However , the development of smart contracts has its own unique programming language and security requirements, which are difficult for conventional software personnel to adapt to quickly, and how to realize the efficient development of smart contracts according to the application requirements is an important issue that needs to be solved for its further development. To this end, this paper proposes a smart contract generation method based on AST-LSTM characterization and code annotation tuning large language model, which adopts AST-LSTM model combining Abstract Syntax Tree (AST) and Tree-LSTM to vectorize the code as well as Sentence-Bert to vectorize the annotations and carry out a weighted analysis, and constructs a smart contract clustering analysis model to achieve accurate clustering of functionally similar smart contracts. Then the AST-LSTM+Transformer model is used to detect defects in the clustered code and correlate the related annotation information to construct a diverse Prompt feature prompt statement dataset. Finally, the LLaMA2-7B model is used as the basis for demand-specific smart contract generation with the help of Lora and P-Tuning v2 fine-tuning techniques. In this paper, with the help of BLEU, an auxiliary tool for bilingual translation quality assessment, and Mythril, VaaS, 1 and other code security detection tools, we conducted comparative experiments with existing methods. The results of the experiment show that the average value of BLEU of the code generated by this paper’s method is improved by about 25%, and the code security is improved by about 9%, which will greatly promote the rapid development and exploitation of smart contracts with high-security requirements.
Springer Science and Business Media LLC
Title: Smart contract generation model based on code annotation and AST-LSTM tuning
Description:
Abstract
With the wide application of smart contracts in many fields, the number, types, and complexity of smart contracts are showing a rapidly increasing trend.
However , the development of smart contracts has its own unique programming language and security requirements, which are difficult for conventional software personnel to adapt to quickly, and how to realize the efficient development of smart contracts according to the application requirements is an important issue that needs to be solved for its further development.
To this end, this paper proposes a smart contract generation method based on AST-LSTM characterization and code annotation tuning large language model, which adopts AST-LSTM model combining Abstract Syntax Tree (AST) and Tree-LSTM to vectorize the code as well as Sentence-Bert to vectorize the annotations and carry out a weighted analysis, and constructs a smart contract clustering analysis model to achieve accurate clustering of functionally similar smart contracts.
Then the AST-LSTM+Transformer model is used to detect defects in the clustered code and correlate the related annotation information to construct a diverse Prompt feature prompt statement dataset.
Finally, the LLaMA2-7B model is used as the basis for demand-specific smart contract generation with the help of Lora and P-Tuning v2 fine-tuning techniques.
In this paper, with the help of BLEU, an auxiliary tool for bilingual translation quality assessment, and Mythril, VaaS, 1 and other code security detection tools, we conducted comparative experiments with existing methods.
The results of the experiment show that the average value of BLEU of the code generated by this paper’s method is improved by about 25%, and the code security is improved by about 9%, which will greatly promote the rapid development and exploitation of smart contracts with high-security requirements.
Related Results
The impact of organic rice contract farming on farmers' livelihood and land tenure in Cambodia : a case study in Kampong Speu province
The impact of organic rice contract farming on farmers' livelihood and land tenure in Cambodia : a case study in Kampong Speu province
This study examines organic rice contract farming in Cambodia and its impact on farmers‟ livelihood and land tenure. The study‟s objective is to gain a better insight of the terms ...
Joint Beamforming and Aerial IRS Positioning Design for IRS-assisted MISO System with Multiple Access Points
Joint Beamforming and Aerial IRS Positioning Design for IRS-assisted MISO System with Multiple Access Points
<p><code>Intelligent reflecting surface (IRS) is a promising concept for </code><code><u>6G</u></code><code> wireless communications...
Joint Beamforming and Aerial IRS Positioning Design for IRS-assisted MISO System with Multiple Access Points
Joint Beamforming and Aerial IRS Positioning Design for IRS-assisted MISO System with Multiple Access Points
<p><code>Intelligent reflecting surface (IRS) is a promising concept for </code><code><u>6G</u></code><code> wireless communications...
Generative AI-Driven Smart Contract Optimization for Secure and Scalable Smart City Services
Generative AI-Driven Smart Contract Optimization for Secure and Scalable Smart City Services
Smart cities use advanced infrastructure and technology to improve the quality of life for their citizens. Collaborative services in smart cities are making the smart city ecosyste...
Prediction of COVID-19 Data Using an ARIMA-LSTM Hybrid Forecast Model
Prediction of COVID-19 Data Using an ARIMA-LSTM Hybrid Forecast Model
The purpose of this study is to study the spread of COVID-19, establish a predictive model, and provide guidance for its prevention and control. Considering the high complexity of ...
Marriage agreement and inheritance agreement: comparative legal analysis
Marriage agreement and inheritance agreement: comparative legal analysis
In the scientific article the author conducted a comparative legal analysis between a marriage contract and an inheritance contract. The concept, legal nature, peculiarities of con...
Digitally topological groups
Digitally topological groups
<abstract><p>The purpose of the paper is to study digital topological versions of typical topological groups. In relation to this work, given a digital image $ (X, k), ...
High-precision blood glucose prediction and hypoglycemia warning based on the LSTM-GRU model
High-precision blood glucose prediction and hypoglycemia warning based on the LSTM-GRU model
Objective: The performance of blood glucose prediction and hypoglycemia warning based on the LSTM-GRU (Long Short Term Memory - Gated Recurrent Unit) model was evaluated. Methods: ...

