TokenAware: Accurate and Efficient Bookkeeping Recognition for Token Smart Contracts
Open Access
- 31 January 2023
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 32 (1) , 1-35
Abstract
Tokens have become an essential part of blockchain ecosystem, so recognizing token transfer behaviors is crucial for applications depending on blockchain. Unfortunately, existing solutions cannot recognize token transfer behaviors accurately and efficiently because of their incomplete patterns and inefficient designs. This work proposes TokenAware , a novel online system for recognizing token transfer behaviors. To improve accuracy, TokenAware infers token transfer behaviors from modifications of internal bookkeeping of a token smart contract for recording the information of token holders (e.g., their addresses and shares). However, recognizing bookkeeping is challenging, because smart contract bytecode does not contain type information. TokenAware overcomes the challenge by first learning the instruction sequences for locating basic types and then deriving the instruction sequences for locating sophisticated types that are composed of basic types. To improve efficiency, TokenAware introduces four optimizations. We conduct extensive experiments to evaluate TokenAware with real blockchain data. Results show that TokenAware can automatically identify new types of bookkeeping and recognize 107,202 tokens with 98.7% precision. TokenAware with optimizations merely incurs 4% overhead, which is 1/345 of the overhead led by the counterpart with no optimization. Moreover, we develop an application based on TokenAware to demonstrate how it facilitates malicious behavior detection.Keywords
Funding Information
- Hong Kong ITF Project (GHP/052/19SZ)
- Research and Development Program of Shenzhen (SGDX20190918101201696)
- Hong Kong RGC Projects (PolyU15219319, PolyU15224121)
- National Natural Science Foundation of China (61872057, U19A2066)
- National Key R&D Program of China (2018YFB0804100)
- Natural Science Foundation of Sichuan Province (2022NSFSC0871)
This publication has 9 references indexed in Scilit:
- SigRec: Automatic Recovery of Function Signatures in Smart ContractsIEEE Transactions on Software Engineering, 2021
- Characteristics of Wallet Contracts on Ethereum2020
- Scenario-based creation and digital investigation of ethereum ERC20 tokensForensic Science International: Digital Investigation, 2020
- XBlock-ETH: Extracting and Exploring Blockchain Data From EthereumIEEE Open Journal of the Computer Society, 2020
- Detecting Token Systems on Ethereum2019
- Measuring Ethereum-Based ERC20 Token Networks2019
- Enabling Clone Detection For Ethereum Via Smart Contract Birthmarks2019
- An Adaptive Gas Cost Mechanism for Ethereum to Defend Against Under-Priced DoS Attacks2017
- Use-definition chains with applicationsComputer Languages, 1978