0%
HomeBlogAnnouncements
Open Sourcing Rundler 🦀

Open Sourcing Rundler 🦀

Author: Dan Coombs

Reviewed by Brady Werkheiser


Published on September 28, 20235 min read

Today we are excited to open source Rundler (Rust Bundler), an ERC-4337 bundler implementation by Alchemy, written in Rust. With Rundler, we strive to accelerate the smart account transition to achieve the next level of user experience on EVM chains. Bundlers are a vital piece of the infrastructure to power Account Abstraction. We are open sourcing Rundler to foster a decentralized and robust network capable of supporting this transition.

Rundler is a high-performance, high-reliability, modular, ERC-4337 bundler.

Too many words?

Lets break that down 👇

ERC-4337 is a standard to deliver Account Abstraction on all EVM chains with zero changes to the core protocol. It accomplishes this by relying on higher-level, off-chain infrastructure like Bundlers. Basically, ERC-4337 lets developers get all the benefits of Account Abstraction, without the risks of core protocol development.

To learn how ERC-4337 works, check out this 4-part series, "You Could Have Invented Account Abstraction," by David Philipson, an engineer on Alchemy’s AA team.

To start building with ERC-4337 accounts, explore our enterprise-grade Embedded Accounts.

The core off-chain piece of the higher-layer infrastructure noted above is the Bundler. A Bundler’s job is to take transaction-like objects (User Operations) submitted by users, group them into a single EVM transaction, and land that transaction onchain. In return it takes a small fee from each user. Whereas EOA wallets submit transactions to nodes, all ERC-4337 smart accounts submit UserOps to a Bundler.

Diagram of how a bundler handles user operations (UOs).
Diagram of how a bundler handles user operations (UOs).

We built Rundler to help the ecosystem onboard the next 1B users into web3. We believe Account Abstraction and ERC-4337 are the best path to make crypto accessible to a mainstream audience. In order to deliver that mainstream experience, we need highly reliable infrastructure with best-in-class developer experience, modular design, and support for every EVM chain.

As we’ve built Rundler we’ve been deeply involved with the evolution of the ERC-4337 standard, and we intend to continue to contribute here. We’re learning a ton from our experience running Rundler in production, and we continue to share those experiences with the 4337 community to help improve.

Performance and reliability are paramount to onboard the types of applications that will bring a billion users onchain. This belief is at the core of Rundler and Alchemy’s associated APIs, and we strive to continue to push the limit.

Every EVM chain deserves best-in-class infrastructure to support Account Abstraction. Protocols handle the hairy details differently (i.e. gas usage, precompiles, transaction supply-chain, etc.). With Rundler we hope that its logic can be extended to support the majority, if not all, of these use cases.

We’re not stopping with Rundler. We strive for the different components of the Rundler library to be extended and used to power new 4337 and alternative-mempool infrastructure.

At Alchemy, we believe the transition to smart accounts is required to bring the benefits of Ethereum’s technology to everyone. Rundler is a crucial step towards achieving that vision.

Rundler is built to achieve the levels of performance required by the most demanding workloads. We chose Rust as our programming language to help achieve this via its concurrency primitives and zero-cost abstractions. We want Rundler to be highly concurrent, horizontally scalable, and easily extendable to meet the scalability demands of next-generation applications.

We recently measured Rundler as landing 7.5M gas per second on Polygon Mainnet (roughly 55 TPS in that workload), and with this architecture, we can land higher volumes.

Sustained eth_sendUserOperation transactions per second on Polygon.
Sustained eth_sendUserOperation transactions per second on Polygon.

Rundler’s architecture is designed to meet the high-reliability service users expect. By leveraging the learnings of years of running blockchain infrastructure, we built Rundler as an extension of that ethos. Rundler shines in modern cloud-like settings where each component can run and scale independently and where observability and telemetry are a must.

Rundler is built in a modular fashion, where each component is modeled as a library (or crate in Rust) and is able to run independently of other components. As our interfaces stabilize, we hope to use these components to power the next iteration of write-path infrastructure.

We’ve been running Rundler in production since April, where it is being used to help power some of the most promising applications in the space including CyberConnect CyberAccounts and Circle Programmable Wallets.

Here are some numbers from our first few months:

  • 402K+ UserOps landed successfully on chain

  • 71% of UserOps landed in a bundle with more than 1 UO, 4.7x higher than other known bundler implementations

  • 430% quarterly growth in Unique Active Developer teams sending UserOps

Rundler is used to power our Bundler API endpoints. However, it is under active development by a strong team of developers at Alchemy. We will continue to add features to enable our users to leverage the power of Account Abstraction to its fullest extent.

Along with having full ERC-4337 spec compatibility and v0.6 Entry Point contract support, Rundler has a number of cool features worth highlighting:

Rundler can be run as a full node in a single process, where each component communicates via in-memory message passing. Alternatively, these components can also be run in independent processes where they communicate via gRPC facilitating horizontal scalability and redundant deployments.

We’ve pioneered novel ways of estimating the different gas fields of an ERC-4337 user operation leveraging some clever smart contract trickery and binary search.

Our mempool implementation is chain reorganization resistant. We track the progress of the chain, detect when the chain has reorg-ed, and return any User Operations that may have been dropped from the chain to the mempool so that they become eligible for inclusion once again.

We’ve built our bundle building component to achieve network-level gas throughput. That is, we strive to completely saturate any network with bundles that approach the block’s gas limit and that land in every block.

We’ve been experimenting with ERC-4337 alternative mempools and have been helping push this conversation forward. Today, these alt-mempools open the bundler up to certain mempool attacks, but we hope to use this research to implement a secure alt-mempool in the future.

Now that we’re here, whats next? On our immediate roadmap we are starting to build out P2P and safe alternative mempools, support for Entry Point v0.7, signature aggregation, and block builder integrations.

The promised ERC-4337 public P2P mempool is coming this fall and we are currently building out support.

As mentioned above, we are looking to iterate on our alternative mempool approach to build a bundler-safe implementation.

Entry Point v0.7 and Multiple Version Support

The ERC-4337 team is hard at work on the next iteration of the Entry Point contract, v0.7. Once released we will strive for quick support while maintaining support for the v0.6 contract.

Signature aggregation is one of the most touted features of ERC-4337. However, implementing it in a way that allows bundlers to maintain profitability has proven challenging. We are taking a closer look here and hope to power the first practical signature aggregators.

In our attempt to land high rates of User Operations onchain we’ve encountered issues that will only be exacerbated by the introduction of the P2P mempool (more on this another time). These problems are greatly reduced if/when block builders integrate bundling directly into their process.

We hope that by open sourcing Rundler we can continue to spur innovation in the space. Users can explore the logic that is powering their User Operations and contributors can add features and fix bugs to improve and harden the Rundler.

If you’re looking to contribute, explore our contribution guide and reach out!

Building out the ERC-4337 ecosystem is a team effort, and we wouldn’t be able to achieve what we have without the leadership, guidance, and support from multiple teams across the space.

The ERC-4337 team has pioneered the standard, and has answered countless questions during our development. They developed the bundler reference implementation and spec tests that were invaluable during our development process. We are excited to continue to work with this team to push ERC-4337 ahead.

Shout-out to the Reth team, from which we've taken inspiration for many of our practices. They are pushing the Ethereum Rust ecosystem forward in an open way, and we thank them for their continued contributions.

See you in the (alternative) mempool.

🦀

Desktop section background image

Build blockchain magic

Alchemy combines the most powerful web3 developer products and tools with resources, community and legendary support.

Get your API key