ERC-7507 Multi-user NFT extension
Draft · NFTs & multi-token · created 2023-08-24
An ERC-721 extension that allows multiple users, each with their own expiration time, to be registered on a single NFT in addition to the owner. It lets several people use the same NFT like a subscription, without transferring ownership.
Why it is needed
Some NFTs represent intellectual property (IP) assets such as artwork or other content. These assets need licensing, a way to lend out usage rights without transferring ownership outright. In particular, subscription models where multiple people use the asset concurrently for a set period are common, but existing standards struggle to express this. A similar feature already exists in ERC-4907, but it only allows one user at a time, making it a standard suited to rental situations where one person has exclusive use until the next user takes over. That fits physical-like assets such as game items well, but not IP assets that can be shared among multiple people. This standard fills that gap by defining a common way to record multiple users on a single token, each with their own expiration time.
What to implement
event UpdateUser(uint256 indexed tokenId, address indexed user, uint64 expires);: An event emitted when a specific user's expiration time for a given NFT changes.function userExpires(uint256 tokenId, address user) external view returns(uint256);: Queries a specific user's expiration time for the given NFT.function setUser(uint256 tokenId, address user, uint64 expires) external;: Registers a user for the given NFT and sets an expiration time as a UNIX timestamp. The user can use the NFT until that time.
In depth
A user role distinct from owner
This standard proposes a new user role on ERC-721 tokens, separate from the existing owner role. A single token can have multiple users, each with an independent expiration time (expires). This structure allows a single NFT to be expressed as a model where multiple users subscribe to it non-exclusively. It targets NFTs representing IP assets, granting access licenses without transferring ownership.
setUser behavior and call permissions
setUser(uint256 tokenId, address user, uint64 expires) sets the expiration time for a specific user on a specific token. expires is a UNIX timestamp, and the user can use the NFT until that time. In the reference implementation, only a caller who passes the _isApprovedOrOwner check, meaning the owner or an approved address, can call this function. Otherwise it reverts with "ERC7507: caller is not owner or approved". After setting, it emits an UpdateUser(tokenId, user, expires) event. The test cases also show renewal behavior, calling it again for the same user to extend the expiration or change it to 0.
userExpires query
userExpires(uint256 tokenId, address user) is a view function that returns the expiration time for that user on that token. The reference implementation reads the value from a _expires store structured as mapping(uint256 => mapping(address => uint64)), and querying a nonexistent token reverts with "ERC7507: query for nonexistent token". According to the test cases, it returns 0 for a user that was never registered.
Relationship to ERC-4907
ERC-4907 also defines a user role on tokens, but it does not allow more than one user. It suits rental scenarios where one person has exclusive usage rights until the next user takes over, a model common for physical-like asset NFTs in games. The problem this proposal identifies is that this is not useful for shareable IP assets. This standard complements ERC-4907 by supporting multiple users, and for consistency it follows ERC-4907's naming conventions for functions and parameters.
Why usersOf was not included
The proposers did not include a user-list query function such as usersOf(uint256 tokenId) in the interface. Including such a function would require implementations to support enumerability over multiple users, which is not always necessary, for example in an open subscription that anyone can join. So whether to support list queries was left to the implementer's discretion.
Interface identification and compatibility
The reference implementation inherits OpenZeppelin's ERC721 and has supportsInterface recognize type(IERC7507).interfaceId, allowing support for this extension to be announced via the ERC-165 method. The original text states that no backwards compatibility issues were found. The Security Considerations section also states there are no additional concerns.
Proposal status
This proposal is in Draft status, created on August 24, 2023. It is not yet a finalized standard, so its content may change or progress may stall.