Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
ERC-6147 introduces a role called a guard, with an optional application-defined validity period, to separate ownership of an NFT or soulbound token from authority to transfer it.
This article explains the following proposal. The original article was prepared with assistance from ChatGPT.
Summary
ERC-6147 extends ERC-721 by separating ownership from transfer authority. It introduces a guard address and an expiration timestamp, allowing implementations to support use cases such as theft prevention, NFT lending, leasing, and soulbound-like behavior.

SBT stands for Soulbound Token. The term generally refers to a token whose transfer is restricted or prohibited under its applicable rules.
An NFT lease is an arrangement that allows another person or organization to use an NFT for a specified period.
Leases often involve more detailed contractual terms, longer durations, and payments from the lessee to the lessor. Terms may include the duration, usage fees, permitted uses, and renewal options.
NFT lending can also involve temporary access or possession, with the asset returned according to the lending agreement. The distinction between a loan and a lease depends on the application and its contractual terms; payment is not necessarily exclusive to leases.

Motivation
NFTs can have both utility and financial value. Theft is a concern, and although cold-wallet custody can reduce some risks, it may make frequent use of an NFT less convenient.
A mortgage provides an analogy for separating rights over an asset. A homeowner may continue using a property while a lender holds a security interest in it. If the borrower defaults, the lender may enforce its rights according to the agreement and applicable law.
This is an analogy for separating rights, not a claim that the guard role creates a legal mortgage or equivalent security interest.
Non-transferable tokens create another challenge. If a holder loses access to the private key controlling the receiving address, recovering the token can be difficult. Separating possession from transfer authority can support recovery arrangements in which an authorized guard moves the token to a replacement address.
An issuer, such as a university issuing a digital credential, might also retain a role for recovering or revoking a credential according to its published policy. Such authority must be defined transparently rather than assumed to exist in every SBT.

The guard expiration timestamp allows applications to adapt transfer restrictions to their particular requirements. An issuer might offer a discount for NFTs with a defined lock-up period, for example. In a lending arrangement, expiration may restore ordinary transfer authority to the recorded owner.
These mechanisms separate possession and transfer authority while allowing applications to choose their own rules for security, recovery, and usability.
Specification
The following rules describe how the guard role behaves.
When a guard is active
- The owner and otherwise approved accounts cannot transfer the token or change the guard and its expiration solely by virtue of their ordinary ERC-721 permissions.
- The guardInfo function returns the active guard address and expiration timestamp.
- The active guard can change or remove the guard assignment and exercise transfer authority.
- When a token is burned, its guard information must be removed.
When no guard is active or the guard has expired
- An expired guard is no longer effective.
- If a token has no active guard, guardInfo returns (address(0), 0).
- The token owner or an appropriately approved account may assign a new guard and expiration.
Other considerations
When issuing SBTs, an application can designate a common guard address to simplify management. Whether this produces a genuinely non-transferable token depends on the implementation and the guard's authority.
Contract interface
For background on ERC-721 interfaces, see:
https://chaldene.net/erc721#st-toc-h-5
interface IERC6147 {
event UpdateGuardLog(uint256 indexed tokenId, address indexed newGuard, address oldGuard, uint64 expires);
function changeGuard(uint256 tokenId, address newGuard, uint64 expires) external;
function removeGuard(uint256 tokenId) external;
function transferAndRemove(address from, address to, uint256 tokenId) external;
function guardInfo(uint256 tokenId) external view returns (address, uint64);
}UpdateGuardLog
An event recording a change to a token's guard or expiration.
A newGuard value of the zero address indicates that the guard assignment has been removed.
changeGuard
Sets or changes a token's guard and expiration.
When no active guard exists, the token owner or an approved account can establish a guard. When a guard is active, ordinary ownership or approval does not authorize replacing it. The active guard controls changes to its assignment.
The function may be implemented with public or external visibility.
Requirements
- newGuard must not be the zero address.
- expires must represent a valid expiration.
- The operation must fail if tokenId does not identify a valid NFT.
Parameters
- tokenId: Identifier of the NFT whose guard is being configured.
- newGuard: Address of the new guard.
- expires: Unix timestamp defining how long the guard retains its authority.
removeGuard
Removes a token's guard and expiration. An active guard can remove its own assignment.
The function may be implemented with public or external visibility.
Requirements
- The guard address is reset to the zero address.
- The expiration is reset to zero.
- The operation must fail for an invalid token ID.
Parameter
- tokenId: Identifier of the NFT whose guard assignment is being removed.
transferAndRemove
Transfers an NFT and removes its guard assignment and expiration.
The function may be implemented with public or external visibility.
Requirements
- The token is transferred to the designated recipient and the guard assignment is cleared.
- The operation must fail for an invalid token ID.
Parameters
- from: Source address.
- to: Recipient address.
- tokenId: Identifier of the NFT being transferred.
guardInfo
Returns the effective guard address and its expiration for a token. The displayed interface declares a view function.
Requirement
The zero address indicates that there is no active guard.
Parameter
- tokenId: Identifier of the NFT being queried.
Return values
The effective guard address and expiration timestamp.
Interface detection
A conforming implementation must return true when supportsInterface is called with the ERC-6147 interface identifier 0xb61d1057.
Rationale
General applicability
ERC-6147 distinguishes ownership from transfer authority. This common mechanism allows developers to build several applications without requiring a separate token interface for each use case.
Soulbound tokens
An issuer may establish a guard during token issuance to control transfers. Additional restrictions are necessary if the intended behavior is permanent non-transferability.
NFT theft prevention
An NFT holder may designate a cold-wallet address as the guard while keeping the NFT in an account used for everyday applications. This can reduce the risk that compromise of the ordinary owner account alone results in an unauthorized transfer while the guard is active.
Compromise of the guard account remains a risk.
NFT lending
A lending arrangement may place an NFT in the borrower's account while assigning transfer authority to the lender as guard. The borrower can use the NFT through applications that recognize its recorded ownership, but cannot freely transfer it while the guard is active.
The lender can exercise the guard's transfer authority according to the agreement. The application must define how the asset is returned and how the loan's duration relates to guard expiration.
Expiration
An expiration timestamp provides additional flexibility.
Flexible issuance
An issuer may restrict transfers for a period after Mint, for example as a condition of discounted issuance.
Safer asset management
If access to the guard address is lost, expiration can restore ordinary owner-controlled transfer authority. This helps avoid an indefinite transfer lock if the owner still has access to its account.
SBT validity
Time-limited credentials may use expiration-related policies, although expiration of a guard does not itself invalidate a credential. Applications must implement the relevant validity checks.
Extensibility
The standard defines the guard and its expiration without prescribing a particular implementation of social recovery, multisignature authorization, or other complex policies. A guard may be a smart contract implementing those policies.
Social recovery is a mechanism for restoring account access with the help of designated trusted parties.
A typical design follows these steps.
- The account holder initiates a recovery request after losing access.
- Designated guardians authorize recovery according to the account's recovery policy, for example by submitting signatures.
- The contract verifies that the required authorization threshold has been met and updates the account's control configuration.
Guardians do not need to reveal their private keys or recovery phrases to perform this operation.
Multisignature authorization requires multiple authorized signatures before an operation can execute.
For example, a 2-of-3 multisignature wallet has three designated signers and requires authorization from at least two of them. Organizations often use this arrangement to reduce dependence on a single key for important operations.
Its security depends on signer independence, key management, and the correctness of the contract.
Naming
The proposal uses guard rather than guardian because the shorter name is more concise.
Backward compatibility
ERC-6147 extends ERC-721. When a token has no active guard, its ordinary transfer behavior follows the underlying ERC-721 implementation.
Applications that initiate transfers of guarded tokens must account for the additional authorization restrictions.
Implementation
The implementation code is available here.
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.8;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "./IERC6147.sol";
abstract contract ERC6147 is ERC721, IERC6147 {
struct GuardInfo{
address guard;
uint64 expires;
}
mapping(uint256 => GuardInfo) internal _guardInfo;
function changeGuard(uint256 tokenId, address newGuard, uint64 expires) public virtual{
require(expires > block.timestamp, "ERC6147: invalid expires");
_updateGuard(tokenId, newGuard, expires, false);
}
function removeGuard(uint256 tokenId) public virtual {
_updateGuard(tokenId, address(0), 0, true);
}
function transferAndRemove(address from, address to, uint256 tokenId) public virtual {
safeTransferFrom(from, to, tokenId);
removeGuard(tokenId);
}
function guardInfo(uint256 tokenId) public view virtual returns (address, uint64) {
if(_guardInfo[tokenId].expires >= block.timestamp){
return (_guardInfo[tokenId].guard, _guardInfo[tokenId].expires);
}
else{
return (address(0), 0);
}
}
function _updateGuard(uint256 tokenId, address newGuard, uint64 expires, bool allowNull) internal {
(address guard,) = guardInfo(tokenId);
if (!allowNull) {
require(newGuard != address(0), "ERC6147: new guard can not be null");
}
if (guard != address(0)) {
require(guard == _msgSender(), "ERC6147: only guard can change it self");
} else {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC6147: caller is not owner nor approved");
}
if (guard != address(0) || newGuard != address(0)) {
_guardInfo[tokenId] = GuardInfo(newGuard,expires);
emit UpdateGuardLog(tokenId, newGuard, guard, expires);
}
}
function _checkGuard(uint256 tokenId) internal view returns (address) {
(address guard, ) = guardInfo(tokenId);
address sender = _msgSender();
if (guard != address(0)) {
require(guard == sender, "ERC6147: sender is not guard of the token");
return guard;
}else{
return address(0);
}
}
function transferFrom(address from, address to, uint256 tokenId) public virtual override {
address guard;
address new_from = from;
if (from != address(0)) {
guard = _checkGuard(tokenId);
new_from = ownerOf(tokenId);
}
if (guard == address(0)) {
require(
_isApprovedOrOwner(_msgSender(), tokenId),
"ERC721: transfer caller is not owner nor approved"
);
}
_transfer(new_from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override {
address guard;
address new_from = from;
if (from != address(0)) {
guard = _checkGuard(tokenId);
new_from = ownerOf(tokenId);
}
if (guard == address(0)) {
require(
_isApprovedOrOwner(_msgSender(), tokenId),
"ERC721: transfer caller is not owner nor approved"
);
}
_safeTransfer(from, to, tokenId, _data);
}
function _burn(uint256 tokenId) internal virtual override {
(address guard, )=guardInfo(tokenId);
super._burn(tokenId);
delete _guardInfo[tokenId];
emit UpdateGuardLog(tokenId, address(0), guard, 0);
}
/// @dev See {IERC165-supportsInterface}.
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC6147).interfaceId || super.supportsInterface(interfaceId);
}
}GuardInfo
A struct containing a guard address and its expiration.
_guardInfo
A mapping from NFT token IDs to GuardInfo records.
changeGuard
Sets or updates the guard address and expiration.
removeGuard
Clears the guard assignment and expiration.
transferAndRemove
Transfers the NFT and clears the guard assignment.
guardInfo
Returns the effective guard address and expiration. The example retains the original timestamp comparison.
_updateGuard
Updates the guard record after checking the applicable authorization.
When removing an assignment, the guard is set to the zero address and the expiration to zero. When establishing an assignment, the new guard address and expiration are stored.
_checkGuard
Checks whether the token has an active guard and, if so, whether the caller is that guard.
Other functions
The remaining functions implement or override ERC-721 behavior.
The following article covers ERC-721 in more detail.
The historical code is reproduced unchanged. It depends on the corresponding OpenZeppelin version and should not be treated as a production-ready implementation without testing the authorization, transfer, Burn, and receiver-callback behavior.
Security considerations
The guard expiration should be selected according to the application.
While a guard is active, ordinary token approvals and setApprovalForAll do not by themselves authorize transfers. An owner may therefore be unable to complete a marketplace sale even if an existing approval and signed order appear valid.
Trading platforms should inspect guard information before presenting a guarded token as immediately transferable. The contract must still enforce the applicable authorization when a transfer is executed.
Test cases
The test code is available here.
$ cd contract
$ npm install
$ npx hardhat test test/ERC6147/ERC6147.test.tsThese are the original commands for executing the tests in the referenced development environment.
Citation
5660-eth (@5660-eth), Wizard Wang, "ERC-6147: Guard of NFT/SBT, an Extension of ERC-721," Ethereum Improvement Proposals, no. 6147, December 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-6147.
Personal observations
ERC-6147 appears useful for a range of applications. An implementation could charge NFT lending fees or allow loan extensions when specified conditions are met.
The original article discusses automatic return when a lending period ends. In practice, an expiration changes which authority is effective; it does not automatically transfer an NFT to another account. A return transaction or an additional application-specific settlement mechanism is necessary if recorded ownership must change.
There are several important design considerations for lending:
- A borrower should not be able to extend the loan or reset its restrictions without the required authorization.
- While an active guard exists, the implementation should respect the guard's authority. Loan renewal and repayment policies must be coordinated with the token's ownership and approval rules.
Because ERC-6147 defines a general interface, individual implementations can behave differently. Developers should understand the standard's requirements and explicitly define the additional rules of their applications.
Conclusion
ERC-6147 introduces an expiring guard role that separates NFT ownership from transfer authority. It provides a foundation for restricted transfers, recovery policies, and lending arrangements without requiring those applications to share one specific implementation.
If you have questions, feel free to contact me on Twitter.
Historical recruitment notice
At the time of the original article, CryptoGames was recruiting people interested in blockchain, Web3, NFTs, and smart contract development.
The original notice emphasized opportunities to take ownership of work and grow as an engineer. Check the company's current recruitment information separately.

