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 the validateUserOp function called by the EntryPoint
  • IStandardExecutor from ERC-6900, which defines execute and executeBatchfunctions for executing callData

Plugins may include the below interfaces.

Lifecycle of a call to an ERC-6900 Account

Calls to the account follow five steps.

  1. Run pre-validation actions
  2. Validate the call
  3. Run pre-execution actions
  4. Execute the tasks
  5. Run post-execution actions

This follows the same separation of validation and execution introduced by ERC-4337, but includes hooks between validation and execution.