● How to Survive in the Ethereum Dark Forest
-
Individual orders are grouped together into a batch and executed at the same time.
-
The same clearing price is assigned to all orders within one batch.
● ethers-provider-flashbots-bundle This repository contains the FlashbotsBundleProvider ethers.js provider, an additional Provider to ethers.js to enable high-level access to eth_sendBundle and eth_callBundle rpc endpoint on mev-relay.
● Ethereum Smart Contract Best Practices FrontRunning
- Front Running Prevention: Commit - Reveal
The best remediation is to remove the benefit of front-running in your application, mainly by removing the importance of transaction ordering or time. Commit - Reveal:
- Indicate intent to do some action (claim a bounty, propose a purchase or sale), submit a commitment:
○ Submit: keccak256(encoded action, msg.sender)
○ Contract stores the commitment (message digest)
- To execute the action, reveal the proposed action:
○ Submit: encoded action
○ Contract checks that the commitment == keccak256(encoded action, msg.sender)