Method and system for generating smart contract with vulnerabilities based on TreeGAN

A smart contract and vulnerability technology, applied in the field of blockchain technology and deep learning, can solve problems such as unnaturalness, lack of training data, and extensiveness, and achieve the effect of accelerating model convergence and flexible selection.

Active Publication Date: 2021-08-06
HOHAI UNIV
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0007] Purpose of the invention: In view of the lack of training data and the excessive and unnatural way of vulnerability injection technology when deep learning technology is applied in the field of smart contract vulnerability detection, the purpose of this invention is to propose a method to generate natural Solidity smart contract source code method and system

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and system for generating smart contract with vulnerabilities based on TreeGAN
  • Method and system for generating smart contract with vulnerabilities based on TreeGAN
  • Method and system for generating smart contract with vulnerabilities based on TreeGAN

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0039] In order to make the technical means, creative features, goals and effects achieved by the present invention easy to understand, the present invention will be further described below in conjunction with specific embodiments.

[0040] In order to ensure that the generated vulnerability smart contract can pass through the compiler without grammatical errors, the present invention selects TreeGAN as the framework. After determining the type of vulnerability in the generated contract, collect the real vulnerability smart contract data set bugSet on the public platform.

[0041] In order to speed up the convergence, the model needs to be pre-trained first. Considering that most vulnerable contracts only need to modify the characters or positions of one or a few statements, it can be concluded that the environmental information of the vulnerable contract and some real contracts should be similar. Therefore, the pre-training strategy of the present invention is: analyze the s...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to a method and a system for generating a smart contract with vulnerabilities based on a TreeGAN, and belongs to the field of block chain technology and deep learning. The method comprises the steps that a real vulnerability contract data set and a real contract data set similar to vulnerability contract environment characteristics are collected according to vulnerability types needed to be contained in contract generation, and TreeGAN is selected as a training framework, so that the grammar correctness of contract generation is guaranteed. In order to accelerate convergence, the data set is converted into a grammar generation form sequence as input for model pre-training and formal training. Meanwhile, in order to enable the TreeGAN to be better used for vulnerability contract generation, a standard LSTM network is newly added on the basis of an original discriminator and is used for learning vulnerability information, and the input of the network is a statement set which is extracted from the smart contract and is closely related to the vulnerability information. After training is completed, the generator part of the model can be used for generating a natural intelligent contract with correct grammar and specific vulnerabilities.

Description

technical field [0001] The present invention relates to the fields of block chain technology and deep learning, in particular to a method and system for generating source codes of smart contracts with vulnerabilities based on TreeGAN. Background technique [0002] With the development of blockchain technology, many smart contract application platforms such as Ethereum have emerged. A major feature of these platforms is "code is law", which means that even if there are logic loopholes that can be exploited in smart contracts, and As a result, property losses have occurred, and it is difficult for participants to take effective rescue measures. The DAO attack in 2016 almost caused hundreds of millions of dollars in losses. This means that there is a strong demand for vulnerability detection in the field of smart contracts. In addition, in the past few years, deep learning technology has achieved amazing results in various fields. Combining deep learning to detect vulnerabiliti...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F21/57G06N3/04G06N3/08G06F16/27G06Q40/04
CPCG06F21/577G06N3/08G06Q40/04G06F16/27G06N3/044
Inventor 张鹏程邝镇源王奔楚涵婷
Owner HOHAI UNIV
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products