owned this note
owned this note
Published
Linked with GitHub
*Acknowlegements: We would like to thank [Hazim Jumali](https://twitter.com/hazimj_) (Stackup), [Kristof Gazso](https://twitter.com/kristofgazso) (Pimlico), [Derek Chiang](https://twitter.com/decentrek) and [Taek Lee](https://twitter.com/leekt216) (ZeroDev Kernel) for their review and feedback on this. [Vignesh Aravamudhan](https://github.com/vignesha22) and [Sherif Abdelmoatty](https://twitter.com/SherifA990) for running the necessary tests.
We would like to emphasize from the beginning that the purpose of this exercise was not to assert the superiority of one implementation over the other. The primary goal was purely academic, aiming to document the extent of gas consumption by smart wallets during different operations in comparison to EOAs.
Gas consumption is a critical factor to consider when developing and deploying smart contracts on the Ethereum blockchain. Different implementations of account abstraction can have varying gas costs for various operations. In this blog post, we will compare the gas consumption of different account abstraction implementations, specifically focusing on the following SDKs: Simple Account, Kernel, Etherspot, and Biconomy. We will analyze the gas costs for wallet deployment, native token transfer, ERC20 transfer, NFT minting, NFT transfer, and swaps.
Before we dive into the comparison, it's important to note the additional information related to the testing of these implementations:
- All transactions were performed on the Mumbai Testnet, ensuring that the results are specific to the test environment and may not directly reflect the gas costs on the Ethereum mainnet.
- ZeroDev Kernel contracts were tested using the Stackup bundler and UserOp.js. This approach provides a comprehensive evaluation of the Stackup implementation, as it involves both the bundler and UserOp.js for transaction execution. Currently, UserOp.js uses an alpha version of Kernel 2.0, which is expected to be further optimized before entering production.
- Etherspot and Biconomy contracts were tested using their respective SDKs. This testing methodology ensures that the gas costs reflect the specific implementation details of each SDK, giving a fair comparison within their ecosystem.
- SimpleAccount contracts were tested using both Stackup's and Pimlico's bundler.
- UserOps using Paymasters were not considered for these tests.
- Gnosis Safe contract was [Candide Wallet's](https://www.candidewallet.com/) implementation.
- The github commit hashes of the contracts that were used for testing are as follows:
- Etherspot - [88e99223540d1b2352d45b238469ea617509d123](https://github.com/etherspot/etherspot-prime-contracts/commit/88e99223540d1b2352d45b238469ea617509d123)
- Biconomy - [9cea2f63c0a61380f295be122aeb6ee4697608d5](https://github.com/bcnmy/scw-contracts/commit/9cea2f63c0a61380f295be122aeb6ee4697608d5)
- SimpleAccount - [abff2aca61a8f0934e533d0d352978055fddbd96](https://github.com/eth-infinitism/account-abstraction/commit/abff2aca61a8f0934e533d0d352978055fddbd96)
- ZeroDev Kernel - [130d258f1b8996718894c5a40222af06262c96e1](https://github.com/zerodevapp/kernel/commit/130d258f1b8996718894c5a40222af06262c96e1)
- Gnosis - [f7131dad4532e40488ade1932b9fd4f68c8d0e58](https://github.com/candidelabs/CandideWalletContracts/commit/f7131dad4532e40488ade1932b9fd4f68c8d0e58)
**Gas Consumption Results:**
Below is a table displaying the gas consumption results (in gas units) for each operation across various account abstraction implementations. The table also includes the corresponding gas consumption for an externally owned account (EOA).
| Implementation | Wallet Deployment | Native Transfer | ERC20 Transfer |NFT Transfer | NFT Mint | Swap |
| -------- | -------- | -------- | -------- | -------- | -------- | -------- |
[Etherspot](https://github.com/etherspot/etherspot-prime-contracts)|[172994](https://dashboard.tenderly.co/tx/polygon-mumbai/0x3a198487d62e4af12fbc5bb188faacffe8022bcb0e87d9df7bdce4670121e46a/gas-usage)|[105682](https://mumbai.polygonscan.com/tx/0xfde380a76d67e6201b5313e564107ceb72541d243c6afdf892f7dbcee993d223)|[110983](https://mumbai.polygonscan.com/tx/0xfa52ca11bf6dc61b7fe73860a3b482d9ee315c7b3a9bb0c57a622fc78aec6e72)|[118390](https://mumbai.polygonscan.com/tx/0x34e55ce6ab8c2ac003b46f39b3ce08e182a367306cb6e71d2e44fc4ef95a7a4b)|[153451](https://mumbai.polygonscan.com/tx/0xf17f2983b68b6e0710fcc23ff9de026c57f1ad7364d453a5ff29fbae163ba2ac)|[185612](https://mumbai.polygonscan.com/tx/0x281514b31e6fb02a59419c78441c7d03948857630b9407d4756c9b515976e95a)|
[SimpleAccount](https://github.com/stackup-wallet/contracts)|[279730](https://dashboard.tenderly.co/tx/polygon-mumbai/0x20322da82dbdc13ea69ae462ab60bab9ee71b82ca4dd963ec939caf66e632dfc/gas-usage)|[96806](https://mumbai.polygonscan.com/tx/0x969778adca19122e402c5c12a65248f5cc75b42f19d1d38045b70dfe6a9c8655)|[105273](https://mumbai.polygonscan.com/tx/0xa168918dfc8d611b0063ae8b193cabccce88e02ea8d869e7dc5449f0ace5ab02)|[135850](https://mumbai.polygonscan.com/tx/0x22f98286b701f6717f2db60f50f122eb35146ea8c289070616601719124c65ee)|[146816](https://mumbai.polygonscan.com/tx/0x3ccb8212406c1b8c375a5c8c53a21c89ff1ddc8f5fe8764bd82bfcd761d9ae21)|[198567](https://mumbai.polygonscan.com/tx/0xb22269bdd03203085ec1a0843da452a6922f589aa4e7a269832e2e4679e9770d)|
[Biconomy](https://github.com/bcnmy/scw-contracts)|[161207](https://dashboard.tenderly.co/tx/polygon-mumbai/0x87bb3bd2171e0727720fb089ff0d7935abb38b8ef7f57ab4461dddf89cf9baa5/gas-usage)|[126111](https://mumbai.polygonscan.com/tx/0x95927823a3d6bf89cd1e67aa4acb5fe852d81ef058a85b37b5269e16a54eee0b)|[136489](https://mumbai.polygonscan.com/tx/0x3bb31f24cb3ff31ee76c6214bab6c5e2cd8686206b5a4383c53a9cbe592ef120)|[143472](https://mumbai.polygonscan.com/tx/0x28742f7e1d12d81e4810ae9cf0f4fd673273a1c3044b2fe0ede9cd3d60d8ed66)|[157517](https://mumbai.polygonscan.com/tx/0x45432a0213cd921359dbe72f29ceceb6addfd6321df861590149618da6e2a4a4)|[198544](https://mumbai.polygonscan.com/tx/0xdcb7b030c77e8ba94f2036c9767773f14c9ef8323de917808454514b33a9638e)|
[ZeroDev Kernel](https://github.com/zerodevapp/kernel)|[200157](https://dashboard.tenderly.co/tx/polygon-mumbai/0x20c25b162fc0b0dd2f5597a0c911b7e7aa660b859800684fd1d60203e314aac7/gas-usage)|[114862](https://mumbai.polygonscan.com/tx/0xe07ecbe7bee4cf4874f86ca0b515167bc6c4ae87d9fc523f793d23758f29d19d)|[117551](https://mumbai.polygonscan.com/tx/0x410caad89e0d7edffba23c6fa67c0a1ee3eaf2a669ae6c1ddd8ff60f522ce199)|[146989](https://mumbai.polygonscan.com/tx/0x8020a2d6db124de439bb2d396390ff8fd632036a91f31832f1ceb4fb31c50f6f)|[164917](https://mumbai.polygonscan.com/tx/0x65b9e5607d207c19a7cee6fd37c6d26f3d4b9a97ee4696fc0794e924a7f9d415)|[214226](https://mumbai.polygonscan.com/tx/0x43b9c8eeded61d4870bc020973d2dfa2e57d03e753c9f9e89f35849766f826bb)|
[Gnosis Safe*](https://www.candidewallet.com/)| [244315](https://dashboard.tenderly.co/tx/polygon-mumbai/0x614bc42b9f027b0c8145f78e211f643a5ad4aa934b041f930936e6132acfc868/gas-usage)|[106585](https://mumbai.polygonscan.com/tx/0x2f1ccd0cd79b083f5c2ca5731110a2a1bc3d72829b6fe10d442fbb95c18b1bd8)|[116868](https://mumbai.polygonscan.com/tx/0xdca0d6cdb4aa86c2605f02795158c377b2b7180a7d86b0ab1a8be508b43c7c76)|[124406](https://mumbai.polygonscan.com/tx/0x93251532af7920d5bf6836f469746b41d066d89f2b05ef6bdb3b8989cbed5199)|[159379](https://mumbai.polygonscan.com/tx/0x738355b4f0a1f53063f10646a2fc8fc5ff7be13948c309613f3160acf957974d)|[191623](https://mumbai.polygonscan.com/tx/0xaa0036ff5bcc645ee0fac853c8286fb9b9d515387f22f958f8bd2d4ab4052372)|
EOA| - | [21000](https://mumbai.polygonscan.com/tx/0x2972c60b246a92ad291e5c8fde90b5c3a1d0987270e002170c5944e6aaa8f1dd)|[51806](https://mumbai.polygonscan.com/tx/0x27e43f02d11cf35ef4fad8dc4df5763757ef7cb94b3a38a3ffed97a07482fb1d) | [61044](https://mumbai.polygonscan.com/tx/0x4ee748cd877a5499aa564720c402091cb4030e880a3972f84a1979992a01bff5)| [57708](https://mumbai.polygonscan.com/tx/0xaae579f986f15373fca5b521a27fa859394fb152acf60deb7fea55427f38dee3)| [102027](https://mumbai.polygonscan.com/tx/0xdbca611d064f3b8d6fb2335a32778603a823003bfbd16259e5c428a12d6bf664)|
![](https://hackmd.io/_uploads/r11-fYgK3.png)
**Wallet Deployment:**
Finding the gas consumption for wallet deployments posed a challenge due to the interconnected nature of the deployment process. The deployment of the wallet contract is not an independent event but rather occurs within the context of the first UserOp initiated from a specific wallet address. To address this, we utilized Tenderly's gas profiler feature, which allowed us to determine the gas consumed by the `_createSenderIfNeeded` contract function call. Through our testing, we discovered that SimpleAccount consumed the highest gas (279K), followed by Gnosis (244K), ZeroDev Kernel (200K). Etherspot's implementation at 172K and Biconomy at 161K gas units.
**Native Token Transfer:**
Simple Account implementation leads in terms of gas efficiency for native token transfers, with a consumption of 96k. Etherspot closely follows with 105k, while Kernel, with 114k gas have slightly higer cost and Biconomy's implementation consumes 126.
**ERC20 Transfer:**
Simple Account implementation consumes the least amount of gas at 105K, Etherspot follows closely utilizing 110k gas,followed by Kernel at 117k. Biconomy has a gas cost of 136k.
**NFT Minting:**
Simple Account implementation requires the least amount of gas at 143K closely followed by Etherspot that requires 153k, followed by Biconomy and Gnosis at 157k and 159k, respectively. Kernel uses 164k gas units.
**NFT Transfer:**
Simple Account and Kernel demonstrates the lowest gas consumption for NFT transfers at 147K gas units, closely followed by Etherspot at 153k. Biconomy's implementation consumes at 157k.
**Swaps:**
Kernel is the highest in terms of gas consumption for swaps at 214k. While Biconomy and Simple Account implementations have gas costs of 199k and 198k, respectively. Etherspot's implementation consumes the least gas units (185K) for swaps.
**Conclusion**
In this comparison of gas consumption in various account abstraction implementations, we analyzed the gas costs for wallet deployment, native token transfer, ERC20 transfer, NFT minting, NFT transfer, and swaps. The results show that the performance varies across the implementations and operations tested.
Ultimately, the choice of account abstraction implementation depends on the specific requirements of your project and the trade-offs you are willing to make between functionality and gas efficiency. Consider these gas consumption results as a starting point for your evaluation and conduct further research to determine the best implementation for your needs.