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.
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.
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 indexing and query layer of web3. Developers build and publish open APIs, called subgraphs, that applications can query using GraphQL. The Graph currently supports indexing data from over 40 different networks including Ethereum, NEAR, Arbitrum, Optimism, ZkSync, Polygon, Avalanche, Celo, Fantom, Moonbeam, IPFS, Cosmos Hub and PoA with more networks coming soon. To date, 88,900+ subgraphs have been deployed on the hosted service. Tens of thousands of developers use The Graph for applications such as Uniswap, Synthetix, KnownOrigin, Art Blocks, Gnosis, Balancer, Livepeer, DAOstack, Audius, Decentraland, and many others.
The Graph Network’s self service experience for developers launched in July 2021; since then over 800+ subgraphs have migrated to the Network, with 450+ Indexers serving subgraph queries, 11,300+ Delegators, and 2,500+ Curators to date. More than 5.6+ million GRT has been signaled to date.
If you are a developer building an application or web3 application, you can use subgraphs for indexing and querying data from blockchains. The Graph allows applications to efficiently and performantly present data in a UI and allows other developers to use your subgraph too! You can deploy a subgraph to the network using the newly launched Subgraph Studio or query existing subgraphs that are in the Graph Explorer. The Graph would love to welcome you to be Indexers, Curators and/or Delegators on The Graph’s mainnet. Join The Graph community by introducing yourself in The Graph Discord for technical discussions, join The Graph’s Telegram chat, and follow The Graph on Twitter, LinkedIn, Instagram, Facebook, Reddit, and Medium! The Graph’s developers and members of the community are always eager to chat with you, and The Graph ecosystem has a growing community of developers who support each other.
The Graph Foundation oversees The Graph Network. The Graph Foundation is overseen by the Technical Council. Edge & Node, StreamingFast, Semiotic Labs, The Guild, Messari and GraphOps are seven of the many organizations within The Graph ecosystem.
- Graph Protocol
- Pranav Maheshwari
- June 29, 2023