Account Abstraction On Mobile
Problem
ERC-4337: Account Abstraction Using Alt Mempool has finally allowed us to create user-friendly crypto wallets with a seamless web2-like onboarding experience, using smart contract accounts internally. Users don’t need to have any ETH to start using their wallets since developers can sponsor their transactions. Authentication toolkits like Privy, Magic, or Web3Auth allow you to forget about passphrases and backups.
Unfortunately, most of these tools and AA implementations are intended to be used in web apps. And while React Native devs benefit from the plethora of JS libraries and integrations, native developers are less lucky. Existing libraries like Web3j and web3.swift don’t have the support for sending user operations and only distant plans to add it.
Solution
Which brings me to AA-Kotlin and AA-Swift. These are lightweight Android and iOS libraries based on Alchemy’s aa-sdk. Just like aa-sdk, these libraries are intended to be modular and support your custom implementation of smart accounts. Right now, Alchemy’s LightAccount is implemented and is located in the Alchemy module, while Core contains the core components for interacting with ERC-4337. More modules with explicit support for other smart account implementations like ZeroDev are coming in the future (feel free to contribute!).
The repositories also contain an example of using a smart contract account with Web3Auth as an authentication solution. Web3Auth allows you to create a wallet using OAuth-based login systems. If you want to see how a seamless web2-like experience can be implemented in your wallet, make sure to check it.
AA-Kotlin repository: https://github.com/syn-mcj/aa-kotlin
AA-Swift repository: https://github.com/syn-mcj/aa-swift
Happy abstracting 😉