# MEV Boost Account Abstraction Based on ERC-4337 ## Project Abstract Only validators and searchers benefit from current MEV ecosystem while the transaction senders where MEV is actually extracted from are excluded. In fact, senders need to pay twice for the transaction execution: the transaction fee and the fetched MEV. The latter always goes against the intention of the sender and can be consider as a robbery in secret towards sender. The project supports senders to capture MEV under the ERC-4337 framework: - Senders use special ERC-4337 wallets called `MEVBoostAccount` and send special userOps called `BoostUserOp` which invokes boost methods of `MEVBoostAccount`. - Searchers use a special ERC-4337 paymaster called `MEVBoostPaymaster` which refunds maxium MEV to users by `BoostUserOp` auction and also pays transaction fee for `BoostUserOp`. The project mainly has following advantages: - Improve the current MEV ecosystem and maximize the sender's interests by trustlessly ensuring the maxium MEV capture by the sender. - It provides a completely **decentralized** and **permisionless** MEV-Share solution. - Considering the existence of MEV, the project promotes the adoption of the ERC-4337 wallet by providing the build-in mev capture features and making transaction possibly less expensive than the EOA. ## Objectives - Implement the `MEVBoostAccount` and `MEVBoostPaymaster` that conform to the ERC-4337 specification. - The project will be open source and provide smart contracts and sdks to support third party integration. - After wallet sdk integration, users can easily deploy `MEVBoostAccount` and send `BoostUserOp` through the sdk. - After seacher sdk integration, searcher can easily fetch `BoostUserOp` through the sdk and provide MEV to the `BoostUserOp`. - Further implement the `BoostUserOp` auction mechanism and provide various auction modes. - The project will be open source and provide smart contracts and sdks to support third party integration. - Wallet users are guaranteed to capture as much MEV as possible through the auction mechanism. - Wallet users can choose the appropriate auction mode for each `BoostUserOp` through the sdk. - Searcher can obtain latest MEV quotation of `BoostUserOp` and bid on demand through sdk. - Since MEV is ubiquitous on Ethereum, implement a modified `EntryPoint` which natively supports `BoostUserOp`. - Reduce gas consumption of `BoostUserOp`. - Simplify the development of `MEVBoostAccount` and `MEVBoostPaymaster`. ## Outcomes - Improve the current MEV ecosystem and maximize the sender's interest by trustlessly ensuring the maxium MEV capture by the sender. - It provides a completely **decentralized** and **permisionless** MEV-Share solution. - Considering the existence of MEV, the project promotes the adoption of the ERC-4337 wallet by providing the build-in mev capture features and making transaction cost possibly less expensive than the EOA. - The sender's interest are protected for searchers get involved in sufficient competition through the auction mechanism and public mempool. - Expand the application scenarios of the ERC-4337 framework. ## Grant Scope - Implement the `MEVBoostAccount` and `MEVBoostPaymaster` that conform to the ERC-4337 specification. The expected outputs are as follows: - Searchers can provide senders with the MEV and pay transaction fee through `MEVBoostPaymaster`. - Senders can use `MEVBoostAccount` to capture the MEV provided by searchers. - `MEVBoostAccount` and `MEVBoostPaymaster` can be support by generic bundler. - Further implement the `BoostUserOp` auction mechanism. The expected outputs are as follows: - Senders can get the highest bid from searchers. - Provide various auction modes to senders. The expected outputs are as follows: - senders can choose different auction curves to meet their requirements - Implement a modified `EntryPoint` which may includes the utility functions, interaction interfaces and integrated `BoostUserOp` handling. The expected outputs are as follows: - Reduce gas consumption of `BoostUserOp`. - Simplify the development of `MEVBoostAccount` and `MEVBoostPaymaster`. ## Project Team I apply the grants as an individual and will allocate at least 14-21 hours per week to the project. ## Background **I have recently started the MEVBoostAA project and verified my idea. Here is the project link: [MEVBoostAA](https://github.com/doublespending/MEVBoostAA).** ### Current MEV Ecosystem - In the view of the sender - `sender` --[fee to excute tx]--> `validator` - The fact goes against the intention of the sender - `sender` --[fee to excute tx]--> `validator` - `sender` --[mev caputured by searcher]--> `searcher` - `searcher` --[share mev with validator]--> `validator` ### MEV Ecosystem with MEVBoostAA MEVBoostAA captures MEV from searchers to senders based on the framework of ERC-4337. so, senders will be protected. - `sender` --[mev caputured by searcher]--> `searcher` - **`searcher` (as a paymaster) --[fee to excute tx] --> `validator`** - **`searcher` --[maxium MEV refund]--> `sender`** - `searcher` -- share mev with validator --> `validator` ### Some Related Links - [MEV and Me](https://research.paradigm.xyz/MEV) - [MEV-Share: programmably private orderflow to share MEV with users](https://collective.flashbots.net/t/mev-share-programmably-private-orderflow-to-share-mev-with-users/1264?utm_source=substack&utm_medium=email) - By comparison, this proposal has the following advantages: - It is a completely **decentralized** and **permisionless** MEV-Share solution. - Utilizing the ERC-4337 framework, this proposal is more concise and with less work. This proposal only need to foucus on the development of `MEVBoostAccount` and `MEVBoostPaymaster`. - This proposal guarantees the interest of senders at the constract level without introducing trust assumption. - Easy to integrate without integrating the heavy flashbot service. - This proposal is premissless and with high transparency. The `BoostUserOp` can be public in the ERC-4337 mempool. - [awesome-MEV-resources](https://github.com/0xalpharush/awesome-MEV-resources) ## Methodology Phase 1: Implement the `MEVBoostAccount` and `MEVBoostPaymaster` that conform to the ERC-4337 specification. - Design according to the MEV scheme and ERC-4337 - Implementation `MEVBoostAccount` and `MEVBoostPaymaster` that comform to the ERC-4337 specification. - Verify that `MEVBoostAccount` and `MEVBoostPaymaster` satisfy constraints of the bundler. - Implement wallet sdk. - Implement searcher sdk. - PoC to verify the life cycle of the `BoostUserOp`. - The sender constructs `BoostUserOp`. - The searcher provides MEV to the sender in `MEVBoostPaymaster`. - `BoostUserOp` is successfully executed. - The sender obtains the MEV. Phase 2: Further implement the `BoostUserOp` auction mechanism and Provide various auction modes to senders - Design according to the auction scheme and ERC-4337 - Implement `BoostUserOp` auction mechanism. - Provide sender with various auction modes. - PoC to verify that the process of the auction. - The sender chooses the auction mode. - The searcher bids for the `boostUserOp`. - The searcher provides MEV to the sender in `MEVBoostPaymaster`. - `BoostUserOp` is successfully executed. - The sender obtains the MEV. Phase 3: Implement a modified `EntryPoint` which may includes the utility functions, interaction interfaces and integrated `BoostUserOp` handling. - Try to modify `EntryPoint` to support `BoostUserOp` natively. - Compare the complexity of the implement of `MEVBoostAccount` and `MEVBoostPaymaster` after modification. - Compare gas consumption after modification. ## Timeline Note: assume the proposal would be granted from May 2023. It is expected to take 9 months and the roadmap is as follows: - May 2023 - July 2023 (3 months) - Implement the `MEVBoostAccount` and `MEVBoostPaymaster` to supports senders to capture MEV under the ERC-4337 framework. - output - A solution that supports senders to capture MEV under the ERC-4337 framework - Smart contract - SDK for sender - SDK for searcher - August 2023 - October 2024 (3 months) - Further implement the BoostUserOp auction mechanism and provide various auction modes. - output - A solution that supports `BoostUserOp` auction and various auction modes. - Smart contract - SDK for sender - SDK for searcher - October 2023 - January 2024 (2 months) - Implement a modified `EntryPoint` which may includes the utility functions, interaction interfaces and integrated `BoostUserOp` handling. - output - Modified `Entrypoint` contract optimized for `BoostUserOp`. - A report that compares the complexity of the implement of `MEVBoostAccount` and `MEVBoostPaymaster` after modification. - A report that compares gas consumption after modification. ## Budget Total budget requested: $40000 - Principle Researchers Costs: $35,000 - Mainly include the human cost of research and development - May 2023 - July 2023 (3 months): $10000 - August 2023 - October 2023 (3 months): $10000 - August 2023 - October 2023 (2 months): $5000 - Hardware Costs & Deploy Costs: $5000 - Mainly include the cost of PoC server and contract deployment