---
eip: 5700
label: ERC-5700
title: Bindable Token Interface
status: Draft
type: Standards Track
category: ERC
created: 2022-09-22
requires: 165, 721, 1155
official: https://eips.ethereum.org/EIPS/eip-5700
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-5700.md
canonical: https://eips.huatuo.xyz/ko/eip-5700/
lang: ko
tldr: "ERC-721이나 ERC-1155 토큰을 NFT에 \"바인딩\"해, 소유자가 바인딩을 해제할 때까지 그 NFT가 전송될 때 함께 이동하게 하는 초안 인터페이스입니다."
tags: [nft, bundling, composability, token, draft]
---

# ERC-5700: Bindable Token Interface

> Interface for binding fungible and non-fungible tokens to assets.

**TL;DR:** ERC-721이나 ERC-1155 토큰을 NFT에 "바인딩"해, 소유자가 바인딩을 해제할 때까지 그 NFT가 전송될 때 함께 이동하게 하는 초안 인터페이스입니다.

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

여러 토큰이 한 묶음일 때가 있습니다. 피지털 의류 NFT와 거기에 딸린 음악, 아바타, 디지털 트윈이 그렇고, 가상 토지와 그 장식품도 그렇습니다. 이런 묶음을 옮기려면 보통 토큰을 하나씩 전송해야 하고, 이들이 함께 속해 있다는 사실을 온체인에 기록하는 것도 없습니다.

ERC-5700은 "바인딩 가능한" 토큰을 정의합니다. 바인딩 가능한 [ERC-721](/eip-721/)이나 [ERC-1155](/eip-1155/) 토큰은 특정 ERC-721 NFT에 바인딩할 수 있습니다. 바인딩되면 토큰은 지갑이 아니라 NFT 자체가 소유하므로, NFT의 주인이 바뀔 때마다 바인딩된 토큰도 추가 비용 없이 암묵적으로 함께 넘어갑니다. 현재 NFT 소유자는 언제든 바인딩을 해제해 일반적인 전송 가능 토큰을 되찾을 수 있습니다.

## 어떻게 동작하나요?

- **바인딩.** `bind(from, bindAddress, bindId, tokenId)`는 토큰을 `from`에서 `bindAddress`의 NFT 컨트랙트로 전송하고 NFT `bindId`에 속한다고 기록합니다. 대상 컨트랙트가 ERC-721이 아니거나 NFT가 존재하지 않으면 리버트해야 합니다. `Transfer`와 `Bind` 이벤트가 발생합니다.
- **바인딩 해제.** `unbind(from, to, bindAddress, bindId, tokenId)`는 토큰이 바인딩된 NFT의 소유자(또는 승인된 오퍼레이터)만 호출할 수 있습니다. 소유권이 `to`로 넘어가며, `to`가 컨트랙트라면 일반적인 safe-transfer 수신자 확인을 거칩니다. `Unbind`와 `Transfer` 이벤트가 발생합니다.
- **조회.** `binderOf(tokenId)`는 토큰이 바인딩된 NFT를 반환하고(바인딩되지 않았으면 제로 주소), `boundBalanceOf(bindAddress, bindId)`는 NFT에 바인딩된 토큰의 수를 셉니다.
- ERC-1155 버전은 수량과 배치 변형을 추가합니다. `batchBind`, `batchUnbind`, `boundBalanceOfBatch`, 그리고 `BindBatch` / `UnbindBatch` 이벤트입니다.

두 인터페이스 모두 [ERC-165](/eip-165/)로 감지되며, ERC-721 버전의 인터페이스 ID는 `0x82a34a7d`입니다.

## 샘플 코드

액세서리 토큰을 "옷장" NFT에 바인딩하고 나중에 되찾는 예입니다(ERC-721 버전).

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

interface IERC721Bindable {
    event Bind(address indexed operator, address indexed from,
        address indexed bindAddress, uint256 bindId, uint256 tokenId);
    event Unbind(address indexed operator, address indexed from, address to,
        address indexed bindAddress, uint256 bindId, uint256 tokenId);

    function bind(address from, address bindAddress, uint256 bindId, uint256 tokenId) external;
    function unbind(address from, address to, address bindAddress, uint256 bindId, uint256 tokenId) external;
    function binderOf(uint256 tokenId) external view returns (address, uint256);
    function boundBalanceOf(address bindAddress, uint256 bindId) external view returns (uint256);
}

contract Example {
    function attach(IERC721Bindable accessory, address wardrobe, uint256 wardrobeId, uint256 hatId) external {
        // caller must own (or be approved for) hatId
        accessory.bind(msg.sender, wardrobe, wardrobeId, hatId);
    }

    function detach(IERC721Bindable accessory, address wardrobe, uint256 wardrobeId, uint256 hatId) external {
        // caller must own (or be approved for) the wardrobe NFT
        accessory.unbind(msg.sender, msg.sender, wardrobe, wardrobeId, hatId);
    }
}
```

## 알아둘 점

- 상태는 **Draft**입니다. 인터페이스는 아직 바뀔 수 있으며 확정된 표준으로 다뤄서는 안 됩니다.
- ERC-5700을 이해하지 못하는 앱은 바인딩된 토큰을 NFT의 소유자가 아니라 NFT 컨트랙트 주소가 소유한 것으로 표시합니다. 명세는 이를 가벼운 설계의 알려진 트레이드오프로 짚습니다.
- 보안은 바인딩 해제가 바인딩된 NFT의 현재 소유자나 오퍼레이터로 제한되는지에 달려 있습니다. 어떤 구현이든 이 확인을 꼼꼼히 검토하세요.
- 명세 본문과 인터페이스 주석이 ERC-1155 바인딩 가능 인터페이스 ID에 대해 서로 다릅니다. 의존하기 전에 레퍼런스 구현으로 확인하세요.
- "NFT가 무언가를 소유한다"는 같은 아이디어에 대한 다른 접근은 각 NFT에 자체 스마트 계정을 주는 [ERC-6551](/eip-6551/)입니다. [ERC-998](/eip-998/)은 더 오래된 컴포저블 NFT 초안입니다.


---

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