What is Account Abstraction (ERC-4337)

04 Apr 2024

What is Account Abstraction

Web3 might as well be the biggest disruption since the early days of the internet. It is the building block for an ownership-driven digital economy that is borderless and facilitates near-instant settlements.

Despite the ocean of possibility, the user experience remains out of reach for the masses. Most people find it difficult to grasp concepts like public key cryptography, and seed phrases when all they want to do is transfer value from point A to point B.

ERC-4337, dubbed “Account Abstraction”, might as well be the key to unlocking mass adoption of blockchain technology for an ownership-based internet.

This article sheds light on what account abstraction (AA) is and how ERC-4337 works.

What is ERC-4337 and Account Abstraction?

ERC-4337 and Account Abstraction (AA) are two sides of the same coin that helps improve the user experience on the Ethereum blockchain. Account Abstraction refers to the proposal enabling users to use smart contracts by adding flexibility to externally owned accounts (EOA) or custodial wallets.

Let’s simplify this.

Firstly, ERC-4337 is a specific Ethereum Improvement Proposal (EIP) related to Account Abstraction. ERC stands for Ethereum Request for Comment. These are proposals made by the Ethereum community to discuss network changes or improvements.

In the Ethereum network, there are two main types of accounts:

  • Externally Owned Accounts (EOAs)
  • Smart Contract Accounts (SCAs)

EOAs are controlled by private keys and are what most people use for daily transactions. Contract Accounts, on the other hand, are controlled by code (smart contracts).

Account Abstraction is a concept proposing to treat all accounts as smart contracts, essentially blurring the line between EOAs and SCAs. This would enable more flexible and sophisticated control over account actions.

For instance, users could set rules or conditions for transactions, have recovery options for lost keys, and potentially improve security against hacks and thefts.

Implementing AA could involve various technical approaches. ERC-4337 is one of the proposals detailing how it can be done. It includes changes that define how crypto is transferred and how users interact with the blockchain. The idea is to create a more user-friendly and secure system by leveraging the programmability of smart contracts for regular user accounts.

The first account abstraction proposal can be traced to 2016 in the form of EIP-86. This was a proposal that would have allowed users to create ‘account contracts’ instead of using the current mechanism.

There have been other proposals too. But all these proposals weren’t merged with Ethereum and are in the ‘stagnant’ category now as they have been inactive for more than 6 months.

ERC-4337 was proposed in 2021.

But, what does this proposal entail? Before we understand this further, it’s important to understand the distinction between Smart Contract Accounts and Externally Owned Accounts.

Understanding Ethereum Accounts: Smart Contract Accounts (SCA) and Externally Owned Accounts (EOA)

An Ethereum account refers to a unique digital address that can be used to transact and store Ethereum on the Ethereum blockchain. These accounts enable users to make crypto transactions. There are two types of Ethereum accounts.

  • Externally Owned Accounts (EOA)

If you’ve been an Ethereum user before ERC-4337 was implemented, you likely used only Externally Owned Accounts (EOAs).

EOAs are controlled by private keys. The owner of the private key has control over the account, including the ability to send transactions, such as transferring Ether or other tokens, and interacting with smart contracts.

Externally owned accounts are essentially custodial wallets that are operated manually. They act like individual user accounts and have been the foundation for most blockchain interactions.

These accounts come with a seed phrase as a wallet key that holds access to the accounts. Whoever holds the private key can log in and make transactions.

Unique Address

Each EOA has a unique identifier, similar to a bank account number, that allows you to receive and send cryptocurrency.

Private Key as Your Signature

To authorize transactions, EOAs rely on a cryptographic key called a private key. This key acts like your digital signature, proving ownership and granting permission to transfer funds. However, if you lose your private key, you will lose full access to your crypto.

Limited Functionality

EOAs can only execute basic transaction operations like sending/receiving cryptocurrency, interacting with smart contracts (like dApps), and creating new smart contracts.

  • Smart Contract Accounts (SCAs)

A smart contract account is a blockchain account controlled by code (a smart contract) rather than a single private key. This allows for customizable rules, enhanced security features, and the ability to interact with other smart contracts.

Unlike traditional Externally Owned Accounts (EOAs) that rely on private keys, SCAs leverage smart contracts to manage your account. These smart contracts act like mini-programs on the blockchain that hold the commands or instructions for handling your funds.

So, when you customize a smart contract, you can define a set of conditions that will automatically execute a function when certain conditions are met.

Enhanced Security

Smart contracts can implement features like multi-signature authorization, requiring approval from multiple parties before a transaction can be completed. This reduces the risk of unauthorized access compared to relying solely on a private key.

Greater Flexibility

The code within the smart contract can be programmed to handle your funds according to your wishes. This allows for features like:

  • Gas fee payment in tokens other than the blockchain's native currency
  • Setting up automatic payments or delaying transactions until specific conditions are met
  • Social recovery mechanisms (ways to recover the account even if you lose your keys)
  • Customized transaction rules (e.g., requiring multiple signatures for a transaction)
  • Integrate with more user-friendly authentication methods, like fingerprint scanners or two-factor authentication

How Does ERC-4337 Work?

ERC-4337 works by introducing a new system for user interaction with the Ethereum blockchain, built around the concept of account abstraction.

Explaining how it works could get quite technical. So, let’s begin by understanding with an analogy.

Imagine your regular crypto wallet is like a simple flip phone — it can send and receive messages (crypto), but not much else. ERC-4337 is like turning that flip phone into a smartphone.

Here's the basic idea:

  • Normal Wallets (EOAs): You use a private key to unlock your wallet and send crypto. It's easy but risky if you lose the key.
  • Smart Wallets (SCAs) with ERC-4337: These are like apps on your phone. You can set rules for sending crypto (like needing two approvals), pay fees with different tokens, and even have ways to recover your wallet if you forget your key.

Here's how it (sort of) works:

  1. You tell your smart wallet what you want to do (send crypto, etc.)
  2. The wallet bundles your request with others and sends it (imagine carpooling transactions)
  3. A special program checks everything and makes sure it is legitimate
  4. If all is good, the action happens!

Below is a breakdown of the key components.

UserOperations

Instead of directly initiating transactions from their wallets, users create "UserOperations." These are essentially signed messages that represent a user's desired action on the blockchain, like sending tokens or interacting with a smart contract.

Separate Mempool

UserOperations are submitted to a special mempool, a temporary storage area for transactions. This special mempool is distinct from the main Ethereum mempool. This separate mempool allows for features like gas abstraction without disrupting the core network.

Bundlers

Special nodes on the network called "bundlers" collect multiple UserOperations from the mempool and combine them into a single and efficient transaction reducing transaction fees for users.

EntryPoint Smart Contract

The bundled transaction is then sent to a global smart contract called the "EntryPoint." This contract acts as a gatekeeper, verifying the validity of the UserOperations. Once the prerequisite conditions are met, the smart contract executes the transaction on the user's behalf.

What Does Account Abstraction Enable?

Easy User Onboarding

AA allows users to integrate social login into your games simplifying the process of onboarding new users to the platform. This cuts out the account creation process removing the biggest hurdle in onboarding new gamers to the platform.

Additionally, when the user interface is governed by smart contracts, you don’t need to remember long seed phrases. Even when you forget your password, you can easily recover your account by making changes to the code.

Social Recovery

Currently, losing your private key means losing access to your Ethereum funds forever. Account abstraction separates account access from the private key.

With social recovery, you designate trusted contacts (like family/friends) who can help regain access if you lose your signing key. This could involve a multi-step verification process or a time-delayed access procedure to prevent unauthorized recovery.

Simplified Wallet Management

With smart accounts, you can customize your wallet to pre-approve transactions by adding relevant segments to the codes. Additionally, you can even create one wallet with multiple user access.

There is also room for you to integrate multiple EOAs by executing smart contracts. You can even integrate fiat payment options in one go making it simpler for new users to onboard the crypto wagon.

Developers can also enable batch transactions that will allow gamers to execute multiple transactions in one go saving time and gas fees on occasion.

Gasless Transactions & Fee Flexibility

Transaction fees (gas) on Ethereum can be expensive. Account abstraction allows smart contracts to sponsor gas fees on your behalf. This could be for specific purposes or through pre-paid gas allowances.

Alternatively, smart contracts might implement dynamic fee models based on transaction urgency or network congestion. This opens up blockchain interaction for those who don't hold any cryptocurrency but still want to participate.

Customizable Authorization

Today, transactions are typically signed with your private key. Account abstraction enables more sophisticated authorization schemes.

Imagine setting time limits on transactions (e.g., only valid for 24 hours) or spending limits to prevent accidental misuse. You could even require multiple signatures (multi-sig) for high-value transactions, adding an extra layer of security.

Add Enhanced Features

ERC-4337 allows developers to add enhanced features to their web3 games like cross-chain interaction, buying and selling of multiple NFTs in one go, buying in-game assets with a single approval, etc.

These features combined can become a driving force for the new users to your platform.

How Does Transak Use Biconomy’s Account Abstraction to Facilitate Web3 Games?

Transak leverages Biconomy's Account Abstraction to enhance user experience in web3 games.

This technology simplifies wallet management and transactions, offering a seamless and user-friendly experience. It integrates aspects of both externally owned and contract accounts, streamlining processes like user onboarding and transactions.

By reducing the complexity typically associated with web3 gaming, Transak and Biconomy make these games more accessible, especially to those new to the web3 environment.

Get Transak for your web3 game today.

What Does This Mean for Web3 Games?

Seamless Onboarding

  • No more crypto-confusion: Currently, new players need to understand private keys, gas fees, and set up wallets – barriers to entry for many. With account abstraction, developers can sponsor gas, helping players start playing immediately without needing upfront crypto holdings.
  • Familiar logins: The ability to support social logins or even password-like systems can make web3 games feel similar to traditional web2 experiences, lowering the bar for non-crypto natives.
  • Fiat on-ramp: Players can buy crypto of their choice directly from Transak and use the same currency to also pay for gas.

Improved Gaming Mechanics

  • Micro-transactions on steroids: Batching transactions under account abstraction makes micro-transactions and pay-per-use models far more cost-effective – opening up new avenues for in-game economies.
  • Automated actions: Smart contract accounts could automate in-game tasks like yield harvesting or scheduled asset sales – freeing up player time for the more fun elements of the game.
  • Gasless game logic: Some in-game logic and asset transfers could potentially be handled by smart contracts without the need for every single on-chain transaction. This improves performance and reduces costs.

Conclusion

Web3's promise of ownership and decentralized economies is exciting, but the technical hurdles create barriers to entry. Account abstraction breaks down these barriers by:

  • Simplifying onboarding with familiar logins or no immediate crypto requirements.
  • Offering recovery options that eliminate the fear of permanently losing game assets due to lost keys.
  • Integrating with fiat on-ramps so players can directly buy in-game assets.

With account abstraction, web3 games can become as intuitive as their traditional counterparts. Customizations such as gas sponsorship, transaction batching, and flexible fee models make interactions smoother, faster, and cheaper. Security is also bolstered with options for time-bound transactions, spending limits, and multi-signature approvals.

For more information, visit transak.com or follow on twitter.com/transak.

About the Author:

Transak Team