Silius - ERC-4337 (Account Abstraction) bundler implementation in Rust.
For more information: https://hackmd.io/@Vid201/aa-bundler-rust
This project is still under active development.
Prerequisites:
Rust version: 1.71.1
libclang-dev
,pkg-config
andlibssl-dev
on Debian/Ubuntu.- Ethereum execution client JSON-RPC API with enabled
debug_traceCall
. For production, you can use Geth or Erigon. For testing, we are using Geth dev mode (tested with v1.12.0); so you need to install Geth for running tests. solc
>=0.8.12.cargo-sort
andcargo-udeps
.
Set up third-party dependencies (ERC-4337 smart contracts and bundler tests):
make fetch-thirdparty
make setup-thirdparty
Create wallet for bundler:
cargo run --release -- create-wallet --output-path ${HOME}/.silius --chain-id 5
Run bundler (with user operation pool and JSON-RPC API):
cargo run --release -- bundler --eth-client-address http://127.0.0.1:8545 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws
Run only bundling component:
cargo run --release -- bundling --eth-client-address ws://127.0.0.1:8546 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789
Run only user operation pool:
cargo run --release -- uopool --eth-client-address ws://127.0.0.1:8546 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789
Run only JSON-RPC API:
cargo run --release -- rpc --http --ws
docker run --net=host -v ./bundler-spec-tests/keys/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266:/data/silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -v ./db:/data/silius/db ghcr.io/vid201/silius:latest bundler --eth-client-address http://127.0.0.1:8545 --datadir data/silius --mnemonic-file data/silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789 --http --http.addr 0.0.0.0 --http.port 3000 --http.api eth,debug,web3 --ws --ws.addr 0.0.0.0 --ws.port 3001 --ws.api eth,debug,web3 --eth-client-proxy-address http://127.0.0.1:8545
Bundler was tested on the following networks:
Chain | Mainnet | Testnet |
---|---|---|
Ethereum | π | π (Goerli), βοΈ (Sepolia) |
Polygon PoS | π | βοΈ (Mumbai) |
The address of the entry point smart contract is the same on all EVM networks.
Address | Version | Commit | Audited |
---|---|---|---|
0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 | 0.6.0 | 9b5f2e4 | April 2023 |
To get started, check the examples here. More examples will be added in the future.
Thank you for showing interest in contributing to the project!
There is a contributing guide to help get you started.
There are some additional prerequisites for testing:
Before making a PR, make sure to run the following commands:
make format
make lint
make test
Official bundler spec tests developed by the eth-infinitism team are also included in the repo's CI pipeline (commit: bbd61f21e95ed1290678fcbfd9551b1502c81fe9). You can find more information on how to run tests here. Make sure your contribution doesn't break the tests!
The best place for the discussion is the dedicated Telegram group.
- Luban the Paymaster: A Cross-chain Tx Sponsorship Protocol.
- Ethers UserOp: An ether-rs middleware to craft UserOperations.
This project is dual-licensed under Apache 2.0 and MIT terms:
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
Silius is an open-source project and a public good. If you want to help the project, you can send donations of any size via:
- Ethereum address:
0x7cB801446AC4f5EA8f7333EFc58ab787eB611558