Private mempool hiding needs strong lower bound to block sandwich attacks

How Much Must a Private Mempool Hide? Exact Leakage Thresholds for Sandwich Attacks

Computer Science and Game TheoryCryptography and Security

Summary

Sandwich attacks happen when traders see a pending transaction and try to insert their own trades around it to make a profit. The authors study how much information about a transaction size must be hidden in private mempools to stop these attacks. They find that the smallest possible size visible to others determines if attackers can profit by front-running. If the privacy leaks a lower bound above a certain threshold, then profitable sandwich attacks can no longer occur. They also show that hiding the direction of the trade makes some attacks harder but not impossible.

What this means in practice

  • For blockchain developers: Design privacy layers for transaction pools that set appropriate size hiding thresholds to prevent profitable sandwich attacks in automated market makers.
  • For cryptocurrency exchange operators: Adjust mempool transaction visibility policies to reduce extractable value losses from front-runners by controlling what transaction size information is leaked.

A theory result. No direct application yet.

Authors

Tingyi Lin, Jiazhuo Li, Ruoran Lai

Abstract

Private and encrypted mempools hide pending transactions to stop sandwich attacks and other forms of maximal extractable value (MEV), but what they hide is rarely everything: a transaction's pair, direction, and a coarse range for its size can still leak. How much leakage makes sandwiching pay? We answer exactly for a fee-free constant-product automated market maker, the pricing rule behind Uniswap v2. Traders observe an interval containing the victim's size and bid in a first-price auction for the right to sandwich it, and the winning front-run must keep the victim's trade executable at every size in the interval. The answer turns on the smallest size consistent with the leak. It alone determines the feasible front-runs, the largest feasible front-run is optimal for pointwise, expected, and worst-case profit alike, and the guaranteed profit has a closed form. When execution is costly, a privacy layer that wants to rule out sandwiches profitable at every consistent size may therefore reveal anything about the size except a lower bound above an explicit threshold; the upper end of the range is irrelevant. With two or more symmetric traders, every pure-strategy perfect Bayesian equilibrium of the auction hands the entire expected net rent to the auctioneer. If the direction is hidden too, no non-contingent first leg front-runs both possible directions, while post-trade arbitrage can survive even perfect pre-trade hiding.