GRC-4337

GRC-4337: Account Abstraction AKA Smart Wallet

GRC-4337 is a standard that enables account abstraction on the Glide network, which provides more flexibility in account design. With this abstraction, wallets are no longer limited to private key-based accounts common in EOAs (Externally Owned Accounts). GRC-4337 introduces mechanisms to allow different types of account logic, such as multisig, smart contract-based wallets, and more advanced implementations such as biometric and social authentication.

The account abstraction proposal completely avoids the need for consensus layer protocol changes. Instead of adding new protocol features and changing lower-layer transaction types, this proposal introduces an upper-layer pseudo-transaction object called UserOperation. Users send UserOperation objects into a separate new mempool. The bundler packages this set of objects into a single transaction by making a call to a special contract, and the transaction is then inserted into a block.

The Components of GRC-4337

GRC-4337 introduces several vital components that work together to enable account abstraction and enhance the functionality of Glide accounts. These components include UserOperations, Bundlers, EntryPoint, Account Contracts, Factory Contract, Paymaster, and Aggregators. Let's explore each of these components in detail.

UserOperations:

UserOperations are pseudo-transaction objects that represent the intentions of users. Instead of directly initiating transactions from EOAs, users create UserOperations that encapsulate their desired transaction actions. These UserOperations are similar to unconfirmed transactions and contain essential information such as the sender, recipient, transaction data, and gas fee details.

UserOperations empower users by allowing them to define multiple actions within a single operation. This eliminates the need for users to initiate separate transactions for each action, streamlining the transaction process and reducing gas fees.

With UserOperations, users can perform various actions, including transferring funds, interacting with smart contracts, or executing multiple actions. These UserOperations are then processed and executed by the smart contract wallets, enabling more complex and efficient transactions on the Glide network.

Bundlers:

Bundlers play a crucial role in the account abstraction workflow. They are responsible for listening to the UserOperation mempool, bundling multiple UserOperations, and submitting them as a single transaction to the Glide network.

When a UserOperation is created, it is initially stored in the UserOperation mempool, a separate mempool dedicated to processing GRC-4337 transactions. Bundlers monitor this mempool and select UserOperations to include in their bundled transactions based on various criteria, such as gas fee prioritization.

Bundlers are validators or actors who take UserOperations from the mempool and bundle them into a single transaction known as a "bundle transaction". These bundle transactions are then submitted to the EntryPoint contract for execution.

Bundlers are critical in optimizing transaction processing by combining multiple UserOperations into a single transaction. This reduces the number of transactions on the Glide network and enhances efficiency while ensuring the integrity and reliability of the bundled operations.

EntryPoint:

The EntryPoint contract is a smart contract that handles the verification and execution logic for transactions. Once the Bundlers submit bundled transactions, the EntryPoint contract unpacks the bundle and executes all its operations.

The EntryPoint contract validates the UserOperations within the bundle, ensuring that each operation meets the required criteria and can be executed successfully. It verifies the signatures, checks the available gas fees, and performs any additional validation required for the specific transaction.

If an operation within the bundle fails during execution, the EntryPoint contract can roll back or undo all the actions performed by that operation. This ensures the integrity and reliability of the transactions and helps maintain the consistency of the Glide network.

The EntryPoint contract acts as a reference point for the bundled transactions and coordinates the execution of UserOperations. It plays a crucial role in the account abstraction workflow, ensuring that transactions are processed accurately and securely.

Account Contract:

Account Contracts are smart contract wallets that users interact with instead of traditional EOAs. Account Contracts are owned and controlled by users, offering more flexibility and customization compared to EOAs. These accounts can contain arbitrary verification logic, allowing users to define their transaction verification processes.

Account Contracts can execute complex operations, interact with other smart contracts, and hold assets. They eliminate the need for users to manage their private keys and ether balances, making the Glide user experience more user-friendly and accessible. This makes Account Contract a powerful tool for automating and simplifying complex transactions on the Glide network.

With GRC-4337, Account Contract become an integral part of the account abstraction workflow. They execute the operations defined within UserOperations, interact with other contracts as required, and facilitate seamless transaction processing on behalf of users.

Factory Contract:

When a user initiates interaction with a wallet for the first time, the initCode field within the UserOperation takes a leading role. This field set up the formation of the smart contract wallet, synchronously aligning with the wallet's initial operation within the same UserOperation.

To guarantee the predictable generation of addresses, wallet developers are entrusted with implementing the Account Factory Contract. Utilizing the CREATE2 method becomes indispensable, ensuring the reliability and correctness of newly generated addresses. It works in conjunction with the initial operation of the wallet, allowing users to establish their wallets securely and efficiently.

Paymaster:

The Paymaster component in GRC-4337 is an optional smart contract that can sponsor gas fees for Account Contracts. It allows users to pay transaction fees with GRC-20 tokens instead of Ether.

A Paymaster can be any entity willing to cover the gas fees for a specific transaction. It can be a dApp, a wallet provider, or any other party capable of reimbursing the Bundler for the gas costs incurred during transaction execution. The Paymaster's role is to ensure that the gas fees are paid, allowing users to benefit from sponsored transactions and reducing the burden of transaction costs.

The Paymaster feature in GRC-4337 adds flexibility and affordability to transaction processing, enabling users to perform transactions without the need to pay gas fees directly. It opens possibilities for innovative fee models and sponsorship arrangements within the Glide ecosystem.

Aggregators:

Aggregators are optional smart contracts that work in conjunction with Account Contracts to validate aggregated signatures from multiple UserOperations. They provide an additional layer of security and efficiency by consolidating multiple signatures into a single value. Aggregators help Account Contracts validate the signatures of UserOperations, ensuring the authenticity and integrity of the transactions.

Aggregators receive the UserOperations containing the required signatures and perform the necessary verification steps. They ensure that the signatures are valid and correspond to the intended operations within the bundle.

By validating multiple signatures, Aggregators enhance the security and trustworthiness of transactions. They enable collaborative decision-making and provide an additional layer of verification for complex transactions involving multiple parties.

Aggregators are a valuable component of GRC-4337, particularly in scenarios where multi-signature functionality is required. They ensure the integrity and authenticity of transactions, contributing to the overall security of the Glide network.

Last updated