The client came to us with an age-old problem: using blockchain is a pain.
Here's what they meant:
- To send a token to someone, you need to get the native currency to pay for the gas fees.
- Seed phrases are impossible to remember, so you have to write them down somewhere. And if you lose it, your funds are gone forever.
So, the task they set for us was:
Create a full-fledged Web3 wallet where blockchain newbies don't have to worry about gas and seed phrases, and can access a user-friendly ecosystem with tokens and NFTs.
In our team, we discussed two solutions:
- The already tried-and-tested relayer (based on ERC-2771),
- The new, but enticing Account Abstraction (ERC-4337).
At first glance, it seems better to use a time-tested solution rather than a standard that's still in draft. But the client had big plans to collaborate with external DeFi protocols to arrange for sponsoring users' gas fees who would use the wallet.
It's a brilliant idea! A perfect example of a win-win: protocols pay for the gas for using their service and gain more users due to better UX, while the user avoids up to 4 extra steps to acquire the native network token for gas fees. Instead, they would pay a comparable amount in the same token they are operating with.
Also, our client planned an on-ramp integration (like MoonPay) that would allow buying crypto for the wallet using a credit card, Apple Pay, etc.
For all this, a relayer wasn't suitable as it requires changes to be made in the smart contracts of the services we want to partner with. Let's be honest - those willing to adapt their applications for yet-to-be-released wallets were not exactly queuing up.
But Account Abstraction required no changes on the part of other DeFi applications. We just needed to connect to our solution and set some rules, which is much simpler than rewriting and adding additional logic.
Another feature of AA was bundling several transactions into one. While a meta-transaction from a relayer could only contain one transaction, an AA bundler allowed packing several user operations (UserOperations) into one transaction. This helps to save on costs for potential gas sponsors.