Account Abstraction: The ERC4337 Update

Written by
Tatum team
July 20, 2023
5
min. read

It's widely recognized in the blockchain community that achieving extensive blockchain adoption requires a more user-friendly approach in Web3 apps. The centrality of Account Abstraction to this goal can't be overstated. Without it, the process of making Web3 accessible to broader user bases becomes significantly more challenging. 

Account Abstraction is not merely a feature, but a fundamental requirement for the transition of Web3 from a complex, niche system to a universally applicable and user-friendly platform. 

In this article, we cover everything you need to know about blockchain account abstraction and how it works.

What Is Account Abstraction (ERC4337)?

Account abstraction, outlined in Ethereum's ERC-4337 update, introduces a paradigm shift that enables the creation of non-custodial wallets in the form of fully programmable smart contracts. 

This modification doesn't merely augment the system, but reshapes the infrastructure and unlocks a whole new suite of possibilities in the Ethereum ecosystem.

The benefits are multifaceted and wide-ranging. For instance, wallet recovery becomes more straightforward and efficient, removing the often daunting process faced by users. Then there's the introduction of signless transactions, streamlining the transactional process and eliminating a step often seen as a hurdle by many. Moreover, the capacity to establish team wallets introduces a new level of collaboration within the Ethereum ecosystem. Collectively, these advancements refine the web3 experience, making it more secure, expedient, and flexible.

Why Is AA Important?

In a nutshell, Account Abstraction isn't just a trend – it's a major step forward for the world of blockchain apps.

Account Abstraction drastically simplifies the transaction process and opens up a whole new level of flexibility. With AA, smart contracts handle all the nitty-gritty details, which means they can implement any rule or logic for transaction validation. It allows for a much broader array of applications and possibilities.

Plus, it even improves the overall security of the system. By centralizing the ownership of assets in smart contracts, it can reduce the risk of user errors that might occur in handling assets. 

Need an example? Here’s what Roman Canales, Product at zkSync, remarked about Account Abstraction.

“Imagine Netflix or Disney Plus where you can have an account for your family and sub-accounts within your account where you have larger control. This can be easily done with account abstraction, where you have the permission to configure the sub-accounts and determine what they are allowed to watch.” - Ramon Canales (Product at zkSync)

Account Abstraction (AA) vs Externally Owned Accounts (EOA)

The term 'Account Abstraction' refers to a concept wherein there is no longer a need for an Externally Owned Account (EOA). It eliminates it altogether.  

In basic terms, blockchains such as Ethereum require a method to trace the ownership of assets. Ethereum employs two types of entities to handle these assets: Externally Owned Accounts (EOA) and Smart Contracts.

Today, most of the wallets and apps you know are using EOA. EOA users handle assets by signing  “transactions” - those signatures are then validated by the network. On the other hand, smart contract users manage assets by signing what's called a “payload,” authenticated by the smart contract.

In the clever framework of Account Abstraction, the use of assets directly through an EOA is completely eliminated. All assets become the property of smart contracts. The smart contract takes over the responsibility of implementing user authentication, permission setting, and other associated processes.

How Does Account Abstraction Work?

Account Abstraction and the ERC-4337 update introduced a paradigm shift in the Ethereum landscape, providing a newfound level of flexibility and autonomy. The primary innovation lies not in the idea of contract-based wallets, but rather in the capacity to uncouple the need for distinct Externally Owned Accounts (EOAs) or contract accounts. This uncoupling fundamentally changes how accounts and transactions operate in the Ethereum network.

Smart accounts are self-standing smart contracts capable of initiating and executing transactions autonomously, eliminating the requirement for an EOA. Smart accounts can accommodate any custom operation that can be encoded within smart contract parameters, providing a vast scope for customization and control.

Smart accounts operate through the use of entities known as UserOperations, replacing the traditional transaction method used by EOAs. UserOperations are objects that delineate a particular operation to be performed by the user. They encapsulate a range of data elements, detailing transaction types, token information, gas limit and price parameters at different stages of the transaction, the signature needed for transaction validation, among other metadata.

When a smart account sends a UserOperation, it enters a collective queue for all UserOperations, referred to as the 'alt mempool'. The UserOperations are then collected into groups by entities known as bundlers, functioning in a similar manner to nodes that validate regular transactions. Bundlers use algorithms comparable to those employed by mining or validator nodes to prioritize transactions from which they can derive maximum value.

These bundled UserOperations are relayed through a single approved 'Entry Point', where each individual UserOperation is authenticated and executed by calling a specific function. Given that UserOperations can encompass any kind of logical instruction, this facilitates users in defining custom rules for account management and fund disposition, offering enhanced autonomy and adaptability.

Here’s how Vitalik Buterin outlined it precisely in his Medium article:

How Do You Use ERC-4337? 

The Account Abstraction framework can be used on the Ethereum or any EVM chain. ERC-4337 was released live on March 1st, 2023. As a developer you need to follow the following steps to use it in your application. 

Your wallet needs to add a smart contract with two simple functions to use ERC-4337:

First function - ‘validateUserOp’, which processes a UserOperation as input. This function is tasked with verifying the signature and nonce on the UserOperation, covering the transaction fee, and incrementing the nonce upon successful verification. In cases where verification does not succeed, this function will raise an exception.

Second function - an operation execution function, which interprets ‘calldata’ as directives for the wallet's actions. The interpretation of the ‘calldata’ and the subsequent actions taken by this function are entirely flexible. However, it's anticipated that the most common response would involve parsing the ‘calldata’ as instructions for the wallet to initiate one or more calls.

Three Account Abstraction Examples and Use Cases

Enhanced Security Measures

The security framework of smart accounts vastly differs from that of EOAs, eliminating the reliance on seed phrases or private keys. Owners of smart accounts can delegate several devices, individuals, or even third-party services to function as account guardians. Should the owner misplace their credentials, these guardians are capable of signing a transaction that reassigns new credentials for accessing the smart account - much like Web2 UX works. This ensures the account remains secure without infringing upon the user's control or possession of their assets.

Consolidated Transactions

Performing a basic swap between two tokens on a decentralized exchange under the current model necessitates two separate transactions. Initially, the user must authorize the dapp to access the token intended for swapping, followed by executing the swap itself. More intricate web3 transactions may even require more than two approvals. Smart accounts, however, can consolidate numerous transactions into one batch, requiring a single approval. This makes the DeFi transaction process as straightforward as transactions in traditional finance, for the first time.

Preprogrammed Transactions

EOAs necessitate manual initiation or approval for every transaction within a dapp. There's no current method to automate transactions within trusted frameworks. Conversely, smart accounts offer a degree of autonomy, allowing users to define parameters such as token accessibility, spending thresholds, transaction timing, gas limits, and specific actions triggered by pre-set conditions. The extent of customization is bounded only by the user's imagination.

Takeaway

Account Abstraction represents a significant stride towards bridging the user experience gap between Web2 and Web3. By unifying the operations of EOAs and contract accounts into smart accounts, these updates enhance the flexibility, autonomy, and customizability of transactions on the Ethereum network. This, in turn, streamlines the user experience, making the interaction with the blockchain technology more intuitive, and familiar to users accustomed to Web2 UX.

Moreover, the ability to define bespoke transaction rules and logic within smart accounts creates the potential for more personalized and user-centric applications. This adaptability, combined with the improved efficiency and security offered by account abstraction, brings us one step closer to a more user-friendly, accessible, and widely adopted Web3. With these innovations, we're not just closing the gap between Web2 and Web3 UX, we're building a bridge to the future of decentralized applications.

And when you’re ready to finally build your Web3 app on Ethereum - download Tatum’s SDK to start and join our channels for support and advice from our community of builders.