Flare is committed to providing developers with the best possible building environment, partnering with Etherspot and Web3Auth to help you take your dapp’s user experience to the next level. This comprehensive guide, written by Etherspot, outlines the process of building dapps with Account Abstraction on Flare.
Account Abstraction and ERC-4337
User experience will play a crucial role in the future adoption of Web3. From the complexities of Web3 wallet creation to the mandatory possession of native chain tokens, the current experience can be frustrating for both newcomers and experienced users alike.
To address these challenges, the concept of Account Abstraction emerged, resulting in the Ethereum Improvement Proposal EIP-4337, or ERC-4337. In the current Ethereum landscape, there exist two main account categories: Externally Owned Accounts (EOAs) and Contract Accounts. EOAs, managed through private keys, interact with contract accounts to carry out transactions. Meanwhile, contract accounts are overseen by the deployed code on the network.
The ERC-4337 standard introduces account abstraction to the Ethereum network, enabling smart contracts to function as wallets and execute transactions on behalf of users. This groundbreaking development eliminates the need for users to manage private keys or hold ETH for gas fees.
ERC-4337 works on top of the blockchain without needing to change the blockchain itself. This renders it immediately applicable, whether on Ethereum or any EVM chain, with no substantial modifications to the fundamental blockchain infrastructure. ERC-4337 consists of key parts like UserOperations, Bundler, EntryPoint, Smart Account, Paymaster, and Aggregator.
- UserOperations: Replaces traditional transactions by sending operations to a higher-level mempool.
- Bundler: Acts as an intermediary, assembling transactions based on UserOperations and submitting them to the network.
- Smart Account: The end user’s account, capable of verifying UserOperations and supporting additional features like social recovery and multi-operations.
- EntryPoint: Serves as the initial point of entry for a UserOperation, determining the transaction execution flow and specifying involved contracts.
- Paymaster: Delegates the responsibility of paying gas fees, offering flexibility in handling transaction costs and settling fees with ERC20 tokens.
- Aggregator: Manages and collates the results of executed UserOperations, enhancing usability and efficiency.
How to implement Account Abstraction into any dapp on Flare
For developers on Flare who want to enhance their dapps and make them ERC-4337 compliant, Etherspot provides the essential tools. With the Prime AA SDK, Skandha Bundler, and Arka Paymaster, Etherspot facilitates the integration of Account Abstraction features. These features offer benefits such as Web2-like onboarding, a seamless multi-chain experience, fiat on/off ramp, gasless transactions, recovery guardians, and much more. Check out this guide to integrating Etherspot Prime into your dapp on Flare.
If you want to dive right into the code, you can run these commands in the terminal to clone and deploy a functioning dapp on Flare:
git clone https://github.com/taylorferran/etherspot-flare.git
cd etherspot-flare
npm i
npm run start
Another way to get going with Account Abstraction on Flare is to use Transaction Kit. Using this video guide you can find out how to interact with smart contracts on coston2 through a React dapp:
Web2-like Onboarding with Etherspot and Web3Auth
Etherspot teams up with Web3Auth to provide a smooth Web3 experience via social logins. This collaboration enables users to log in through platforms like Twitter, Discord or Google, establishing an Etherspot smart contract wallet for them to effortlessly engage with dapps.
Here is an example of a working Web3Auth social login implementation using the Etherspot Prime SDK. Don’t forget to replace WEB3AUTH_CHAIN_ID_HEX with 0x10 for Flare Testnet Coston, 0x72 for Flare Testnet Coston2 and 0xe for Flare Mainnet.
📚Etherspot Documentation 👉 https://etherspot.fyi/
📚Web3Auth Documentation 👉https://web3auth.io/docs/index.html
In case you have any questions regarding the integration, feel free to reach out to the Etherspot team on Discord.
Why not also join the Flare Ecosystem Call with Etherspot & Web3Auth on November 28 at 13:00 UTC on X: https://twitter.com/i/spaces/1lDGLPYmrkoGm. During this session, we will explore UX challenges in Web3, the impact of Account Abstraction on Flare’s ecosystem, and how Etherspot and Web3Auth tackle these challenges, providing advantages for both developers and users.