ERC-5489: NFT Hyperlink Extension
NFT Hyperlink Extension embeds hyperlinks onto NFTs, allowing users to click any hNFT and be transported to any url set by the owner.
Abstract
This EIP proposes a new extension for NFTs (non-fungible token, aka EIP-721): 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.
Motivation
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.
Interface
IERC5489
The authorizeSlotTo(uint256 tokenId, address slotManagerAddr)
function MAY be implemented as public or external.
The revokeAuthorization(uint256 tokenId, address slotManagerAddr)
function MAY be implemented as public or external.
The revokeAllAuthorizations(uint256 tokenId)
function MAY be implemented as public or external.
The setSlotUri(uint256 tokenId, string calldata newUri)
function MAY be implemented as public or external.
The getSlotUri(uint256 tokenId, address slotManagerAddr)
function MAY be implemented as pure or view.
The SlotAuthorizationCreated
event MUST be emitted when a slot is authorized to an address.
The SlotAuthorizationRevoked
event MUST be emitted when a slot authorization is revoked.
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.
Metadata JSON schema
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.
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
.
Security Considerations
No security considerations were found.
Copyright
Copyright and related rights waived via CC0.