EIPs Explained

ERC-3754 · Stagnant · ERC · 2021-08-21

ERC-3754: A Vanilla Non-Fungible Token Standard

A stripped-down NFT standard with no token URI or metadata, meant for tokens that represent abstract rights such as options, memberships or call permissions rather than artwork or collectibles.

What problem does it solve?

ERC-721 NFTs became known as receipts for digital or physical assets: a picture, a collectible, a game item. Most of them carry a tokenURI that points to metadata and an image.

ERC-3754 argues that an NFT can also be a pure unit of abstract ownership, a right: the right to call a certain function, an option to buy another NFT, or a prepaid subscription to an oracle's data feed. For that kind of token, the image and metadata are noise. The proposal defines a "vanilla" NFT that is just an ownable, transferable ID, so other contracts can build utilities on top of it.

How it works

The interface is the ERC-721 core with the URI parts removed:

Function Purpose
balanceOf(owner) Number of tokens an address holds
ownerOf(tokenId) Current holder of a token
approve / getApproved Per-token approval for one operator
setApprovalForAll / isApprovedForAll Blanket approval for an operator
transferFrom / safeTransferFrom Move a token (safe variants check the receiver)

It emits the same Transfer, Approval and ApprovalForAll events as ERC-721, so indexers that already track NFTs can follow these tokens too.

What makes the token meaningful is not stored in the token itself. Another contract checks ownerOf(tokenId) == msg.sender and grants access, a discount or an option exercise. Transferring the token transfers the right.

Sample code

A contract that lets only the holder of a "right" token call a function:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface IERC3754 {
    function ownerOf(uint256 tokenId) external view returns (address);
    function balanceOf(address owner) external view returns (uint256);
}

contract OracleFeed {
    IERC3754 public immutable accessPass;
    uint256 private latestPrice;

    constructor(IERC3754 pass) {
        accessPass = pass;
    }

    /// Holding any pass grants read access; no per-call fee needed.
    function read() external view returns (uint256) {
        require(accessPass.balanceOf(msg.sender) > 0, "no pass");
        return latestPrice;
    }

    /// A specific token can carry a specific right.
    function readWithPass(uint256 passId) external view returns (uint256) {
        require(accessPass.ownerOf(passId) == msg.sender, "not your pass");
        return latestPrice;
    }
}

Things to know

  • Status is Stagnant: the proposal has not progressed and is not widely implemented as a separate standard.
  • Because it drops tokenURI and the metadata interface, wallets and marketplaces built for ERC-721 may show these tokens without names or images.
  • In practice the same effect is usually achieved with a normal ERC-721 contract, optionally with empty or minimal metadata.
  • ERC-4341, by the same author, builds on this idea to transfer ordered batches of tokens as "phrases".

#nft #token #rights #standard

Details

Authors
Simon Tian (@simontianx)
Status
Stagnant
Type
Standards Track / ERC
Created
2021-08-21

Machine-readable: Markdown · JSON