EIPs Explained

ERC-5585 · Final · ERC · 2022-08-15

ERC-5585: ERC-721 NFT Authorization

An ERC-721 extension that lets an NFT owner license named usage rights (display, distribution, commercial use…) to other addresses for a set time, without giving up ownership.

What problem does it solve?

A plain ERC-721 token has one owner and nothing else. Yet the value of many NFTs (art, music, virtual land, characters) comes from what others are allowed to do with them: show them in a gallery, print them on merchandise, build derivative works, rent them out. Without a standard, these licences live in off-chain contracts that wallets and marketplaces cannot see.

ERC-5585 separates commercial usage rights from ownership. The owner keeps the token, but can grant one or more users a specific list of rights for a limited period, and anyone can check on-chain who holds which rights until when.

How it works

  • The project defines its catalogue of rights as strings, returned by getRights() (for example "display", "distribution", "commercial").
  • The NFT holder calls authorizeUser(tokenId, user, duration) to grant all rights, or authorizeUser(tokenId, user, rights, duration) to grant a subset. Granting rights not in the catalogue must fail.
  • Each grant is stored as a UserRecord { user, rights[], expires }. Several users can hold rights to the same token at once.
  • The holder can later extendDuration or updateUserRights; an authorized user can pass their rights on with transferUserRights.
  • getExpires and getUserRights let anyone verify a licence; checkAuthorizationAvailability tells you whether a token can take another user.
  • The contract owner sets two policy knobs: updateUserLimit (max users per NFT) and updateResetAllowed. If reset is allowed, the NFT holder may call resetUser to revoke a licence early; if not, licences hold until they expire.
  • An authorizeUser event fires whenever a user or expiry changes, so indexers can track licences.

Sample code

Granting a one-year display licence and checking it (ethers v6):

import { Contract, Wallet, JsonRpcProvider } from "ethers";

const abi = [
  "function getRights() view returns (string[])",
  "function authorizeUser(uint256 tokenId, address user, string[] rights, uint256 duration)",
  "function getUserRights(uint256 tokenId, address user) view returns (string[])",
  "function getExpires(uint256 tokenId, address user) view returns (uint256)",
];

const provider = new JsonRpcProvider(process.env.RPC_URL);
const owner = new Wallet(process.env.PRIVATE_KEY!, provider);
const nft = new Contract(process.env.NFT_ADDRESS!, abi, owner);

console.log(await nft.getRights()); // e.g. ["display", "distribution", "commercial"]

const ONE_YEAR = 365 * 24 * 60 * 60;
await (await nft.authorizeUser(42n, galleryAddress, ["display"], ONE_YEAR)).wait();

console.log(await nft.getUserRights(42n, galleryAddress)); // ["display"]
console.log(await nft.getExpires(42n, galleryAddress));    // unix timestamp

Things to know

  • Status: Final.
  • Rights are free-form strings defined per project. The standard records who holds which label; what "display" or "commercial" legally means is up to the project's off-chain terms.
  • Compared with ERC-4907 (one "user" with an expiry, aimed at rentals), ERC-5585 supports multiple users per token and a named list of rights per user.
  • When resetAllowed is false, the holder cannot revoke a licence, even after selling the NFT. The spec suggests escrowing licence fees and refunding pro rata if the token changes hands mid-term.
  • The interface in the spec reuses the names authorizeUser and updateUserLimit for both functions and events, which Solidity does not allow as written; implementations have to rename one side.

#nft #licensing #rights #erc721 #extension

Details

Authors
Veega Labs (@VeegaLabsOfficial), Sean NG (@ngveega), Tiger (@tiger0x), Fred (@apan826), Fov Cao (@fovcao)
Status
Final
Type
Standards Track / ERC
Created
2022-08-15
Requires

Machine-readable: Markdown · JSON