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.
翻译:随着区块链自动化和对抗交易的普及,通过透明的区块链,敌手可以观察所有未被挖掘的交易及其执行逻辑。这种透明度进一步启用了一种新型的敌手,该敌手可以在实时中复制和跟进有利可图的未决定交易,从而获得显著的财务收益。本文介绍了区块链模仿游戏,并提出了一种称为Ape的广义模仿攻击方法。利用动态程序分析技术,Ape支持对对抗智能合约的自动合成。在一年的时间(2021年8月1日到2022年7月31日)内,Ape在以太坊上可以获得148.96M美元的利润,在BNB智能链(BSC)上可以获得42.7M美元的利润。我们还展示了交易和合约的模仿作为防御策略的潜力。在一年的时间内,我们发现Ape在以太坊和BSC上可以成功模仿13次和22次已知的去中心化金融(DeFi)攻击。我们的研究结果表明,区块链验证器可以实时模仿攻击以防止DeFi的入侵。