This technical blog post details the rigorous optimization of Kernel, ZeroDev's core Smart Contract Account (SCA), to make it the most gas-efficient and widely adopted solution for ERC-4337 (Account Abstraction) wallets.
The Challenge of Modularity
Initial versions of Kernel faced a challenge: its essential modularity (support for plugins) introduced a gas overhead compared to simpler, non-modular implementations. The goal of the Kernel v2.1 upgrade was to eliminate this performance penalty while retaining its flexibility.
The results show that Kernel v2.1 and the specialized Kernel v2.1-lite are now the most gas-efficient SCAs available.
Key Performance Data (Total Gas Consumption)
The benchmark demonstrated Kernel's superior performance across key operations (Creation + Native Transfer + ERC20 Transfer):
- Kernel v2.1-lite: 440,417 gas units (The most efficient overall).
- Kernel v2.1: 486,942 gas units.
- Other Implementations (Range): 487,249 to 594,505 gas units.
Core Optimization Strategies
To achieve these gains, ZeroDev focused on two main areas:
- Proxy Optimization:
- The standard OpenZeppelin proxy was replaced with the hyper-optimized, audited proxy from Solady, saving gas per operation and reducing deployment size.
- An unnecessary proxy administrative feature (for upgrades) was removed, saving approximately 20,000 gas on deployment.
- ECDSA Validation Optimization:
- ZeroDev adopted Solady’s ECDSA recovery procedure for immediate savings.
- The creation of Kernel Lite was the biggest breakthrough. This specialized version hardcodes the ECDSA validation logic, eliminating the plugin dispatch overhead for the majority of users who only need standard signature support.
Commitment to Ecosystem
ZeroDev is sharing its success by open-sourcing the benchmark tools. This encourages other SCW implementations to test their contracts, improve gas efficiency, and contribute to cheaper transactions for all AA users.