The invention discloses a graph neural network-based intelligent contract
bytecode similarity detection method, which comprises the following steps of: performing disassembling operation on Ethereum
virtual machine bytecodes, and performing
data flow analysis and
control flow analysis on disassembling results to obtain a data flow graph and a
control flow graph corresponding to the bytecodes; combining the
data flow diagram and the
control flow diagram of each external function into a
byte code characteristic diagram; a large number of intelligent contracts with similar labels are adopted to
train a graph neural network, vectorization operation is performed on the
byte code feature graph in the training process, and feature vectors are obtained; and taking the problem contract as a reference
smart contract, respectively inputting the
bytecode feature maps of the reference
smart contract and the to-be-detected
smart contract into the trained graph neural network to respectively obtain corresponding feature vectors, comparing the
Euclidean distance of the two feature vectors, and measuring to obtain the similarity of the
bytecode of the two smart contracts. Compared with a traditional method, the method has higher accuracy, problem contracts can be effectively recognized, and the safety of a block
chain system is enhanced.