Eating Sandwiches: Modular and Lightweight Elimination of Transaction Reordering Attacks

Authors Orestis Alpos , Ignacio Amores-Sesar , Christian Cachin , Michelle Yeo

Thumbnail PDF


  • Filesize: 1.43 MB
  • 22 pages

Document Identifiers

Author Details

Orestis Alpos
  • Institute of Computer Science, University of Bern, Switzerland
Ignacio Amores-Sesar
  • Institute of Computer Science, University of Bern, Switzerland
Christian Cachin
  • Institute of Computer Science, University of Bern, Switzerland
Michelle Yeo
  • IST Austria, Klosterneuburg, Austria


We would like to thank Krzysztof Pietrzak and Jovana Mićić for useful discussions.

Cite AsGet BibTex

Orestis Alpos, Ignacio Amores-Sesar, Christian Cachin, and Michelle Yeo. Eating Sandwiches: Modular and Lightweight Elimination of Transaction Reordering Attacks. In 27th International Conference on Principles of Distributed Systems (OPODIS 2023). Leibniz International Proceedings in Informatics (LIPIcs), Volume 286, pp. 12:1-12:22, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)


Traditional blockchains grant the miner of a block full control not only over which transactions but also their order. This constitutes a major flaw discovered with the introduction of decentralized finance and allows miners to perform MEV attacks. In this paper, we address the issue of sandwich attacks by providing a construction that takes as input a blockchain protocol and outputs a new blockchain protocol with the same security but in which sandwich attacks are not profitable. Furthermore, our protocol is fully decentralized with no trusted third parties or heavy cryptography primitives and carries a linear increase in latency and minimum computation overhead.

Subject Classification

ACM Subject Classification
  • Security and privacy → Distributed systems security
  • Consensus
  • MEV
  • Byzantine behavior
  • Rational behavior


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Distributed randomness beacon, 2023. URL:
  2. Ethereum, 2023. URL:
  3. MEV over time, 2023. URL:
  4. Random ordering of equally-priced transactions incentivises competitive spam, 2023. URL:
  5. Ittai Abraham, Benny Pinkas, and Avishay Yanai. Blinder - scalable, robust anonymous committed broadcast. In CCS, pages 1233-1252. ACM, 2020. URL:
  6. Orestis Alpos, Ignacio Amores-Sesar, Christian Cachin, and Michelle Yeo. Eating sandwiches: Modular and lightweight elimination of transaction reordering attacks. CoRR, abs/2307.02954, 2023., URL:
  7. Guillermo Angeris and Tarun Chitra. Improved price oracles: Constant function market makers. In AFT, pages 80-91. ACM, 2020. URL:
  8. Robert J. Aumann. Acceptable points in general cooperative n-person games. In Albert William Tucker and Robert Duncan Luce, editors, Contributions to the Theory of Games (AM-40), Volume IV, pages 287-324. Princeton University Press, Princeton, 1959. URL:
  9. Leemon Baird and Atul Luykx. The hashgraph protocol: Efficient asynchronous BFT for high-throughput distributed ledgers. In COINS, pages 1-7. IEEE, 2020. URL:
  10. Carsten Baum, James Hsin-yu Chiang, Bernardo David, Tore Kasper Frederiksen, and Lorenzo Gentile. Sok: Mitigation of front-running in decentralized finance. IACR Cryptol. ePrint Arch., page 1628, 2021. URL:
  11. Carsten Baum, Bernardo David, and Rafael Dowsley. Insured MPC: efficient secure computation with financial penalties. In Financial Cryptography, volume 12059 of Lecture Notes in Computer Science, pages 404-420. Springer, 2020. URL:
  12. Carsten Baum, Bernardo David, and Tore Kasper Frederiksen. P2DEX: privacy-preserving decentralized cryptocurrency exchange. In ACNS (1), volume 12726 of Lecture Notes in Computer Science, pages 163-194. Springer, 2021. URL:
  13. B. Douglas Bernheim, Bezalel Peleg, and Michael D Whinston. Coalition-proof nash equilibria I. Concepts. Journal of Economic Theory, 42(1):1-12, 1987. URL:
  14. Manuel Blum. Coin flipping by telephone a protocol for solving impossible problems. SIGACT News, 15(1):23-27, jan 1983. URL:
  15. Dan Boneh, Joseph Bonneau, Benedikt Bünz, and Ben Fisch. Verifiable delay functions. In CRYPTO (1), volume 10991 of Lecture Notes in Computer Science, pages 757-788. Springer, 2018. URL:
  16. Mic Bowman, Debajyoti Das, Avradip Mandal, and Hart Montgomery. On elapsed time consensus protocols. In INDOCRYPT, volume 13143 of Lecture Notes in Computer Science, pages 559-583. Springer, 2021. URL:
  17. Christian Cachin, Rachid Guerraoui, and Luís E. T. Rodrigues. Introduction to Reliable and Secure Distributed Programming (2. ed.). Springer, 2011. URL:
  18. Christian Cachin, Klaus Kursawe, Frank Petzold, and Victor Shoup. Secure and efficient asynchronous broadcast protocols. In CRYPTO, volume 2139 of Lecture Notes in Computer Science, pages 524-541. Springer, 2001. URL:
  19. Christian Cachin, Jovana Micic, Nathalie Steinhauer, and Luca Zanolini. Quick order fairness. In Financial Cryptography, volume 13411 of Lecture Notes in Computer Science, pages 316-333. Springer, 2022. URL:
  20. Chainlink Labs. Chainlink 2.0: Next steps in the evolution of decentralized oracle networks. Whitepaper, 2021. URL:
  21. Krishnendu Chatterjee, Amir Kafshdar Goharshady, and Arash Pourdamghani. Probabilistic smart contracts: Secure randomness on the blockchain. In IEEE ICBC, pages 403-412. IEEE, 2019. URL:
  22. Kevin Choi, Arasu Arun, Nirvan Tyagi, and Joseph Bonneau. Bicorn: An optimistically efficient distributed randomness beacon. IACR Cryptol. ePrint Arch., page 221, 2023. URL:
  23. Benny Chor, Shafi Goldwasser, Silvio Micali, and Baruch Awerbuch. Verifiable secret sharing and achieving simultaneity in the presence of faults (extended abstract). In FOCS, pages 383-395. IEEE Computer Society, 1985. URL:
  24. Bram Cohen and Krzysztof Pietrzak. The chia network blockchain. Whitepaper, 2019. URL:
  25. Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms, 3rd Edition. MIT Press, 2009. URL:
  26. Philip Daian, Steven Goldfeder, Tyler Kell, Yunqi Li, Xueyuan Zhao, Iddo Bentov, Lorenz Breidenbach, and Ari Juels. Flash boys 2.0: Frontrunning in decentralized exchanges, miner extractable value, and consensus instability. In IEEE Symposium on Security and Privacy, pages 910-927. IEEE, 2020. URL:
  27. Bernardo David, Peter Gazi, Aggelos Kiayias, and Alexander Russell. Ouroboros praos: An adaptively-secure, semi-synchronous proof-of-stake blockchain. In EUROCRYPT (2), volume 10821 of Lecture Notes in Computer Science, pages 66-98. Springer, 2018. URL:
  28. Yvo Desmedt and Yair Frankel. Threshold cryptosystems. In CRYPTO, volume 435 of Lecture Notes in Computer Science, pages 307-315. Springer, 1989. URL:
  29. Yael Doweck and Ittay Eyal. Multi-party timed commitments. CoRR, abs/2005.04883, 2020. URL:
  30. Sisi Duan, Michael K. Reiter, and Haibin Zhang. Secure causal atomic broadcast, revisited. In DSN, pages 61-72. IEEE Computer Society, 2017. URL:
  31. Lioba Heimbach and Roger Wattenhofer. Eliminating sandwich attacks with the help of game theory. In AsiaCCS, pages 153-167. ACM, 2022. URL:
  32. Mahimna Kelkar, Soubhik Deb, and Sreeram Kannan. Order-fair consensus in the permissionless setting. In APKC@AsiaCCS, pages 3-14. ACM, 2022. URL:
  33. Mahimna Kelkar, Soubhik Deb, Sishan Long, Ari Juels, and Sreeram Kannan. Themis: Fast, strong order-fairness in byzantine consensus. IACR Cryptol. ePrint Arch., page 1465, 2021. URL:
  34. Mahimna Kelkar, Fan Zhang, Steven Goldfeder, and Ari Juels. Order-fairness for byzantine consensus. In Daniele Micciancio and Thomas Ristenpart, editors, Advances in Cryptology - CRYPTO 2020 - 40th Annual International Cryptology Conference, CRYPTO 2020, Santa Barbara, CA, USA, August 17-21, 2020, Proceedings, Part III, volume 12172 of Lecture Notes in Computer Science, pages 451-480. Springer, 2020. URL:
  35. John Kelsey, Luís T. A. N. Brandão, Rene Peralta, and Harold Booth. Nistir 8213. a reference for randomness beacons: Format and protocol version 2, 2011. Google Scholar
  36. Aggelos Kiayias, Hong-Sheng Zhou, and Vassilis Zikas. Fair and robust multi-party computation using a global transaction ledger. In EUROCRYPT (2), volume 9666 of Lecture Notes in Computer Science, pages 705-734. Springer, 2016. URL:
  37. Gillat Kol and Moni Naor. Games for exchanging information. In STOC, pages 423-432. ACM, 2008. URL:
  38. Kshitij Kulkarni, Theo Diamandis, and Tarun Chitra. Towards a theory of maximal extractable value I: constant function market makers. CoRR, abs/2207.11835, 2022., URL:
  39. Klaus Kursawe. Wendy, the good little fairness widget: Achieving order fairness for blockchains. In AFT, pages 25-36. ACM, 2020. URL:
  40. Arjen K. Lenstra and Benjamin Wesolowski. Trustworthy public randomness with sloth, unicorn, and trx. Int. J. Appl. Cryptogr., 3(4):330-343, 2017. URL:
  41. Donghang Lu, Thomas Yurek, Samarth Kulshreshtha, Rahul Govind, Aniket Kate, and Andrew Miller. Honeybadgermpc and asynchromix: Practical asynchronous MPC and its application to anonymous communication. In CCS, pages 887-903. ACM, 2019. URL:
  42. Mohsen Alambardar Meybodi, Amir Kafshdar Goharshady, Mohammad Reza Hooshmandasl, and Ali Shakiba. Optimal mining: Maximizing bitcoin miners' revenues from transaction fees. In Blockchain, pages 266-273. IEEE, 2022. URL:
  43. Andrew Miller, Yu Xia, Kyle Croman, Elaine Shi, and Dawn Song. The honey badger of BFT protocols. In CCS, pages 31-42. ACM, 2016. URL:
  44. Michael Mitzenmacher and Eli Upfal. Probability and Computing: Randomized Algorithms and Probabilistic Analysis. Cambridge University Press, 2005. URL:
  45. Satoshi Nakamoto. Bitcoin: A peer-to-peer electronic cash system. Whitepaper, 2009. URL:
  46. Martin J. Osborne and Ariel Rubinstein. A course in game theory. The MIT Press, Cambridge, USA, 1994. electronic edition. Google Scholar
  47. Torben P. Pedersen. Cps, certificate practice statement. In Encyclopedia of Cryptography and Security. Springer, 2005. URL:
  48. Kaihua Qin, Liyi Zhou, and Arthur Gervais. Quantifying blockchain extractable value: How dark is the forest? In IEEE Symposium on Security and Privacy, pages 198-214. IEEE, 2022. URL:
  49. Michael K. Reiter and Kenneth P. Birman. How to securely replicate services. ACM Trans. Program. Lang. Syst., 16(3):986-1009, 1994. URL:
  50. R. L. Rivest, A. Shamir, and D. A. Wagner. Time-lock puzzles and timed-release crypto. Technical report, Massachusetts Institute of Technology, USA, 1996. Google Scholar
  51. Nikolaj I. Schwartzbach. Deposit schemes for incentivizing behavior in finite games of perfect information. CoRR, abs/2107.08748, 2021. URL:
  52. Avishay Yanai. Blinderswap: MEV meets MPC., 2021. Accessed 03/08/23.
  53. Haoqian Zhang, Louis-Henri Merino, Vero Estrada-Galiñanes, and Bryan Ford. F3B: A low-latency commit-and-reveal architecture to mitigate blockchain front-running. CoRR, abs/2205.08529, 2022. URL: