ERC-5218 · Stagnant · ERC · 2022-07-11
ERC-5218: NFT Rights Management
Proposed ERC-721 extension that records copyright licenses on chain as a tree tied to each NFT, so the root license moves with the token and every sublicense and revocation is traceable.
What problem does it solve?
ERC-721 tracks who owns a token, not what the owner may legally do with the artwork or music behind it. NFT projects usually publish a license on a website, but the token itself does not say which license applies, and sublicenses (say, an owner letting a brand use the image) are invisible on chain. Rental standards like ERC-4907 cover simple "user" rights, but not general licensing.
EIP-5218 gives NFTs a standard on-chain record of licenses: who holds one, what terms it points to, who may revoke it, and how licenses derive from each other. It does not define legal terms; it provides the structure to record them.
How it works
Licenses form a tree per NFT:
- The root license is granted to the NFT owner and is tethered to the token. When the NFT is transferred, the root license holder changes to the new owner.
- Any active license holder can create sublicenses, which can have their own sublicenses.
- Each license stores: token ID, parent license ID, holder, a URI to the terms, and a revoker address (the licensor, the holder, or a contract that revokes when conditions are met).
Main functions of IERC5218 (which extends IERC721):
| Function | Purpose |
|---|---|
createLicense(tokenId, parentLicenseId, holder, uri, revoker) |
Root license (by NFT owner) or sublicense (by parent holder) |
revokeLicense(licenseId) |
Only the revoker; if a root license is revoked the NFT should return to its creator |
transferSublicense(licenseId, newHolder) |
Only the current holder; root licenses move with the NFT instead |
isLicenseActive, getLicenseHolder, getLicenseURI, getParentLicenseId, getLicenseIdByTokenId... |
Read the state |
Events CreateLicense, TransferLicense and RevokeLicense make the full history traceable. supportsInterface must return true for 0xac7b5ca9.
The license URI may point to JSON with three layers, borrowed from Creative Commons: legal code, a human-readable deed, and a machine-readable form.
Sample code
License metadata JSON (store it on IPFS or another content-addressed system so it cannot change silently; the text values here are placeholders):
{
"legal-code": "ipfs://<cid>/legal.txt",
"human-readable": "Holder may display the artwork and use it on merchandise up to a set revenue cap.",
"machine-readable": "ipfs://<cid>/license.rdf"
}
Granting a sublicense from the NFT owner's root license:
uint256 root = rights.getLicenseIdByTokenId(tokenId);
uint256 subId = rights.createLicense(
tokenId,
root, // parent license
brandAddress, // new license holder
"ipfs://<cid>/sublicense.json",
msg.sender // revoker: the current owner
);
Things to know
- Status: Stagnant.
- There is no function to update a license URI, so terms are meant to be permanent. To change them, revoke and create a new license.
- In the reference implementation, revoking a license implicitly revokes all its sublicenses:
isLicenseActivechecks the ancestors lazily, and only oneRevokeLicenseevent may be emitted. - Be careful with the
revoker: if it is a contract, do not hardcode the license holder's address, because licenses can move with transfers. - Whether an on-chain record creates an enforceable license depends on the license text and applicable law; get legal review. Transferring copyright ownership is out of scope; the spec suggests combining with ERC-5289 for signed legal documents.