---
eip: 4400
label: ERC-4400
title: EIP-721 Consumable Extension
status: Final
type: Standards Track
category: ERC
created: 2021-10-30
requires: 165, 721
official: https://eips.ethereum.org/EIPS/eip-4400
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-4400.md
canonical: https://eips.huatuo.xyz/ko/eip-4400/
lang: ko
tldr: "ERC-721 NFT에 표준 \"consumer\" 역할을 추가합니다. consumer는 토큰을 전송하거나 승인할 수는 없지만 토큰의 효용을 사용할 수 있는 주소이며, 전송될 때마다 자동으로 초기화됩니다."
tags: [nft, erc721, roles, rental, utility]
---

# ERC-4400: EIP-721 Consumable Extension

> Interface extension for EIP-721 consumer role

**TL;DR:** ERC-721 NFT에 표준 "consumer" 역할을 추가합니다. consumer는 토큰을 전송하거나 승인할 수는 없지만 토큰의 효용을 사용할 수 있는 주소이며, 전송될 때마다 자동으로 초기화됩니다.

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

NFT에는 소유 외의 쓰임새가 자주 있습니다. 메타버스 토지에 씬을 배포하거나, 게임 내 아이템을 착용하거나, 이벤트에 입장하는 것 등입니다. 소유자는 토큰을 넘기지 않고도 다른 사람이 그 효용을 누리게 해주고 싶어 하는 경우가 많습니다. 많은 프로젝트가 이를 위해 자체 역할(`operator`, `contributor`, `user` 등)을 만들었지만, 이름과 의미가 제각각이어서 마켓플레이스와 도구가 범용적으로 지원할 수 없었습니다.

ERC-4400은 최소한의 표준 역할 하나, 즉 **consumer**를 정의해 렌탈 마켓플레이스, 스테이킹 컨트랙트, dApp이 모두 같은 방식으로 이를 읽고 설정할 수 있게 합니다. 예를 들어 스테이킹 컨트랙트가 여러분의 NFT를 보관하는 동안에도 여러분은 consumer로 남아 게임에서 계속 사용할 수 있습니다.

## 어떻게 동작하나요?

이 확장은 읽기 함수 하나, 변경 함수 하나, 이벤트 하나를 추가합니다.

| 멤버 | 용도 |
| --- | --- |
| `consumerOf(tokenId)` | 현재 consumer. 없으면 `address(0)` |
| `changeConsumer(consumer, tokenId)` | consumer를 설정하거나 해제. 소유자, 승인된 주소, 오퍼레이터가 호출 가능 |
| `ConsumerChanged(owner, consumer, tokenId)` | 변경될 때마다 발생 |

규칙:

- consumer를 소유자, 오퍼레이터, 승인된 주소로 취급해서는 **안 됩니다**. consumer는 토큰을 전송하거나 승인할 수 없습니다.
- 전송될 때마다 consumer는 기본값으로 초기화되며, `address(0)`을 권장합니다. 따라서 `Transfer` 이벤트는 consumer가 해제되었음도 의미합니다.
- consumer가 실제로 무엇을 *할 수 있는지*는 각 애플리케이션이 정합니다.
- `supportsInterface(0x953c8dfa)`는 `true`를 반환해야 합니다([ERC-165](/eip-165/)).

## 샘플 코드

OpenZeppelin v5 `ERC721` 위에 얹은 최소 구현입니다.

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

import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";

interface IERC721Consumable {
    event ConsumerChanged(address indexed owner, address indexed consumer, uint256 indexed tokenId);
    function consumerOf(uint256 tokenId) external view returns (address);
    function changeConsumer(address consumer, uint256 tokenId) external;
}

contract ConsumableNFT is ERC721, IERC721Consumable {
    mapping(uint256 => address) private _consumers;

    constructor() ERC721("Land", "LAND") {}

    function consumerOf(uint256 tokenId) external view returns (address) {
        _requireOwned(tokenId);
        return _consumers[tokenId];
    }

    function changeConsumer(address consumer, uint256 tokenId) external {
        address owner = _requireOwned(tokenId);
        require(_isAuthorized(owner, msg.sender, tokenId), "not authorised");
        _consumers[tokenId] = consumer;
        emit ConsumerChanged(owner, consumer, tokenId);
    }

    function _update(address to, uint256 tokenId, address auth) internal override returns (address from) {
        from = super._update(to, tokenId, auth);
        _consumers[tokenId] = address(0); // reset on every transfer
    }

    function supportsInterface(bytes4 id) public view override returns (bool) {
        return id == 0x953c8dfa || super.supportsInterface(id);
    }
}
```

## 알아둘 점

- **상태: Final.**
- 만료 기능은 내장되어 있지 않습니다. consumer는 변경되거나 토큰이 전송될 때까지 유지됩니다. 자동 만료되는 기간제 렌탈이 필요하다면 [ERC-4907](/eip-4907/)(`expires` 타임스탬프가 있는 `user`)과 ERC-1155용 [ERC-5006](/eip-5006/)을 비교해 보세요.
- 보안 부담은 구현자에게 있습니다. 전송 권한이 없더라도 소각이나 메타데이터 변경처럼 소유자에게만 있어야 할 권한을 consumer에게 주면 이 역할의 의미가 사라집니다.
- 전송 시 해제되므로 구매자가 이전 소유자의 consumer를 물려받는 일은 없습니다.


---

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