Skip to main content
QUICK REVIEW

[Paper Review] Towards Effective Detection of Ponzi schemes on Ethereum with Contract Runtime Behavior Graph

Ruichao Liang, Jing Chen|arXiv (Cornell University)|Jun 3, 2024
Spam and Phishing DetectionComputer Science4 citations
TL;DR

This paper proposes PonziGuard, a novel approach for detecting Ponzi schemes on Ethereum by modeling smart contract runtime behavior through a Contract Runtime Behavior Graph (CRBG) and leveraging Graph Neural Networks (GNNs) for graph classification. It achieves 96.9% precision, 98.2% recall, and 97.5% F1-score on a ground-truth dataset and identifies 805 real-world Ponzi contracts on Ethereum Mainnet, including 0-day schemes.

ABSTRACT

Ponzi schemes, a form of scam, have been discovered in Ethereum smart contracts in recent years, causing massive financial losses. Existing detection methods primarily focus on rule-based approaches and machine learning techniques that utilize static information as features. However, these methods have significant limitations. Rule-based approaches rely on pre-defined rules with limited capabilities and domain knowledge dependency. Using static information like opcodes for machine learning fails to effectively characterize Ponzi contracts, resulting in poor reliability and interpretability. Moreover, relying on static information like transactions for machine learning requires a certain number of transactions to achieve detection, which limits the scalability of detection and hinders the identification of 0-day Ponzi schemes. In this paper, we propose PonziGuard, an efficient Ponzi scheme detection approach based on contract runtime behavior. Inspired by the observation that a contract's runtime behavior is more effective in disguising Ponzi contracts from the innocent contracts, PonziGuard establishes a comprehensive graph representation called contract runtime behavior graph (CRBG), to accurately depict the behavior of Ponzi contracts. Furthermore, it formulates the detection process as a graph classification task on CRBG, enhancing its overall effectiveness. The experiment results show that PonziGuard surpasses the current state-of-the-art approaches in the ground-truth dataset. We applied PonziGuard to Ethereum Mainnet and demonstrated its effectiveness in real-world scenarios. Using PonziGuard, we identified 805 Ponzi contracts on Ethereum Mainnet, which have resulted in an estimated economic loss of 281,700 Ether or approximately $500 million USD. We also found 0-day Ponzi schemes in the recently deployed 10,000 smart contracts.

Motivation & Objective

  • To address the limitations of existing rule-based and static analysis methods that fail to reliably detect Ponzi contracts due to low discriminative power and poor interpretability.
  • To overcome the scalability issue of transaction-based detection methods that cannot identify 0-day Ponzi schemes lacking real transaction history.
  • To leverage runtime behavior—specifically, dynamic data flows and execution traces—as a more effective signal for distinguishing Ponzi contracts from benign ones.
  • To develop a graph-based representation, Contract Runtime Behavior Graph (CRBG), that captures the behavioral patterns unique to Ponzi contracts.
  • To formulate Ponzi detection as a graph classification task using GNNs, enhancing both accuracy and interpretability.

Proposed method

  • Perform static analysis on smart contracts to identify potential Ponzi logic and generate synthetic transaction sequences mimicking typical investment behavior.
  • Use dynamic taint analysis during contract execution with these synthetic transactions to collect detailed runtime data on data flows and control flow.
  • Construct a Contract Runtime Behavior Graph (CRBG) from the taint analysis results, representing nodes as program elements and edges as data/control dependencies observed at runtime.
  • Apply Graph Neural Networks (GNNs) to learn representations of CRBGs and classify them as Ponzi or non-Ponzi contracts.
  • Formulate the detection task as a graph classification problem, enabling end-to-end learning from runtime behavior patterns.
  • Use contract fuzzing to invoke contracts and gather runtime information, enabling detection of 0-day Ponzi schemes before real transactions occur.
Figure 1. Opcode Frequency Distributions. The KL divergence between Ponzi and non-Ponzi contracts ranges from 0.011 to 0.018, while the KL divergence between different Ponzi contracts ranges from 0.012 to 0.016.
Figure 1. Opcode Frequency Distributions. The KL divergence between Ponzi and non-Ponzi contracts ranges from 0.011 to 0.018, while the KL divergence between different Ponzi contracts ranges from 0.012 to 0.016.

Experimental results

Research questions

  • RQ1Can runtime behavior provide a more discriminative signal than static features like opcodes or transaction patterns for detecting Ponzi contracts?
  • RQ2To what extent does the use of dynamic taint analysis and runtime data improve detection accuracy and interpretability compared to static analysis?
  • RQ3Can a graph-based representation of contract execution behavior (CRBG) effectively model the structural patterns of Ponzi contracts?
  • RQ4How effective is the proposed GNN-based classification on CRBGs in detecting both known and 0-day Ponzi schemes?
  • RQ5Can the approach scale to real-world deployment on Ethereum Mainnet and uncover previously undetected malicious contracts?

Key findings

  • PonziGuard achieves a precision of 96.9%, recall of 98.2%, and F1-score of 97.5% on the ground-truth dataset, outperforming state-of-the-art methods.
  • The approach demonstrates the highest interpretability among existing tools by leveraging runtime behavior graphs for explainable detection.
  • PonziGuard successfully identified 805 Ponzi contracts on Ethereum Mainnet, resulting in an estimated economic loss of 281,700 Ether (~$500 million USD).
  • The method detected 0-day Ponzi schemes in the recently deployed 10,000 smart contracts, proving its capability to identify malicious contracts before real transactions occur.
  • The study confirms that opcode-level features show no significant difference between Ponzi and non-Ponzi contracts, validating the need for dynamic behavior modeling.
  • Static analysis tools misclassify false positives like the 'squareRootPonzi' contract due to over-approximation, highlighting the advantage of runtime-based detection.
Figure 2. Contract Runtime Behaviors. (a) is obtained from the Ponzi contract in Listing 1 , and (b) is obtained from a gambling contract (non-Ponzi contract).
Figure 2. Contract Runtime Behaviors. (a) is obtained from the Ponzi contract in Listing 1 , and (b) is obtained from a gambling contract (non-Ponzi contract).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.