Font Size: a A A

Research On Detection Method Of Ethereum Scam Contract Based On Code Visualization And Res Net

Posted on:2023-12-24Degree:MasterType:Thesis
Country:ChinaCandidate:Z YuanFull Text:PDF
GTID:2568307064970569Subject:Computer technology
Abstract/Summary:
Blockchain technology is an emerging technology with the characteristics of decentralization and high security,and has many applications in the fields of digital currency,logistics,finance and justice.As the largest public chain platform in the blockchain field,the most significant feature of Ethereum is the application of smart contracts,which greatly enriches the blockchain functions.While smart contracts bring great convenience to users,there are also serious security problems such as scam contracts.Scam contracts are attractive,less recognizable and more harmful,which seriously damage the blockchain ecology and cause huge losses to users.In this regard,this paper takes Ethereum smart contracts as the research object,combines code visualization method and deep learning detection technology,and conducts the following research to address the problems of inefficient text representation of smart contract data and low accuracy of scam contract detection:(1)Smart Contract Image Representation(IR)method for smart contracts based on code visualization is proposed.The method firstly takes the byte code of smart contract operation as the object,and extracts the opcode from it by processing it into assembly form with the disassembly rules of Ethereum.Then the smart contract opcodes are cleaned and the mapping rules between opcodes and pixels are established.Finally,based on the mapping rules,the smart contract opcode sequence is transformed into a pixel sequence,and the contract pixel sequence is processed into an adaptive size image.The experimental results show that the average storage size of the IR representation of smart contracts is only 0.238 times that of the text representation,and the contract storage space is smaller.The average information entropy of the IR representation of smart contracts is1.043 times that of the text representation,and the equivalent size data has more information.(2)Designing Critical ResidualNetwork(CResNet)based on ResNet.By analyzing the characteristics of smart contract opcodes,the concept of critical opcodes is proposed and the calculation method of critical opcode weights is given.Based on the critical opcode and the weight value,we construct the critical opcode module,combine the residual structure,and design CResNet.(3)Detection Method of Ethereum Scam Contract Based on Code Visualization and ResNet(CV-R)is proposed.The method first obtains the smart contract bytecode from the Ethereum browser,then processes the contract into image form by IR,and finally detects the Ethereum smart contract by CResNet.The experimental results show that CVR has 98.5% detection accuracy and 94.3% detection completeness for fraudulent contracts,and CResNet detection model has 99.6% accuracy,which is a big improvement compared with existing detection methods.The experimental results show that IR is more efficient than text representation and CV-R is more accurate for detecting Ethereum scam contract.We also conduct relevant experiments in real environment and detect 15 scam contracts outside the dataset to further prove the effectiveness of CV-R.Figure [19] Table [10] Reference [74]...
Keywords/Search Tags:smart contract, scam contract, ethereum, residual network, code visualization
Related items