---
eip: 5409
label: ERC-5409
title: EIP-1155 Non-Fungible Token extension
status: Stagnant
type: Standards Track
category: ERC
created: 2022-07-23
requires: 165, 721, 1155
official: https://eips.ethereum.org/EIPS/eip-5409
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-5409.md
canonical: https://eips.huatuo.xyz/ko/eip-5409/
lang: ko
tldr: ERC-1155 컨트랙트에 ERC-721 스타일의 ownerOf(tokenId)를 추가해, 호출자가 진짜 대체 불가능한 토큰의 단일 소유자를 찾거나 그렇지 않으면 영 주소를 받게 한다.
tags: [nft, erc-1155, multi-token, ownership]
---

# ERC-5409: EIP-1155 Non-Fungible Token extension

> Allow EIP-1155 to represent Non-Fungible Tokens (tokens who have a unique owner)

**TL;DR:** ERC-1155 컨트랙트에 ERC-721 스타일의 ownerOf(tokenId)를 추가해, 호출자가 진짜 대체 불가능한 토큰의 단일 소유자를 찾거나 그렇지 않으면 영 주소를 받게 한다.

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

[ERC-1155](/eip-1155/)는 대체 가능 토큰과 대체 불가능 토큰을 한 컨트랙트에 담을 수 있지만, 노출하는 것은 `balanceOf(owner, id)`뿐입니다. 다른 컨트랙트가 "이 ID가 유일한지, 누가 소유하는지"를 물을 표준 방법이 없습니다. ERC-1155는 NFT를 위한 ID 분할 관례를 언급하지만, 이는 비공식적인 합의일 뿐 인터페이스의 일부가 아닙니다.

[ERC-721](/eip-721/)은 `ownerOf(tokenId)`로 그 질문에 답합니다. ERC-5409는 그 함수 하나만 ERC-1155에 가져옵니다. 그러면 컨트랙트가 (효율이 떨어지는) 전체 ERC-721을 구현하지 않아도, NFT를 지원하는 도구가 ERC-1155 NFT를 다룰 수 있습니다.

## 어떻게 동작하나요?

함수는 하나입니다.

```solidity
interface IERC1155OwnerOf {
    function ownerOf(uint256 tokenId) external view returns (address);
}
```

- `tokenId`가 NFT(소유자가 정확히 한 명인 공급량)이면 단일 소유자를 반환합니다.
- 토큰이 존재하지 않**거나** NFT가 아니면(공급량이 1을 넘을 수 있음) `address(0)`을 반환합니다. ERC-721과 달리 revert하지 않습니다.
- `view`일 수도 `pure`일 수도 있습니다.
- `supportsInterface(0x6352211e)`는 `true`를 반환해야 합니다([ERC-165](/eip-165/)). 이 ID는 `ownerOf(uint256)` 셀렉터와 같으며, ERC-721의 인터페이스 안에서 쓰이는 값과 동일합니다.

## 샘플 코드

유일한 토큰을 민팅하고 소유자를 추적하는 ERC-1155(OpenZeppelin v5):

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

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

contract Unique1155 is ERC1155 {
    mapping(uint256 => address) private _owner;
    uint256 public nextId;

    constructor() ERC1155("ipfs://example/{id}.json") {}

    function mint() external returns (uint256 id) {
        id = nextId++;
        _mint(msg.sender, id, 1, "");
    }

    function ownerOf(uint256 id) external view returns (address) {
        return _owner[id]; // zero if unknown
    }

    function _update(address from, address to, uint256[] memory ids, uint256[] memory values)
        internal override
    {
        super._update(from, to, ids, values);
        for (uint256 i; i < ids.length; ++i) if (values[i] == 1) _owner[ids[i]] = to;
    }

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

## 알아둘 점

- 상태는 **Stagnant**이며, 명세의 보안 항목은 아직 "Needs discussion"으로 되어 있습니다.
- 샘플은 모든 ID의 공급량이 정확히 1이라고 가정합니다. 컨트랙트가 대체 가능 ID를 섞어 쓴다면, `ownerOf`는 그 ID들에 대해 `address(0)`을 반환해야 합니다.
- 호출자는 `address(0)`을 오류가 아니라 "단일 소유자 없음"으로 취급해야 합니다. 알 수 없는 ID에서 revert를 기대하는 ERC-721용 코드는 조정이 필요합니다.
- 인터페이스 ID `0x6352211e`는 `ownerOf`가 존재한다는 것만 증명하며, 컨트랙트가 ERC-721을 구현한다는 뜻은 아닙니다.


---

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