---
eip: 7579
label: ERC-7579
title: Minimal Modular Smart Accounts
status: Draft
type: Standards Track
category: ERC
created: 2023-12-14
requires: 165, 1271, 2771, 4337
official: https://eips.ethereum.org/EIPS/eip-7579
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7579.md
canonical: https://eips.huatuo.xyz/ko/eip-7579/
lang: ko
tldr: 모듈형 스마트 계정과 그 플러그인 모듈(validator, executor, fallback handler, hook)을 위한 최소한의 공통 인터페이스. 하나의 모듈이 여러 계정 구현에서 동작해, 사용자가 특정 벤더에 묶이지 않게 한다.
tags: [account-abstraction, smart-accounts, modules, erc4337, wallets]
---

# ERC-7579: Minimal Modular Smart Accounts

> Modular smart account interfaces and behavior for interoperability with minimal restrictions for accounts and modules

**TL;DR:** 모듈형 스마트 계정과 그 플러그인 모듈(validator, executor, fallback handler, hook)을 위한 최소한의 공통 인터페이스. 하나의 모듈이 여러 계정 구현에서 동작해, 사용자가 특정 벤더에 묶이지 않게 한다.

## 어떤 문제를 해결하나요?

스마트 컨트랙트 계정은 기능을 외부 **모듈**로 옮기는 경우가 늘고 있습니다. 패스키나 멀티시그 검증, 세션 키, 지출 한도, 복구 등입니다. 계정 벤더마다 자체 모듈 시스템을 설계했기 때문에 한 계정용으로 만든 모듈은 다른 계정에서 동작하지 않았고, 사용자는 처음 시작한 벤더에 묶여 있었습니다.

ERC-7579는 계정과 모듈이 상호 운용될 수 있게 하는 최소한의 인터페이스 집합을 정의하면서, 계정 내부는 열어 두어 벤더가 계속 혁신할 수 있게 합니다.

## 어떻게 동작하나요?

**모듈 타입**은 숫자 ID로 식별됩니다(하나의 모듈이 여러 타입일 수 있음).

| ID | 타입 | 역할 |
| --- | --- | --- |
| 1 | Validator | `validateUserOp`와 ERC-1271 서명을 검증 |
| 2 | Executor | `executeFromExecutor`를 통해 계정이 호출을 실행하게 할 수 있음 |
| 3 | Fallback handler | 계정의 fallback을 통해 계정에 함수를 추가 |
| 4 | Hook | 실행 전후에 `preCheck` / `postCheck` 수행 |

모든 모듈은 `onInstall(data)`, `onUninstall(data)`, `isModuleType(id)`를 구현합니다.

**계정**은 다음을 구현해야 합니다.

- `execute(bytes32 mode, bytes executionCalldata)`와 `executeFromExecutor(...)`. 후자는 설치된 executor만 호출할 수 있습니다.
- `installModule`, `uninstallModule`, `isModuleInstalled`, 그리고 `ModuleInstalled` / `ModuleUninstalled` 발생. 계정은 모듈 타입을 구분해 유지해야 하며, 예를 들어 validator가 `executeFromExecutor`를 호출할 수 없어야 합니다.
- `accountId()`(예: `"vendor.account.semver"`), `supportsExecutionMode(mode)`, `supportsModule(typeId)`.
- [ERC-1271](/eip-1271/) `isValidSignature`. 선택적으로 `isValidSignatureWithSender`를 통해 validator로 전달할 수 있습니다.

**실행 모드**는 패킹된 `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[])`입니다.

Fallback handler는 `call`/`staticcall`로 호출되며, 원래 발신자가 [ERC-2771](/eip-2771/)에 따라 뒤에 덧붙여집니다. 검증은 현재 [ERC-4337](/eip-4337/)의 `PackedUserOperation`을 가정합니다.

## 샘플 코드

배치 실행 인코딩(ethers v6):

```ts
import { AbiCoder, Interface } from "ethers";

// mode: callType=0x01 (batch), execType=0x00 (revert on failure), rest zero
const MODE_BATCH = "0x01" + "00".repeat(31);

const calls = [
  { target: token, value: 0n, callData: erc20.encodeFunctionData("approve", [router, amount]) },
  { target: router, value: 0n, callData: swapCalldata },
];
const executionCalldata = AbiCoder.defaultAbiCoder().encode(
  ["tuple(address target,uint256 value,bytes callData)[]"], [calls]);

const account = new Interface(["function execute(bytes32 mode, bytes executionCalldata)"]);
const userOpCallData = account.encodeFunctionData("execute", [MODE_BATCH, executionCalldata]);
```

최소한의 validator 스켈레톤:

```solidity
contract OwnerValidator /* is IERC7579Validator */ {
    mapping(address account => address) public owner;

    function onInstall(bytes calldata data) external { owner[msg.sender] = abi.decode(data, (address)); }
    function onUninstall(bytes calldata) external { delete owner[msg.sender]; }
    function isModuleType(uint256 id) external pure returns (bool) { return id == 1; }
    // validateUserOp(...) and isValidSignatureWithSender(...) check signatures against owner[msg.sender]
}
```

## 알아둘 점

- 상태는 **Draft**이며, Security Considerations 섹션에는 아직 "needs more discussion"이라고 적혀 있습니다.
- `delegatecall` 모드는 외부 코드를 계정의 스토리지 컨텍스트에서 실행합니다. 신뢰할 수 있는 대상만 허용하세요.
- 모듈은 `onUninstall`에서 revert해 스스로를 제거하기 어렵게 만들 수 있고, 악의적인 hook은 항상 revert해서 계정을 벽돌로 만들 수 있습니다. 감사를 거친 모듈만 설치하세요.
- 계정 자신에 대한 `execute`로 설정 호출을 허용하는 계정에서는 `installModule`에 대한 더 엄격한 인가가 우회될 수 있습니다.
- [ERC-6900](/eip-6900/)은 별개의, 더 규정적인 모듈형 계정 표준입니다. ERC-7579는 의도적으로 최소한의 길을 택합니다.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7579
