{"eip":7579,"title":"Minimal Modular Smart Accounts","description":"Modular smart account interfaces and behavior for interoperability with minimal restrictions for accounts and modules","authors":["zeroknots (@zeroknots)","Konrad Kopp (@kopy-kat)","Taek Lee (@leekt)","Fil Makarov (@filmakarov)","Elim Poon (@yaonam)","Lyu Min (@rockmin216)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2023-12-14","requires":[165,1271,2771,4337],"discussionsTo":"https://ethereum-magicians.org/t/erc-7579-minimal-modular-smart-accounts/17336","repo":"ERCs","label":"ERC-7579","officialUrl":"https://eips.ethereum.org/EIPS/eip-7579","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7579.md","url":"https://eips.huatuo.xyz/eip-7579/","tldr":{"en":"A minimal common interface for modular smart accounts and their plug-in modules (validators, executors, fallback handlers, hooks), so one module can work across many account implementations instead of locking users into a single vendor.","ja":"モジュラー型スマートアカウントとそのプラグインモジュール（validator、executor、fallback handler、hook）のための最小限の共通インターフェース。1 つのモジュールが多くのアカウント実装で動作し、ユーザーが特定のベンダーに縛られずに済む。","ko":"모듈형 스마트 계정과 그 플러그인 모듈(validator, executor, fallback handler, hook)을 위한 최소한의 공통 인터페이스. 하나의 모듈이 여러 계정 구현에서 동작해, 사용자가 특정 벤더에 묶이지 않게 한다.","zh":"面向模块化智能账户及其插件模块（验证器、执行器、回退处理器、钩子）的最小通用接口，使同一个模块可以跨多种账户实现工作，而不是把用户锁定在单一厂商上。"},"tags":["account-abstraction","smart-accounts","modules","erc4337","wallets"],"explainers":{"en":{"lang":"en","tldr":"A minimal common interface for modular smart accounts and their plug-in modules (validators, executors, fallback handlers, hooks), so one module can work across many account implementations instead of locking users into a single vendor.","tags":["account-abstraction","smart-accounts","modules","erc4337","wallets"],"related":[4337,1271,2771,165,6900],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7579/","markdown":"## What problem does it solve?\n\nSmart contract accounts increasingly move features into external **modules**: passkey or multisig validation, session keys, spending limits, recovery. Each account vendor designed its own module system, so a module written for one account did not work on another, and users were tied to whichever vendor they started with.\n\nERC-7579 defines the smallest set of interfaces that lets accounts and modules interoperate, while leaving account internals open so vendors can keep innovating.\n\n## How it works\n\n**Module types**, identified by a numeric id (one module may be several types):\n\n| Id | Type | Role |\n| --- | --- | --- |\n| 1 | Validator | Checks `validateUserOp` and ERC-1271 signatures |\n| 2 | Executor | Can make the account execute calls via `executeFromExecutor` |\n| 3 | Fallback handler | Adds functions to the account through its fallback |\n| 4 | Hook | `preCheck` / `postCheck` around executions |\n\nEvery module implements `onInstall(data)`, `onUninstall(data)` and `isModuleType(id)`.\n\n**Accounts** must implement:\n\n- `execute(bytes32 mode, bytes executionCalldata)` and `executeFromExecutor(...)`, the latter callable only by installed executors.\n- `installModule`, `uninstallModule`, `isModuleInstalled`, emitting `ModuleInstalled` / `ModuleUninstalled`. Accounts must keep module types apart so that, for example, a validator cannot call `executeFromExecutor`.\n- `accountId()` (e.g. `\"vendor.account.semver\"`), `supportsExecutionMode(mode)`, `supportsModule(typeId)`.\n- [ERC-1271](/eip-1271/) `isValidSignature`, optionally forwarded to a validator via `isValidSignatureWithSender`.\n\nThe **execution mode** is a packed `bytes32`: callType (1 byte: `0x00` single, `0x01` batch, `0xfe` staticcall, `0xff` delegatecall), execType (1 byte: `0x00` revert on failure, `0x01` try and continue), 4 unused bytes, a 4-byte custom mode selector, and a 22-byte payload. A single call encodes `abi.encodePacked(target, value, callData)`; a batch is `abi.encode(Execution[])`.\n\nFallback handlers are invoked with `call`/`staticcall`, and the original sender is appended per [ERC-2771](/eip-2771/). Validation currently assumes [ERC-4337](/eip-4337/) `PackedUserOperation`s.\n\n## Sample code\n\nEncoding a batch execution (ethers v6):\n\n```ts\nimport { AbiCoder, Interface } from \"ethers\";\n\n// mode: callType=0x01 (batch), execType=0x00 (revert on failure), rest zero\nconst MODE_BATCH = \"0x01\" + \"00\".repeat(31);\n\nconst calls = [\n  { target: token, value: 0n, callData: erc20.encodeFunctionData(\"approve\", [router, amount]) },\n  { target: router, value: 0n, callData: swapCalldata },\n];\nconst executionCalldata = AbiCoder.defaultAbiCoder().encode(\n  [\"tuple(address target,uint256 value,bytes callData)[]\"], [calls]);\n\nconst account = new Interface([\"function execute(bytes32 mode, bytes executionCalldata)\"]);\nconst userOpCallData = account.encodeFunctionData(\"execute\", [MODE_BATCH, executionCalldata]);\n```\n\nA minimal validator skeleton:\n\n```solidity\ncontract OwnerValidator /* is IERC7579Validator */ {\n    mapping(address account =\u003e address) public owner;\n\n    function onInstall(bytes calldata data) external { owner[msg.sender] = abi.decode(data, (address)); }\n    function onUninstall(bytes calldata) external { delete owner[msg.sender]; }\n    function isModuleType(uint256 id) external pure returns (bool) { return id == 1; }\n    // validateUserOp(...) and isValidSignatureWithSender(...) check signatures against owner[msg.sender]\n}\n```\n\n## Things to know\n\n- Status is **Draft**; the Security Considerations section still says \"needs more discussion\".\n- `delegatecall` mode runs foreign code in the account's storage context. Only allow trusted targets.\n- Modules can revert in `onUninstall` to make themselves hard to remove, and malicious hooks can brick an account by always reverting. Install only audited modules.\n- Accounts that allow configuration calls via `execute` on themselves may let stricter authorization on `installModule` be bypassed.\n- [ERC-6900](/eip-6900/) is a separate, more prescriptive modular account standard; ERC-7579 deliberately takes the minimal route.\n"},"ja":{"lang":"ja","tldr":"モジュラー型スマートアカウントとそのプラグインモジュール（validator、executor、fallback handler、hook）のための最小限の共通インターフェース。1 つのモジュールが多くのアカウント実装で動作し、ユーザーが特定のベンダーに縛られずに済む。","tags":["account-abstraction","smart-accounts","modules","erc4337","wallets"],"related":[4337,1271,2771,165,6900],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7579/","markdown":"## 何を解決するのか\n\nスマートコントラクトアカウントは、機能を外部の**モジュール**に移すことが増えています。パスキーやマルチシグの検証、セッションキー、支出制限、リカバリーなどです。アカウントのベンダーごとに独自のモジュールシステムを設計していたため、あるアカウント向けに書かれたモジュールは別のアカウントでは動かず、ユーザーは最初に使い始めたベンダーに縛られていました。\n\nERC-7579 は、アカウントとモジュールが相互運用できる最小限のインターフェースの集合を定義します。アカウントの内部は自由なままにしておくので、ベンダーはイノベーションを続けられます。\n\n## 仕組み\n\n**モジュールタイプ**は数値 ID で識別されます（1 つのモジュールが複数のタイプを兼ねることもあります）。\n\n| ID | タイプ | 役割 |\n| --- | --- | --- |\n| 1 | Validator | `validateUserOp` と ERC-1271 署名を検証する |\n| 2 | Executor | `executeFromExecutor` を通じてアカウントに呼び出しを実行させられる |\n| 3 | Fallback handler | アカウントの fallback を通じてアカウントに関数を追加する |\n| 4 | Hook | 実行の前後で `preCheck` / `postCheck` を行う |\n\nすべてのモジュールは `onInstall(data)`、`onUninstall(data)`、`isModuleType(id)` を実装します。\n\n**アカウント**は次を実装しなければなりません。\n\n- `execute(bytes32 mode, bytes executionCalldata)` と `executeFromExecutor(...)`。後者はインストール済みの executor だけが呼び出せます。\n- `installModule`、`uninstallModule`、`isModuleInstalled`。`ModuleInstalled` / `ModuleUninstalled` を発行します。アカウントはモジュールタイプを区別して保持しなければならず、たとえば validator が `executeFromExecutor` を呼べてはいけません。\n- `accountId()`（例: `\"vendor.account.semver\"`）、`supportsExecutionMode(mode)`、`supportsModule(typeId)`。\n- [ERC-1271](/eip-1271/) の `isValidSignature`。任意で `isValidSignatureWithSender` を通じて validator に転送できます。\n\n**実行モード**は詰め込まれた `bytes32` です。callType（1 バイト: `0x00` 単一、`0x01` バッチ、`0xfe` staticcall、`0xff` delegatecall）、execType（1 バイト: `0x00` 失敗時に revert、`0x01` 試行して続行）、未使用の 4 バイト、4 バイトのカスタムモードセレクター、22 バイトのペイロードで構成されます。単一の呼び出しは `abi.encodePacked(target, value, callData)` でエンコードし、バッチは `abi.encode(Execution[])` です。\n\nFallback handler は `call`/`staticcall` で呼び出され、元の送信者が [ERC-2771](/eip-2771/) に従って末尾に付加されます。検証は現在、[ERC-4337](/eip-4337/) の `PackedUserOperation` を前提としています。\n\n## サンプルコード\n\nバッチ実行のエンコード（ethers v6）:\n\n```ts\nimport { AbiCoder, Interface } from \"ethers\";\n\n// mode: callType=0x01 (batch), execType=0x00 (revert on failure), rest zero\nconst MODE_BATCH = \"0x01\" + \"00\".repeat(31);\n\nconst calls = [\n  { target: token, value: 0n, callData: erc20.encodeFunctionData(\"approve\", [router, amount]) },\n  { target: router, value: 0n, callData: swapCalldata },\n];\nconst executionCalldata = AbiCoder.defaultAbiCoder().encode(\n  [\"tuple(address target,uint256 value,bytes callData)[]\"], [calls]);\n\nconst account = new Interface([\"function execute(bytes32 mode, bytes executionCalldata)\"]);\nconst userOpCallData = account.encodeFunctionData(\"execute\", [MODE_BATCH, executionCalldata]);\n```\n\n最小限の validator のスケルトン:\n\n```solidity\ncontract OwnerValidator /* is IERC7579Validator */ {\n    mapping(address account =\u003e address) public owner;\n\n    function onInstall(bytes calldata data) external { owner[msg.sender] = abi.decode(data, (address)); }\n    function onUninstall(bytes calldata) external { delete owner[msg.sender]; }\n    function isModuleType(uint256 id) external pure returns (bool) { return id == 1; }\n    // validateUserOp(...) and isValidSignatureWithSender(...) check signatures against owner[msg.sender]\n}\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** です。Security Considerations のセクションは今も「needs more discussion」となっています。\n- `delegatecall` モードは、外部のコードをアカウントのストレージコンテキストで実行します。信頼できる対象だけを許可してください。\n- モジュールは `onUninstall` で revert することで、自身を削除しにくくできます。また、悪意ある hook は常に revert することでアカウントを使用不能にできます。監査済みのモジュールだけをインストールしてください。\n- アカウント自身への `execute` 経由で設定変更の呼び出しを許可するアカウントでは、`installModule` に対するより厳格な認可がバイパスされる可能性があります。\n- [ERC-6900](/eip-6900/) は別の、より規定的なモジュラーアカウント標準です。ERC-7579 は意図的に最小限の道を選んでいます。\n"},"ko":{"lang":"ko","tldr":"모듈형 스마트 계정과 그 플러그인 모듈(validator, executor, fallback handler, hook)을 위한 최소한의 공통 인터페이스. 하나의 모듈이 여러 계정 구현에서 동작해, 사용자가 특정 벤더에 묶이지 않게 한다.","tags":["account-abstraction","smart-accounts","modules","erc4337","wallets"],"related":[4337,1271,2771,165,6900],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7579/","markdown":"## 어떤 문제를 해결하나요?\n\n스마트 컨트랙트 계정은 기능을 외부 **모듈**로 옮기는 경우가 늘고 있습니다. 패스키나 멀티시그 검증, 세션 키, 지출 한도, 복구 등입니다. 계정 벤더마다 자체 모듈 시스템을 설계했기 때문에 한 계정용으로 만든 모듈은 다른 계정에서 동작하지 않았고, 사용자는 처음 시작한 벤더에 묶여 있었습니다.\n\nERC-7579는 계정과 모듈이 상호 운용될 수 있게 하는 최소한의 인터페이스 집합을 정의하면서, 계정 내부는 열어 두어 벤더가 계속 혁신할 수 있게 합니다.\n\n## 어떻게 동작하나요?\n\n**모듈 타입**은 숫자 ID로 식별됩니다(하나의 모듈이 여러 타입일 수 있음).\n\n| ID | 타입 | 역할 |\n| --- | --- | --- |\n| 1 | Validator | `validateUserOp`와 ERC-1271 서명을 검증 |\n| 2 | Executor | `executeFromExecutor`를 통해 계정이 호출을 실행하게 할 수 있음 |\n| 3 | Fallback handler | 계정의 fallback을 통해 계정에 함수를 추가 |\n| 4 | Hook | 실행 전후에 `preCheck` / `postCheck` 수행 |\n\n모든 모듈은 `onInstall(data)`, `onUninstall(data)`, `isModuleType(id)`를 구현합니다.\n\n**계정**은 다음을 구현해야 합니다.\n\n- `execute(bytes32 mode, bytes executionCalldata)`와 `executeFromExecutor(...)`. 후자는 설치된 executor만 호출할 수 있습니다.\n- `installModule`, `uninstallModule`, `isModuleInstalled`, 그리고 `ModuleInstalled` / `ModuleUninstalled` 발생. 계정은 모듈 타입을 구분해 유지해야 하며, 예를 들어 validator가 `executeFromExecutor`를 호출할 수 없어야 합니다.\n- `accountId()`(예: `\"vendor.account.semver\"`), `supportsExecutionMode(mode)`, `supportsModule(typeId)`.\n- [ERC-1271](/eip-1271/) `isValidSignature`. 선택적으로 `isValidSignatureWithSender`를 통해 validator로 전달할 수 있습니다.\n\n**실행 모드**는 패킹된 `bytes32`입니다. callType(1바이트: `0x00` 단일, `0x01` 배치, `0xfe` staticcall, `0xff` delegatecall), execType(1바이트: `0x00` 실패 시 revert, `0x01` 시도하고 계속), 사용하지 않는 4바이트, 4바이트 커스텀 모드 셀렉터, 22바이트 페이로드로 구성됩니다. 단일 호출은 `abi.encodePacked(target, value, callData)`로 인코딩하고, 배치는 `abi.encode(Execution[])`입니다.\n\nFallback handler는 `call`/`staticcall`로 호출되며, 원래 발신자가 [ERC-2771](/eip-2771/)에 따라 뒤에 덧붙여집니다. 검증은 현재 [ERC-4337](/eip-4337/)의 `PackedUserOperation`을 가정합니다.\n\n## 샘플 코드\n\n배치 실행 인코딩(ethers v6):\n\n```ts\nimport { AbiCoder, Interface } from \"ethers\";\n\n// mode: callType=0x01 (batch), execType=0x00 (revert on failure), rest zero\nconst MODE_BATCH = \"0x01\" + \"00\".repeat(31);\n\nconst calls = [\n  { target: token, value: 0n, callData: erc20.encodeFunctionData(\"approve\", [router, amount]) },\n  { target: router, value: 0n, callData: swapCalldata },\n];\nconst executionCalldata = AbiCoder.defaultAbiCoder().encode(\n  [\"tuple(address target,uint256 value,bytes callData)[]\"], [calls]);\n\nconst account = new Interface([\"function execute(bytes32 mode, bytes executionCalldata)\"]);\nconst userOpCallData = account.encodeFunctionData(\"execute\", [MODE_BATCH, executionCalldata]);\n```\n\n최소한의 validator 스켈레톤:\n\n```solidity\ncontract OwnerValidator /* is IERC7579Validator */ {\n    mapping(address account =\u003e address) public owner;\n\n    function onInstall(bytes calldata data) external { owner[msg.sender] = abi.decode(data, (address)); }\n    function onUninstall(bytes calldata) external { delete owner[msg.sender]; }\n    function isModuleType(uint256 id) external pure returns (bool) { return id == 1; }\n    // validateUserOp(...) and isValidSignatureWithSender(...) check signatures against owner[msg.sender]\n}\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**이며, Security Considerations 섹션에는 아직 \"needs more discussion\"이라고 적혀 있습니다.\n- `delegatecall` 모드는 외부 코드를 계정의 스토리지 컨텍스트에서 실행합니다. 신뢰할 수 있는 대상만 허용하세요.\n- 모듈은 `onUninstall`에서 revert해 스스로를 제거하기 어렵게 만들 수 있고, 악의적인 hook은 항상 revert해서 계정을 벽돌로 만들 수 있습니다. 감사를 거친 모듈만 설치하세요.\n- 계정 자신에 대한 `execute`로 설정 호출을 허용하는 계정에서는 `installModule`에 대한 더 엄격한 인가가 우회될 수 있습니다.\n- [ERC-6900](/eip-6900/)은 별개의, 더 규정적인 모듈형 계정 표준입니다. ERC-7579는 의도적으로 최소한의 길을 택합니다.\n"},"zh":{"lang":"zh","tldr":"面向模块化智能账户及其插件模块（验证器、执行器、回退处理器、钩子）的最小通用接口，使同一个模块可以跨多种账户实现工作，而不是把用户锁定在单一厂商上。","tags":["account-abstraction","smart-accounts","modules","erc4337","wallets"],"related":[4337,1271,2771,165,6900],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7579/","markdown":"## 它解决什么问题？\n\n智能合约账户越来越多地把功能移到外部**模块**中：通行密钥（passkey）或多签验证、会话密钥、支出限额、恢复。每个账户厂商都设计了自己的模块系统，因此为某个账户编写的模块无法在另一个账户上使用，用户被绑定在最初选择的厂商上。\n\nERC-7579 定义了让账户和模块可以互操作的最小接口集合，同时保持账户内部开放，让厂商可以继续创新。\n\n## 它如何运作\n\n**模块类型**由数字 ID 标识（一个模块可以同时属于多种类型）：\n\n| ID | 类型 | 作用 |\n| --- | --- | --- |\n| 1 | Validator（验证器） | 检查 `validateUserOp` 和 ERC-1271 签名 |\n| 2 | Executor（执行器） | 可以通过 `executeFromExecutor` 让账户执行调用 |\n| 3 | Fallback handler（回退处理器） | 通过账户的 fallback 为账户添加函数 |\n| 4 | Hook（钩子） | 在执行前后进行 `preCheck` / `postCheck` |\n\n每个模块都实现 `onInstall(data)`、`onUninstall(data)` 和 `isModuleType(id)`。\n\n**账户**必须实现：\n\n- `execute(bytes32 mode, bytes executionCalldata)` 和 `executeFromExecutor(...)`，后者只能由已安装的执行器调用。\n- `installModule`、`uninstallModule`、`isModuleInstalled`，并触发 `ModuleInstalled` / `ModuleUninstalled`。账户必须区分各模块类型，例如验证器不能调用 `executeFromExecutor`。\n- `accountId()`（例如 `\"vendor.account.semver\"`）、`supportsExecutionMode(mode)`、`supportsModule(typeId)`。\n- [ERC-1271](/eip-1271/) 的 `isValidSignature`，可选地通过 `isValidSignatureWithSender` 转发给验证器。\n\n**执行模式**是一个打包的 `bytes32`：callType（1 字节：`0x00` 单次调用，`0x01` 批量，`0xfe` staticcall，`0xff` delegatecall）、execType（1 字节：`0x00` 失败时 revert，`0x01` 尝试并继续）、4 个未使用字节、4 字节的自定义模式选择器，以及 22 字节的负载。单次调用编码为 `abi.encodePacked(target, value, callData)`；批量调用为 `abi.encode(Execution[])`。\n\n回退处理器通过 `call`/`staticcall` 调用，并按照 [ERC-2771](/eip-2771/) 附加原始发送者。验证目前假定使用 [ERC-4337](/eip-4337/) 的 `PackedUserOperation`。\n\n## 示例代码\n\n编码批量执行（ethers v6）：\n\n```ts\nimport { AbiCoder, Interface } from \"ethers\";\n\n// mode: callType=0x01 (batch), execType=0x00 (revert on failure), rest zero\nconst MODE_BATCH = \"0x01\" + \"00\".repeat(31);\n\nconst calls = [\n  { target: token, value: 0n, callData: erc20.encodeFunctionData(\"approve\", [router, amount]) },\n  { target: router, value: 0n, callData: swapCalldata },\n];\nconst executionCalldata = AbiCoder.defaultAbiCoder().encode(\n  [\"tuple(address target,uint256 value,bytes callData)[]\"], [calls]);\n\nconst account = new Interface([\"function execute(bytes32 mode, bytes executionCalldata)\"]);\nconst userOpCallData = account.encodeFunctionData(\"execute\", [MODE_BATCH, executionCalldata]);\n```\n\n一个最小的验证器骨架：\n\n```solidity\ncontract OwnerValidator /* is IERC7579Validator */ {\n    mapping(address account =\u003e address) public owner;\n\n    function onInstall(bytes calldata data) external { owner[msg.sender] = abi.decode(data, (address)); }\n    function onUninstall(bytes calldata) external { delete owner[msg.sender]; }\n    function isModuleType(uint256 id) external pure returns (bool) { return id == 1; }\n    // validateUserOp(...) and isValidSignatureWithSender(...) check signatures against owner[msg.sender]\n}\n```\n\n## 需要注意\n\n- 状态为 **Draft**；Security Considerations 一节仍写着\"needs more discussion\"。\n- `delegatecall` 模式会在账户的存储上下文中运行外部代码。只允许受信任的目标。\n- 模块可以在 `onUninstall` 中 revert，使自己难以被移除；恶意钩子可以通过始终 revert 让账户变砖。请只安装经过审计的模块。\n- 允许通过对自身调用 `execute` 来进行配置调用的账户，可能让对 `installModule` 的更严格授权被绕过。\n- [ERC-6900](/eip-6900/) 是另一个更具规定性的模块化账户标准；ERC-7579 则有意走最小化路线。\n"}},"requiredBy":[7484,7710,7780,7821,8286]}
