ERC-5635 NFT derivative work licensing oracle (NFT Licensing Agreements)
Stagnant · NFTs & multi-token · created 2022-08-10
An oracle standard that lets an original NFT (oNFT) holder register and query on-chain the license agreement and royalty terms granted to a derivative NFT (dNFT) creator.
Why it is needed
When creating a derivative work (dNFT) based on an NFT, there is no common way to prove who the original NFT (oNFT) holder granted rights to and under what terms. License agreements exist only as off-chain documents or verbal agreements, so marketplaces or buyers have no standardized way to check whether a given dNFT has proper authorization or who should be paid how much in royalties. It is also undefined how license-related rights and royalty revenue are passed on to a new owner when the oNFT is sold to someone else, so without a mechanism to filter out falsified license claims, each service ends up handling this differently.
What to implement
event Licence(address indexed _oNFT, uint256 indexed _oNFT_Id, address indexed _dNFT, uint256 indexed _dNFT_Id, uint64 _expiryTime, LicensingAgreementType _type, string _licenseName, string _licenseUri);: An event recording that a license agreement has been concluded.event Approval(address indexed _oNFT, address indexed _owner, address indexed _approved, uint256 indexed _tokenId);: An event recording the delegation of licensing authority for a specific oNFT token.event ApprovalForAll(address indexed _oNFT, address indexed _owner, address indexed _operator, bool _approved);: An event recording the delegation of licensing authority for all oNFTs held by an owner.function licence(address indexed _oNFT, uint256 indexed _oNFT_Id, address indexed _dNFT, uint256 indexed _dNFT_Id, uint64 _expiryTime, LicensingAgreementType _type, string _licenseName, string _licenseUri) external payable;: Concludes a license agreement from oNFT to dNFT on behalf of the licensor.function approve(address indexed _oNFT, address _approved, uint256 _tokenId) external payable;: Delegates licensing authority for a single specific oNFT token.function setApprovalForAll(address indexed _oNFT, address _operator, bool _approved) external;: Delegates licensing authority over all oNFTs held by msg.sender.function getApproved(address indexed _oNFT, uint256 _tokenId) external view returns (address);: Looks up the approved address for a specific oNFT token.function isApprovedForAll(address indexed _oNFT, address _owner, address _operator) external view returns (bool);: Checks whether a specific operator is approved for all of an owner's oNFTs.function supportsInterface(bytes4 interfaceID) external view returns (bool);: Checks whether this contract supports a specific interface.
In depth
Three roles and two stages
This standard defines three roles. An oNFT is the original NFT that derivative works are based on, and its holder is the licensor. A dNFT is a derivative NFT created based on one or more oNFT attributes, and its holder is the licensee. The registry is a trusted contract that verifies whether the oNFT holder actually signed or issued the credential. The point at which a dNFT is minted marks the boundary: everything before is the Licensing stage, and everything after is the Discovery stage. The IERC5635Licensing interface is for the licensing stage, while IERC5635DNFT and IERC5635Registry are for the discovery stage.
IERC5635DNFT: the interface implemented by dNFTs
Every dNFT contract must implement IERC5635DNFT and IERC165. The ERC165 identifier is 0xd584841c. numberOfCredentials(_tokenId) returns the number of licensing credentials linked to that dNFT. authorizedBy(_tokenId, _credentialId) returns, for a given credential, the address and token ID of the oNFT the license originated from, as well as the address of the registry that verifies it. The maximum value of _credentialId is numberOfCredentials(_tokenId)-1.
IERC5635Registry: the license lookup interface
Every registry contract must implement IERC5635Registry and IERC165. The ERC165 identifier is 0xb5065e9f. LicensingAgreementType is an enum with three values: NonExclusive, Exclusive, and Sole. isLicensed returns a boolean indicating whether a specific dNFT (and token ID) has been licensed from a specific oNFT (and token ID). licensingInfo returns, together, whether a license exists, the licensor address, the signature timestamp (_timeOfSignature), the expiry timestamp (_expiryTime), the agreement type, the license name, and the license URI. The license name takes an identifier form, similar to SPDX's 'SPDX-License-Identifier: MIT'. royaltyRate returns the beneficiary address that receives royalties and the rate, where the rate has 9 decimal places, so the actual rate is the value divided by 1,000,000,000.
IERC5635Licensing: concluding and approving licenses
A registry may optionally implement IERC5635Licensing. The licence function takes the oNFT, oNFT token ID, dNFT, dNFT token ID, expiry time, agreement type, license name, and URI, concludes the licensing agreement, and emits a Licence event. approve delegates licensing authority for a single oNFT token to a specific address, while setApprovalForAll delegates authority over all oNFTs held by msg.sender at once. getApproved and isApprovedForAll can be used to check each approval state, and delegation is recorded via the Approval and ApprovalForAll events. An approved address can call licence on behalf of the oNFT holder.
The royalty beneficiary is the new owner of the oNFT
This standard embeds a design decision about who the royalty beneficiary should be. When someone sells their oNFT, all rights tied to that license should transfer to the new owner without restriction, so the royalty beneficiary should likewise become the new owner.
Difference from the CantBeEvil license
The CantBeEvil license is a creator-to-holder license that specifies what rights a creator grants to an NFT holder. The licensing agreement in this standard, by contrast, is an agreement concluded between a licensor and a licensee. Because the two are different in nature, the CantBeEvil license cannot be used as the licensing agreement referred to by this standard.
On-chain enforcement and compatibility
As with EIP-2981, this standard cannot enforce compliance with licensing rules on-chain; it works by encouraging NFT marketplaces to follow it. This standard is compatible with EIP-721, EIP-1155, and EIP-2981.
Proposal status: Stagnant
This ERC is in Stagnant status, meaning discussion has stalled. The Security Considerations section simply states 'Needs discussion,' indicating the security review is incomplete, and 'TODO' markers remain within the interface definitions, showing parts of the proposal are still unresolved.