Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Intelligent contract similarity retrieval method and system based on stack instruction sequence

A technology of smart contracts and retrieval systems, used in instruments, software maintenance/management, reverse engineering, etc.

Pending Publication Date: 2020-07-28
INST OF COMPUTING TECH CHINESE ACAD OF SCI
View PDF11 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The purpose of the present invention is to solve the similarity calculation problem of smart contracts, and proposes a method and system for similarity retrieval of smart contracts based on stack instruction sequences

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
  • Intelligent contract similarity retrieval method and system based on stack instruction sequence
  • Intelligent contract similarity retrieval method and system based on stack instruction sequence
  • Intelligent contract similarity retrieval method and system based on stack instruction sequence

Examples

Experimental program
Comparison scheme
Effect test

example 1 00

[0052] Example 1 2000002,0x2BD2326c993DFaeF84f696526064FF22eba5b362,

[0053] PUSH1 PUSH1 MSTORE CALLDATASIZE ISZERO PUSH1 JUMPI PUSH1 PUSH1 EXPPUSH1 CALLDATALOAD DIV PUSH4 DUP2 EQ PUSH1 JUMPI JUMPDEST PUSH1 PUSH1 SLOADPUSH1 AND DUP2 JUMP JUMPDEST ISZERO ISZERO PUSH1 PUSHNAPRE DUP2 MSTO

example 2 000

[0054] Example 2 2000013,0xBFC39b6F805a9E40E77291afF27aeE3C96915BDD,

[0055] PUSH1 PUSH1 MSTORE CALLDATASIZE ISZERO PUSH1 JUMPI JUMPDEST PUSH1JUMPDEST PUSH1 PUSH1 SWAP1 SLOAD SWAP1 PUSH2 EXP SWAP1 DIV PUSH20 AND PUSH20AND PUSH1 CALLVALUE PUSH1 MLOAD DUP1 SWAP1 POP PUSH1 PUSH1 MLOAD DUP1 DUP4SUB DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO PUSH1 JUMPI PUSH32PUSH1 PUSH1 SWAP1 SLOAD SWAP1 PUSH2 EXP SWAP1 DIV PUSH20 AND PUSH1 MLOAD DUP1DUP3 PUSH20 AND DUP2 MSTORE PUSH1 ADD SWAP2 POP POP PUSH1 MLOAD DUP1 SWAP2SUB SWAP1 LOG1 PUSH1 JUMP JUMPDEST JUMPDEST JUMP JUMPDEST STOP

[0056] Formally speaking, the instruction sequence of contract c is S c =(s 1 ,s 2 ,...,s N ), S c The length is N. For example 1, c=0x2BD2326c993DFaeF84f696526064FF22eba5b362, N=36, s 1 =s 2 =PUSH1,s 36 =RETURN.

[0057] Next, design a deep neural network model to learn instruction sequences, such as figure 1 As shown, the whole model can be divided into four layers, which are input layer, en...

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 provides an intelligent contract similarity retrieval method and system based on a stack instruction sequence. The method comprises the steps of obtaining a stack instruction sequence when a to-be-detected intelligent contract is executed on an Ethereum virtual machine, modeling the stack instruction sequence through a neural network to vectorize the intelligent contract to obtain vector representation of the intelligent contract, and obtaining the intelligent contract most similar to the vector representation through vector similarity analysis and retrieval. The vector similarity analysis can be used as a basis for security detection.

Description

technical field [0001] The invention relates to block chain smart contract modeling, and in particular to a smart contract similarity retrieval method and system based on stack instruction sequences. Background technique [0002] Existing smart contract analysis tools are mainly based on smart contract codes and bytecodes. Studies have shown that after comparing code blocks, more than 96% of existing smart contract codes have similar redundant lines, which will lead to differences in functions. The similarity of contracts increases, so the comparison at the code level cannot measure the similarity between contracts well. Contents of the invention [0003] The purpose of the present invention is to solve the similarity calculation problem of smart contracts, and proposes a smart contract similarity retrieval method and system based on stack instruction sequences. [0004] Aiming at the deficiencies of the prior art, the present invention proposes a similarity retrieval met...

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/57G06F8/75G06F40/194G06N3/04
CPCG06F21/577G06F8/75G06F2221/033G06N3/044G06N3/045
Inventor 柳阳敖翔庄福振罗平何清
Owner INST OF COMPUTING TECH CHINESE ACAD OF SCI
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products