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-7634 proposes a mechanism to limit the number of transfer operations for ERC-721 NFTs.

This article translates, summarizes, and expands on the proposal below as discussed in the original June 2024 article.

I also cover other Ethereum improvement proposals.

Overview

This standard proposes extending ERC-721 with transfer limits through the introduction of TransferCount.

For more on ERC-721, see the following article.

https://chaldene.net/erc721

It provides an interface for setting and retrieving transfer limits, tracking transfer counts (the original text misspells transfer as trasnfer in two places: setting the trasnfer count and tracking it), and defining state before and after transfer operations. This gives implementers more fine-grained control over NFT ownership and transfer rights, including the ability to restrict transfers.

Motivation

Once an NFT is issued through mint, it may leave the creator's control. Some projects, however, want to retain certain controls over their NFTs.

Examples include preventing transfer while an NFT is being used in an application, or limiting how often an NFT can be purchased in an attempt to preserve scarcity.

The proposal describes the following potential benefits.

Preserving scarcity

For example, limiting the number of bids in an NFT auction may help preserve the price of high-value NFTs, particularly in a Dutch auction, as suggested in the original article.

A Dutch auction is an auction in which the price gradually decreases.

How a Dutch auction works

  • Setting the price
    • The seller sets a relatively high initial price when the auction begins.
  • Falling price
    • The price decreases gradually over time as the auction proceeds.
  • Deciding when to buy
    • Participants indicate that they want to buy once the price has fallen to a level they consider acceptable.
  • Immediate purchase
    • The auction ends when someone decides to buy.
    • The buyer purchases the item at the price at that moment.

Benefits of Dutch auctions

  • Fast sales
    • A gradually decreasing price can reduce the chance of an item remaining unsold and help sell it within a short period.
  • Price discovery
    • Participants choose the price at which they are prepared to buy, helping discover the item's actual market price.
  • Prompt decisions
    • As the price falls, buyers risk being beaten by another participant. This encourages them to decide promptly and can help identify committed buyers.

Example

Suppose a work of art is offered in a Dutch auction with a starting price of JPY 1,000,000. Once the auction begins, the price decreases by JPY 50,000 per minute. If a participant decides to buy when the price reaches JPY 700,000, the auction ends and that participant acquires the artwork at that price.

For intellectual property such as patents, value can also be managed by restricting access until a specified number of transactions has occurred, after which the work could be made freely available under CC0. In games, items such as weapons, equipment, and vehicles can have limits on trades or uses, allowing their value to decline with use until the item is eventually removed through burn.

Security and stability

The proposal suggests that restricting transfer may reduce the risk of NFT arbitrage through high-frequency trading (HFT), improve network security and stability, and discourage malicious transactions.

High-frequency trading (HFT) uses algorithms to conduct a large number of trades at high speed.

Characteristics

  • High-speed trading
    • High-performance computers and sophisticated algorithms execute trades in extremely short periods, measured in milliseconds or nanoseconds.
  • High trading volume
    • Millions to hundreds of millions of trades may be executed in a day.
  • Algorithmic decision-making
    • Algorithms make trading decisions with little human intervention.
  • Low latency
    • Techniques such as placing servers close to exchanges are used to minimize execution latency.

Benefits of high-frequency trading

  • Improved market liquidity
    • A high volume of orders can improve liquidity and increase trading activity.
  • More efficient price discovery
    • Algorithms rapidly identify small price differences and trade on them, which can help prices adjust efficiently.
  • Lower transaction costs
    • Rapid trading may narrow the bid-ask spread and reduce transaction costs.

Risks

  • Greater market volatility
    • Large numbers of orders in a short time may amplify price fluctuations.
  • Flash crashes
    • Algorithm failures or simultaneous cancellations of many orders can contribute to sudden, severe price declines.
  • Fairness concerns
    • High-frequency traders have a substantial speed advantage over ordinary investors, raising questions about market fairness.
  • Regulatory challenges
    • HFT regulation differs across countries and regions. Risks may increase in markets without adequate regulation.

Reducing economic risk

The original article argues that limiting trading frequency in NFT-based restaking could reduce economic risk and discourage bubbles. It cites platforms such as EigenLayer (Ethereum), Babylon (Bitcoin), and Picasso (Solana) as examples in its discussion of NFTs representing restaking positions. If positions are repeatedly restaked in the market, leverage may increase and a bubble may form. Transfer-count limits are suggested as a possible way to discourage Ponzi-like dynamics within staking ecosystems. These examples and proposed effects reflect the original article, not a guarantee that transfer restrictions eliminate such risks.

Key considerations

The following are several potential benefits of the proposed NFT standard.

Main points

Controlling how value is preserved

NFT creators can configure custom transfer limits in an attempt to preserve the value of digital assets. As with physical collectibles whose value is associated with scarcity, limiting the number of transfers is intended to help preserve NFT value over time.

Supporting intended use

Restricting transfer can help ensure that NFTs are used for their intended purpose. For example, imposing transfer limits on NFTs representing limited-edition digital art could discourage excessive trading and help protect their value.

Expanding use cases

These enhancements broaden potential NFT applications. For instance, limited transfer functionality for NFTs representing memberships or licenses can support new digital ownership models.

Straightforward integration

The standard extends the existing ERC-721 interface with a separate interface, IERC7634, containing the new functionality. Existing NFT projects can integrate transfer restrictions while retaining compatibility.

Specification

A contract conforming to the standard must implement the following interface.

js
pragma solidity ^0.8.4;

/// @title IERC7634 Interface for Limited Transferable NFT
/// @dev Interface for ERC7634 Limited Transferable NFT extension for ERC721
/// @author Saber Yu

interface IERC7634 {

    /**
     * @dev Emitted when transfer count is set or updated
     */
    event TransferCount(uint256 indexed tokenId, address owner, uint256 counts);

    /**
     * @dev Returns the current transfer count for a tokenId
     */
    function transferCountOf(uint256 tokenId) external view returns (uint256);

    /**
     * @dev Sets the transfer limit for a tokenId. Can only be called by the token owner or an approved address.
     * @param tokenId The ID of the token for which to set the limit
     * @param limit The maximum number of transfers allowed for the token
     */
    function setTransferLimit(uint256 tokenId, uint256 limit) external;

    /**
     * @dev Returns the transfer limit for a tokenId
     */
    function transferLimitOf(uint256 tokenId) external view returns (uint256);
}
  • setTransferLimit
    • For a specified tokenId, sets the NFT's transfer limit.
  • transferLimitOf
    • For a specified tokenId, retrieves the NFT's transfer limit.
  • transferCountOf
    • For a specified tokenId, returns the NFT's current transfer count.

Rationale

Whether tracking transfer counts is important

Tracking the number of transfer operations is optional, and the implementation depends on the requirements.

Where tracking is implemented, the contract needs transfer counting logic in an _incrementTransferCount function, the transfer limit retrieval function transferLimitOf, and the current transfer count retrieval function transferCountOf.

Other data to track

The hooks invoked before and after transfer, namely _beforeTokenTransfer and _afterTokenTransfer, can be overridden to define the NFT's state before and after transfer. These hooks perform the checks and updates required by the transfer limits and counts.

Compatibility

This standard is compatible with ERC-721.

Extensions

The burn function

Integrating the burn functionality of ERC-5679 allows an NFT that reaches a specified transfer limit to undergo burn automatically. The original article compares this to Snapchat messages disappearing after being viewed several times.

For more on ERC-5679, see the following article.

ERC-5679: Standardizing Mint and Burn for ERC-20, ERC-721, and ERC-1155

Integration with SBTs

Integration with soulbound tokens (SBTs), which provide mechanisms that prevent transfer, can make NFTs permanently non-transferable through transfer after a specified number of transactions. The original article compares this to a bidder acquiring an item after multiple rounds of bidding.

Reference implementation

js

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "./IERC7634.sol";

/// @title Limited Transferable NFT Extension for ERC721
/// @dev Implementation of the Limited Transferable NFT extension for ERC721
/// @author Saber Yu

contract ERC7634 is ERC721, IERC7634 {

    // Mapping from tokenId to the transfer count
    mapping(uint256 => uint256) private _transferCounts;

    // Mapping from tokenId to its maximum transfer limit
    mapping(uint256 => uint256) private _transferLimits;

    /**
     * @dev See {IERC7634-transferCountOf}.
     */
    function transferCountOf(uint256 tokenId) public view override returns (uint256) {
        require(_exists(tokenId), "ERC7634: Nonexistent token");
        return _transferCounts[tokenId];
    }

    /**
     * @dev See {IERC7634-setTransferLimit}.
     */
    function setTransferLimit(uint256 tokenId, uint256 limit) public override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC7634: caller is not owner nor approved");
        _transferLimits[tokenId] = limit;
    }

    /**
     * @dev See {IERC7634-transferLimitOf}.
     */
    function transferLimitOf(uint256 tokenId) public view override returns (uint256) {
        require(_exists(tokenId), "ERC7634: Nonexistent token");
        return _transferLimits[tokenId];
    }

    /**
     * @dev Internal function to increment transfer count.
     */
    function _incrementTransferCount(uint256 tokenId) internal {
        _transferCounts[tokenId] += 1;
        emit TransferCount(tokenId, ownerOf(tokenId), _transferCounts[tokenId]);
    }

    /**
     * @dev Override {_beforeTokenTransfer} to enforce transfer limit.
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal override {
        require(_transferCounts[tokenId] < _transferLimits[tokenId], "ERC7634: Transfer limit reached");
        super._beforeTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Override {_afterTokenTransfer} to handle post-transfer logic.
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId,
        uint256 quantity
    ) internal virtual override {
        _incrementTransferCount(tokenId);

        if (_transferCounts[tokenId] == _transferLimits[tokenId]) {
            // Optional post-transfer operations once the limit is reached
            // Uncomment the following based on the desired behavior such as the `burn` opearation
            // ---------------------------------------
            // _burn(tokenId); // Burn the token
            // ---------------------------------------
        }

        super._afterTokenTransfer(from, to, tokenId, quantity);
    }


    /**
     * @dev Override {supportsInterface} to declare support for IERC7634.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
        return interfaceId == type(IERC7634).interfaceId || super.supportsInterface(interfaceId);
    }
}

Each NFT creator should be able to configure a transfer limit. To prevent tampering or fraud, implementers should also consider making an established transfer limit immutable. When integrating with systems that perform complex operations and may exceed gas limits during execution, care should be taken to avoid resource-intensive operations.

The reference code is reproduced as written in the original article. Its hooks and limit initialization require review against the chosen ERC-721 implementation before production use.

Citation

Qin Wang (@qinwang-git), Saber Yu (@OniReimu), Shiping Chen shiping.chen@data61.csiro.au, "ERC-7634: Limited Transfer Count NFT [DRAFT]," Ethereum Improvement Proposals, no. 7634, February 2024. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7634.

Conclusion

This article covered ERC-7634, which proposes limiting the number of times an ERC-721 NFT can be transferred using transfer.

If you have questions, feel free to send me a direct message on Twitter.

Twitter @cardene777

I also publish technical content on the following platforms.

https://chaldene.net/