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-7578 proposes a mechanism for associating information about physical assets with the tokens they back.

This article translates, summarizes, and expands on the proposal linked below.

I've also covered other EIPs.

Overview

The standard extends ERC-721 so holders of NFTs backed by physical assets can obtain information for verifying the authenticity of the assets and redeeming their tokens for those assets. To improve transparency, it associates the following information with an NFT:

  • Information about relevant parties, such as the owner and custodian of the physical asset.
  • Information about the legal relationship between the NFT holder and the owner of the physical asset.
  • Asset details, including the serial number, manufacturer, and verification certificates.

This includes legal information about the conditions for exchanging an NFT for the physical asset and the rights and obligations of the owner.

For more about ERC-721, see the article below.

https://chaldene.net/erc721

Motivation

NFTs have traditionally represented ownership of digital assets. However, the tokenization of real-world assets (RWAs) is expected to grow, with the use of NFTs for physical assets projected to expand rapidly. When physical assets are tokenized, missing asset information or a lack of transparency about owners and custodians can create uncertainty for NFT holders and prospective users. The proposal includes the following information in minted tokens to make it easier to verify and redeem the underlying assets.

  1. [Token issuer] Identifying information for the individual or legal entity issuing the NFT: [name], [unique identifier], [network identifier]

    • The token issuer connects the physical asset with its digital representation.
    • NFT holders can use this information to conduct due diligence on the issuer's credibility.
    • It also clarifies the issuer's responsibilities and could help standardize and improve the NFT minting process.
  2. [Legal owner of the physical asset] Identifying information for the legal owner: [name], [unique identifier], [network ID]

    • The NFT issuer may not be the legal owner of the physical asset, so NFT holders need to be able to identify the legal owner.
    • This allows holders to assess legal counterparty risk.
  3. [Storage location] Identifying information for the physical asset's storage location: [physical address or jurisdiction]

    • Certain physical assets require specific storage conditions.
    • Disclosing the storage location allows NFT holders to assess custody risks.
  4. [Legal agreement] Type of legal relationship: [IPFS link to the relevant document]

    • Provides a link to a legal document defining the relationship between the NFT holder and the legal owner of the physical asset.
    • This allows NFT holders to assess legal risks and enforceability.
  5. [Governing law] Applicable law and jurisdiction: [jurisdiction]

    • Specifies the governing law and jurisdiction as part of the legal agreement.
    • This allows holders to assess jurisdictional risk immediately.
  6. [Declared value] Value of the underlying asset: [value]

    • Defines the value of the NFT and its underlying physical asset.
    • This is useful for ancillary services such as insurance.
    • The declared value does not necessarily reflect market value.

The expected benefits include:

  • Greater trust
    • Transparency about the parties involved and assurance of the physical asset's authenticity can strengthen trust in the NFT market as a whole.
  • Traceability
    • A clear history of the asset and changes in ownership makes the asset easier to track.
  • Stronger legal protection
    • Clarifying the legal relationship between NFT holders and physical asset owners improves transaction security.

Specification

Interface

js
pragma solidity ^0.8.21;

/**
 * @notice Struct encapsulating fields required to by the ERC-7578 standard to represent the physical asset
 * @param tokenIssuer The network or entity minting the token
 * @param assetHolder The legal owner of the physical asset
 * @param storedLocation The physical storage location
 * @param terms Link to IPFS contract, agreement or terms
 * @param jurisdiction The legal justification set out in the terms
 * @param declaredValue The declared value at time of token minting
 */
struct Properties {
    string tokenIssuer;
    string assetHolder;
    string storedLocation;
    string terms;
    string jurisdiction;
    Amount declaredValue;
}

/**
 * @notice Struct encapsulating fields describing the declared value of the physical asset
 * @param currency The currency of the amount
 * @param value The value of the amount
 */
struct Amount {
    string currency;
    uint256 value;
}

/**
 * @notice Required interface of an ERC-7578 compliant contract
 */
interface IERC7578 {
    /**
     * @notice Emitted when the properties of the `tokenId` token are set
     *
     * @param tokenId The ID of the token
     * @param properties The properties of the token
     */
    event PropertiesSet(uint256 indexed tokenId, Properties properties);

    /**
     * @notice Emitted when the properties of the `tokenId` token are removed
     *
     * @param tokenId The ID of the token
     */
    event PropertiesRemoved(uint256 indexed tokenId);

    /**
     * @notice Retrieves all the properties of the `tokenId` token
     * @dev Does NOT revert if token doesn't exist
     * @param tokenId The token ID of the minted token
     */
    function getProperties(uint256 tokenId) external view returns (Properties memory properties);

    /**
     * @notice Sets the properties of the `tokenId` token
     *
     * IMPORTANT: Properties required to be set when minting a token
     *
     * @param tokenId The ID of the token
     * @param properties The properties of the token
     */
    function setProperties(uint256 tokenId, Properties calldata properties) external;
}

Properties

js
struct Properties {
    string tokenIssuer;
    string assetHolder;
    string storedLocation;
    string terms;
    string jurisdiction;
    Amount declaredValue;
}

A struct representing a physical asset.

  • tokenIssuer
    • The network or entity issuing the token.
  • assetHolder
    • The legal owner of the physical asset.
  • storedLocation
    • The storage location of the physical asset.
  • terms
    • An IPFS link, agreement, or terms of use.
  • jurisdiction
    • The legal jurisdiction specified in the terms.
  • declaredValue
    • The declared value at the time the token was issued.
    • Uses the Amount struct.

Amount

js
struct Amount {
    string currency;
    uint256 value;
}

A struct representing the value of the physical asset.

  • currency
    • The currency in which the amount is denominated.
  • value
    • The numerical value of the amount.

PropertiesSet

js
event PropertiesSet(uint256 indexed tokenId, Properties properties);

An event emitted when the token's properties are set.

  • tokenId
    • The token ID.
  • properties
    • The token's properties.

PropertiesRemoved

js
event PropertiesRemoved(uint256 indexed tokenId);

An event emitted when the token's properties are removed.

  • tokenId

    • The token ID.

    This event is emitted when the token's properties are removed.

getProperties

js
function getProperties(uint256 tokenId) external view returns (Properties memory properties);

Retrieves the properties of the token identified by tokenId. Returns the corresponding properties information.

  • tokenId
    • The ID of the minted token.
  • Return value
    • The token's properties.

setProperties

js
function setProperties(uint256 tokenId, Properties calldata properties) external;

Sets the properties of the token identified by tokenId.

  • tokenId
    • The token ID.
  • properties
    • The token's properties.

Additional requirements

  • Properties must be set before the token is minted.
  • tokenId must be greater than 0.
  • The terms parameter must link to a document stored on IPFS.
  • Minting fails (revert) if the token's properties have not been set.
  • If a token has valid properties, its properties must be removed when the token is burned (burn).

Additional notes

  • Because tokenId must be greater than 0, the properties can be checked before minting.
  • The _update function is overridden to check that properties are set before minting and removed after burning (burn).
  • The terms parameter is an HTTP link to a document stored on IPFS.
    • This is intended to ensure that the document is immutable and that NFT holders can verify it.
  • The proposal treats the accuracy of the declared data as the responsibility of the token issuer, so the properties are not validated at the contract level.
    • This establishes a basis for trust in the token issuer and the token itself.

Compatibility

This standard is compatible with ERC-721.

Implementation

js
pragma solidity ^0.8.21;

import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import { IERC7578, Properties, Amount } from "./interfaces/IERC7578.sol";

/**
 * @title ERC7578
 * @author DESAT
 * @notice Implementation of the ERC-7578: Physical Asset Redemption standard
 **/
contract ERC7578 is ERC721, IERC7578 {
    /**
     * @notice Thrown when the properties of a token are not initialized
     */
    error PropertiesUninitialized();

    /**
     * @notice Retrieves the properties of the `tokenId` token
     */
    mapping(uint256 tokenId => Properties) private _properties;

    /**
     * @notice Initializes the [ERC-721](/EIPS/eip-721) dependency contract by setting a `name` and a `symbol` to the token collection
     */
    constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {}

    /**
     * @inheritdoc IERC7578
     */
    function setProperties(uint256 tokenId, Properties calldata properties) public {
        _properties[tokenId] = Properties({
            tokenIssuer: properties.tokenIssuer,
            assetHolder: properties.assetHolder,
            storedLocation: properties.storedLocation,
            terms: properties.terms,
            jurisdiction: properties.jurisdiction,
            declaredValue: Amount({
                currency: properties.declaredValue.currency,
                value: properties.declaredValue.value
            })
        });

        emit PropertiesSet(tokenId, _properties[tokenId]);
    }

    /**
     * @inheritdoc IERC7578
     */
    function getProperties(uint256 tokenId) public view override returns (Properties memory properties) {
        properties = _properties[tokenId];
    }

    /**
     * @notice Removes the properties of the `tokenId` token
     * @param tokenId The ID of the token from which to remove the properties
     */
    function _removeProperties(uint256 tokenId) internal {
        delete _properties[tokenId];
        emit PropertiesRemoved(tokenId);
    }

    /**
     * @notice Override of the {_update} function to remove the properties of the `tokenId` token or
     * to check if they are set before minting
     * @param tokenId The ID of the token being minted or burned
     */
    function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {
        address from = _ownerOf(tokenId);
        if (to == address(0)) {
            _removeProperties(tokenId);
        } else if (from == address(0)) {
            if (bytes(_properties[tokenId].tokenIssuer).length == 0) revert PropertiesUninitialized();
        }

        return super._update(to, tokenId, auth);
    }
}

Security

To ensure the authenticity of a token's properties, the setProperties method should be callable only by a trusted externally owned account (EOA) or contract. The trusted entity must verify that the properties accurately reflect the physical asset associated with the token.

Citation

Lee Vidor (@V1d0r) vidor@emergentx.org, David Tan david@emergentx.org, Lee Smith lee@emergentx.org, Gabriel Stoica (@gabrielstoica) gabriel@emergentx.org, "ERC-7578: Physical Asset Redemption [DRAFT]," Ethereum Improvement Proposals, no. 7578, August 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7578.

Conclusion

This article covered ERC-7578, a proposal for linking information about physical assets to the tokens they back. I hope you found it useful.

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

Twitter @cardene777

I also publish on the following platforms.

https://chaldene.net/