Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article examines ERC5218, a proposal for managing NFT-associated licenses on-chain.
This article translates, summarizes, and expands on the specification below.
I also cover other EIPs:
Overview
ERC5218 proposes an API for managing licenses associated with NFTs. It provides a mechanism for creating, transferring, and revoking copyright licenses attached to NFTs on-chain. The standard does not define the legal terms of a license itself; it provides an interface for recording and retrieving that information.
Motivation
ERC721 manages ownership of NFTs. However, associating an NFT with an off-chain copyrighted work, such as an image or a piece of music, requires a legally meaningful connection. Many NFT projects currently express their licenses in off-chain documents rather than recording this information in the NFTs themselves.
This leaves questions unanswered, such as whether the holder of an NFT may use the associated image commercially. Existing standards, such as ERC721 for ownership and ERC4907 for rentals, do not address this kind of rights management.
ERC5218 addresses this problem by enabling rights, including copyright licenses, to be managed on-chain.
How licensing works
ERC5218 enables the following license-management operations:
- The NFT holder holds the root license.
- The NFT holder can issue sublicenses to other parties under that license.
- The license transfers with the NFT. When the NFT is sent to another person, the license moves with it.
- Licenses can be revoked according to conditions set by the creator.
This mechanism allows license issuance and status (active or inactive, for example) to be managed entirely on-chain.
Referencing licenses through URIs
Each license has an associated URI, which points to external information such as:
- Human-readable legal license terms, for example, a document explaining permitted uses of a copyrighted work.
- Machine-readable summary information, for example, data expressed in CC REL.
This helps users understand which rights they hold and makes it easier for NFT creators and third parties to check for unauthorized use.
Specification
Interface
An ERC5218-compliant contract must implement the IERC5218 interface. It extends ERC721 with functions and events for managing license creation, transfer, and revocation.
pragma solidity ^0.8.0;
/// @title ERC-5218: NFT Rights Management
interface IERC5218 is IERC721 {
/// @dev This emits when a new license is created by any mechanism.
event CreateLicense(uint256 _licenseId, uint256 _tokenId, uint256 _parentLicenseId, address _licenseHolder, string _uri, address _revoker);
/// @dev This emits when a license is revoked. Note that under some
/// license terms, the sublicenses may be `implicitly` revoked following the
/// revocation of some ancestral license. In that case, your smart contract
/// may only emit this event once for the ancestral license, and the revocation
/// of all its sublicenses can be implied without consuming additional gas.
event RevokeLicense(uint256 _licenseId);
/// @dev This emits when the a license is transferred to a new holder. The
/// root license of an NFT should be transferred with the NFT in an ERC721
/// `transfer` function call.
event TransferLicense(uint256 _licenseId, address _licenseHolder);
/// @notice Check if a license is active.
/// @dev A non-existing or revoked license is inactive and this function must
/// return `false` upon it. Under some license terms, a license may become
/// inactive because some ancestral license has been revoked. In that case,
/// this function should return `false`.
/// @param _licenseId The identifier for the queried license
/// @return Whether the queried license is active
function isLicenseActive(uint256 _licenseId) external view returns (bool);
/// @notice Retrieve the token identifier a license was issued upon.
/// @dev Throws unless the license is active.
/// @param _licenseId The identifier for the queried license
/// @return The token identifier the queried license was issued upon
function getLicenseTokenId(uint256 _licenseId) external view returns (uint256);
/// @notice Retrieve the parent license identifier of a license.
/// @dev Throws unless the license is active. If a license doesn't have a
/// parent license, return a special identifier not referring to any license
/// (such as 0).
/// @param _licenseId The identifier for the queried license
/// @return The parent license identifier of the queried license
function getParentLicenseId(uint256 _licenseId) external view returns (uint256);
/// @notice Retrieve the holder of a license.
/// @dev Throws unless the license is active.
/// @param _licenseId The identifier for the queried license
/// @return The holder address of the queried license
function getLicenseHolder(uint256 _licenseId) external view returns (address);
/// @notice Retrieve the URI of a license.
/// @dev Throws unless the license is active.
/// @param _licenseId The identifier for the queried license
/// @return The URI of the queried license
function getLicenseURI(uint256 _licenseId) external view returns (string memory);
/// @notice Retrieve the revoker address of a license.
/// @dev Throws unless the license is active.
/// @param _licenseId The identifier for the queried license
/// @return The revoker address of the queried license
function getLicenseRevoker(uint256 _licenseId) external view returns (address);
/// @notice Retrieve the root license identifier of an NFT.
/// @dev Throws unless the queried NFT exists. If the NFT doesn't have a root
/// license tethered to it, return a special identifier not referring to any
/// license (such as 0).
/// @param _tokenId The identifier for the queried NFT
/// @return The root license identifier of the queried NFT
function getLicenseIdByTokenId(uint256 _tokenId) external view returns (uint256);
/// @notice Create a new license.
/// @dev Throws unless the NFT `_tokenId` exists. Throws unless the parent
/// license `_parentLicenseId` is active, or `_parentLicenseId` is a special
/// identifier not referring to any license (such as 0) and the NFT
/// `_tokenId` doesn't have a root license tethered to it. Throws unless the
/// message sender is eligible to create the license, i.e., either the
/// license to be created is a root license and `msg.sender` is the NFT owner,
/// or the license to be created is a sublicense and `msg.sender` is the holder
/// of the parent license.
/// @param _tokenId The identifier for the NFT the license is issued upon
/// @param _parentLicenseId The identifier for the parent license
/// @param _licenseHolder The address of the license holder
/// @param _uri The URI of the license terms
/// @param _revoker The revoker address
/// @return The identifier of the created license
function createLicense(uint256 _tokenId, uint256 _parentLicenseId, address _licenseHolder, string memory _uri, address _revoker) external returns (uint256);
/// @notice Revoke a license.
/// @dev Throws unless the license is active and the message sender is the
/// eligible revoker. This function should be used for revoking both root
/// licenses and sublicenses. Note that if a root license is revoked, the
/// NFT should be transferred back to its creator.
/// @param _licenseId The identifier for the queried license
function revokeLicense(uint256 _licenseId) external;
/// @notice Transfer a sublicense.
/// @dev Throws unless the sublicense is active and `msg.sender` is the license
/// holder. Note that the root license of an NFT should be tethered to and
/// transferred with the NFT. Whenever an NFT is transferred by calling the
/// ERC721 `transfer` function, the holder of the root license should be
/// changed to the new NFT owner.
/// @param _licenseId The identifier for the queried license
/// @param _licenseHolder The new license holder
function transferSublicense(uint256 _licenseId, address _licenseHolder) external;
}Events
CreateLicense- Emitted when a license is created.
RevokeLicense- Emitted when a license is revoked.
TransferLicense- Emitted when the holder of a license changes.
Functions
isLicenseActive- Returns whether the specified license is currently active.
getLicenseTokenId- Retrieves the token ID of the NFT associated with the license.
getParentLicenseId- Retrieves the parent license ID.
getLicenseHolder- Returns the address of the license holder.
getLicenseURI- Returns the URI containing the license terms.
getLicenseRevoker- Returns the address authorized to revoke the license.
getLicenseIdByTokenId- Returns the ID of the root license associated with the specified NFT.
License-management functions
createLicense- Creates a new license.
- Both root licenses and sublicenses are issued through this function.
revokeLicense- Revokes the specified license.
- Returning the NFT to its creator is recommended when the root license is revoked.
transferSublicense- Transfers a sublicense.
- The root license automatically moves with the NFT's
transfer.
License structure

The original figure is retained from the source.
Licenses are organized in a tree structure.
An NFT has a root license belonging to its owner, who can issue sublicenses to others. The holder of a sublicense can, in turn, issue another license to a different party.
The resulting rights relationships expand hierarchically.
Tracing licenses through event logs
All license creation, transfer, and revocation must be traceable through event logs. For revocation, the standard allows some implementation flexibility:
- When invalidating an entire group of sublicenses, emit a single
Revokeevent for the parent license. - Emit a separate
Revokeevent for each license to make its status easier to determine.
Implementers choose between these approaches based on the license terms.
Revoker design
A license may be revoked by one of the following:
- The issuer (licensor).
- The holder (licensee).
- A smart contract that calls
revokeLicensewhen specified conditions are met.
Avoid hardcoding addresses; a flexible design that accommodates transfers is recommended.
License URIs and their format
The URI returned by getLicenseURI should point to a three-layer JSON structure such as the following:
{
"title": "License Metadata",
"type": "object",
"properties": {
"legal-code": {
"type": "string",
"description": "The legal code of the license."
},
"human-readable": {
"type": "string",
"description": "The human readable license deed."
},
"machine-readable": {
"type": "string",
"description": "The machine readable code of the license that can be recognized by software, such as CC REL."
}
}
}The format draws on the Creative Commons licensing structure and distinguishes three kinds of information:
- Legally operative documents.
- Explanations summarized for human readers.
- Machine-readable data that software can interpret.
URI storage and updates
License URIs are generally intended to be immutable. Decentralized storage such as IPFS, or IPFS-style URIs containing a hash that allows integrity verification, is therefore preferable.
If an update is unavoidable, the following approaches are available:
- Revoke the original license and create a new one.
- Add a license-update function, with strict access controls governing who may call it.
supportsInterface requirement
To indicate support for this interface, the ERC165 supportsInterface function must return true when called with 0xac7b5ca9.
For more on ERC165, see the following article.
[ERC165] Checking Whether a Contract Supports an Interface
Additional details
Design goals of ERC5218
ERC5218 aims to simplify rights management by making all licenses associated with an NFT traceable.
Why is ERC721 alone insufficient?
ERC721 records ownership of an NFT but does not record legal usage rights (licenses). Optional metadata can carry license information, but it does not provide a way to trace sublicensing relationships, limiting the transparency expected in Web3.
Some projects instead issue an NFT representing a particular license, such as the royalty-free license for BAYC #6068. This approach can obscure relationships between licenses, forcing an auditor to inspect every relevant NFT and its nonstandard metadata.
How does ERC5218 address this?
ERC5218 records all licenses as a tree of parent-child relationships. This offers several benefits:
- Clear relationships between root licenses and sublicenses.
- Consistent tracing of license creation, transfer, and revocation through event logs.
- Improved license management while maintaining ERC721 compatibility.
Licensing is distinct from transferring copyright
ERC5218 is intended to attach copyright usage permissions (licenses) to NFTs. It does not itself constitute a legally formal assignment of copyright, and its interface does not require an explicit signature from the copyright owner.
If the intent is to transfer the copyright itself along with the NFT, the proposal envisages combining it with ERC5289.
For more on ERC5289, see the following article.
[ERC5289] Giving Smart Contracts Legal Binding Force
ERC5289 provides a mechanism for handling signatures on legal agreements on-chain. A contract can execute the following operations atomically, so that both succeed or both fail:
- Record a signature on the legal agreement using ERC5289.
- Transfer the NFT with its associated license using ERC5218.
This design allows the NFT and its associated legal rights to be transferred together.
Compatibility
ERC5218 is compatible with ERC721.
Reference implementation
License struct
struct License {
bool active; // このライセンスが有効かどうか
uint256 tokenId; // 紐づくNFTのトークンID
uint256 parentLicenseId; // 親ライセンスのID(サブライセンスの場合)
address licenseHolder; // ライセンスの保有者
string uri; // ライセンス内容のURI
address revoker; // 取消権限を持つアドレス
}Mappings for license management
_licenses- key: License ID
- value: License information
_licenseIds- key: NFT token ID
- value: Root license ID
These mappings associate each NFT with a tree of licenses. Starting from any license, the implementation can follow its parents back to the root.
Revoking licenses and handling sublicenses
When a license is revoked, every sublicense beneath it also becomes inactive. To reduce gas costs, the implementation uses lazy evaluation.
Only the license on which revokeLicense is explicitly called is marked active = false.
Instead, isLicenseActive() also checks that all ancestor licenses are active.
Sublicense restrictions
Licenses other than the root license, i.e., sublicenses, are subject to these restrictions:
- Only the holder of an active license can issue a new sublicense.
- Only the holder of an active license can transfer it to someone else.
- An authorized revoker can revoke only an active license.
Integration between root licenses and ERC721
The root license follows the movement of the NFT.
- When an NFT is minted, a root license is issued to its owner.
- When an NFT is transferred using
transfer, the license holder changes to the new NFT owner. - When the NFT's root license is revoked, the NFT is returned to its original creator.
- The creator can then transfer the NFT to another party with a new license.
This design keeps the license and NFT ownership aligned.
Relationship to the Token-Bound NFT License
The Token-Bound NFT License (TBNL) is particularly well suited to ERC5218 implementations. It is tailored to the ERC5218 interface and provides specific examples of how license terms can be written. It serves as a reference not only for the technical management of licenses but also for drafting their legal terms.
Security
When implementing ERC5218, carefully manage the permissions of the license holder (licenseHolder) and the authorized revoker (revoker).
Controlling license holders and revokers
Pay particular attention when:
- A license may be transferred to another party.
- Revocation authority is assigned to a contract.
In these situations, hardcoding a specific licenseHolder address in the revoker contract is dangerous.
If the old address continues to be used after a license transfer, unexpected behavior or security problems may result.
Flexible and secure design
Implement license-management logic in a way that accommodates changes.
For example, the contract can dynamically retrieve the current licenseHolder on each invocation, or use an access-control mechanism designed to accommodate changes in ownership.
References
James Grimmelmann (@grimmelm), Yan Ji (@iseriohn), Tyler Kell (@relyt29), "ERC-5218: NFT Rights Management [DRAFT]," Ethereum Improvement Proposals, no. 5218, July 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-5218.
Conclusion
ERC5218 proposes a mechanism for managing NFT-associated licenses on-chain.
If you have questions, feel free to reach out by direct message on Twitter.
I also publish on the following platforms:



