ERC-6785 · Draft · ERC · 2023-03-27
ERC-6785: ERC-721 Utilities Information Extension
A draft ERC-721 extension that publishes what perks an NFT grants (its utility) via an on-chain URI with a full change history, plus a metadata schema for describing the utility.
What problem does it solve?
Many NFTs promise a "utility": event access, a call with the creator, a discount. Those promises usually live on a website or Discord post, can change silently, and are a common hook for phishing ("claim your utility here"). Buyers have no reliable on-chain record of what was promised or how the terms evolved.
ERC-6785 puts a pointer to the utility description on-chain for each token, keeps a history of every change, and extends the ERC-721 metadata JSON with a structured utilities section.
How it works
The contract interface (ERC-165 ID 0xed231d73):
| Member | Purpose |
|---|---|
setUtilityUri(tokenId, uri) |
Set or change the utility URI. Should be restricted to whoever provides the utility. Empty string means no utility. |
utilityUriOf(tokenId) |
Current utility URI |
utilityHistoryOf(tokenId) |
Every utility URI the token has had, in order |
UpdateUtility(tokenId, uri) |
Must be emitted on every change, including batch updates |
The URI is mutable on purpose: access instructions may depend on an off-chain tool that later moves. The history makes those changes auditable. The URI can point to gated content, for example only shown after the holder signs in with their wallet, and can include current status such as remaining sessions.
The token's normal metadata should follow an extended ERC-721 JSON schema with a utilities object:
| Field | Required | Meaning |
|---|---|---|
type |
yes | Kind of utility |
description |
yes | Short description |
t&c |
yes | Terms and conditions |
properties |
no | Array of key-value details |
expiry |
no | Seconds the utility stays valid after mint |
Sample code
Metadata for an NFT that grants two 30-minute video calls, valid for about six months:
{
"name": "Creator Pass #12",
"description": "Holder pass",
"image": "ipfs://<cid>/12.png",
"utilities": {
"type": "Video call",
"description": "Private video call with the creator",
"properties": [{ "sessions": 2 }, { "duration": 30 }, { "time_unit": "minutes" }],
"expiry": 15770000,
"t&c": "https://example.com/terms"
}
}
Reading the current utility and its history (ethers v6):
import { Contract } from "ethers";
const nft = new Contract(addr, [
"function utilityUriOf(uint256) view returns (string)",
"function utilityHistoryOf(uint256) view returns (string[])",
], provider);
const current = await nft.utilityUriOf(12n);
const history: string[] = await nft.utilityHistoryOf(12n);
console.log(current, `changed ${history.length} time(s)`);
Things to know
- Status is Draft: names and schema may change.
- The standard records promises; it does not enforce them. Delivering the utility remains the creator's responsibility.
- Whoever can call
setUtilityUricontrols what holders see, so restrict it tightly. - Storing an ever-growing
string[]history on-chain costs gas on each update. - The rationale text mentions a
getUtilityUrimethod, but the interface definesutilityUriOf; use the latter. - For on-chain usage rights rather than descriptions, see ERC-4907 (rental user role) and ERC-4400 (consumer role).