-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EIP-5585: EIP-721 NFT Authorization #5585
Changes from 13 commits
ee736ef
fce56eb
ce382b5
40a6f27
bfea70a
9a93e10
1e5e364
8e47a9a
e813678
4358c72
0543ec3
a6983ce
decd400
22e277d
d4768f5
07e0e52
5508587
2af15d2
c1b593b
3080ff6
b6ed341
54d914e
f404f08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,111 @@ | ||||||||||||||||||||||
--- | ||||||||||||||||||||||
eip: 5585 | ||||||||||||||||||||||
title: EIP-721 NFT Authorization | ||||||||||||||||||||||
description: NFT owners can authorize other users to use their NFTs for business purpose. | ||||||||||||||||||||||
author: Veega Labs (@VeegaLabsOfficial) | ||||||||||||||||||||||
discussions-to: https://ethereum-magicians.org/t/nft-authorization-erc721-extension/10661 | ||||||||||||||||||||||
status: Draft | ||||||||||||||||||||||
type: Standards Track | ||||||||||||||||||||||
category: ERC | ||||||||||||||||||||||
created: 2022-08-15 | ||||||||||||||||||||||
requires: 721 | ||||||||||||||||||||||
--- | ||||||||||||||||||||||
|
||||||||||||||||||||||
## Abstract | ||||||||||||||||||||||
|
||||||||||||||||||||||
1. By registering and confirming ownership and other commercial rights independently on the chain, it supports the independent circulation of commercial authorization. Thereby the users will get more benefits in addition to selling, and it will significantly motivate users in various ways. | ||||||||||||||||||||||
2. After separating the ownership of assets and other commercial rights, the information of full authorization chain will be saved by smart contracts, and the benefits of commercial users will be protected by smart contracts on the blockchain, and would not be affected by the changes of ownership. | ||||||||||||||||||||||
3. The cryptocurrency paid by the users will be hosted and locked in the smart contract, and the "authorized funds" will be dynamically unlocked to asset owners based on how long the assets being used. (this feature will be implemented in the future) | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be a paragraph, not a list. It should also describe a high-level overview of the solution described in the spec. |
||||||||||||||||||||||
|
||||||||||||||||||||||
## Motivation | ||||||||||||||||||||||
|
||||||||||||||||||||||
The development of NFT has simplified the ownership verification and transaction. However, other kinds of rights except ownership such as exhibition rights, lease rights, creation of derivatives etc. are still difficult to be circulated and used independently, which have limited the value and commercialization of digital assets. | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
|
||||||||||||||||||||||
As the development of the Metaverse, digital assets are diverse on the blockchain such as digital collections, virtual real estate, and commercial copyrights etc., the commercial rights (exhibition rights, derivative rights, commercial authorization, etc.) based on digital assets are becoming a potential business form. | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
|
||||||||||||||||||||||
After separating the ownership of assets and other commercial rights, other problems will be raised. For example, when the ownership changes, at the same time the commercial authorization is still valid, it will result the conflict interest between the new owner and the commercial authorization user. It is extremely important thing how to protect the interests of both parties. | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This should probably actually be in the security considerations section |
||||||||||||||||||||||
|
||||||||||||||||||||||
## Specification | ||||||||||||||||||||||
|
||||||||||||||||||||||
Pandapip1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||
```solidity | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not a valid solidity interface, and the indentation is off. Please fix this. |
||||||||||||||||||||||
struct UserRecord { | ||||||||||||||||||||||
address user; | ||||||||||||||||||||||
uint expires | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
// The total users of every single NFT can be authorized to set by creators | ||||||||||||||||||||||
uint256 userLimit = 5; | ||||||||||||||||||||||
|
||||||||||||||||||||||
//The starting time of staking | ||||||||||||||||||||||
mapping(uint256 => uint) timeOfStaking; | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The implementation should not be standardized. The only thing that the spec should contain for this EIP is a list of external functions, a list of events, and the struct - everything in a solidity interface, but no more. |
||||||||||||||||||||||
|
||||||||||||||||||||||
//if resetAllowed == false£¬the authorization can be revoked; otherwise, it cannot be revoked. | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure what happened here - is the euro and the logical not meant to be here? |
||||||||||||||||||||||
bool resetAllowed = false; | ||||||||||||||||||||||
|
||||||||||||||||||||||
// Mapping tokenID to user amount | ||||||||||||||||||||||
mapping(uint256 => uint256) private _userAmount; | ||||||||||||||||||||||
|
||||||||||||||||||||||
//Store the authorized users and their expire time | ||||||||||||||||||||||
mappint(uint256 => mapping (uint => UserRecord)) expires; | ||||||||||||||||||||||
|
||||||||||||||||||||||
//Store the index of users authorization | ||||||||||||||||||||||
mappint(uint256 => mapping (address => uint)) _userTokensIndex; | ||||||||||||||||||||||
|
||||||||||||||||||||||
//NFT creators can set the starting time of the staking | ||||||||||||||||||||||
function stakingTimeUpdate(address[] user, uint[] stakingTime) external; | ||||||||||||||||||||||
|
||||||||||||||||||||||
//Update userLimit and resetAllowed | ||||||||||||||||||||||
function userLimitAndresetAllowedUpdate(uint256 limit, bool allowed) external onlyOwner; | ||||||||||||||||||||||
|
||||||||||||||||||||||
/** | ||||||||||||||||||||||
* @dev Authorize the usage of the token(the owner or approver). | ||||||||||||||||||||||
* @param tokenId The token ID. | ||||||||||||||||||||||
* @param user The address that should use the token. | ||||||||||||||||||||||
* @param duration Durations in seconds for the authorization. | ||||||||||||||||||||||
*/ | ||||||||||||||||||||||
|
||||||||||||||||||||||
// NFT Owner authorize NFT to users. | ||||||||||||||||||||||
function userAuthorization(uint256 tokenId, address user, uint duration) external returns(uint) | ||||||||||||||||||||||
|
||||||||||||||||||||||
// NFT Owner extends the duration of authorization | ||||||||||||||||||||||
function durationUpdate(uint256 tokenId, address user, uint duration) external returns(uint) | ||||||||||||||||||||||
|
||||||||||||||||||||||
// Get the times of expired for one specific tokenId and user. | ||||||||||||||||||||||
function userExpiresTime(uint256 tokenId, address user) external view returns(uint) | ||||||||||||||||||||||
|
||||||||||||||||||||||
// Check if the token is available for authorization. | ||||||||||||||||||||||
function authorizationAvailabilityCheck (uint256 tokenId) public view returns(bool) | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are not descriptive enough. Describe what each parameter does and what the return value is. |
||||||||||||||||||||||
|
||||||||||||||||||||||
/** | ||||||||||||||||||||||
@dev Reset the user registration record of the tokenId, if you own the tokenId. | ||||||||||||||||||||||
*/ | ||||||||||||||||||||||
|
||||||||||||||||||||||
//Clear authorization records | ||||||||||||||||||||||
function resetUser(uint256 tokenId, address user) external; | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here - describe all the parameters. |
||||||||||||||||||||||
|
||||||||||||||||||||||
event userAuthorization(uint256 indexed tokenID, address indexed user, uint expires); | ||||||||||||||||||||||
|
||||||||||||||||||||||
event userAuthorizationUpdate(uint256 indexed id, uint expires); | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. Describe all the parameters and when this is emitted. |
||||||||||||||||||||||
``` | ||||||||||||||||||||||
|
||||||||||||||||||||||
## Rationale | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please fix the grammar issues with this section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a problem, thanks. |
||||||||||||||||||||||
|
||||||||||||||||||||||
By separating every single NFT's ownership and user rights to maximize its utilities and therefore enhance its commercial value. | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This particular line reads like motiavation. Please rephrase it or remove it. |
||||||||||||||||||||||
|
||||||||||||||||||||||
First of all, NFT Creator can set the maximum number of authorized users of each NFT, the authorization period and whether the NFT holder can cancel the authorization at any time, so as to define the NFT¡¯s fundamental authorization and protect interests of all roles according to the project. | ||||||||||||||||||||||
|
||||||||||||||||||||||
Secondly, this EIP combines staking and authorization then the NFT creator can set the number of users that the NFT owner can authorize according to the staking period of time of each NFT. For example, if a NFT owner stakes his NFT for one year, he can obtain the maximum number of authorized users specified by userLimited. If he stakes his NFT for half a year, he can only authorize 2 or 3 users, so as to avoid the hype of NFT to a certain extent and maximize every single NFT¡¯s value. | ||||||||||||||||||||||
|
||||||||||||||||||||||
In addition, this design can be seamlessly integrated with third parties. (1) It is completely based on [EIP-721](./eip-721.md) extensions, developers can easily use all interfaces based on existing code (2) other projects can directly interact with these interfaces and functions to implement their own types of transactions. For example, Lavender Bear's announcement platform can use this agreement to allow all its NFT holders to authorize their partners and also allow them to activate or terminate the authorization at any time to better manage partners. | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Fix grammar. |
||||||||||||||||||||||
|
||||||||||||||||||||||
## Backwards Compatibility | ||||||||||||||||||||||
|
||||||||||||||||||||||
This standard will be completely EIP-721 compatible by adding an extension function set. All the interfaces and functions are easy for developer to understand and adopted. | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
|
||||||||||||||||||||||
## Security Considerations | ||||||||||||||||||||||
|
||||||||||||||||||||||
There is a flag to control the rights between the owner and the user. The owner can cancel the authorization at anytime if the flag is true, and can NOT cancel the authorization when it comes to false. | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This reads like rationale to me, not like security considerations. |
||||||||||||||||||||||
|
||||||||||||||||||||||
## Copyright | ||||||||||||||||||||||
|
||||||||||||||||||||||
Copyright and related rights waived via [CC0](../LICENSE.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.