-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Non-Fungible Token with usage rights #4512
Changes from 15 commits
4295fa6
87dd966
9c00fd9
e12c0ef
db55c2b
1f6b3b3
54340c2
66e0d2f
0c9f061
923737e
1022425
fbb1124
c6c5888
1b2093d
6161f6f
2a344e6
fd285b2
5534381
522e7ec
23a2248
c604dc3
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,168 @@ | ||||||
--- | ||||||
eip: 4512 | ||||||
title: Non-Fungible Token with usage rights | ||||||
description: Separation of Non-Fungible Token ownership and usage rights , Truly in line with real life. | ||||||
status: Draft | ||||||
type: Standards Track | ||||||
author: KKimos (@KKimos), KKimos <[email protected]> | ||||||
category: ERC | ||||||
created: 2021-12-01 | ||||||
requires: 165, 721 | ||||||
--- | ||||||
|
||||||
## Simple Summary | ||||||
KKimos marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
Only add a user role, change the way NFT sharing. | ||||||
|
||||||
## Abstract | ||||||
|
||||||
This standard adds a new right of Non-Fungible Token that the right to use. Through this standard, you can achieve : | ||||||
|
||||||
- Separation of the right to use and ownership of Non-Fungible Token | ||||||
- Non-secured lease Non-Fungible Token | ||||||
- You can continue to use it after you mortgage the Non-Fungible Token | ||||||
- Metaverse sharing economy | ||||||
|
||||||
It is precisely because of the separation of ownership and use right that the utilization rate of assets can be greater. You must distinguish between the rights of the user and the owner. | ||||||
|
||||||
## Motivation | ||||||
|
||||||
Uber, airbnb, and WeWork promote the development of the sharing economy. In the blockchain , the ERC721-based leasing system has encountered great bottlenecks. For example, excess assets need to be mortgaged for leasing, The increase in NFT prices will lead to defaults ,You cannot continue to use it during NFT in mortgages. As a result, a new NFT standard is proposed, which is fully compatible with ERC721. Separate the right to use and own the NFT. | ||||||
KKimos marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
Different from 2615, we only added a right to use, so that we can get all the functions of 2615, and reduce many unnecessary operations in 2615. The explanation is as follows: | ||||||
KKimos marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
- The owner should not use some of the ownership rights when mortgage NFT, such as transfer, AXS-like breeding or weapon upgrade, because it is likely to change the status of the original NFT, so when the user mortgages the NFT, the ownership must be mortgaged in the contract middle. | ||||||
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. Could you clarify what you mean by this? I suspect you're discussing a case where the owner (Alice) of an NFT is mortgaging the NFT via another party (Bob). Who is the owner now? Is Alice now the I think is also laying down some guidelines for what a |
||||||
- In the case of mortgage or transaction, the owner has the right to continue to use it before returning the ransom or selling it | ||||||
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. I don't see the concept of a ransom elsewhere in the EIP. Maybe it would be beneficial if you outlined the flow of mortgaging and then paying off the mortgage of an NFT using this EIP? |
||||||
|
||||||
## Specification | ||||||
|
||||||
This standard adds the user role, and users can transfer their own usage rights. | ||||||
|
||||||
### ERC-4512 Interface | ||||||
|
||||||
```solidity | ||||||
event TransferUser(address from,address to,uint256 tokenId); | ||||||
event ApprovalUser(address indexed user, address indexed approved, uint256 indexed tokenId); | ||||||
function balanceOfUser(address user) external view returns (uint256 balance); | ||||||
function userOf(uint256 tokenId) external view returns (address user); | ||||||
function safeTransferUserFrom( | ||||||
address from, | ||||||
address to, | ||||||
uint256 tokenId | ||||||
) external; | ||||||
function safeTransferUserFrom( | ||||||
address from, | ||||||
address to, | ||||||
uint256 tokenId, | ||||||
bytes calldata data | ||||||
) external; | ||||||
function safeTransferAllFrom( | ||||||
address from, | ||||||
address to, | ||||||
uint256 tokenId | ||||||
) external; | ||||||
function safeTransferAllFrom( | ||||||
address from, | ||||||
address to, | ||||||
uint256 tokenId, | ||||||
bytes calldata data | ||||||
) external; | ||||||
function approveUser(address to, uint256 tokenId) external; | ||||||
function getApprovedUser(uint256 tokenId) external view returns (address operator); | ||||||
KKimos marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
``` | ||||||
|
||||||
### ERC-4512 Receiver | ||||||
|
||||||
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. as above, imho the interface for |
||||||
```solidity | ||||||
function onERCXReceived(address operator, address from, uint256 itemId, uint256 layer, bytes memory data) public returns(bytes4); | ||||||
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
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. Also, why is |
||||||
``` | ||||||
|
||||||
### ERC-4512 Extensions | ||||||
|
||||||
Extensions here are provided to help developers build with this standard. | ||||||
|
||||||
#### 1. ERC-4512 Emurable | ||||||
KKimos marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
```solidity | ||||||
function tokenOfUserByIndex(address owner, uint256 index) external view returns (uint256 tokenId); | ||||||
function totalSupply() external view returns (uint256); | ||||||
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); | ||||||
function tokenByIndex(uint256 index) external view returns (uint256); | ||||||
``` | ||||||
|
||||||
#### 2. ERC721 | ||||||
KKimos marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
Fully compatible with ERC721 | ||||||
KKimos marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
```solidity | ||||||
event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId); | ||||||
event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId); | ||||||
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); | ||||||
function balanceOf(address _owner) external view returns (uint256); | ||||||
function ownerOf(uint256 _tokenId) external view returns (address); | ||||||
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) external payable; | ||||||
function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable; | ||||||
function transferFrom(address _from, address _to, uint256 _tokenId) external payable; | ||||||
function approve(address _approved, uint256 _tokenId) external payable; | ||||||
function setApprovalForAll(address _operator, bool _approved) external; | ||||||
function getApproved(uint256 _tokenId) external view returns (address); | ||||||
function isApprovedForAll(address _owner, address _operator) external view returns (bool); | ||||||
|
||||||
interface ERC165 { | ||||||
function supportsInterface(bytes4 interfaceID) external view returns (bool); | ||||||
} | ||||||
``` | ||||||
|
||||||
|
||||||
|
||||||
## Rationale | ||||||
|
||||||
#### 1 . Mortgage | ||||||
|
||||||
When mortgage NFT, you only need to mortgage the right to use into the mortgage contract, leaving the right to use.The advantage of this is that you can still use your own NFT before delivery. | ||||||
|
||||||
#### 2 . Rent | ||||||
|
||||||
Lease does not require any collateral. First, you mortgage the NFT ownership into the contract, and the tenantry leases the right to use. | ||||||
|
||||||
This has the following benefits : | ||||||
|
||||||
- No need to mortgage assets | ||||||
- Don't worry about the risk of default | ||||||
Comment on lines
+235
to
+246
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. Similar to above, I'm personally not fully understanding the intended path to leverage this EIP for NFT mortgages or rentals. The This would also be a good section for discussing why the authors opted to create a more simplified EIP-2612, and any other alternatives that were considered but ultimately discarded in favour of the current EIP. |
||||||
|
||||||
## Backward compatibility | ||||||
|
||||||
This protocol is fully backward compatible with ERC721.Refer to above Specification. | ||||||
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
|
||||||
|
||||||
|
||||||
|
||||||
## Test Cases | ||||||
|
||||||
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. I don't see any tests - are there tests somewhere to run? |
||||||
When running the tests, you need to create a test network with Ganache-CLI: | ||||||
|
||||||
``` | ||||||
ganache-cli -a 15 --gasLimit=0x1fffffffffffff -e 1000000000 | ||||||
``` | ||||||
|
||||||
And then run the tests using Truffle: | ||||||
|
||||||
``` | ||||||
truffle test -e development | ||||||
``` | ||||||
|
||||||
Powered by Truffle and Openzeppelin test helper. | ||||||
|
||||||
## Reference Implementation | ||||||
|
||||||
[Github Reposotory](../assets/eip-4512). | ||||||
|
||||||
|
||||||
|
||||||
## Security Considerations | ||||||
|
||||||
When using the modified agreement, you must distinguish between the right of use and ownership. In theory, the right of use cannot change the NFT. | ||||||
|
||||||
|
||||||
|
||||||
## Copyright | ||||||
|
||||||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# ERCX | ||
Unsecured Leasing NFT Promotes the Development of Metaverse's Sharing Economy |
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.