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

Update EIP-5489: Move to review #5736

Merged
merged 11 commits into from
Nov 13, 2022
50 changes: 38 additions & 12 deletions EIPS/eip-5489.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
eip: 5489
title: NFT Hyperlink Extension
description: NFT Hyperlink Extension tries to make NFTs as decentralized medium for Web3.
description: NFT Hyperlink Extension embeds hyperlinks onto NFTs, allowing users to click any hNFT and be transported to any url set by the owner.
author: IronMan_CH (@coderfengyun)
discussions-to: https://ethereum-magicians.org/t/eip-5489-nft-hyperlink-extension/10431
status: Draft
status: Review
type: Standards Track
category: ERC
created: 2022-08-16
Expand All @@ -15,24 +15,21 @@ requires: 165, 721

This EIP proposes a new extension for NFTs (non-fungible token, aka [EIP-721](./eip-721.md)): nft-hyperlink-extention (hNFT), embedding NFTs with hyperlinks, referred to as “hNFTs”. As owners of hNFTs, users may authorize a URL slot to a specific address which can be either an externally-owned account (EOA) or a contract address and hNFT owners are entitled to revoke that authorization at any time. The address which has slot authorization can manage the URL of that slot.

Industries like advertisement can put advertisement materials on these hyperlink slots.

## Motivation
As NFTs attract more and more user attention, NFTs have the potential to evolve towards becoming the decentralized medium for Web3. But there are some missing core components, such as how to attach, edit and exhibit highly customized information on this medium (NFT). For example, end users can’t attach extra rich texts, videos or images on NFTs, also there’s no way to exhibit these rich-content attachments on NFTs. Industries like advertisement eagerly look forward this kind of rich-content attachment ability on NFTs.

This proposal try to answer this question, it tries to use hyperlink as the main form of “highly customized attachment on NFT”, and also resolve how to attach, edit and exhibit these attachments on NFTs.
As NFTs attract more attention, they have the potential to become the primary medium of Web3. Currently, end users can’t attach rich texts, videos, or images to NFTs, and there’s no way to render these rich-content attachments. Many industries eagerly look forward to this kind of rich-content attachment ability. Attaching, editing, and displaying highly customized information can usefully be standardized.

This EIP uses hyperlinks as the aforementioned form of “highly customized attachment on NFT”, and also specifies how to attach, edit, and display these attachments on NFTs.

## Specification

The key words "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.

### New URI format

This EIP adds a new URI scheme, "hnft://". This URI scheme enables redirecting or connecting activity between hNFTs.

### Interface

#### `IERC5489`

```solidity
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;
Expand Down Expand Up @@ -89,7 +86,9 @@ interface IERC5489 {
) external;

/**
* @dev
* @dev Throws if `tokenId` is not a valid NFT. URIs are defined in RFC 3986.
* The URI MUST point to a JSON file that confirms to the "EIP5489 Metadata JSON schema".
*
* returns the latest uri of an slot on a token, which is indicated by `tokenId`, `slotManagerAddr`
*/
function getSlotUri(uint256 tokenId, address slotManagerAddr)
Expand Down Expand Up @@ -118,29 +117,56 @@ The `SlotUriUpdated` event MUSt be emitted when a slot's URI is changed.
The `supportInterface` method MUST return true when called with `0x8f65987b`.

### Authentication

The `authorizeSlotTo`, `revokeAuthorization`, and `revokeAllAuthorizations` functions are authenticated if and only if the message sender is the owner of the token.

## Rationale

### Extends NFT with hyperlinks

URIs are used to represent the value of slots to ensure enough flexibility to deal with different use cases.

### Authorize slot to address

We use addresses to represent the key of slots to ensure enough flexibility to deal with all use cases.

### New URI format to enable redirect between hNFTs
This extension adds a new URI scheme, `hnft://` so that the URI pointed to by the NFT is resolvable.
### Metadata JSON schema

```json
{
"title": "AD Metadata",
"type": "object",
"properties": {
"icon": {
"type": "string",
"description": "A URI pointing to a resource with mime type image/* representing the slot's occupier. Consider making any images at a width between 48 and 1080 pixels and aspect ration between 1.91:1 and 4:5 inclusive. Suggest to show this as an thumbnail of the target resource"
},
"description": {
"type": "string",
"description": "A paragraph which briefly introduce what is the target resource"
},
"target": {
"type": "string",
"description": "A URI pointing to target resource, sugguest to follow 30X status code to support more redirections, the mime type and content rely on user's setting"
}
}
}
```

## Backwards Compatibility

As mentioned in the specifications section, this standard can be fully EIP-721 compatible by adding an extension function set.

In addition, new functions introduced in this standard have many similarities with the existing functions in EIP-721. This allows developers to easily adopt the standard quickly.

## Reference Implementation

You can find an implementation of this standard in [`ERC5489.sol`](../assets/eip-5489/contracts/ERC5489.sol).

## Security Considerations

No security considerations were found.

## Copyright

Copyright and related rights waived via [CC0](../LICENSE.md).