Method for detecting inconsistent behaviors in Ethereum token transaction

A detection method and technology of Ethereum, applied in the field of detection of inconsistent behavior in Ethereum token transactions, can solve the problems of inconsistent contract code implementation, inconsistent semantics, and easy to generate false positives, so as to avoid insufficient effective information and coverage. high effect

Pending Publication Date: 2020-02-07
UNIV OF ELECTRONIC SCI & TECH OF CHINA
View PDF0 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

These methods have the following disadvantages: (1) The method code identification scheme is easy to generate false positives. For example, if a certain constant in the smart contract code is equal to the code of the standard interface, false positives will be generated
(3) Neither method can detect cross-contract collaboration token transaction behavior
(4) The focus of the two methods is only to identify whether a smart contract is a token contract, and does not identify whether the implementation of the token contract meets the standards
[0004] In the document "Network Analysis of ERC20 Tokens Trading on Ethereum Blockchain", Somin and others analyzed the Transfer event to identify the transaction behavior of the token and then analyzed the transaction network. This method has the following problems: The Transfer event does not necessarily reflect the real token Behavior, contract code implementation that does not conform to the standard can cause the Transfer event to be completely different from the real token transaction behavior. Somin et al. did not pay attention to whether the implementation of the Transfer event is inconsistent with the definition of the standard
It cannot be easily extended to detect inconsistencies in the bytecode of the Ethereum Virtual Machine (EVM), because (1) it requires the source code of the smart contract; (2) the detection of inconsistencies requires knowledge of the semantics of the program, which pattern search does not support. Semantics

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 for detecting inconsistent behaviors in Ethereum token transaction
  • Method for detecting inconsistent behaviors in Ethereum token transaction
  • Method for detecting inconsistent behaviors in Ethereum token transaction

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0060] The vast majority of ERC20 tokens on Ethereum use the mapping structure to store token holders and holding balances. This structure establishes a one-to-one mapping relationship between the address of an account and the token balance it holds. Such as figure 2 As shown in , it illustrates how to use the corresponding mapping code to read the balance of an account address from the database. In addition, there are corresponding solidity source codes (ie "amount=balances[addr];") and corresponding EVM instructions (Ethereum virtual machine instructions). This type of structure first uses the SHA3 instruction of the EVM to perform a hash operation on the account address and the mapped code to obtain a new address value. Then, through the command SLOAD of the EVM, according to the obtained new address value, read the content stored in the location from the Ethereum database, which is the balance of the account address. Similarly, if you want to write a new balance, use ...

Embodiment 2

[0136] Some ERC20 tokens on Ethereum use the mapping structure to store token holders and holding balances. This mapping structure establishes a one-to-one correspondence between the account address and a structure, which contains the token holdings of the account and some other information. image 3 It shows how to use this type of mapping code to read the balance of an account address from the database, its corresponding solidity source code (ie "amount=balances[addr].amount;") and the corresponding EVM instruction. First, the account address and mapping code are hashed to obtain a new address value, and the corresponding EVM instruction is SHA3. Then, according to the relative position of the variable representing the token balance in the structure, an offset is obtained, and then the new address is added to the offset by the EVM instruction ADD, and the address of the balance is obtained value. Finally, according to the address where the calculated balance is located, t...

Embodiment 3

[0219] Some ERC20 tokens on Ethereum use the mapping structure of to store token holders and holding balances. This structure establishes a corresponding relationship between the account address and a structure array. The structure array records all the historical balances of the account. Each element of the array contains the balance of the account at a certain time node, and the last item of the array records Contains the latest token holdings of the account. Figure 4Shows how to use this type of mapping code to read the balance of an account address from the database, and its corresponding solidity source code (ie "amount=balances[addr][balances[addr].length-1].amount ;") and the corresponding EVM instructions. First, the account address and mapping code are hashed to obtain the address code of the structure array, and the corresponding EVM instruction is SHA3. In the second step, use the SLOAD command to read the current length of the structure array from the location ...

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 for detecting inconsistent behaviors in Ethereum token transaction. The method comprises the following steps: A, acquiring an execution track: capturing the executiontrack when clients are fully synchronized; B, extracting each transaction standard method set; C, extracting a standard event set, and recording modification of a transaction data structure to the Ethereum database; d, comparing each transaction with the modified data set, identifying a core data structure and an Ethereum token contract, and recording a mapping relationship; E, scanning all transaction information again, and when an identified Ethereum token contract is found, extracting a core data structure and modification of an Ethereum database; and F, comparing the standard method set and the standard event set called by each transaction with the modified data set, and judging that the transaction behaviors are inconsistent if any two of the standard method sets and the standard event sets are different. According to the invention, whether a single or a plurality of linked token contracts are Ethereum token contracts can be identified, and whether the realization of Ethereum token transaction meets the transaction behavior standard can be automatically identified.

Description

technical field [0001] The invention relates to a detection method for computer data security, in particular to a detection method for inconsistent behavior in Ethereum token transactions. Background technique [0002] The success of Bitcoin has inspired the birth of many cryptocurrencies, most of which are deployed and run on Ethereum in the form of smart contracts. A smart contract is a program that expresses the nature of a contract running on the Ethereum Virtual Machine (a program module of the Ethereum client). The smart contract has a wide range of applications, and its specific contract content can involve tokens, gambling or other purposes. Token contract is a specific contract form of smart contract, specifically for token transactions. In order to regulate the interaction between tokens and users and third-party tools (such as blockchain wallets, blockchain exchange markets, etc.), some token contract implementation specifications and standards have emerged, suc...

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
IPC IPC(8): G06Q20/38G06Q20/42G06Q40/04
CPCG06Q20/3827G06Q20/42G06Q40/04
Inventor 陈厅张愉菲李子豪罗夏朴王挺曹蓉肖修卓张小松牛伟纳
Owner UNIV OF ELECTRONIC SCI & TECH OF CHINA
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