{"eip":6900,"title":"Modular Smart Contract Accounts","description":"Interfaces for smart contract accounts and modules, optionally supporting upgradability and introspection","authors":["Adam Egyed (@adamegyed)","Fangting Liu (@trinity-0111)","Jay Paik (@jaypaik)","Yoav Weiss (@yoavw)","Huawei Gu (@huaweigu)","Daniel Lim (@dlim-circle)","Ruben Koch (@0xrubes)","David Philipson (@dphilipson)","Howy Ho (@howydev)","Nikita Belenkov (@nikita-quantstamp)","zer0dot (@zer0dot)","David Kim (@PowerStream3604)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2023-04-18","requires":[165,1271,4337],"discussionsTo":"https://ethereum-magicians.org/t/eip-modular-smart-contract-accounts-and-plugins/13885","repo":"ERCs","label":"ERC-6900","officialUrl":"https://eips.ethereum.org/EIPS/eip-6900","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-6900.md","url":"https://eips.huatuo.xyz/eip-6900/","tldr":{"en":"A draft standard for modular smart accounts: validation logic, execution functions and hooks live in installable modules, so one module can work on any compliant ERC-4337 account.","ja":"モジュール式スマートアカウントのドラフト標準。検証ロジック、実行関数、フックをインストール可能なモジュールに置くことで、1 つのモジュールが準拠する任意の ERC-4337 アカウントで動作する。","ko":"모듈형 스마트 계정을 위한 드래프트 표준. 검증 로직, 실행 함수, 훅을 설치 가능한 모듈에 두어, 하나의 모듈이 규격을 따르는 모든 ERC-4337 계정에서 동작하게 한다.","zh":"模块化智能账户的草案标准：验证逻辑、执行函数和 hook 都放在可安装的模块中，因此同一个模块可以在任何兼容的 ERC-4337 账户上运行。"},"tags":["account-abstraction","smart-account","modules","erc4337","wallet"],"explainers":{"en":{"lang":"en","tldr":"A draft standard for modular smart accounts: validation logic, execution functions and hooks live in installable modules, so one module can work on any compliant ERC-4337 account.","tags":["account-abstraction","smart-account","modules","erc4337","wallet"],"related":[4337,1271,165,7579],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-6900/","markdown":"## What problem does it solve?\n\n[ERC-4337](/eip-4337/) lets smart contract accounts define their own validation and execution logic. Features like session keys, spending limits, subscriptions or role-based access are then built either into a specific account implementation or as proprietary plugins for one wallet platform. Users get locked into the account that has the features they want, and module developers have to pick which platforms to support.\n\nERC-6900 defines how an account and its modules talk to each other, so any compliant module can be installed on any compliant account, with clear rules about what each module is allowed to do.\n\n## How it works\n\nA modular account splits its logic into three kinds of **modular functions**, all hosted in external module contracts:\n\n- **Validation functions** decide whether an action is authorised. There are three flows: user operation validation (`validateUserOp` via the EntryPoint), runtime validation (direct calls through `executeWithRuntimeValidation`), and signature validation ([ERC-1271](/eip-1271/) `isValidSignature`).\n- **Execution functions** add new callable functions (selectors) to the account.\n- **Hooks**: *validation hooks* run before a validation function (e.g. to enforce limits), and *execution hooks* run before and/or after an execution (a pre-hook can pass data to its post-hook).\n\nThe account must implement ERC-4337's `IAccount` and `IAccountExecute`, ERC-1271, and `IERC6900Account`:\n\n- `execute`, `executeBatch`, `executeWithRuntimeValidation`\n- `installExecution` / `uninstallExecution`, which take the module's **execution manifest** (its selectors, hooks and interface IDs)\n- `installValidation` / `uninstallValidation`, which take a `ValidationConfig` with flags `isGlobal`, `isSignatureValidation` and `isUserOpValidation`, plus the selectors it may validate and its hooks\n- `accountId()`\n\nModules implement `IERC6900Module` (`onInstall`, `onUninstall`, `moduleId()` returning `\"vendor.module.semver\"`) and any of the validation, validation-hook, execution or execution-hook module interfaces.\n\nKey rule: a validation function may only authorise selectors it was installed for, unless it is marked global. Calls from `execute` back into the account itself get extra checks, so a narrow module cannot escalate its own permissions.\n\n## Sample code\n\nShape of a minimal module (based on the spec's interfaces):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.25;\n\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ninterface IERC6900Module is IERC165 {\n    function onInstall(bytes calldata data) external;\n    function onUninstall(bytes calldata data) external;\n    function moduleId() external view returns (string memory);\n}\n\ncontract DailyLimitModule is IERC6900Module {\n    mapping(address account =\u003e uint256) public limit;\n\n    function onInstall(bytes calldata data) external {\n        limit[msg.sender] = abi.decode(data, (uint256)); // msg.sender is the account\n    }\n\n    function onUninstall(bytes calldata) external {\n        delete limit[msg.sender]; // clean up, or stale state may be reused on reinstall\n    }\n\n    function moduleId() external pure returns (string memory) {\n        return \"example.daily-limit.1.0.0\";\n    }\n\n    function supportsInterface(bytes4 id) external pure returns (bool) {\n        return id == type(IERC6900Module).interfaceId || id == type(IERC165).interfaceId;\n    }\n    // A real module would also implement a validation-hook or execution-hook interface.\n}\n```\n\n## Things to know\n\n- Status: **Draft**. The interfaces have gone through major revisions; check the spec version your account and modules target.\n- Modules are trusted code. A malicious module can add reverting hooks that brick the account or execution functions that drain it. Install only audited modules.\n- Be careful with global validation: a globally enabled validation function can authorise any native function exposed to it, which is effectively root access.\n- The spec allows `onUninstall` failures to be ignored, so modules can leave stale state behind. Clean up fully, especially before reinstalling with the same entity ID.\n- [ERC-7579](/eip-7579/) (Draft) is an alternative, more minimal modular account standard. The two are not interchangeable.\n"},"ja":{"lang":"ja","tldr":"モジュール式スマートアカウントのドラフト標準。検証ロジック、実行関数、フックをインストール可能なモジュールに置くことで、1 つのモジュールが準拠する任意の ERC-4337 アカウントで動作する。","tags":["account-abstraction","smart-account","modules","erc4337","wallet"],"related":[4337,1271,165,7579],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-6900/","markdown":"## 何を解決するのか\n\n[ERC-4337](/eip-4337/) により、スマートコントラクトアカウントは独自の検証・実行ロジックを定義できます。セッションキー、支出制限、サブスクリプション、ロールベースのアクセス制御といった機能は、特定のアカウント実装に組み込まれるか、特定のウォレットプラットフォーム向けの独自プラグインとして作られてきました。ユーザーは欲しい機能を持つアカウントに囲い込まれ、モジュール開発者はどのプラットフォームに対応するかを選ばなければなりません。\n\nERC-6900 はアカウントとモジュールが互いにやり取りする方法を定義します。これにより、準拠する任意のモジュールを準拠する任意のアカウントにインストールでき、各モジュールに許される操作も明確なルールで定められます。\n\n## 仕組み\n\nモジュール式アカウントは、ロジックを 3 種類の**モジュール関数**に分け、すべて外部のモジュールコントラクトに置きます。\n\n- **検証関数**は、操作が許可されているかを判断します。フローは 3 つあります。ユーザーオペレーションの検証（EntryPoint 経由の `validateUserOp`）、ランタイム検証（`executeWithRuntimeValidation` を通じた直接呼び出し）、署名検証（[ERC-1271](/eip-1271/) の `isValidSignature`）です。\n- **実行関数**は、アカウントに新しい呼び出し可能な関数（セレクター）を追加します。\n- **フック**：*検証フック*は検証関数の前に実行され（例：制限の強制）、*実行フック*は実行の前や後（またはその両方）に実行されます（pre フックは post フックにデータを渡せます）。\n\nアカウントは、ERC-4337 の `IAccount` と `IAccountExecute`、ERC-1271、そして `IERC6900Account` を実装する必要があります。\n\n- `execute`、`executeBatch`、`executeWithRuntimeValidation`\n- `installExecution` / `uninstallExecution`：モジュールの**実行マニフェスト**（セレクター、フック、インターフェース ID）を受け取る\n- `installValidation` / `uninstallValidation`：`isGlobal`、`isSignatureValidation`、`isUserOpValidation` のフラグを持つ `ValidationConfig`、検証可能なセレクター、およびそのフックを受け取る\n- `accountId()`\n\nモジュールは `IERC6900Module`（`onInstall`、`onUninstall`、`\"vendor.module.semver\"` を返す `moduleId()`）と、検証・検証フック・実行・実行フックの各モジュールインターフェースのいずれかを実装します。\n\n重要なルール：検証関数は、グローバルとして指定されていない限り、インストール時に対象とされたセレクターだけを許可できます。`execute` からアカウント自身への呼び出しには追加のチェックが入るため、権限の狭いモジュールが自分の権限を昇格させることはできません。\n\n## サンプルコード\n\n最小限のモジュールの形（仕様のインターフェースに基づく）:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.25;\n\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ninterface IERC6900Module is IERC165 {\n    function onInstall(bytes calldata data) external;\n    function onUninstall(bytes calldata data) external;\n    function moduleId() external view returns (string memory);\n}\n\ncontract DailyLimitModule is IERC6900Module {\n    mapping(address account =\u003e uint256) public limit;\n\n    function onInstall(bytes calldata data) external {\n        limit[msg.sender] = abi.decode(data, (uint256)); // msg.sender is the account\n    }\n\n    function onUninstall(bytes calldata) external {\n        delete limit[msg.sender]; // clean up, or stale state may be reused on reinstall\n    }\n\n    function moduleId() external pure returns (string memory) {\n        return \"example.daily-limit.1.0.0\";\n    }\n\n    function supportsInterface(bytes4 id) external pure returns (bool) {\n        return id == type(IERC6900Module).interfaceId || id == type(IERC165).interfaceId;\n    }\n    // A real module would also implement a validation-hook or execution-hook interface.\n}\n```\n\n## 知っておくべきこと\n\n- ステータス：**Draft**。インターフェースは大きな改訂を経てきました。アカウントとモジュールが対象とする仕様バージョンを確認してください。\n- モジュールは信頼されるコードです。悪意あるモジュールは、アカウントを使用不能にする revert するフックや、アカウントの資産を抜き取る実行関数を追加できます。監査済みのモジュールだけをインストールしてください。\n- グローバル検証には注意してください。グローバルに有効化された検証関数は、公開されている任意のネイティブ関数を許可でき、事実上 root アクセスに相当します。\n- 仕様では `onUninstall` の失敗を無視してもよいため、モジュールが古い状態を残す可能性があります。特に同じエンティティ ID で再インストールする前には、完全にクリーンアップしてください。\n- [ERC-7579](/eip-7579/)（Draft）は、より最小限の代替モジュール式アカウント標準です。両者に互換性はありません。\n"},"ko":{"lang":"ko","tldr":"모듈형 스마트 계정을 위한 드래프트 표준. 검증 로직, 실행 함수, 훅을 설치 가능한 모듈에 두어, 하나의 모듈이 규격을 따르는 모든 ERC-4337 계정에서 동작하게 한다.","tags":["account-abstraction","smart-account","modules","erc4337","wallet"],"related":[4337,1271,165,7579],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-6900/","markdown":"## 어떤 문제를 해결하나요?\n\n[ERC-4337](/eip-4337/)은 스마트 컨트랙트 계정이 자체 검증 및 실행 로직을 정의할 수 있게 합니다. 세션 키, 지출 한도, 구독, 역할 기반 접근 제어 같은 기능은 특정 계정 구현에 내장되거나 한 지갑 플랫폼 전용 독점 플러그인으로 만들어집니다. 사용자는 원하는 기능이 있는 계정에 묶이게 되고, 모듈 개발자는 어떤 플랫폼을 지원할지 골라야 합니다.\n\nERC-6900은 계정과 모듈이 서로 어떻게 소통하는지를 정의하여, 규격을 따르는 모든 모듈을 규격을 따르는 모든 계정에 설치할 수 있게 하고, 각 모듈이 무엇을 할 수 있는지에 대한 명확한 규칙을 둡니다.\n\n## 어떻게 동작하나요?\n\n모듈형 계정은 로직을 세 종류의 **모듈 함수**로 나누며, 모두 외부 모듈 컨트랙트에 있습니다.\n\n- **검증 함수**는 어떤 동작이 승인되었는지 판단합니다. 흐름은 세 가지입니다. 사용자 오퍼레이션 검증(EntryPoint를 통한 `validateUserOp`), 런타임 검증(`executeWithRuntimeValidation`을 통한 직접 호출), 서명 검증([ERC-1271](/eip-1271/)의 `isValidSignature`)입니다.\n- **실행 함수**는 계정에 새로 호출 가능한 함수(셀렉터)를 추가합니다.\n- **훅**: *검증 훅*은 검증 함수 전에 실행되고(예: 한도 강제), *실행 훅*은 실행 전과/또는 후에 실행됩니다(pre-훅은 post-훅에 데이터를 넘길 수 있음).\n\n계정은 ERC-4337의 `IAccount`와 `IAccountExecute`, ERC-1271, 그리고 `IERC6900Account`를 구현해야 합니다.\n\n- `execute`, `executeBatch`, `executeWithRuntimeValidation`\n- `installExecution` / `uninstallExecution`: 모듈의 **실행 매니페스트**(셀렉터, 훅, 인터페이스 ID)를 받음\n- `installValidation` / `uninstallValidation`: `isGlobal`, `isSignatureValidation`, `isUserOpValidation` 플래그가 있는 `ValidationConfig`와, 검증할 수 있는 셀렉터 및 훅을 받음\n- `accountId()`\n\n모듈은 `IERC6900Module`(`onInstall`, `onUninstall`, `\"vendor.module.semver\"`를 반환하는 `moduleId()`)과 검증, 검증 훅, 실행, 실행 훅 모듈 인터페이스 중 필요한 것을 구현합니다.\n\n핵심 규칙: 검증 함수는 글로벌로 표시되지 않는 한 설치될 때 지정된 셀렉터만 승인할 수 있습니다. `execute`에서 계정 자신으로 되돌아오는 호출에는 추가 검사가 적용되므로, 좁은 권한의 모듈이 스스로 권한을 상승시킬 수 없습니다.\n\n## 샘플 코드\n\n최소 모듈의 형태(사양의 인터페이스 기반):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.25;\n\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ninterface IERC6900Module is IERC165 {\n    function onInstall(bytes calldata data) external;\n    function onUninstall(bytes calldata data) external;\n    function moduleId() external view returns (string memory);\n}\n\ncontract DailyLimitModule is IERC6900Module {\n    mapping(address account =\u003e uint256) public limit;\n\n    function onInstall(bytes calldata data) external {\n        limit[msg.sender] = abi.decode(data, (uint256)); // msg.sender is the account\n    }\n\n    function onUninstall(bytes calldata) external {\n        delete limit[msg.sender]; // clean up, or stale state may be reused on reinstall\n    }\n\n    function moduleId() external pure returns (string memory) {\n        return \"example.daily-limit.1.0.0\";\n    }\n\n    function supportsInterface(bytes4 id) external pure returns (bool) {\n        return id == type(IERC6900Module).interfaceId || id == type(IERC165).interfaceId;\n    }\n    // A real module would also implement a validation-hook or execution-hook interface.\n}\n```\n\n## 알아둘 점\n\n- 상태: **Draft**. 인터페이스는 큰 개정을 여러 번 거쳤습니다. 계정과 모듈이 대상으로 하는 사양 버전을 확인하세요.\n- 모듈은 신뢰해야 하는 코드입니다. 악의적인 모듈은 계정을 먹통으로 만드는 revert 훅이나 계정 자산을 빼내는 실행 함수를 추가할 수 있습니다. 감사를 거친 모듈만 설치하세요.\n- 글로벌 검증에 주의하세요. 글로벌로 활성화된 검증 함수는 자신에게 노출된 모든 네이티브 함수를 승인할 수 있어, 사실상 root 권한과 같습니다.\n- 사양은 `onUninstall`의 실패를 무시하는 것을 허용하므로 모듈이 오래된 상태를 남길 수 있습니다. 특히 같은 엔티티 ID로 다시 설치하기 전에는 완전히 정리하세요.\n- [ERC-7579](/eip-7579/)(Draft)는 더 최소한의 대안 모듈형 계정 표준입니다. 둘은 서로 호환되지 않습니다.\n"},"zh":{"lang":"zh","tldr":"模块化智能账户的草案标准：验证逻辑、执行函数和 hook 都放在可安装的模块中，因此同一个模块可以在任何兼容的 ERC-4337 账户上运行。","tags":["account-abstraction","smart-account","modules","erc4337","wallet"],"related":[4337,1271,165,7579],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-6900/","markdown":"## 它解决什么问题？\n\n[ERC-4337](/eip-4337/) 允许智能合约账户定义自己的验证和执行逻辑。会话密钥、支出限额、订阅或基于角色的访问控制等功能，要么内置在某个特定的账户实现中，要么是某个钱包平台的专有插件。用户被锁定在拥有所需功能的账户上，模块开发者则必须选择支持哪些平台。\n\nERC-6900 定义了账户与其模块之间如何交互，使任何兼容的模块都能安装到任何兼容的账户上，并对每个模块被允许做什么给出明确规则。\n\n## 它如何运作\n\n模块化账户把逻辑拆分为三类**模块化函数**，全部托管在外部模块合约中：\n\n- **验证函数**决定某个操作是否被授权。有三种流程：用户操作验证（通过 EntryPoint 的 `validateUserOp`）、运行时验证（通过 `executeWithRuntimeValidation` 直接调用）以及签名验证（[ERC-1271](/eip-1271/) 的 `isValidSignature`）。\n- **执行函数**为账户添加新的可调用函数（选择器）。\n- **Hook**：*验证 hook* 在验证函数之前运行（例如用于强制执行限额），*执行 hook* 在执行之前和/或之后运行（pre-hook 可以向 post-hook 传递数据）。\n\n账户必须实现 ERC-4337 的 `IAccount` 和 `IAccountExecute`、ERC-1271 以及 `IERC6900Account`：\n\n- `execute`、`executeBatch`、`executeWithRuntimeValidation`\n- `installExecution` / `uninstallExecution`，接收模块的**执行清单（execution manifest）**（其选择器、hook 和接口 ID）\n- `installValidation` / `uninstallValidation`，接收带有 `isGlobal`、`isSignatureValidation` 和 `isUserOpValidation` 标志的 `ValidationConfig`，以及它可验证的选择器和它的 hook\n- `accountId()`\n\n模块实现 `IERC6900Module`（`onInstall`、`onUninstall`、返回 `\"vendor.module.semver\"` 的 `moduleId()`），以及验证、验证 hook、执行或执行 hook 模块接口中的任意一种。\n\n关键规则：除非被标记为全局，否则验证函数只能授权它安装时对应的选择器。从 `execute` 回调账户自身的调用会受到额外检查，因此权限狭窄的模块无法提升自己的权限。\n\n## 示例代码\n\n一个最小模块的形态（基于规范中的接口）：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.25;\n\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ninterface IERC6900Module is IERC165 {\n    function onInstall(bytes calldata data) external;\n    function onUninstall(bytes calldata data) external;\n    function moduleId() external view returns (string memory);\n}\n\ncontract DailyLimitModule is IERC6900Module {\n    mapping(address account =\u003e uint256) public limit;\n\n    function onInstall(bytes calldata data) external {\n        limit[msg.sender] = abi.decode(data, (uint256)); // msg.sender is the account\n    }\n\n    function onUninstall(bytes calldata) external {\n        delete limit[msg.sender]; // clean up, or stale state may be reused on reinstall\n    }\n\n    function moduleId() external pure returns (string memory) {\n        return \"example.daily-limit.1.0.0\";\n    }\n\n    function supportsInterface(bytes4 id) external pure returns (bool) {\n        return id == type(IERC6900Module).interfaceId || id == type(IERC165).interfaceId;\n    }\n    // A real module would also implement a validation-hook or execution-hook interface.\n}\n```\n\n## 需要注意\n\n- 状态：**Draft**。接口经历过重大修订；请确认你的账户和模块所针对的规范版本。\n- 模块是受信任的代码。恶意模块可以添加会 revert 的 hook 使账户无法使用，或添加执行函数把账户资产转走。请只安装经过审计的模块。\n- 要谨慎对待全局验证：全局启用的验证函数可以授权暴露给它的任何原生函数，这实际上相当于 root 权限。\n- 规范允许忽略 `onUninstall` 的失败，因此模块可能留下过期状态。请彻底清理，尤其是在使用相同实体 ID 重新安装之前。\n- [ERC-7579](/eip-7579/)（Draft）是另一种更精简的模块化账户标准。两者不可互换。\n"}}}
