Paper 2023/1338

Lanturn: Measuring Economic Security of Smart Contracts Through Adaptive Learning

Kushal Babel, Cornell Tech, IC3
Mojan Javaheripi, University of California San Diego
Yan Ji, Cornell Tech, IC3
Mahimna Kelkar, Cornell Tech, IC3
Farinaz Koushanfar, University of California San Diego
Ari Juels, Cornell Tech, IC3
Abstract

We introduce Lanturn: a general purpose adaptive learning-based framework for measuring the cryptoeconomic security of composed decentralized-finance (DeFi) smart contracts. Lanturn discovers strategies comprising of concrete transactions for extracting economic value from smart contracts interacting with a particular transaction environment. We formulate the strategy discovery as a black-box optimization problem and leverage a novel adaptive learning-based algorithm to address it. Lanturn features three key properties. First, it needs no contract-specific heuristics or reasoning, due to our black-box formulation of cryptoeconomic security. Second, it utilizes a simulation framework that operates natively on blockchain state and smart contract machine code, such that transactions returned by Lanturn’s learning-based optimization engine can be executed on-chain without modification. Finally, Lanturn is scalable in that it can explore strategies comprising a large number of transactions that can be reordered or subject to insertion of new transactions. We evaluate Lanturn on the historical data of the biggest and most active DeFi Applications: Sushiswap, UniswapV2, UniswapV3, and AaveV2. Our results show that Lanturn not only rediscovers existing, well-known strategies for extracting value from smart contracts, but also discovers new strategies that are previously undocumented. Lanturn also consistently discovers higher value than evidenced in the wild, surpassing a natural baseline computed using value extracted by bots and other strategic agents.

Metadata
Available format(s)
PDF
Category
Applications
Publication info
Published elsewhere. ACM CCS 2023
Keywords
BlockchainSmart ContractsDeFi SecurityMEVMachine Learning
Contact author(s)
babel @ cs cornell edu
mojan @ ucsd edu
yj348 @ cornell edu
mahimna @ cs cornell edu
fkoushanfar @ eng ucsd edu
juels @ cornell edu
History
2023-09-08: approved
2023-09-07: received
See all versions
Short URL
https://ia.cr/2023/1338
License
Creative Commons Attribution
CC BY

BibTeX

@misc{cryptoeprint:2023/1338,
      author = {Kushal Babel and Mojan Javaheripi and Yan Ji and Mahimna Kelkar and Farinaz Koushanfar and Ari Juels},
      title = {Lanturn: Measuring Economic Security of Smart Contracts Through Adaptive Learning},
      howpublished = {Cryptology {ePrint} Archive, Paper 2023/1338},
      year = {2023},
      url = {https://eprint.iacr.org/2023/1338}
}
Note: In order to protect the privacy of readers, eprint.iacr.org does not use cookies or embedded third party content.