主页EIPs
EIPsERC-5409
ERC-5409

EIP-1155 Non-Fungible Token extension

Allow EIP-1155 to represent Non-Fungible Tokens (tokens who have a unique owner)
StagnantStandards Track: ERC
创建时间: 2022-07-23
关联 EIP: EIP-165, EIP-721, EIP-1155
Ronan Sandford (@wighawag)
社区讨论原文链接编辑
1 分钟了解

相关视频
欢迎补充好内容
去提交
正文

Abstract

This standard is an extension of EIP-1155. It proposes an additional function, ownerOf, which allows EIP-1155 tokens to support Non-Fungibility (unique owners). By implementing this extra function, EIP-1155 tokens can benefit from EIP-721's core functionality without implementing the (less efficient) EIP-721 specification in the same contract.

Motivation

Currently, EIP-1155 does not allow an external caller to detect whether a token is truly unique (can have only one owner) or fungible. This is because EIP-1155 do not expose a mechanism to detect whether a token will have its supply remain to be "1". Furthermore, it does not let an external caller retrieve the owner directly on-chain.

The EIP-1155 specification does mention the use of split id to represent non-fungible tokens, but this requires a pre-established convention that is not part of the standard, and is not as simple as EIP-721's ownerOf.

The ability to get the owner of a token enables novel use-cases, including the ability for the owner to associate data with it.

Specification

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY" and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Contract Interface

interface IERC1155OwnerOf { /// @notice Find the owner of an NFT /// @dev The zero address indicates that there is no owner: either the token does not exist or it is not an NFT (supply potentially bigger than 1) /// @param tokenId The identifier for an NFT /// @return The address of the owner of the NFT function ownerOf(uint256 tokenId) external view returns (address); }

The ownerOf(uint256 tokenId) function MAY be implemented as pure or view.

The supportsInterface method MUST return true when called with 0x6352211e.

Rationale

ownerOf does not throw when a token does not exist (or does not have an owner). This simplifies the handling of such a case. Since it would be a security risk to assume all EIP-721 implementation would throw, it should not break compatibility with contract handling EIP-721 when dealing with this EIP-1155 extension.

Backwards Compatibility

This EIP is fully backward compatible with EIP-1155.

Security Considerations

Needs discussion.

Copyright and related rights waived via CC0.

扩展阅读
欢迎补充好内容
去提交
相关项目
欢迎补充好内容
去提交

不想错过最新的 EIP 动态?

订阅 EIPs Fun 周刊以跟进相关更新,建⽴你与 EIP 之间的连接 ,更好地建设以太坊。

详情
聚集 EIP 贡献者, 扩展以太坊
资源
GitHub
支持社区