Your Guide to Account Abstraction on Linea

User experience (UX) in web3 stands to improve a great deal as the ecosystem continues to grow. =Compared to the web2 apps we are all used to, the web3 UX can be complicated, error-prone, unfamiliar, and burdened by concepts such as seed phrases, transactions, and gas fees.

Account abstraction is a change to the current model that aims to abstract away the details of blockchain from users and enable a web3 user experience that is seamless, delightful, and rivals the best of web2.

In this article, let’s look at account abstraction, specifically what it means, how it works, and some of the major UX advances it makes possible. We will also look at two of the most immediate improvements—transaction sponsoring and paymasters—in greater detail and give examples of how they have been implemented on Linea.

This should equip you to tackle the final wave of Linea’s DeFi Voyage. Good luck!

The Current State of Web3 User Account Design

To understand account abstraction, you first need to understand the current state. In the current Ethereum model, users interact with the blockchain through externally owned accounts (EOAs).

A MetaMask wallet interfacing with an EOA
A MetaMask wallet interfacing with an EOA

EOAs implement the flow we are all familiar with:

  1. Create a new wallet.

  2. Obtain a private key or secret recovery phrase that you must secure and keep private. Read the warnings about what happens if you lose this key.

  3. Onboard your fiat to an exchange.

  4. Swap your fiat for ETH (or whatever the native currency of your chosen chain).

  5. Approve every transaction. Read the warnings about what can happen if this is a malicious transaction.

  6. Pay gas fees.

  7. And so on...

This results in the familiar (and complicated) user flows that turn off so many potential web3 users. How do you onramp funds? How do you swap for ETH to pay gas fees? What are gas fees? How do I know if this is a malicious transaction?

And, of course, users must always remember the security requirements of storing keys: store them somewhere safe, where they can find them, but not where someone else can find them. With EOAs, if you lose your keys, you lose your funds. If someone steals those keys, they get your funds. There is no recourse.

But account abstraction abstracts these UX problems away.

What is Account Abstraction in Web3?

Account Abstraction is a change to Ethereum works that introduces smart contract wallets—special smart contracts that manage how a user’s Ethereum account works and what it can do.

On Ethereum, there are currently two types of accounts: EOAs and contract accounts.

As covered above, EOAs are controlled by a private key or secret recovery phrase. With this, you control the account. Without it, you can’t do anything. EOAs are limited in what they can do to the most basic of operations such as sending a cryptocurrency and paying gas fees. Importantly, though, they can initiate transactions.

On the other hand, a contract account can do nearly anything (within the confines of Ethereum’s security and rules). However, it is passive—it can’t initiate a transaction. It can only respond to a transaction initiated by an EOA. This is important because a contract account could solve most of the UX issues in web3—if it could initiate transactions. However, since all activity on the blockchain can only be initiated by an EOA, contract accounts are not the answer.

Account Abstraction combines these two types of accounts and introduces a technical layer that allows for smart contract wallets—special-purpose smart contracts that can define and manage a user’s account. At a high level, you can think of AA as a hybrid account—EOAs with the power of contract accounts.

(Note: It’s not quite this simple, and there are several competing visions for implementing account abstraction. Check out this article from MetaMask and this article from the Ethereum Foundation for a more thorough discussion. Also note that smart contract wallets are also known as account contracts, smart accounts, and smart wallets.)

The Benefits of Account Abstraction

Because these new smart contract wallets are fully programmable and extensible, developers can create special features for these accounts that minimize the complexity of blockchain and make web3 significantly more intuitive for users.

For example, because smart contract wallets have more flexibility, account abstraction makes the following possible:

  • Account recovery - Users can define alternate authorized accounts that can access accounts if they lose their keys. No more “lose your keys, lose your funds.”

  • Social logins - Users can create accounts simply by using an email address or X/Twitter account, just like the flows they follow in web2.

  • Paymasters - Decentralized applications (dapps) can sponsor gas fees for their users, removing the need for users to understand the complications of gas and gas fees.

  • Batched transactions - Batching transactions allows a user to submit several DeFi transactions at once (such as swap a token, provide liquidity to an AMM, then stake the resulting liquidity pool token) or even purchase a cart full of items at once.

  • Gaming sessions - Batched transactions also allow for long-lasting sessions in web3 games. For example, an eight-hour session means a gamer can sign a single transaction that covers all moves the player makes during that timeframe. Signing every single transaction during that time would be simply unusable.

  • Shared account security - Sharing account access across devices or individuals allows for multi-signature authentication. Users can require some number of those entities to sign a transaction. Users can specify that any transaction over a certain dollar value requires approval from a trusted friend. A company might even require signatures from the entire governing board.

  • Automatic payments - Monthly subscriptions and services could be paid for automatically without approving each individual transaction.

  • More advanced security - Other advanced security concepts are possible, such as limiting how much can be transferred from a wallet each day or a whitelist that restricts where a wallet can send tokens.

These benefits add up to a much smoother, secure, and delightful UX for web3 users, one that rivals web2 experiences and onboarding but still has the benefits and decentralization of web3.

UX Solutions: Paymaster and Transaction Sponsoring

Let’s look at two exciting UX opportunities that account abstraction creates.

Transaction sponsoring is the concept of a third party paying the gas fees for a user. This could take the form of subsidizing gas with payments, providing gas tokens directly to a user, or even off-chain agreements where transaction costs are reimbursed. In AA, transaction sponsoring means a dapp programmatically pays the transaction fees for a user.

A paymaster is an entity (in this example, a smart contract) that allows dapps to set gas policies. For example, using a paymaster, a dapp can sponsor transactions by paying the gas fees on behalf of a user. Paymasters can also allow dapps (and their users) to pay gas, not in ETH, but in USDC or another crypto, by swapping the alternate token for ETH inside the contract before sending the transaction.

With paymasters (and transaction sponsoring), users don’t need to have the gas token in their wallet and don’t have to pay for the right to send a transaction. In fact, they don't need to understand the concept of gas at all!

Instead, users can click a button and get results seamlessly within an easy and familiar UX experience.

Timeless Wallet: An Example of Account Abstraction on Linea

Account abstraction is especially powerful on L2s such as Linea, where the power of smart contract wallets is combined with cheap and fast transactions, creating a user experience that can rival the best of web2.

Let’s look at the Timeless wallet as an example. Timeless is a social web3 wallet that uses account abstraction for a seamless user experience. Users can create their wallet with the click of a button, without the need to remember the secret recovery phrase or a private key. It is a non-custodial wallet that supports multiple chains including Ethereum, Harmony, and Polygon.

Users can access and enjoy web3 without the fear of losing their secret recovery phrase, and can also interact with other users using Timeless’ wallet-to-wallet chat feature. Timeless also allows users to discover and join communities of like-minded individuals while participating in DeFi.

Continue Exploring Account Abstraction

Account abstraction promises to revolutionize web3 UX. It creates the experiences that users want and that rival the web2 powerhouses. Combined with the cheap and fast transactions enabled by Layer 2s such as Linea, account abstraction could be the step needed to onboard the next billion users to web3.

Explore Account Abstraction with the Linea DeFi Voyage

Subscribe to Linea
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.