Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EIP: ERC-721 Multi-Metadata Extension #7160

Merged
merged 16 commits into from
Jul 11, 2023

Conversation

0xGh
Copy link
Contributor

@0xGh 0xGh commented Jun 9, 2023

This EIP proposes an extension to the ERC721 standards to support multiple metadata URIs per token via a new tokenURIs method that returns the pinned metadata index and a list of metadata URIs.

Please discuss here: https://ethereum-magicians.org/t/erc721-multi-metadata-extension/14629

@0xGh 0xGh requested a review from eth-bot as a code owner June 9, 2023 14:53
@eth-bot
Copy link
Collaborator

eth-bot commented Jun 9, 2023

✅ All reviewers have approved.

@eth-bot eth-bot added the e-consensus Waiting on editor consensus label Jun 9, 2023
@github-actions github-actions bot added c-new Creates a brand new proposal s-draft This EIP is a Draft t-erc labels Jun 9, 2023
@github-actions github-actions bot added the w-ci Waiting on CI to pass label Jun 9, 2023
EIPS/erc-multimetadata.md Outdated Show resolved Hide resolved
Co-authored-by: Andrew B Coathup <[email protected]>
@eth-bot eth-bot changed the title ERC721 Multi-Metadata Extension Add EIP: ERC721 Multi-Metadata Extension Jun 10, 2023
@eth-bot eth-bot added the e-review Waiting on editor to review label Jun 10, 2023
@github-actions github-actions bot added w-ci Waiting on CI to pass and removed w-ci Waiting on CI to pass labels Jun 10, 2023
@0xGh 0xGh force-pushed the erc-multi-metadata branch 2 times, most recently from 141799a to c3b3186 Compare June 10, 2023 08:26
@eth-bot eth-bot changed the title Add EIP: ERC721 Multi-Metadata Extension Add EIP: ERC-721 Multi-Metadata Extension Jun 10, 2023
@github-actions github-actions bot removed the w-ci Waiting on CI to pass label Jun 10, 2023
@github-actions github-actions bot added the w-ci Waiting on CI to pass label Jun 23, 2023
EIPS/eip-7160.md Outdated Show resolved Hide resolved
@github-actions
Copy link

The commit 8722f0e (as a parent of 4a17802) contains errors.
Please inspect the Run Summary for details.

@github-actions github-actions bot removed the w-ci Waiting on CI to pass label Jun 25, 2023
EIPS/eip-7160.md Outdated Show resolved Hide resolved
EIPS/eip-7160.md Outdated

## Motivation

The current [ERC-721](./eip-721.md) standard allows for a single metadata URI per token. However, there are use cases where multiple metadata URIs are desirable, such as when a token represents a collection of (cycling) assets with individual metadata, historic token metadata, collaborative and multi-artist tokens, evolving tokens. This extension enables such use cases by introducing the concept of multi-metadata support.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be important to include answers to:

  • Why does this need to be more than just tokenURI and some token-specific functions to change the active URI?
  • Who would be interested in the non-pinned URIs?
  • How would this information be displayed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a paragraph right below. Let me know what you think. Also @mpeyfuss can chime in and add further reasons for why having a multi-metadata standard might be a good idea.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah there are quite a few examples we've found working with creators and collectors on why multi-metadata is interesting. Can add example use cases. One of the most mentioned reasons is that of having the option to provide versions of the token that match different aspect ratios and could be utilized for specific display purposes while keeping provenance/ownership intact.

EIPS/eip-7160.md Outdated
The `IERC721MultiMetadata` interface extends the existing `IERC721` interface and introduces additional methods and events:

```solidity
interface IERC721MultiMetadata is IERC721 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm no Solidity expert, but I've been told to avoid making interfaces depend on one another:

Suggested change
interface IERC721MultiMetadata is IERC721 {
interface IERC721MultiMetadata /* is IERC721 */ {

Copy link
Contributor Author

@0xGh 0xGh Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out as suggested by you. By the way should the interface name reflect the EIP name (IERC7160) instead of being called IERC721MultiMetadata or is it fine to give it a name?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can name it however you like!

EIPS/eip-7160.md Outdated Show resolved Hide resolved
EIPS/eip-7160.md Outdated Show resolved Hide resolved
event TokenUriPinned(uint256 indexed tokenId, uint256 indexed index, address indexed sender);
event TokenUriUnpinned(uint256 indexed tokenId, address indexed sender);

function tokenURIs(uint256 tokenId) external view returns (uint256 index, string[] memory uris);
Copy link
Contributor Author

@0xGh 0xGh Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SamWilsn initially my idea was to propose only the addition of the tokenURIs method as it would allow dapps to retrieve all the uris and the current index (whether it is pinned or not).

However in this proposal we provide a standard interface to dapps/marketplaces to implement pinning, unpinning and related events. Should they decide to adopt this EIP I assume that it would make sense for them to have a standard way to offer pinning/unpinning via UI.

Thoughts on these additional methods and events for pinning/unpinning? Should we keep or drop them?

By the way we'll try to get their (marketplaces) opinion too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xGh don't the functions on lines 34 and 35 accomplish this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes they do. Just sharing some context and thoughts based on what we discussed in private.

@0xGh
Copy link
Contributor Author

0xGh commented Jun 27, 2023

@SamWilsn thank you for taking the time to review this pr!

mpeyfuss and others added 4 commits July 7, 2023 22:39
- added natspec to the interface and reference implementation
- made use of keywords from RFC 2119
- listed out potential use cases rather than in one sentence
- general updates to wording
- removed reference that the default method of handling unpinned uris is defined as the latest uri as that is highly dependent on the application
- added interface id as is
- improved rationale section
- removed token ownership check in the reference implementation from `hasPinnedTokenUri` as that is a view function and doesn't need that check
- added imports from openzeppelin in the reference implementation
- change linearzation of parent contracts in reference implementation
- added Ownable constructor explicitly in the reference implementation
- updated security considerations as there are some to be aware of but nothing out of the ordinary
EIPS/eip-7160.md Outdated Show resolved Hide resolved
@eth-bot eth-bot enabled auto-merge (squash) July 11, 2023 15:16
Copy link
Collaborator

@eth-bot eth-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Reviewers Have Approved; Performing Automatic Merge...

@eth-bot eth-bot merged commit b53b74c into ethereum:master Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-new Creates a brand new proposal e-consensus Waiting on editor consensus e-review Waiting on editor to review s-draft This EIP is a Draft t-erc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants