DEV Community

Cover image for Demystifying Account Abstraction
Abdul Azeez V
Abdul Azeez V

Posted on • Edited on • Originally published at linkedin.com

Demystifying Account Abstraction

What if your crypto wallet got hacked or you forgot the seed phrase? You lost complete access to your funds, right?

Not anymore.

Nowadays account abstraction is a word we always hear in the web3 circles. It is considered a significant step towards the mass adoption of web3 technology.

So by definition, account abstraction is:

A concept in blockchain technology that separates the control logic of an account from the account itself, allowing for more flexible and programmable account behaviors

What does that mean? What benefits does it bring? Let's go deep by understanding how accounts and transactions work in Ethereum.

Accounts in Ethereum

There are two types of accounts in Ethereum:

Two Types of Ethereum Accounts

Both EOA and smart contracts can store assets like NFTs and tokens. But, only EOA can initiate a transaction. Smart contracts can store code run on EVMs, while EOA can't. There are no private key associated with smart contracts.

Typical EOA transaction flow

In Ethereum Externally owned accounts (EOAs) initiate a transaction, sign it with private key and send it to mempool which is validated by validators. The private key kept by the user is the only barrier to accessing the crypto assets. Account abstraction intends to abstract away this dependancy.

Block theory has a good explanation on this here

Demerits of EOA accounts:

  • Loss of Private key results in total loss of funds
  • Recovery of wallets not possible
  • The transaction requires paying gas directly from the EOA
  • Bad User Experience
  • Limited Functionality

Smart Contract Wallets (SWC)

We can overcome the private key issue by using smart contracts as our wallets, or Smart contract wallets (SCW).

Smart contract wallet (SCW)

Using SCWs we can abstract the signature from asset ownership. Multi-signature wallets can be implemented using smart contracts which increases security. But still, an EOA is needed to initiate the transaction.

Account Abstracted Wallets

Account abstraction aims to detach the validity conditions of a transaction like signature verification, gas payment, nonce increase, and chain compatibility to an EVM smart contract level.
How to do it?

History of Account Abstraction

Achieving account abstraction has been a long-time dream of many Ethereum developers. It was initially proposed as EIP-86 by Vitalik Buterin 2016. However, it needed significant changes to the protocol. EIP 1014, EIP 2938 and EIP 3074 are some of the proposals that helped in the development of account abstraction architecture.

EIP 4337

EIP 4337 was the last proposal for Account Abstraction in Ethereum. It introduced a concept of pseudo transactions called UserOperations (UserOps). UserOps decouples the transaction validation from the consensus layer through an alternative mempool (altmempool)

ERC4337 Transaction flow

In EIP 4337, UserOps are sent to an altmempool by the user which is picked by a bundler. Bundler act as proxy EOAs, bundling the UserOperations and sending them to a global singleton EntryPoint contract. The entry point calls the smart contract accounts deployed, which have the code to validate transactions. After successful validation, the transaction is executed.

Paymaster is a smart contract that sponsors the gas fees for UserOps, enabling gasless transactions for end users. It abstracts the gas payment from the user and allows user-friendly transaction models like ERC20 tokens, etc. Users don't need ETH anymore to pay for gas.

The Transaction validation through smart contracts allows the possibility of signing transactions using social logins, biometrics, etc.

Benefits of AA:

  • Enhanced Security: Multi-sig, social recovery, and other security mechanisms.
  • Recovery Options: Built-in recovery mechanisms to regain access.
  • Sponsored Transactions: Can pay gas using alternative methods or tokens.
  • Improved UX: Abstracts away private key management for users.
  • Batch Transactions: Multiple operations can be bundled and executed atomically
  • Custom Authentication: Authentication methods like biometrics, social recovery, or hardware wallets.
  • Account Segmentation
  • No need for EOA to initiate a transaction

READ MORE

LinkedIn | Github

Top comments (0)