Modular Accounts with ERC-6900
ERC-6900 defines modular smart account and plugin interfaces
Introduction
ERC-6900 introduces a standardized framework for modular smart accounts and plugins within the Ethereum ecosystem.
The proposal aims to enhance the flexibility and composability of smart contract accounts by allowing developers to separate different functionalities into distinct modules that can be upgraded and interacted with independently. ERC-6900 accounts must follow ERC-4337.
Structure
The functionality of smart accounts is separated into distinct modules called plugins. These plugins can include validation, execution, and hook functions. Plugins can be upgraded, and the standard defines interfaces for updating and inspecting these modules.
Types of Plugins
There are three types of plugins:
- Validation functions are functions that validate authentication and authorization of a caller to an account.
- Execution functions execute any custom logic allowed by the account.
- Hooks are smart contract functions executed before or after another function, and can modify the state or cause a call to revert.
Plugins are required to have standard function signatures to be compatible with ERC-6900 accounts.
Interfaces
Accounts are required to implement the below standard interfaces:
IAccount
from ERC-4337, which creates thevalidateUserOp
function called by the EntryPointIStandardExecutor
from ERC-6900, which definesexecute
andexecuteBatch
functions for executing callData
Plugins may include the below interfaces.
IPluginUpdate
to allow plugins to be modifiedIPluginLoupe
to allow plugin information to be inspected on chain
Lifecycle of a call to an ERC-6900 Account
Calls to the account follow five steps.
- Run pre-validation actions
- Validate the call
- Run pre-execution actions
- Execute the tasks
- Run post-execution actions
This follows the same separation of validation and execution introduced by ERC-4337, but includes hooks between validation and execution.
Updated 10 months ago