Lune

USENIX Security2023Top-tier venue

The Blockchain Imitation Game

Kaihua Qin, Stefanos Chaliasos, Liyi Zhou, Benjamin Livshits, Dawn Song, Arthur Gervais

Abstract

The use of blockchains for automated and adversarial trading has become commonplace. However, due to the transparent nature of blockchains, an adversary is able to observe any pending, not-yet-mined transactions, along with their execution logic. This transparency further enables a new type of adversary, which copies and front-runs profitable pending transactions in real-time, yielding significant financial gains. Shedding light on such "copy-paste" malpractice, this paper introduces the Blockchain Imitation Game and proposes a generalized imitation attack methodology called APE. Leveraging dynamic program analysis techniques, APE supports the automatic synthesis of adversarial smart contracts. Over a timeframe of one year (1st of August, 2021 to 31st of July, 2022), APE could have yielded 148.96M USD in profit on Ethereum, and 42.70M USD on BNB Smart Chain (BSC). Not only as a malicious attack, we further show the potential of transaction and contract imitation as a defensive strategy. Within one year, we find that APE could have successfully imitated 13 and 22 known Decentralized Finance (DeFi) attacks on Ethereum and BSC, respectively. Our findings suggest that blockchain validators can imitate attacks in real-time to prevent intrusions in DeFi.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

14 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • teEther: Gnawing at Ethereum to Automatically Exploit Smart Contracts cites Making Smart Contracts Smarter
  • Rolling in the Shadows: Analyzing the Extraction of MEV Across Layer-2 Rollups cites Flash Boys 2.0: Frontrunning in Decentralized Exchanges, Miner Extractable Value, and Consensus Instability
  • Rolling in the Shadows: Analyzing the Extraction of MEV Across Layer-2 Rollups cites Quantifying Blockchain Extractable Value: How dark is the forest?
  • Insecurity Through Obscurity: Veiled Vulnerabilities in Closed-Source Contracts cites teEther: Gnawing at Ethereum to Automatically Exploit Smart Contracts
  • Insecurity Through Obscurity: Veiled Vulnerabilities in Closed-Source Contracts cites Flash Boys 2.0: Frontrunning in Decentralized Exchanges, Miner Extractable Value, and Consensus Instability
  • Insecurity Through Obscurity: Veiled Vulnerabilities in Closed-Source Contracts cites Rolling in the Shadows: Analyzing the Extraction of MEV Across Layer-2 Rollups
  • Insecurity Through Obscurity: Veiled Vulnerabilities in Closed-Source Contracts cites Making Smart Contracts Smarter
  • Insecurity Through Obscurity: Veiled Vulnerabilities in Closed-Source Contracts cites Quantifying Blockchain Extractable Value: How dark is the forest?
  • Insecurity Through Obscurity: Veiled Vulnerabilities in Closed-Source Contracts cites Securify: Practical Security Analysis of Smart Contracts
  • Detecting Various DeFi Price Manipulations with LLM Reasoning cites Flash Boys 2.0: Frontrunning in Decentralized Exchanges, Miner Extractable Value, and Consensus Instability
  • Detecting Various DeFi Price Manipulations with LLM Reasoning cites Quantifying Blockchain Extractable Value: How dark is the forest?
  • LookAhead: Preventing DeFi Attacks via Unveiling Adversarial Contracts cites Flash Boys 2.0: Frontrunning in Decentralized Exchanges, Miner Extractable Value, and Consensus Instability
  • LookAhead: Preventing DeFi Attacks via Unveiling Adversarial Contracts cites Uncover the Premeditated Attacks: Detecting Exploitable Reentrancy Vulnerabilities by Identifying Attacker Contracts
  • Uncover the Premeditated Attacks: Detecting Exploitable Reentrancy Vulnerabilities by Identifying Attacker Contracts cites teEther: Gnawing at Ethereum to Automatically Exploit Smart Contracts
  • Uncover the Premeditated Attacks: Detecting Exploitable Reentrancy Vulnerabilities by Identifying Attacker Contracts cites Making Smart Contracts Smarter
  • Uncover the Premeditated Attacks: Detecting Exploitable Reentrancy Vulnerabilities by Identifying Attacker Contracts cites Securify: Practical Security Analysis of Smart Contracts
  • Quantifying Blockchain Extractable Value: How dark is the forest? cites Flash Boys 2.0: Frontrunning in Decentralized Exchanges, Miner Extractable Value, and Consensus Instability
  • Securify: Practical Security Analysis of Smart Contracts cites Making Smart Contracts Smarter
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers14

  1. Uncover the Premeditated Attacks: Detecting Exploitable Reentrancy Vulnerabilities by Identifying Attacker ContractsShuo Yang, Jiachi Chen, Mingyuan Huang, Zibin Zheng et al.ICSE 2024 · 24 citations
  2. Rolling in the Shadows: Analyzing the Extraction of MEV Across Layer-2 RollupsChristof Ferreira Torres, Albin Mamuti, Ben Weintraub, Cristina Nita-Rotaru et al.CCS 2024 · 12 citations
  3. Insecurity Through Obscurity: Veiled Vulnerabilities in Closed-Source ContractsSen Yang, Kaihua Qin, Aviv Yaish, Fan ZhangCCS 2026 · 3 citations
  4. Detecting Various DeFi Price Manipulations with LLM ReasoningJuantao Zhong, Daoyuan Wu, Ye Liu, Maoyi Xie et al.ASE 2025 · 3 citations
  5. LookAhead: Preventing DeFi Attacks via Unveiling Adversarial ContractsShoupeng Ren, Lipeng He, Tianyu Tu, Di Wu et al.FSE 2025 · 3 citations

Builds on20

  1. Making Smart Contracts SmarterLoi Luu, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena et al.CCS 2016 · 2,306 citations
  2. Securify: Practical Security Analysis of Smart ContractsPetar Tsankov, Andrei Marian Dan, Dana Drachsler-Cohen, Arthur Gervais et al.CCS 2018 · 1,108 citations
  3. Flash Boys 2.0: Frontrunning in Decentralized Exchanges, Miner Extractable Value, and Consensus InstabilityPhilip Daian, Steven Goldfeder, Tyler Kell, Yunqi Li et al.S&P 2020 · 607 citations
  4. teEther: Gnawing at Ethereum to Automatically Exploit Smart ContractsJohannes Krupp, Christian RossowUSENIX Security 2018 · 345 citations
  5. Quantifying Blockchain Extractable Value: How dark is the forest?Kaihua Qin, Liyi Zhou, Arthur GervaisS&P 2022 · 336 citations

Related papers

  1. FlashSyn: Flash Loan Attack Synthesis via Counter Example Driven ApproximationZhiyang Chen, Sidi Mohamed Beillahi, Fan LongICSE 2024 · 21 citations
  2. GenDetect: Generalizing Reactive Detection for Resilience Against Imitative DeFi Attack CascadeBowen Cai, Weiheng Bai, Youshui Lu, Haoran Xu et al.ICSE 2026
  3. On the Just-In-Time Discovery of Profit-Generating Transactions in DeFi ProtocolsLiyi Zhou, Kaihua Qin, Antoine Cully, Benjamin Livshits et al.S&P 2021 · 148 citations
  4. Following Devils' Footprint: Towards Real-time Detection of Price Manipulation AttacksBosi Zhang, Ningyu He, Xiaohui Hu, Kai Ma et al.USENIX Security 2025
  5. Frontrunner Jones and the Raiders of the Dark Forest: An Empirical Study of Frontrunning on the Ethereum BlockchainChristof Ferreira Torres, Ramiro Camino, Radu StateUSENIX Security 2021 · 179 citations
Dusk over the sea between two cliffs drawn in fine vertical lines