ERC-6147: Guard of NFT/SBT, an Extension of ERC-721
A new management role with an expiration date of NFT/SBT is defined, achieving the separation of transfer right and holding right.
Abstract
This standard is an extension of ERC-721. It separates the holding right and transfer right of non-fungible tokens (NFTs) and Soulbound Tokens (SBTs) and defines a new role, guard
with expires
. The flexibility of the guard
setting enables the design of NFT anti-theft, NFT lending, NFT leasing, SBT, etc.
Motivation
NFTs are assets that possess both use and financial value.
Many cases of NFT theft currently exist, and current NFT anti-theft schemes, such as transferring NFTs to cold wallets, make NFTs inconvenient to be used.
In current NFT lending, the NFT owner needs to transfer the NFT to the NFT lending contract, and the NFT owner no longer has the right to use the NFT while he has obtained the loan. In the real world, for example, if a person takes out a mortgage on his own house, he still has the right to use that house.
For SBT, the current mainstream view is that an SBT is not transferable, which makes an SBT bound to an Ether address. However, when the private key of the user address is leaked or lost, retrieving SBT will become a complicated task and there is no corresponding standard. The SBTs essentially realizes the separation of NFT holding right and transfer right. When the wallet where SBT is located is stolen or unavailable, SBT should be able to be recoverable.
In addition, SBTs still need to be managed in use. For example, if a university issues diploma-based SBTs to its graduates, and if the university later finds that a graduate has committed academic misconduct or jeopardized the reputation of the university, it should have the ability to retrieve the diploma-based SBTs.
Specification
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY" and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
ERC-721 compliant contracts MAY implement this EIP.
A guard Must be valid only before expires.
When a token has no guard or the guard is expired, guardInfo
MUST return (address(0), 0)
.
When a token has no guard or the guard is expired, owner, authorised operators and approved address of the token MUST have permission to set guard and expires.
When a token has a valid guard, owner, authorised operators and approved address of the token MUST NOT be able to change guard and expires, and they MUST NOT be able to transfer the token.
When a token has a valid guard, guardInfo
MUST return the address and expires of the guard.
When a token has a valid guard, the guard MUST be able to remove guard and expires, change guard and expires, and transfer the token.
When a token has a valid guard, if the token burns, the guard MUST be deleted.
If issuing or minting SBTs, the guard MAY be uniformly set to the designated address to facilitate management.
Contract Interface
The changeGuard(uint256 tokenId, address newGuard, uint64 expires)
function MAY be implemented as public
or external
.
The removeGuard(uint256 tokenId)
function MAY be implemented as public
or external
.
The transferAndRemove(address from,address to,uint256 tokenId)
function MAY be implemented as public
or external
.
The guardInfo(uint256 tokenId)
function MAY be implemented as pure
or view
.
The UpdateGuardLog
event MUST be emitted when a guard is changed.
The supportsInterface
method MUST return true
when called with 0xb61d1057
.
Rationale
Universality
There are many application scenarios for NFT/SBT, and there is no need to propose a dedicated EIP for each one, which would make the overall number of EIPS inevitably increase and add to the burden of developers. The standard is based on the analysis of the right attached to assets in the real world, and abstracts the right attached to NFT/SBT into holding right and transfer right making the standard more universal.
For example, the standard has more than the following use cases:
SBTs. The SBTs issuer can assign a uniform role of guard
to the SBTs before they are minted, so that the SBTs cannot be transferred by the corresponding holders and can be managed by the SBTs issuer through the guard
.
NFT anti-theft. If an NFT holder sets a guard
address of an NFT as his or her own cold wallet address, the NFT can still be used by the NFT holder, but the risk of theft is greatly reduced.
NFT lending. The borrower sets the guard
of his or her own NFT as the lender's address, the borrower still has the right to use the NFT while obtaining the loan, but at the same time cannot transfer or sell the NFT. If the borrower defaults on the loan, the lender can transfer and sell the NFT.
Additionally, by setting an expires
for the guard
, the scalability of the protocol is further enhanced, as demonstrated in the following examples:
More flexible NFT issuance. During NFT minting, discounts can be offered for NFTs that are locked for a certain period of time, without affecting the NFTs' usability.
More secure NFT management. Even if the guard
address becomes inaccessible due to lost private keys, the owner
can still retrieve the NFT after the guard
has expired.
Valid SBTs. Some SBTs have a period of use. More effective management can be achieved through guard
and expires
.
Extensibility
This standard only defines a guard
and its expires
. For complex functions needed by NFTs and SBTs, such as social recovery and multi-signature, the guard
can be set as a third-party protocol address. Through the third-party protocol, more flexible and diverse functions can be achieved based on specific application scenarios.
Naming
The alternative names are guardian
and guard
, both of which basically match the permissions corresponding to the role: protection of NFT or necessary management according to its application scenarios. The guard
has fewer characters than the guardian
and is more concise.
Backwards Compatibility
This standard can be fully ERC-721 compatible by adding an extension function set.
If an NFT issued based on the above standard does not set a guard
, then it is no different in the existing functions from the current NFT issued based on the ERC-721 standard.
Reference Implementation
Security Considerations
Make sure to set an appropriate expires
for the guard
, based on the specific application scenario.
When an NFT has a valid guard, even if an address is authorized as an operator through approve
or setApprovalForAll
, the operator still has no right to transfer the NFT.
When an NFT has a valid guard, the owner
cannot sell the NFT. Some trading platforms list NFTs through setApprovalForAll
and owners' signature. It is recommended to prevent listing these NFTs by checking guardInfo
.
Copyright
Copyright and related rights waived via CC0.