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.

This article examines ERC7513, which proposes smart NFTs that combine contracts and NFTs, allowing an NFT to execute specific operations while using an IA-NFT mechanism to provide security.

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

I have also covered various other EIPs.

Overview

A smart NFT combines an NFT (non-fungible token) with a smart contract. This combination enables an NFT to execute specific logic or programs and participate in a variety of interactions on the blockchain.

An NFT is a token used to uniquely identify digital assets such as digital art, music, or video. Each has a distinct value and is non-fungible, meaning that each token is recognized as an individual item rather than an interchangeable unit.

A smart contract, by contrast, is a contract or program that executes on a blockchain. When predefined conditions are met, it performs specific actions, such as making a payment or transferring rights.

Conventional NFTs have primarily been used to demonstrate ownership or identify digital items. Smart NFTs incorporate smart contract logic into these tokens, enabling more complex capabilities and interactions. Examples include managing access to digital content under specified conditions and automatically distributing royalties.

The proposal compares this change to the evolution from the conventional telephone to the smartphone. While a conventional telephone was limited to basic calling functionality, smartphones provide access to numerous functions and services through applications in addition to making calls. Similarly, smart NFTs enable a much broader range of intelligent applications than conventional NFTs.

Motivation

Ethereum introduced smart contracts, transforming blockchain technology and laying the foundation for a thriving ecosystem of decentralized applications (dApps). ERC721 subsequently introduced a standard for non-fungible tokens (NFTs), providing a new paradigm for establishing ownership.

For more information about ERC721, see the article below.

https://chaldene.net/erc721

However, smart contracts still present significant barriers for many users, while NFT applications have largely been limited to repeated experimentation in art, gaming, and real-world assets.

Widespread adoption of functional applications involving smart contracts and NFTs continues to face significant challenges. The proposal identifies the following tensions.

  • Demand for intelligent features and convenience leads users to compromise security.
    • For example, users may share their private keys with bots to obtain greater convenience at the expense of security.
  • Individual developers lack the resources needed to turn functionality into marketable products.
    • Bringing innovative ideas to life and making them widely available requires substantial resources that individual developers may not have.
  • Within the philosophy of "code is law," there is insufficient on-chain infrastructure for securely transferring ownership of smart contracts or code.
    • This philosophy treats the code executed on a blockchain as the ultimate rules. Yet the infrastructure needed to transfer rights securely in this environment remains insufficient.

Ethereum and its innovations offer considerable potential, but realizing that potential requires addressing several challenges. These include balancing convenience and security, addressing developers' resource constraints, and ensuring secure transfers of rights in an environment governed by the principle that code is law.

The proposal introduces IA-NFT (Intent Abstraction Non-Fungible Token), a new concept intended to change how conventional NFTs are used and how users interact with smart contracts on the blockchain.

Security and Convenience

An IA-NFT acts as a key to a smart contract. The IA-NFT itself has no private key, so there is no risk of leaking a private key belonging to the token. In conventional blockchain transactions, a private key is directly associated with account security, and its disclosure can lead to stolen assets. The IA-NFT design aims to remove this particular key-exposure risk while simplifying access to smart contracts.

IA-NFT as a Native On-Chain Asset

NFTs have long represented ownership of images, artworks, game items, and real-world assets. However, these underlying assets are not necessarily crypto-native. IA-NFT changes this by verifying ownership of code fragments or smart contracts. This makes it possible to directly represent ownership of blockchain assets or logic itself.

Interaction Abstraction for Intent Abstraction

On-chain interactions can be abstracted into functional IA-NFT modules, making the interaction process more efficient. Users can focus on what they want to achieve rather than how to operate across different dApps. This reduces the complexity users encounter when trying to achieve specific objectives with blockchain technology.

In the blockchain context, an intent is a specific objective or desired outcome of a user or system. Intents play an important role in blockchain technology, particularly in transactions and smart contracts.

Fundamentals of Intents

  • User intent
    • A specific action a user wants to perform on a blockchain.
    • Examples include sending a cryptocurrency to another address or executing a smart contract under specified conditions.
  • System intent
    • An action executed automatically by an application or smart contract.
    • For example, a transaction may be executed automatically when a particular trigger occurs.

The Role of Intents in Blockchain Systems

  • Transaction execution

    • Users realize their intents on-chain by submitting specific transactions, such as transfers, purchases, or contract executions.
    • Transactions encode these intents in a form that the network can execute.
  • Use of smart contracts

    • Smart contracts express intents as programmable logic.
    • This enables users to automate the execution of more complex conditions and agreements.
  • Interaction with decentralized applications (dApps)

    • A dApp combines multiple smart contracts with a user interface.
    • Users realize their intents by interacting with on-chain smart contracts through dApps.

Why Intents Matter

Clearly expressing intents is important for security, transparency, and efficiency in blockchain systems. Smart contracts and transactions designed around intents can accurately reflect users' expected outcomes and help prevent unintended actions.

An intent in a blockchain system represents the fundamental objective or desired outcome behind an action taken by a user or system. Expressing this objective clearly makes it possible to use transactions and smart contracts more securely and reliably.

IA-NFT is a new approach intended to make interactions with blockchains and smart contracts more secure, intuitive, and accessible. It gives users more direct and secure control over their assets and actions, potentially encouraging wider adoption and application of blockchain technology.

Specification

The specification defines interfaces for three principal objects: Smart-NFT, Smart-Manager, and Intent-Proxy. It also establishes how these objects interact with three principal roles: developer, verifier, and user.

Principal Objects

  • Smart-NFT

    • An NFT capable of executing smart contract logic.
    • It extends the functionality of an NFT beyond representing a digital asset, enabling actions to be executed automatically under specified conditions.
  • Smart-Manager

    • A system or program for managing Smart-NFTs and other blockchain objects.
    • It provides management functionality, including creating, updating, and removing Smart-NFTs.
  • Intent-Proxy

    • An interface for translating what users want to accomplish into on-chain actions.
    • It receives the user's desired outcome and executes the appropriate Smart-NFT actions.

Principal Roles and Interactions

  • Developer

    • Develops Smart-NFTs and Smart-Managers.
    • Defines how these objects function and what interfaces they expose.
  • Verifier

    • Verifies that Smart-NFT and Smart-Manager functionality operates correctly.
    • This may include security verification and bug detection.
  • User

    • An end user who executes particular actions through Smart-NFTs and the Intent-Proxy.
    • The user's intent is conveyed to the Smart-NFT through the Intent-Proxy, which executes the appropriate actions.

The smart NFT ecosystem comprises several interacting components and roles. Developers, verifiers, and users have distinct responsibilities, while Smart-NFT, Smart-Manager, and Intent-Proxy are designed to enable more intelligent and efficient on-chain interactions.

Smart-NFT workflow Source: https://eips.ethereum.org/EIPS/eip-7513

Smart-NFT Interface

Before creating a Smart-NFT and submitting a registration request to the Smart-Manager, developers must implement the following two functions in the Smart-NFT.

The execute Function

This function must accept only one parameter of type bytes, which encapsulates the parameters required by the particular Smart-NFT. The implementation must call validatePermission to determine whether the invocation is authorized. This ensures that permissions are checked appropriately before the Smart-NFT executes a specific action.

The validatePermission Function

This function queries the Smart-Manager to determine whether the caller is authorized to invoke the Smart-NFT. It checks whether the Smart-NFT has been successfully verified and can be invoked.

ts
interface ISmartNFT {
  function execute(bytes memory data) external payable returns (bool);

  function validatePermission() external view returns (bool);
}

This interface defines the contract governing how a Smart-NFT operates and interacts with the Smart-Manager. The execute function executes the main logic of the Smart-NFT, and validatePermission checks whether execution of that logic is authorized. These functions provide the foundation for correct and secure Smart-NFT operation.

Smart-Manager Interface

This interface manages Smart-NFTs and their states. Five states are defined for Smart-NFTs.

  • UNREGISTERED
    • A Smart-NFT that has not yet been registered with the Smart-Manager.
  • DEREGISTERED
    • A previously registered Smart-NFT that has been removed or deregistered from the Smart-Manager.
  • UNVERIFIED
    • A Smart-NFT registered with the Smart-Manager that has not yet undergone verification.
  • VERIFIED
    • A Smart-NFT registered with the Smart-Manager that has successfully completed verification.
    • This indicates that the verifier has deemed it safe to use.
  • DENIED
    • A registered Smart-NFT that has failed verification.
    • It may present security risks and should not be used.

The Smart-Manager must implement the following three core interfaces, along with a function for retrieving verification status.

register (Registration)

Developers use this interface to request registration of a Smart-NFT and supply its creation code. If the request succeeds, the Smart-NFT must be marked UNVERIFIED.

auditTo (Audit)

Only trusted verifiers should be allowed to use this interface to audit a Smart-NFT and change its status to Verified or Denied.

isAccessible (Access Check)

This interface determines whether a user can use a particular Smart-NFT. The decision must consider both ownership of an NFT with the corresponding tokenId and whether the Smart-NFT has been successfully verified.

verificationStatusOf (Verification Status)

Returns the current verification stage of the specified Smart-NFT.

These interfaces and states are important for ensuring that Smart-NFTs are securely managed and appropriately verified. They allow users and developers to determine whether the Smart-NFTs they use are considered trustworthy.

A Smart-Manager implementation must inherit ERC1155.

For more information about ERC1155, see the article below.

https://chaldene.net/erc1155

ts
interface ISmartManager {
  enum VerificationStatus {
      UNREGISTERED,
      DEREGISTERED,
      UNVERIFIED,
      VERIFIED,
      DENIED
  }

  function register(
      bytes calldata creationCode,
      uint256 totalSupply
  ) external returns (uint256 tokenId, address implAddr);

  function auditTo(uint256 tokenId, bool isValid) external returns (bool);

  function isAccessible(
      address caller,
      uint256 tokenId
  ) external view returns (bool);

  function verificationStatusOf(
      uint256 tokenId
  ) external view returns (VerificationStatus);
}

register

javascript
function register(
    bytes calldata creationCode,
    uint256 totalSupply
) external returns (uint256 tokenId, address implAddr);

Overview

Registers a Smart-NFT.

Details

This function registers a new Smart-NFT with the Smart-Manager. Upon successful registration, the Smart-NFT enters the UNVERIFIED state. The caller must provide the creation code and total supply of the Smart-NFT.

Arguments

  • creationCode
    • Bytecode used to create the Smart-NFT.
  • totalSupply
    • Total supply of the Smart-NFT.

Return values

  • tokenId
    • Token ID of the registered Smart-NFT.
  • implAddr
    • Implementation address of the Smart-NFT.

auditTo

javascript
function auditTo(uint256 tokenId, bool isValid) external returns (bool);

Overview

Updates the verification status of a Smart-NFT.

Details

Trusted verifiers use this function to change the verification status of a particular Smart-NFT to VERIFIED or DENIED. If the isValid parameter is true, the state changes to VERIFIED; if it is false, the state changes to DENIED.

Arguments

  • tokenId
    • Token ID of the Smart-NFT whose verification status is being updated.
  • isValid
    • Boolean indicating whether verification succeeded.

Return value

  • Returns true on success.

isAccessible

javascript
function isAccessible(
    address caller,
    uint256 tokenId
) external view returns (bool);

Overview

Determines whether a specific Smart-NFT can be accessed by a specified address.

Details

This function checks whether a particular user (caller) is authorized to access the specified Smart-NFT. Access is determined by whether the user owns the Smart-NFT token and whether the Smart-NFT is in the VERIFIED state.

Arguments

  • caller
    • Address whose access permission is being checked.
  • tokenId
    • Token ID of the Smart-NFT for which access is being checked.

Return value

  • Returns true if the specified address can access the Smart-NFT; otherwise, returns false.

verificationStatusOf

javascript
function verificationStatusOf(
    uint256 tokenId
) external view returns (VerificationStatus);

Overview

Returns the current verification status of the specified Smart-NFT.

Details

This function retrieves the current verification status of a specified Smart-NFT: UNREGISTERED, DEREGISTERED, UNVERIFIED, VERIFIED, or DENIED.

Arguments

  • tokenId
    • Token ID of the Smart-NFT whose verification status is requested.

Return value

The verification status of the specified Smart-NFT.

Intent-Proxy Interface

ts
interface IIntentProxy {
  struct Action {
      uint256 tokenId;
      bytes executeParam;
  }

  function executeIntent(
      Action[] calldata actions
  ) external payable returns (bool);
}

The Intent-Proxy interface defines a mechanism for executing actions against specific Smart-NFTs. It enables users to interact efficiently with multiple Smart-NFTs.

The Action Struct

The Intent-Proxy interface defines a struct called Action. It contains the following fields.

  • tokenId
    • NFT ID of the target Smart-NFT.
    • Identifies the Smart-NFT against which the action should be executed.
  • executeParam
    • Parameter passed to the target Smart-NFT's execute function.
    • Encodes the details of the action to be executed.

The executeIntent Function

javascript
function executeIntent(
    Action[] calldata actions
) external payable returns (bool);

Overview

Enables users to execute actions against multiple specified Smart-NFTs as a batch.

Details

Using executeIntent, a user can specify multiple actions in a single call and execute them as a batch. This is particularly useful when operations on specific Smart-NFTs need to be performed together. Examples include applying the same operation to multiple Smart-NFTs or executing different operations in sequence.

Arguments

  • actions
    • Array of actions to execute.
    • Each action is defined by an Action struct containing the target Smart-NFT ID and the parameters of the action to execute.

Return value

  • Returns true if the actions succeed.

This interface enables users to perform complex operations involving multiple Smart-NFTs easily and efficiently. It substantially improves the flexibility and efficiency of blockchain interactions.

Rationale

Why ERC1155 Is Used

The proposal explains why ERC1155 was chosen as the main contract standard for Smart-NFTs. From an implementation perspective, ERC1155 was selected to improve Smart-NFT reusability. Both ERC721 and ERC1155 use the concept of a token ID to identify NFTs. The important difference is that ERC1155 introduces the concept of a share. Holding at least one share grants the right to use the corresponding Smart-NFT's functionality. This resembles owning multiple smartphones of the same model: owning additional phones does not provide additional features, but each individual device provides access to those features.

Another reason to use ERC1155 directly rather than define a new NFT standard is that Smart-NFT transaction behavior can integrate with existing marketplaces. This benefits both developers and users and simplifies the adoption of Smart-NFTs in the existing ecosystem.

ERC1155 enables Smart-NFT functionality to be used efficiently and reused. By facilitating integration with existing marketplaces, it also promotes the adoption of Smart-NFTs.

Verifiers

Verifiers play an important role in the protocol by auditing and verifying Smart-NFT code. The proposal also identifies several challenges facing decentralized verifiers.

Responsibilities of Verifiers

Verifiers are responsible for evaluating the security, functionality, and compliance of smart contract code. This work requires professional programming skills, knowledge of blockchain technology, and expertise in smart contracts. Their objective is to ensure that the code is free of vulnerabilities.

Challenges Facing Decentralized Verifiers

  • Specialized expertise

    • Verification requires specialized knowledge that is not readily accessible to the general public.
  • Authority and trustworthiness

    • In a centralized model, specific auditing organizations or experts can be trusted to perform verification.
    • In a decentralized environment, assessing the expertise and integrity of verifiers is more difficult.
    • Incorrect audits may result and could undermine the stability and reliability of the entire system.
  • Coordination and management

    • In a centralized model, managing and supervising verifiers is relatively straightforward.
    • In a decentralized environment, coordinating the work of different verifiers and ensuring consistency across audits of different contracts and code presents a significant challenge.

Verifiers play an important role in this protocol but face various challenges, particularly in decentralized environments. These include access to the necessary expertise, establishing authority and trustworthiness, and improving coordination and management.

The proposal presents two main perspectives on copyright infringement involving code.

The first perspective is that discussions of copyright infringement involving extremely simple code have little practical value. For example, basic code such as a Hello World program is simple enough for anyone to create independently. The argument is that such code lacks sufficient originality or value to warrant legal protection, making infringement disputes over it a poor use of time and resources.

Complex or Creative Code Is Protected Through Open-Source Licenses

The second perspective is that sufficiently complex or creative code can obtain legal protection through open-source licensing (OSI). Open-source licenses allow developers to share code while specifying the conditions of use. Common licenses such as the GNU General Public License (GPL) and the Massachusetts Institute of Technology (MIT) License allow others to use and modify code while the original authors retain their intellectual property rights. This approach encourages innovation and sharing while protecting complex and valuable code.

Copyright infringement concerns regarding extremely simple code have little practical significance in this argument, whereas complex or creative code can be effectively protected through open-source licenses. This allows developers to share their work with confidence and promotes the growth and innovation of the wider community.

Compatibility

The proposal aims to maximize compatibility with the existing ERC1155 standard. All existing ERC1155 functionality is retained, including detection through ERC165, while adding support for Smart-NFTs. This includes compatibility with current NFT trading platforms.

For more information about ERC165, see the article below.

[ERC165] How to Check Whether a Contract Supports a Specific Interface

For the Smart-NFT itself, the proposal only requires exposing the execute function. This means existing proxy contracts need to focus only on that interface, simplifying and streamlining Smart-NFT integration.

The proposal aims to retain the functionality of ERC1155 while adding new capabilities for Smart-NFTs. The important point is that only the execute function needs to be implemented as the external execution interface to simplify integration. Developers can consequently incorporate Smart-NFTs into existing systems and platforms while maintaining compatibility with NFT trading platforms.

Implementation

The implementation code is available in the following repository.

Security

The proposal discusses security considerations for Smart-NFTs.

Malicious Verifiers

External verifiers provide assurances during the Smart-NFT verification phase, but this structure raises concerns that malicious verifiers could deliberately approve harmful Smart-NFTs. Mitigating this risk requires stricter verification mechanisms, filtering verifiers, introducing penalties, or establishing more stringent consensus criteria. These measures can discourage malicious behavior and improve the reliability of the overall system.

Unexpected Verification Errors

Apart from malicious verifiers, verification may fail to detect issues when Smart-NFT implementations are overly complex or when the Solidity compiler contains vulnerabilities. Additional tools supporting contract audits or audits by multiple verifiers through the auditTo interface can reduce the likelihood of such failures. This reduces the risk that unexpected errors compromise the system.

These security considerations are essential to preserving the reliability and security of Smart-NFT systems. Minimizing risks from malicious verifiers and unexpected verification errors contributes to a more secure and reliable blockchain ecosystem.

Citation

MJ Tseng (@TsengMJ) tsngmj@gmail.com, Clay (@Clay2018) clay.uw@outlook.com, Jeffery.c jeffery.c@a3sprotocol.xyz, Johnny.c johnny.c@a3sprotocol.xyz, "ERC-7513: Smart NFT - A Component for Intent-Centric [DRAFT]," Ethereum Improvement Proposals, no. 7513, September 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7513.

Conclusion

This article covered ERC7513, which proposes combining contracts and NFTs into Smart-NFTs capable of executing specific operations with security provided through the IA-NFT mechanism.

If you have any questions, feel free to contact me via direct message on Twitter.

Twitter @cardene777

I also publish on other platforms.

https://chaldene.net/