Angels or demons: Investigating and detecting decentralized financial traps on ethereum smart contracts
Decentralized Finance (DeFi) uses blockchain technologies to transform traditional financial activities into decentralized platforms that run without intermediaries and centralized institutions. Smart contracts are programs that run on the blockchain, and by utilizing smart contracts, developers can...
Saved in:
Main Authors: | , , , , , , |
---|---|
Format: | text |
Language: | English |
Published: |
Institutional Knowledge at Singapore Management University
2024
|
Subjects: | |
Online Access: | https://ink.library.smu.edu.sg/sis_research/9349 https://ink.library.smu.edu.sg/context/sis_research/article/10349/viewcontent/f4f94ebf_0153_43ea_a2ed_8542c9e21e27.pdf |
Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
Institution: | Singapore Management University |
Language: | English |
id |
sg-smu-ink.sis_research-10349 |
---|---|
record_format |
dspace |
spelling |
sg-smu-ink.sis_research-103492024-10-17T03:23:08Z Angels or demons: Investigating and detecting decentralized financial traps on ethereum smart contracts CHEN, Jiachi HU, Jiang XIA, Xin LO, David GRUNDY, John GAO, Zhipeng CHEN, Ting Decentralized Finance (DeFi) uses blockchain technologies to transform traditional financial activities into decentralized platforms that run without intermediaries and centralized institutions. Smart contracts are programs that run on the blockchain, and by utilizing smart contracts, developers can more easily develop DeFi applications. Some key features of smart contracts—self-executed and immutability—ensure the trustworthiness, transparency and efficiency of DeFi applications and have led to a fast-growing DeFi market. However, misbehaving developers can add traps or backdoor code snippets to a smart contract, which are hard for contract users to discover. We call these code snippets in a DeFi smart contract as “DeFi Contract Traps” (DCTs). In this paper, we identify five DeFi contract traps and introduce their behaviors, describe how attackers use them to make unfair profits and analyze their prevalence in the Ethereum platform. We propose a symbolic execution tool, DeFiDefender, to detect such traps and use a manually labeled small-scale dataset that consists of 700 smart contracts to evaluate it. Our results show that our tool is not only highly effective but also highly efficient.DeFiDefender only needs 0.48 s to analyze one DeFi smart contract and obtains a high average accuracy (98.17%), precision (99.74%)and recall (89.24%). Among the five DeFi contract traps introduced in this paper, four of them can be detected through contract bytecode without the need for source code. We also apply DeFiDefender to a large-scale dataset that consists of 20,679 real DeFi-related Ethereum smart contracts. We found that 52.13% of these DeFi smart contracts contain at least one contract trap. Although a smart contract that contains contract traps is not necessarily malicious, our finding suggests that DeFi-related contracts have many centralized issues in a zero-trust environment and in the absence of a trusted party. 2024-11-01T07:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/9349 info:doi/10.1007/s10515-024-00459-4 https://ink.library.smu.edu.sg/context/sis_research/article/10349/viewcontent/f4f94ebf_0153_43ea_a2ed_8542c9e21e27.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University Decentralized financial Ethereum Financial traps Smart contract analysis Software Engineering |
institution |
Singapore Management University |
building |
SMU Libraries |
continent |
Asia |
country |
Singapore Singapore |
content_provider |
SMU Libraries |
collection |
InK@SMU |
language |
English |
topic |
Decentralized financial Ethereum Financial traps Smart contract analysis Software Engineering |
spellingShingle |
Decentralized financial Ethereum Financial traps Smart contract analysis Software Engineering CHEN, Jiachi HU, Jiang XIA, Xin LO, David GRUNDY, John GAO, Zhipeng CHEN, Ting Angels or demons: Investigating and detecting decentralized financial traps on ethereum smart contracts |
description |
Decentralized Finance (DeFi) uses blockchain technologies to transform traditional financial activities into decentralized platforms that run without intermediaries and centralized institutions. Smart contracts are programs that run on the blockchain, and by utilizing smart contracts, developers can more easily develop DeFi applications. Some key features of smart contracts—self-executed and immutability—ensure the trustworthiness, transparency and efficiency of DeFi applications and have led to a fast-growing DeFi market. However, misbehaving developers can add traps or backdoor code snippets to a smart contract, which are hard for contract users to discover. We call these code snippets in a DeFi smart contract as “DeFi Contract Traps” (DCTs). In this paper, we identify five DeFi contract traps and introduce their behaviors, describe how attackers use them to make unfair profits and analyze their prevalence in the Ethereum platform. We propose a symbolic execution tool, DeFiDefender, to detect such traps and use a manually labeled small-scale dataset that consists of 700 smart contracts to evaluate it. Our results show that our tool is not only highly effective but also highly efficient.DeFiDefender only needs 0.48 s to analyze one DeFi smart contract and obtains a high average accuracy (98.17%), precision (99.74%)and recall (89.24%). Among the five DeFi contract traps introduced in this paper, four of them can be detected through contract bytecode without the need for source code. We also apply DeFiDefender to a large-scale dataset that consists of 20,679 real DeFi-related Ethereum smart contracts. We found that 52.13% of these DeFi smart contracts contain at least one contract trap. Although a smart contract that contains contract traps is not necessarily malicious, our finding suggests that DeFi-related contracts have many centralized issues in a zero-trust environment and in the absence of a trusted party. |
format |
text |
author |
CHEN, Jiachi HU, Jiang XIA, Xin LO, David GRUNDY, John GAO, Zhipeng CHEN, Ting |
author_facet |
CHEN, Jiachi HU, Jiang XIA, Xin LO, David GRUNDY, John GAO, Zhipeng CHEN, Ting |
author_sort |
CHEN, Jiachi |
title |
Angels or demons: Investigating and detecting decentralized financial traps on ethereum smart contracts |
title_short |
Angels or demons: Investigating and detecting decentralized financial traps on ethereum smart contracts |
title_full |
Angels or demons: Investigating and detecting decentralized financial traps on ethereum smart contracts |
title_fullStr |
Angels or demons: Investigating and detecting decentralized financial traps on ethereum smart contracts |
title_full_unstemmed |
Angels or demons: Investigating and detecting decentralized financial traps on ethereum smart contracts |
title_sort |
angels or demons: investigating and detecting decentralized financial traps on ethereum smart contracts |
publisher |
Institutional Knowledge at Singapore Management University |
publishDate |
2024 |
url |
https://ink.library.smu.edu.sg/sis_research/9349 https://ink.library.smu.edu.sg/context/sis_research/article/10349/viewcontent/f4f94ebf_0153_43ea_a2ed_8542c9e21e27.pdf |
_version_ |
1814047930653343744 |