The following document provides architecture, design, and specifications for the ERC-4337 (Account Abstraction - AA) bundler implementation in Rust - Silius. This project was started in the Ethereum Protocol Fellowship - The Third Cohort but is still being actively developed.
One of the essential components of the ERC-4337 AA is bundlers, which play the infrastructure or node/client role. Most of the heavy processing and calculations are done by them, and they have several responsibilities:
GitHub repository: https://github.com/Vid201/silius/
Contributors: Vid Kersic, WillQ
The architecture and its decomposition are heavily inspired by the Erigon architecture (and here). All main components, i.e., ETH RPC API server, user operation mempool (named UoPool), and Bundler Core, are separable components and can be run as standalone processes. Bundler is implemented in a way that supports multiple entry points and mempools.
Only the ETH RPC API server is exposed to the public internet.
debug_traceCall
are necessary for simulating user operation. UoPool also connects to other bundlers in the P2P network to broadcast received user operations and retrieve other user operations.Bundlers are standalone node components that can be spun up and operated without running Ethereum execution/consensus clients (bundlers connect to the ETH clients over gRPC). Possible tighter integrations into Rust-based execution clients are being considered (such as Reth), either running alongside Reth or reusing some of its components/packages (e.g., P2P library for listening for included user operations in the blocks).
JSON-RPC API Method | Input | Output | Description |
---|---|---|---|
eth_chainId | / | chain ID | ID of the chain the bundler is operating on. E.g., 1 for mainnet. |
eth_supportedEntryPoints | / | List<Address> | List of smart contracts addresses of supported entry points. E.g., ["0x0576a174D229E3cFA37253523E645A78A0C91B57"]. |
eth_sendUserOperation | User operation and entry point | Response (user operation hash or failure reason) | Endpoint for sending user operations. User operation is added to the mempool if it passes sanity checks and simulation. |
eth_estimateUserOperationGas | User operation and entry point | preVerificationGas, verificationGasLimit, callGasLimit | Endpoint for estimating the gas values for user operations. |
eth_getUserOperationReceipt | User operation hash | Response(user operation receipt or null) | Endpoint for retrieving receipt for user operations based on their hash (which is returned by the endpoint eth_sendUserOperation). |
eth_getUserOperationByHash | User operation hash | Response(user operation (with the addition of entry point, block number, block hash, and transaction hash) or null) | Endpoint for retrieving user operations based on their hash (which is returned by the endpoint eth_sendUserOperation). |
There are also several DEBUG RPC API endpoints, but they are not described due to being used only for testing purposes.
gRPC Method | Input | Output | Description |
---|---|---|---|
Add | User operation and entry point | Response (user operation hash or failure reason) | User operation is added to the mempool if it passes sanity checks and simulation. The same method is also used for replacing user operations (user operation with the same nonce but higher gas prices). |
Get sorted | Entry point and count | List<UserOperations> | Returns the list of user operations sorted by max priority fee per gas. |
Remove | User operation hash | Response (result=true/false) | Removes user operation from the mempool. |
Chain id | / | chain ID | ID of the chain the bundler is operating on. E.g., 1 for mainnet. |
Supported entry points | / | List<Address> | List of smart contracts addresses of supported entry points. E.g., ["0x0576a174D229E3cFA37253523E645A78A0C91B57"]. |
Estimate user operation gas | User operation and entry point | preVerificationGas, verificationGasLimit, callGasLimit | Method for estimating the gas values for user operations. |
There are also several DEBUG gRPC endpoints, but they are not described due to being used only for testing purposes.
Additional enhancements:
ERC-4337: Account Abstraction Using Alt Mempool
ERC-4337 website
ERC-4337 Twitter
GitHub ETH Infinitism
Bundler spec
Bundler spec tests
Bundler test executor
Bundler spec tests results
Ethereum Protocol Fellowship - The Third Cohort (project description)