Account Abstraction: Here’s What Developers Need to Know

Prefer to hear this blog aloud? Listen to the contents of this blog via The Graph Podcast.


Account Abstraction and Smart Contracts

Account abstraction is a significant improvement to the web3 UX, playing a crucial role in overcoming several barriers to web3 adoption. In short, it adjusts user account management and simplifies how users interact with web3 applications by placing their private keys into smart contracts. This helps make interacting with web3 applications simpler, more secure, and more convenient for users.

As an innovator in the web3 space, The Graph is in a position to play a pivotal role in revolutionizing the adoption of account abstraction. This blog explains what account abstraction is, how it simplifies development to empower a better user experience, and how The Graph is helping to innovate and push the adoption of this important technical development to web3.

What Is Account Abstraction?

Account abstraction has gained popularity in the blockchain community because of its ability to provide greater flexibility and security in the management of digital assets. As web3 applications continue to evolve, account abstraction is expected to play an important role in supporting decentralized and trustless systems for managing digital assets.

As you may already know, the blockchain records and associates account balances with the private key. The user is responsible for managing their seed phrase and wallet access to the account. In contrast, account abstraction places private key management in a smart contract to open up a variety of new account management opportunities.

In account abstraction, an account is placed in a smart contract, and the user's private key is only used to authorize the execution of the smart contract that manages the account. The smart contract can then decide how to allocate the assets held in the account, and can even transfer the assets to other accounts based on predefined conditions.

What Are The Benefits of Account Abstraction?

One of the primary benefits of account abstraction is that it enables more flexibility in how assets are managed on a blockchain network. This has implications for both institutions and individuals in how they manage and access their digital assets. For example, account abstraction can enable the creation of more complex financial instruments, such as smart derivatives, by bundling the management of multiple assets into a single smart contract.

In addition to flexibility, account abstraction enhances the security of a blockchain network. By separating the control of assets from the account used to hold the assets, it becomes more difficult for attackers to steal funds from a particular account. This is because the user's private key is only used to authorize the execution of a smart contract, and not to directly control the assets held in the account.

Vitalik Buterin’s post also emphasizes the importance of account abstraction in both enhancing web3 security and user experience. He suggests that it paves the way for making smart wallets a web3 standard.

What Features Does Account Abstraction Unlock?

Account abstraction enables the unification of contract accounts and EOAs (externally-owned accounts) making user accounts more ‘programmable’. This improves the wallet experience by adding important features on top of accounts including:

  • Session keys: Empowering dapp users with pre-approved transactions, eliminating repeated confirmations, and enhancing the efficiency of interactions
  • Gasless transactions: eliminating the need to pay for each transaction
  • Recurring payments: automate the process of regular transactions
  • 2FA: add an extra layer of verification
  • Social recovery: a social recovery mechanism can be set up that enables trusted contacts to help recover a user's account, thus providing a safeguard against the loss of access
  • Spending/withdrawal limit: facilitate the setting of spending or withdrawal limits, enabling users to control their spending habits and manage their funds more effectively
  • Account recovery: minimize the risk of permanently losing access to the account due to lost credentials
  • Freezing funds: offer additional protection against unauthorized transactions or access
  • Inheritance: make it easier to transfer assets to beneficiaries in a secure and automated way after the user's demise

These features enhance the wallet user experience without compromising the user's control over their funds.

How The Graph is Leading The Way On Account Abstraction

Because the assets handled by account abstraction are managed by smart contracts, The Graph is in a position to play a vital role in the development and success of smart contract wallets in the web3 ecosystem. Using programmable logic on top of EOAs, developers will build event-based smart contracts for the wallet UX. As a result, they will need to leverage The Graph to index the events and show all the activity related to the smart account (smart wallet-based account), such as transfers, withdrawals, and staking, to the user via subgraphs.

Most wallet functionalities, such as initialization, fund transfers, and the execution and signing of transactions, will fall under the category of programmable logic. This can easily be made into functions that can be indexed directly with subgraphs, or if they have events inside the functions the events can be called directly for indexing. The bottom line is that the smart account wallet UX will be revolutionized and empowered by the incredible capabilities of The Graph. Through the use of subgraphs, The Graph will deliver an unparalleled user experience, seamlessly integrating data from various sources, and unlock the full potential of smart account wallets.

In addition, developers can use the benefits of decentralized indexing to build additional features related to the smart account ecosystem. One great example is on-chain recovery by adding a guardian, removing a guardian, as well as recovering a guardian after a cool-down period. All these events are triggered from the account’s smart contract and hence can be captured with subgraphs.

Developer tooling, SDKs, and libraries to build smart wallet infrastructure for their dapps have already started using The Graph for their indexing needs including Biconomy.

Biconomy

As a real world example, Biconomy released an account abstraction SDK which is used by wallets to offer solutions like paying for gas in any token. Some dapps have used this feature to sponsor gas on behalf of their users (gasless transactions). Account abstraction is also used by applications to offer one-click UX by reducing the number of steps required with transaction batching.

To enable these types of transactions, the SDK relies on subgraphs to monitor certain on-chain metrics.

There are 3 types of transactions that the SDK tracks on the Biconomy paymaster:

1. If a dapp deposits to the paymaster

2. If a dapp withdraws from the paymaster

3. When a user operation is sponsored by a dapp

When a user sends any account abstraction gasless transaction on a dapp, the gas fee is deducted from that dapp's deposit in the paymaster. The subgraph helps in making sure Biconomy is on top of tracking all these inflows and outflows.

Find the link to Biconomy’s subgraph here.

Final thoughts

In the world of web3, the revolutionary concept of account abstraction is creating a significant leap in user experience. Embracing this breakthrough, The Graph emerges as an indispensable part of this transformative journey. By using The Graph with the formidable capabilities of account abstraction, a realm of untapped potential unfolds.

This dynamic paves the way for many novel use cases, empowering developers to craft decentralized applications on the Ethereum blockchain that are not only more robust but also remarkably versatile. Witness the dawn of a new era, as The Graph fuels the exploration of boundless horizons in decentralized innovation.

About The Graph

The Graph is the source of data and information for the decentralized internet. As the original decentralized data marketplace that introduced and standardized subgraphs, The Graph has become web3’s method of indexing and accessing blockchain data. Since its launch in 2018, tens of thousands of developers have built subgraphs for dapps across 70+ blockchains - including  Ethereum, Solana, Arbitrum, Optimism, Base, Polygon, Celo, Fantom, Gnosis, and Avalanche.

As demand for data in web3 continues to grow, The Graph enters a New Era with a more expansive vision including new data services and query languages, ensuring the decentralized protocol can serve any use case - now and into the future.

Discover more about how The Graph is shaping the future of decentralized physical infrastructure networks (DePIN) and stay connected with the community. Follow The Graph on X, LinkedIn, Instagram, Facebook, Reddit, Farcaster and Medium. Join the community on The Graph’s Telegram, join technical discussions on The Graph’s Discord.

The Graph Foundation oversees The Graph Network. The Graph Foundation is overseen by the Technical Council. Edge & Node, StreamingFast, Semiotic Labs, Messari, GraphOps, Pinax and Geo are eight of the many organizations within The Graph ecosystem.


Categories
Web3 KnowledgeRecommended
Published
June 29, 2023

Pranav Maheshwari

View all blog posts