Technical

Account Abstraction: The Key To Frictionless Web3 Gaming

October 9, 2024

Web3 adoption, notably in the gaming sector, has long grappled with a subpar user onboarding experience. Lengthy wallet setup processes, high gas fees, and persistent transaction confirmations stand as some of the most prominent challenges hampering user retention and adoption by both users and game developers in the industry.

The introduction of Account Abstraction (AA), as proposed in EIP-4337, holds the potential to address or eliminate these primary friction points altogether, and bring blockchain gaming to standards set by traditional web2 games. 

Let’s dive into what makes account abstraction special and how game studios can leverage its capabilities to offer a seamless gameplay.

An AA Refresher

Before diving into the intricacies of Account Abstraction, it’s important to understand the two main account types within the Ethereum ecosystem: Externally Owned Accounts (EOAs) and Smart Contract Accounts (SCAs).

Ethereum account types

EOAs are user-controlled accounts, secured by a private key that serves as the unique signature and access pass to the blockchain account. Users with conventional EOAs like Metamask, Phantom, or Face Wallet can send/receive transactions and interact with various applications.

In contrast, SCAs are smart contracts deployed on-chain, leveraging account abstraction to function as a flexible, all-in-one solution. They allow transactions to be executed without the need for individual signatures and unlock new use cases like third-party gas fee subsidies.

Account abstraction aims to improve the user experience by allowing for the handling of intricate blockchain operations into the background. ERC-4337 relocates Ethereum's verification logic to the Ethereum Virtual Machine (EVM), enabling smart contracts to initiate transactions and perform complex functions, thus surpassing the limitations of conventional EOAs.

With over 400,000 smart contract accounts already deployed in the past month on Ethereum, Arbitrum, Optimism and Polygon, the industry is poised for a major transition away from EOA wallets across the Ethereum ecosystem. 

How Do SCAs Facilitate Seamless Gameplay?

In the context of web3 gaming, smart contract accounts pave the way for delivering a "web2-like" user experience, while offering developers greater flexibility and a modular approach to account management.


Blockus is actively developing a range of primary capabilities to offer game studios through the application of account abstraction:

Tailored-made Wallet & Marketplace Experience: With AA, game developers can granularly customize the look and feel of the user wallet interface or in-game marketplace to closely align with the game's aesthetics.

Subsidized Transactions: Games have the flexibility to cover player transaction costs and designate the fee token of choice, effectively eliminating the common hurdles associated with traditional wallet setups. Most players dislike paying additional fees when playing web3 games, dreading the long and windy process of setting up a new wallet. For game studios developing web3 games, gas fees also translate into operational expenses. Blockus streamlines this experience by supporting gasless transactions, thereby removing fee-related concerns for users. This allows players to effortlessly mint in-game NFTs, immersing themselves in the game without being burdened by intricate wallet setups.

Session Keys: These keys facilitate transaction processing on behalf of players, eliminating the need for additional wallet confirmations. A player can simply authenticate a game session, allowing the game to act on their behalf for the duration of that session. This approach ensures an optimal player experience while maintaining a high level of security, as players retain control over their assets without having to surrender full ownership.

Optimized Transaction Bundling: Bundling transactions (multicalls) together improves gas efficiency and enhances the overall user experience, from one-click NFT purchases to simultaneous in-game asset farming.

Social Recovery & Social Login: Social recovery methods enable players to regain access to their funds while maintaining self-custody. Social login simplifies the sign-in process by allowing players to use their existing social media accounts instead of having to remember or secure any private keys. Allow players to experience lightning-fast and frictionless onboarding by enabling them to log into your game in under 1 minute using their email or TikTok account.

Secure Wallet Access: With entrusted wallets, users can control access to their accounts for designated wallet addresses via SCAs, while safeguarding their valuable assets. This opens up opportunities for players to rent out their in-game assets, granting them access to exclusive events or even the option to rent out an entire character for continued gameplay.

How Does AA Work?

Now that we have a clear understanding of the way SCAs facilitate seamless gameplay, let’s delve into the mechanics of ERC-4337 smart contract wallets.

We need to first define the five main infrastructure components that enable the utilization of smart contract accounts: the UserOperation, Bundler, EntryPoint, Aggregator, and Paymaster.

UserOperation

UserOperations (userOps) are pseudo-transaction objects containing transaction instructions which are then carried out on behalf of the sender's smart contract account. These userOps serve as proxies for a user's desired transaction intent, and eliminate the need for consensus-layer changes to Ethereum and layer 2 blockchains that support ERC-4337.

UserOperations bear resemblance to internal smart contract transactions by containing: sender, to, calldata, maxFeePerGas, maxPriorityFee, signature, and nonce. However, it's important to emphasize that they should not be classified as conventional transactions! 

UserOps can only access data pertaining to the sender's address, and introduce new fields specific to this structure, including callGasLimit, verificationGasLimit, preVerificationGas, and paymasterAndData

UserOps mempool

UserOperations bypass the traditional public mempool hosting pending transactions for EOAs, and instead get directed to a dedicated ‘userOps mempool,’ a new checkpoint preceding on-chain confirmation.

Bundler

Bundlers are nodes responsible for monitoring userOps mempools and packaging UserOperations from various senders into a single transaction or handleOps call. They then send each bundled transaction to an EntryPoint contract for execution. Bundlers employ their Externally Owned Accounts to initiate transactions on behalf of senders and determine which UserOperation to bundle, through a fee-prioritization logic akin to the approach used by current Ethereum block builders.

Aggregators

Aggregators are specialized helper contracts trusted by accounts to validate aggregated signatures for bundled UserOperations, enhancing transaction processing scalability within the ERC-4337 framework.

EntryPoint

The EntryPoint contract verifies and executes bundled UserOperations, acting as a universal entry point for all users employing ERC-4337 compliant smart contract wallets for EVM transactions.

EIP-4337 Entry Point Contract
EIP-4337 Entry Contract Diagram

Implementing an EntryPoint streamlines the operational logic within smart contract wallets,  shifting the burden of handling complex smart contract functions from the wallet itself to this centralized entry point.

Paymaster

Paymasters are smart contracts that offer developers the flexibility to implement customized gas policies like subsidizing user gas fees or accepting gas fee payments in ERC-20 tokens.

The SCA Transaction Flow

Let’s take a look at the architectural diagram from the proposal itself. 

Diagram of ERC-4337 architecture

We can see how multiple users initiate separate UserOperations, which are then dispatched to the 'userOps mempool'. Here, a bundler with an EOA wallet packages and forwards all UserOperations into a single handleOps call to the EntryPoint contract. The EntryPoint contract then proceeds to validate and execute the received UserOperations.

Once executed, the EOA wallet responsible for bundling the UserOperations is reimbursed for the ETH spent on behalf of the users, either directly from the users' wallets or through the Paymaster.

Conclusion

We’re thrilled about the future integrations of web3 capabilities into web2 gameplay made possible by account abstraction, and the way they can pave the way for onboarding the next 1 billion users into the space.

To learn more, explore the ERC-4337 proposal and visit the official Account Abstraction website.

Sign up to our newsletter
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.