---
eip: 6900
label: ERC-6900
title: Modular Smart Contract Accounts
status: Draft
type: Standards Track
category: ERC
created: 2023-04-18
requires: 165, 1271, 4337
official: https://eips.ethereum.org/EIPS/eip-6900
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-6900.md
canonical: https://eips.huatuo.xyz/ko/eip-6900/
lang: ko
tldr: 모듈형 스마트 계정을 위한 드래프트 표준. 검증 로직, 실행 함수, 훅을 설치 가능한 모듈에 두어, 하나의 모듈이 규격을 따르는 모든 ERC-4337 계정에서 동작하게 한다.
tags: [account-abstraction, smart-account, modules, erc4337, wallet]
---

# ERC-6900: Modular Smart Contract Accounts

> Interfaces for smart contract accounts and modules, optionally supporting upgradability and introspection

**TL;DR:** 모듈형 스마트 계정을 위한 드래프트 표준. 검증 로직, 실행 함수, 훅을 설치 가능한 모듈에 두어, 하나의 모듈이 규격을 따르는 모든 ERC-4337 계정에서 동작하게 한다.

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

[ERC-4337](/eip-4337/)은 스마트 컨트랙트 계정이 자체 검증 및 실행 로직을 정의할 수 있게 합니다. 세션 키, 지출 한도, 구독, 역할 기반 접근 제어 같은 기능은 특정 계정 구현에 내장되거나 한 지갑 플랫폼 전용 독점 플러그인으로 만들어집니다. 사용자는 원하는 기능이 있는 계정에 묶이게 되고, 모듈 개발자는 어떤 플랫폼을 지원할지 골라야 합니다.

ERC-6900은 계정과 모듈이 서로 어떻게 소통하는지를 정의하여, 규격을 따르는 모든 모듈을 규격을 따르는 모든 계정에 설치할 수 있게 하고, 각 모듈이 무엇을 할 수 있는지에 대한 명확한 규칙을 둡니다.

## 어떻게 동작하나요?

모듈형 계정은 로직을 세 종류의 **모듈 함수**로 나누며, 모두 외부 모듈 컨트랙트에 있습니다.

- **검증 함수**는 어떤 동작이 승인되었는지 판단합니다. 흐름은 세 가지입니다. 사용자 오퍼레이션 검증(EntryPoint를 통한 `validateUserOp`), 런타임 검증(`executeWithRuntimeValidation`을 통한 직접 호출), 서명 검증([ERC-1271](/eip-1271/)의 `isValidSignature`)입니다.
- **실행 함수**는 계정에 새로 호출 가능한 함수(셀렉터)를 추가합니다.
- **훅**: *검증 훅*은 검증 함수 전에 실행되고(예: 한도 강제), *실행 훅*은 실행 전과/또는 후에 실행됩니다(pre-훅은 post-훅에 데이터를 넘길 수 있음).

계정은 ERC-4337의 `IAccount`와 `IAccountExecute`, ERC-1271, 그리고 `IERC6900Account`를 구현해야 합니다.

- `execute`, `executeBatch`, `executeWithRuntimeValidation`
- `installExecution` / `uninstallExecution`: 모듈의 **실행 매니페스트**(셀렉터, 훅, 인터페이스 ID)를 받음
- `installValidation` / `uninstallValidation`: `isGlobal`, `isSignatureValidation`, `isUserOpValidation` 플래그가 있는 `ValidationConfig`와, 검증할 수 있는 셀렉터 및 훅을 받음
- `accountId()`

모듈은 `IERC6900Module`(`onInstall`, `onUninstall`, `"vendor.module.semver"`를 반환하는 `moduleId()`)과 검증, 검증 훅, 실행, 실행 훅 모듈 인터페이스 중 필요한 것을 구현합니다.

핵심 규칙: 검증 함수는 글로벌로 표시되지 않는 한 설치될 때 지정된 셀렉터만 승인할 수 있습니다. `execute`에서 계정 자신으로 되돌아오는 호출에는 추가 검사가 적용되므로, 좁은 권한의 모듈이 스스로 권한을 상승시킬 수 없습니다.

## 샘플 코드

최소 모듈의 형태(사양의 인터페이스 기반):

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";

interface IERC6900Module is IERC165 {
    function onInstall(bytes calldata data) external;
    function onUninstall(bytes calldata data) external;
    function moduleId() external view returns (string memory);
}

contract DailyLimitModule is IERC6900Module {
    mapping(address account => uint256) public limit;

    function onInstall(bytes calldata data) external {
        limit[msg.sender] = abi.decode(data, (uint256)); // msg.sender is the account
    }

    function onUninstall(bytes calldata) external {
        delete limit[msg.sender]; // clean up, or stale state may be reused on reinstall
    }

    function moduleId() external pure returns (string memory) {
        return "example.daily-limit.1.0.0";
    }

    function supportsInterface(bytes4 id) external pure returns (bool) {
        return id == type(IERC6900Module).interfaceId || id == type(IERC165).interfaceId;
    }
    // A real module would also implement a validation-hook or execution-hook interface.
}
```

## 알아둘 점

- 상태: **Draft**. 인터페이스는 큰 개정을 여러 번 거쳤습니다. 계정과 모듈이 대상으로 하는 사양 버전을 확인하세요.
- 모듈은 신뢰해야 하는 코드입니다. 악의적인 모듈은 계정을 먹통으로 만드는 revert 훅이나 계정 자산을 빼내는 실행 함수를 추가할 수 있습니다. 감사를 거친 모듈만 설치하세요.
- 글로벌 검증에 주의하세요. 글로벌로 활성화된 검증 함수는 자신에게 노출된 모든 네이티브 함수를 승인할 수 있어, 사실상 root 권한과 같습니다.
- 사양은 `onUninstall`의 실패를 무시하는 것을 허용하므로 모듈이 오래된 상태를 남길 수 있습니다. 특히 같은 엔티티 ID로 다시 설치하기 전에는 완전히 정리하세요.
- [ERC-7579](/eip-7579/)(Draft)는 더 최소한의 대안 모듈형 계정 표준입니다. 둘은 서로 호환되지 않습니다.


---

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