Hacker News new | ask | show | jobs
by threwaway4392 1914 days ago
Can't crypto kill front running entirely?

Alice, wanting to transact, writes down two opposing orders, say buy 1 share of A for $10 and sell 1 share of A $10, plus a signed secret stating which order it actually is.

Other players subscribe to one of the two opposite orders.

Next thing (whatever that means in these blockchains, but after other players have subscribed to one of the two opposite orders), Alice reveals the secret using her private key. This reveals which order it was (buy or sell). Alice then makes a deal automatically with whoever subscribed to that order. The other opposite order is cancelled.

3 comments

This has been proposed quite a few times, but the problem comes down to that it requires letting a single participant "lock down" the entire liquidity pair.

For the above scheme to work, Alice's reveal would have to occur at a later block than her initial commit. Otherwise an arbitrage bot could simply peek at the reveal before the commit is mined. Also Alice's commit has to lock the chain until its reveal. Otherwise when her reveal is propagated on the P2P network, the arbitrage bot could jump the queue in front of her commit and still exploit her.

You're now talking about the market freezing for 12-seconds (the block time) on every single trade. That's completely infeasible for any sort of liquid pair like ETH/USDT. Not to mention a single malicious player could DDoS the entire market. Or use it as a free option during periods of high volatility: lock the market then "reveal" in whatever direction the centralized exchanges moved in the lock-up period.

Maybe you could only lock "big trades", but that in itself reveals a lot of information. You don't necessarily know the direction, but you can likely infer it with high certainty. For example if Alice doesn't own much of a token, then it's nearly certain she's buying not selling.

Front running cannot happen if the mempool is encrypted. These types of blockchains are current being explored but have tradeoffs are are not widely adopted. Here are two example blockchains:

SCRT (Hardware TEE, functional on Cosmos)

Partisia (MPC, no working product)

Other theoretical methods include homomorphic encryption and indistinguishable obfuscation.

Bots can probably still front run arbitrage opportunities where it's clear which transaction is the correct one, but the same can probably be done by encrypting the whole transaction and only specifying the wallets involved.