FairMM: A Fast and Frontrunning-Resistant Crypto Market-Maker

As new and emerging markets, crypto(-currency/-token) markets are susceptible to manipulation and illiquidity. The theory of market economics, offers market makers that bear the promise of bootstrapping/stabilizing such markets and boosting their liquidity. In order, however, to achieve these goals, the market maker operator (typically an exchange) is assumed trusted against manipulations. Common attempts to remove/weaken this trust assumption require several on-chain rounds per trade or use expensive MPC machinery, and/or are susceptible to manipulative market-maker operators that perform informed front-running attacks—i.e., manipulate the sequence of trades using future trade information. Our work proposes a market-maker-based exchange which is resilient against a wide class of front-running (in particular, reordering attacks). When instantiated with a monopolistic profit seeking market maker our system yields a market where the trading price of crypto-tokens converges to a bid-ask spread centered around their true valuation. Importantly, after an initial setup of appropriate smart contracts, the trades are done in an off-chain fashion and smart contracts are invoked asynchronously to the trades. Our methodology yields a highly efficient exchange, where the market maker’s compliance is ensured by a combination of a rational market analysis, cryptographic mechanisms, and smart-contract-based collaterals. We have implemented our exchange in Ethereum and showcase its competitive throughput, its performance under attack, and the associate gas costs.

[1]  Daniel Davis Wood,et al.  ETHEREUM: A SECURE DECENTRALISED GENERALISED TRANSACTION LEDGER , 2014 .

[2]  Jan Camenisch,et al.  Optimistic Fair Secure Computation , 2000, CRYPTO.

[3]  Paul R. Milgrom,et al.  Bid, ask and transaction prices in a specialist market with heterogeneously informed traders , 1985 .

[4]  Alptekin Küpçü,et al.  Usable optimistic fair exchange , 2010, Comput. Networks.

[5]  Liuba Shrira,et al.  Cross-chain deals and adversarial commerce , 2019, The VLDB Journal.

[6]  Georg Fuchsbauer,et al.  WI Is Not Enough: Zero-Knowledge Contingent (Service) Payments Revisited , 2019, IACR Cryptol. ePrint Arch..

[7]  Joël Gugger,et al.  Bitcoin-Monero Cross-chain Atomic Swap , 2020, IACR Cryptol. ePrint Arch..

[8]  Stefan Dziembowski,et al.  FairSwap: How To Fairly Exchange Digital Goods , 2018, IACR Cryptol. ePrint Arch..

[9]  Silvio Micali,et al.  A Completeness Theorem for Protocols with Honest Majority , 1987, STOC 1987.

[10]  Rosario Gennaro,et al.  Zero-Knowledge Contingent Payments Revisited: Attacks and Payments for Services , 2017, IACR Cryptol. ePrint Arch..

[11]  Carsten Baum,et al.  P2DEX: Privacy-Preserving Decentralized Cryptocurrency Exchange , 2021, IACR Cryptol. ePrint Arch..

[12]  Stefan Dziembowski,et al.  Efficient Zero-Knowledge Contingent Payments in Cryptocurrencies Without Scripts , 2016, ESORICS.

[13]  Maurice Herlihy,et al.  Atomic Cross-Chain Swaps , 2018, PODC.

[14]  Ethan Heilman,et al.  The Arwen Trading Protocols , 2020, Financial Cryptography.

[15]  Alexei Zamyatin,et al.  XCLAIM: Trustless, Interoperable, Cryptocurrency-Backed Assets , 2019, 2019 IEEE Symposium on Security and Privacy (SP).

[16]  Matthew Green,et al.  Bolt: Anonymous Payment Channels for Decentralized Currencies , 2017, CCS.

[17]  N. Asokan,et al.  Optimistic fair exchange of digital signatures , 1998, IEEE Journal on Selected Areas in Communications.

[18]  Matthew Green,et al.  Fairness in an Unfair World: Fair Multiparty Computation from Public Bulletin Boards , 2017, CCS.

[19]  Ari Juels,et al.  Flash Boys 2.0: Frontrunning in Decentralized Exchanges, Miner Extractable Value, and Consensus Instability , 2020, 2020 IEEE Symposium on Security and Privacy (SP).

[20]  Jiangshan Yu,et al.  On the optionality and fairness of Atomic Swaps , 2019, IACR Cryptol. ePrint Arch..

[21]  Christian Decker,et al.  A Fast and Scalable Payment Network with Bitcoin Duplex Micropayment Channels , 2015, SSS.

[22]  N. Asokan,et al.  Optimistic Fair Exchange of Digital Signatures (Extended Abstract) , 1998, EUROCRYPT.

[23]  Aggelos Kiayias,et al.  Fair and Robust Multi-party Computation Using a Global Transaction Ledger , 2016, EUROCRYPT.

[24]  Maurice Herlihy,et al.  Privacy-Preserving Cross-Chain Atomic Swaps , 2020, Financial Cryptography Workshops.

[25]  Sebastian Faust,et al.  OptiSwap: Fast Optimistic Fair Exchange , 2020, IACR Cryptol. ePrint Arch..

[26]  L. Glosten Insider Trading, Liquidity, and the Role of the Monopolist Specialist , 1989 .

[27]  Abhi Shelat,et al.  Analysis of the Blockchain Protocol in Asynchronous Networks , 2017, EUROCRYPT.

[28]  J. Wolfers,et al.  Prediction Markets , 2003 .

[29]  Sanmay Das,et al.  Adapting to a Market Shock: Optimal Sequential Market-Making , 2008, NIPS.

[30]  Ran Canetti,et al.  Security and Composition of Multiparty Cryptographic Protocols , 2000, Journal of Cryptology.

[31]  Ran Canetti,et al.  Universally composable security: a new paradigm for cryptographic protocols , 2001, Proceedings 2001 IEEE International Conference on Cluster Computing.

[32]  Andrew Chi-Chih Yao,et al.  How to generate and exchange secrets , 1986, 27th Annual Symposium on Foundations of Computer Science (sfcs 1986).

[33]  Ueli Maurer,et al.  Bitcoin as a Transaction Ledger: A Composable Treatment , 2017, CRYPTO.

[34]  Iddo Bentov,et al.  How to Use Bitcoin to Design Fair Protocols , 2014, CRYPTO.

[35]  Henry G. Berg,et al.  Hanson's Automated Market Maker , 2012 .

[36]  Ueli Maurer,et al.  Universally Composable Synchronous Computation , 2013, TCC.

[37]  Ran Canetti,et al.  Universally composable signature, certification, and authentication , 2004, Proceedings. 17th IEEE Computer Security Foundations Workshop, 2004..

[38]  Aggelos Kiayias,et al.  The Bitcoin Backbone Protocol: Analysis and Applications , 2015, EUROCRYPT.

[39]  Sanmay Das A learning market-maker in the Glosten–Milgrom model , 2005 .