nft-rfc title stage category kind author created modified
4
interNFT standard
draft
NFT/INTERFACE
interface
Deepanshu Tripathi @deepanshutr
2020-11-19
 

Synopsis

This standard describes a set of interfaces that can be utilised to build an inter-chain non-fungible token implementation.

InterNFT is a natively implemented NFT structure for Blockchain applications that implement interoperability protocols. The interNFT is defined by a basic interface that any NFT structure has to implement to be called an interNFT. The ownership of interNFT is maintained by the interNFT wallet. The combination of interNFT and interNFT wallet allows the ownership of the interNFT to be exchanged across interoperable chains while the execution logic of the NFT is still maintained at the native chain.

Motivation

The current set of common NFT definitions are dominated by the ERC721 interface definitions which are biased towards smart contract-based definitions of NFT. A chain app code native definition of NFT may not necessarily be bound by the restrictions that a smart contract definition of NFT will be, allowing for the interface to be made simpler while adding more native implementation relevant methods. Also, the smart contract-based approach for NFT implementation does not account for a common native wallet that may hold ownership representations of multiple NFT implementations and allow for a singular transfer NFT ownership transaction implementation.

The main motivation of the standard is to:

  • Define an inter-chain NFT interface that all data structures must implement to be classified as an interNFT and an interNFT wallet interface that can hold the ownership of all such interNFT implementations for an account.
  • Define a base implementation of the interNFT and interNFT wallet interfaces method signatures with mint, mutate metadata and burn transactions for base NFT and ownership transfers for the base NFT wallet implementation.
  • Define a metadata interface to maintain the interNFT metadata. This interface may further be utilized for storing metadata for objects from other datastructures too.
  • Extend the transfer interNFT functionality of the base interNFT wallet implementation to define packet data structure, app logic and encoding for interchain interNFT ownership transfers and define the ICS specification.

This will allow all projects in the inter-chain ecosystem to:

  • Define their own implementation of interNFT structures with custom mint, mutation and burn transaction logic maintained at their app chain.
  • Have a common wallet implementation for all interNFT implementations which can hold ownership information of multiple kinds of interNFTs from multiple chains in a single wallet for an account.
  • Natively send the ownership of interNFTs across chains through inter-chain communication protocols without a requirement for permissioned bridges or token transformation/pegging.

Definitions

  • interNFT: An implementation of the NFT interface. The interNFT is defined to allow for maximum application logic flexibility in one interface and is focused on interchain ownership transfer. In this document interNFT will also refer to a basic interface, implementation of which will classify a structure as an interNFT

  • classification: a representation of the type or grouping for an interNFT, e.g. an interNFT "Toyota Corolla" will be of classification car.

  • trait: a charectersitic/variable related to an interNFT defined by classification e.g. "top speed" can be a trait of classification car.

  • signature: a cryptographic signature using a private key on bytes of information. A signature can be verified against the public key of the signing private key and sign bytes.

  • fact: a piece of information. A fact can carry signatures from account(s) e.g. "100 mph (ca. 161 km/h)" is a fact and an account can attest it by signing it with their private key.

  • property: the value of a trait is property. Every property has a trait identifier and a corresponding fact fact e.g.

  • account: a singularly identifiable identity of each actor on the application. An account is generally identified by a public key.

  • maintainers: a group of one or more accounts that can issue and mutate properties of a classification of interNFT

  • interNFT wallet: a mapping of a set of interNFT IDs against an account ID. An interNFT wallet specifies the interNFTs owned by and an account.

  • height: the block height of the chain. Used as a measure of time for interNFT time-bound operations.

  • lock: the height after which the interNFT is allowed to be transferred out of an interNFT wallet.

  • burn: the height after which the interNFT is allowed to be burned/redeemed by the owner of the interNFT.

  • interNFT ID: A reference to the interNFT specifying the hash of the NFT Immutable, the address of the originating chain, and the class of the NFT. The address is convertible to a String for reference.

  • immutablestraits of the interNFT that do not change after being issued. The hash of these properties is a part of the NFT Address( interNFT ID).

  • mutablestraits of the interNFT that can be changed through transactions defined on it.

Desired Properties

Standard ownership transfer logic The overall NFT functionality is split into two objects, the NFT, and NFT wallet. NFT object handles the mint, mutation, and burns logic with the NFT wallet object handling the ownership transfers. Both objects can operate independently on different chains.

Singular representation/instantiation The NFTs are addressed by the same hash of the immutable properties, enforcing singular representation/instantiation of NFT across chains.

Singular wallet implementation NFT wallet object implements the wallet and transfer logic and is agnostic to other custom logic associated with the underlying NFT implementation allowing for a singular wallet implementation for all the defined NFT interface.

Implementation flexibility The NFT interface implementation must allow for all the basic functional requirements of an NFT with no restrictions on the extension of the functionalities to account for more complex application logic, as long as the implementation satisfies the NFT interface.

Reduce load/dependence on inter-chain protocol The two objects comprising the NFT functionality, NFT & NFT wallet sould not need to communicate with each other to sync their state at each transaction. They MUST function independently only with a few transactions requiring dependence on the inter-chain protocol(interchain send, burn transactions).

Commodification All the NFTs are represented with a class or classification allowing for transactions to address NFTs though classes instead of direct addresses and hence allowing for NFT commodification.

Trusted minting, mutation and burn execution and Interoperability with private chains The minting, mutation, and burn logic is implemented natively on the issuing chain and is always handled by the same chain instead of handing over the mutation logic to the recipient chain on an NFT ownership transfer. This allows for private and privately validated chains to also exchange their NFTs with other chains while ensuring the execution environment trust and logic privacy(if required).

Native implementation and interoperability The NFT module is implemented at the native chain application logic level instead of at the Smart Contract level, leveraging the chain’s native interoperability protocols to transfer NFTs between chains instead of permissioned bridge Smart Contracts. The basic interface and functionalities of the NFT may be extended by smart contracts to allow for more complex application logic.

Technical Specification

InterNFT interface

An interface that implements the NFT interface, adding interoperability functionalities to it

InterNFT interface {

    // Implementing the NFT interface
    NFT

    // ChainID returns the idendtifier, for the NFT's native Chain, as an ID interface
   ChainID() ID

    // HashID return the identifier, for the immutable properties of the InterNFT, as an ID interface
   HashID() ID

    // MaintainersID returns the identifier, for the maintainer froup of the InterNFT, as an ID interface
   MaintainersID() ID

    // Properties returns the properties of the interNFT as a properties interface
   Properties() Properties

    // CanSend returns a boolean telling if the interNFT can be sent or not given the current height
   CanSend(Height) bool

    // CanBurn returns a boolean telling if the interNFT can be burnt or not given the current height
   CanBurn(Height) bool
}

Height interface

An interface to define a block height type for a chain, used as a metric of time.

Height interface {

    // Count returns the block count for the Height
   Count() string

    //Current height 
    // IsGraterThat returns a Boolean to tell if the Height is grater than a given Height/Current Height
   IsGraterThat(Height) bool
}

Signature interface

An interface for any type that represents a cryptographic signature that can be verified

Signature interface {

    // String returns the human-readable string format of the Signature
   String() string

   // Bytes returns the byte array of the cryptographic signature 
   Bytes() []byte

    // ID returns the identifier for the Signature as an ID interface
   ID() ID

   // Verify returns a boolean to tell if the signature is valid of not given the public key of the signer and the signed bytes
    Verify(PublicKey, []byte) bool

    // HasExpired returns a boolean to tell if the Signature has expired given a Height/Current Height interface
    HasExpired(Height) bool
}

Signatures interface

An interface for a container of a collection of Signatures. The Interface handles the deterministic operations on the Signature collection.

Signatures interface {

    // Get returns a Signature stored in the Signatures given an Identifier for it
   Get(ID) Signature

    // Add appends a given Signature with the Signatures Collection
   Add(Signature) error
   
   // Add removes a given Signature from the Signatures Collection
   Remove(Signature) error
   
   // Add mutates a given Signature in the Signatures Collection
   Mutate(Signature) error
}

Fact interface

An interface to define a type for any kind of information is the system which is non-consequential to the application logic but has to be stored for provenance.

Fact interface  {

    // String returns the human-readable string format of the information stored by the Fact
   String() string

   // Bytes returns the byte array of the information contained by the Fact
   Bytes() []byte

    // Signatures return the cyptographic signatures on the Fact as Signatures interface 
   Signatures() Signatures
}

Property interface

An interface to define any kind of property associated with an interNFT

Property interface {

    // Name returns the name of the Property
   Name() string

    // ID returns the identifier, of the Property, as an ID interface
   ID() ID

   // Fact returns the Fact associated with the Property
   Fact() Fact
}

Properties interface

An interface for a container of a collection of Properties. The Interface handles the deterministic operations on the Property collection.

Properties interface {

    // ID returns the identifier, of the Properties, as an ID interface
   Get(ID) Property

    // Add appends the given Property with the Properties collection 
   Add(Property) error
   
   // Add removes the given Property from the Property collection
   Remove(Property) error
   
   // Add mutates the given Property in the Property collection
   Mutate(Property) error
}

Properties interface

An interface for any type of Trait associated with a Classification of interNFT

Trait interface {

    // Name returns the name of the Trait
   Name() string

   // ID returns the identifier, for a Trait, as an ID interface
   ID() ID

    // IsMutable returns a Boolean to tell if a property value of Trait can be mutated or not
   IsMutable() bool
}

Traits interface

An interface for a container of a collection of Traits. The Interface handles the deterministic operations on the Trait collection.

Traits interface {

    // Get returns a Trait for the given ID
   Get(ID) Trait
}

Classification interface

An interface for a representation of type/class/denomination of the interNFT

Classification interface {

    // Name returns a human redable name for the classification
   Name() string

    // ID return the identifier, for the classification, as an ID interface
   ID() ID

    // Traits returns the traits associated with the Classification
   Traits() Traits
}

Backwards Compatibility

This interface definition backwards compatible with the NFT interface defined in nft-rfc-003

Forwards Compatibility

Not applicable

Example Implementation

TBD

Other Implementations

References

  1. William Entriken, Dieter Shirley, Jacob Evans, Nastassia Sachs 2018.ERC-721 Non-Fungible Token Standard. Retrieved from https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md

History

2020/11/19 - First Draft

Copyright

All content herein is licensed under Apache 2.0.

 

 

概要

此标准描述了一组可用于构建链间不可互换令牌实现的接口。

InterNFT 是用于实施互操作性协议的区块链应用程序的本地实施 NFT 结构。国际NFT由一个基本接口定义,任何NFT结构必须实施才能称为NFT。国贸联的所有权由国贸联钱包维持。国贸联网和NFT钱包的结合使得NFT的所有权可以在互操作链之间交换,而NFT的执行逻辑仍然保留在本土链中。

动机

当前一组常见的 NFT 定义以ERC721接口定义为主,这些定义偏向于 NFT 基于合同的智能定义。NFT 的链式应用代码原生定义未必受 NFT 智能合同定义的限制,从而使界面变得更简单,同时添加更多本地实施相关方法。此外,基于合同的 NFT 实施智能方法不考虑一个通用的本地钱包,该钱包可能持有多个 NFT 实施的所有权表示,并允许单一转让 NFT 所有权交易实施。

该标准的主要动机是:

  • 定义一个链间 NFT 接口,所有数据结构必须实现才能归类为互通和跨 NFT 钱包接口,该界面可以为帐户保留所有此类 NFT 实施的所有权。
  • 定义跨NFT和NFT间钱包接口方法签名的基本实现与薄荷,变异元数据和燃烧交易的基础NFT和所有权转让的基础NFT钱包实施。
  • 定义元数据界面以维护NFT元数据。此接口还可用于存储来自其他数据结构的对象的元数据。
  • 扩展基础NFT钱包实现的传输互通功能,以定义数据包数据结构、应用逻辑和链间联网所有权转移编码,并定义ICS规范。

这将使链间生态系统中的所有项目能够:

  • 使用在其应用链中维护的自定义薄荷、突变和燃烧交易逻辑定义它们自己实施的互不间断结构。
  • 对于所有跨NFT实施,有一个通用的钱包实现,它可以在一个帐户中保存来自多个链条的多种互通的所有权信息。
  • 无需获得许可的桥梁或象征性的转换/固定,即可通过链条跨链发送跨链之间的互通通信的所有权。

定义

  • interNFT: 界面的实现。其定义是允许在一个界面中具有最大的应用逻辑灵活性,并侧重于链间所有权转移。本文档中还将提及一个基本接口,其实施将将结构分类为NFTinterNFTinterNFTinterNFT

  • classification: "丰田花冠"将代表汽车的类型或分组。interNFTinterNFTclassification

  • trait:与"最高速度"等定义相关的魅力/变量可以是汽车。interNFTclassificationtraitclassification

  • signature:使用信息字节上的私人密钥进行加密签名。签名可以根据签名专用密钥和签名字节的公钥进行验证。

  • fact:一条信息。A 可以携带 s 从 (s) 例如"100 英里/小时(ca. 161 km/h)"是一个事实,并且可以通过用他们的私钥签名来证明这一点。factsignatureaccountaccount

  • property:一个值是。每个都有标识符和相应的事实,例如。traitpropertypropertytraitfact

  • account:申请中每个演员的奇异身份。A 通常由公钥识别。account

  • maintainers: 一组一个或多个帐户, 可以发出和变异的propertiesclassificationinterNFT

  • interNFT wallet: 一组 s 对 ID 的映射。指定所拥有和帐户。interNFT IDaccountinterNFT walletinterNFT

  • height: 链条的块高。用作时间限制操作的时间量度。interNFT

  • lock:之后允许转移出。heightinterNFTinterNFT wallet

  • burn: 之后允许燃烧/赎回由业主。heightinterNFTinterNFT

  • interNFT ID: 指指定 NFT 不变的哈希、原始链的地址和 NFT 的类别。该地址可转换为字符串以供参考。interNFT

  • immutables: 发行后不变。这些属性的哈希是 NFT 地址 () 的一部分 。traitinterNFTinterNFT ID

  • mutables:可以通过在它上定义的交易来改变。traitinterNFT

所需属性

标准所有权转让逻辑NFT 的整体功能分为两个对象,NFT 和 NFT 钱包。NFT 对象处理薄荷、突变和燃烧逻辑,NFT 钱包对象处理所有权转移。这两个对象都可以在不同的链条上独立操作。

单数表示/表示NFT 通过不变属性的相同哈希处理,跨链条强制执行 NFT 的单一表示/表示。

单个钱包实现NFT 钱包对象实现钱包和转移逻辑,并且与与基础 NFT 实现相关的其他自定义逻辑不可知,允许所有定义的 NFT 界面实现单一的钱包实现。

实现灵活性NFT 接口实施必须允许 NFT 的所有基本功能要求,只要实施符合 NFT 接口,则对功能扩展没有限制,以考虑更复杂的应用逻辑。

减少对链间协议的负载/依赖两个对象包括 NFT 功能,NFT 和 NFT 钱包灵魂不需要相互通信,以同步其状态在每个交易。它们必须独立运作,只需进行少数需要依赖链间协议(链间发送、燃烧交易)的交易。

商品化所有 NFT 都采用类别或分类表示,允许交易通过类别而不是直接地址解决 NFT,从而允许 NFT 商品化。

可信的薄荷、突变和燃烧执行以及与私人链的互操作性薄荷、突变和燃烧逻辑在发证链上自然而然地实现,并且始终由同一链处理,而不是在 NFT 所有权转让中将突变逻辑交给接收链。这允许私人和私人验证的连锁店也与其他连锁店交换其 NFT,同时确保执行环境的信任和逻辑隐私(如果需要)。

本地实现性和互操作性NFT 模块在本地链应用逻辑级别而不是智能合同级别上实施,利用链条的本地互操作性协议在链之间传输 NFT,而不是许可的桥式智能合约。NFT 的基本接口和功能可以通过智能合约扩展,以允许更复杂的应用逻辑。

技术规范

国际FT界面

实现 NFT 接口的接口,为其添加互操作功能

InterNFT interface {

    // Implementing the NFT interface
    NFT

    // ChainID returns the idendtifier, for the NFT's native Chain, as an ID interface
   ChainID() ID

    // HashID return the identifier, for the immutable properties of the InterNFT, as an ID interface
   HashID() ID

    // MaintainersID returns the identifier, for the maintainer froup of the InterNFT, as an ID interface
   MaintainersID() ID

    // Properties returns the properties of the interNFT as a properties interface
   Properties() Properties

    // CanSend returns a boolean telling if the interNFT can be sent or not given the current height
   CanSend(Height) bool

    // CanBurn returns a boolean telling if the interNFT can be burnt or not given the current height
   CanBurn(Height) bool
}

高度接口

定义链条块高度类型的界面,用作时间指标。

Height interface {

    // Count returns the block count for the Height
   Count() string

    //Current height 
    // IsGraterThat returns a Boolean to tell if the Height is grater than a given Height/Current Height
   IsGraterThat(Height) bool
}

签名界面

表示可验证的加密签名的任何类型的界面

Signature interface {

    // String returns the human-readable string format of the Signature
   String() string

   // Bytes returns the byte array of the cryptographic signature 
   Bytes() []byte

    // ID returns the identifier for the Signature as an ID interface
   ID() ID

   // Verify returns a boolean to tell if the signature is valid of not given the public key of the signer and the signed bytes
    Verify(PublicKey, []byte) bool

    // HasExpired returns a boolean to tell if the Signature has expired given a Height/Current Height interface
    HasExpired(Height) bool
}

签名界面

签名集合容器的界面。界面处理签名集合上的确定性操作。

Signatures interface {

    // Get returns a Signature stored in the Signatures given an Identifier for it
   Get(ID) Signature

    // Add appends a given Signature with the Signatures Collection
   Add(Signature) error
   
   // Add removes a given Signature from the Signatures Collection
   Remove(Signature) error
   
   // Add mutates a given Signature in the Signatures Collection
   Mutate(Signature) error
}

事实界面

定义任何类型信息的界面是系统,它对应用程序逻辑无关,但必须存储才能获得来源。

Fact interface  {

    // String returns the human-readable string format of the information stored by the Fact
   String() string

   // Bytes returns the byte array of the information contained by the Fact
   Bytes() []byte

    // Signatures return the cyptographic signatures on the Fact as Signatures interface 
   Signatures() Signatures
}

属性界面

定义与 INTERNFT 相关的任何类型的属性的界面

Property interface {

    // Name returns the name of the Property
   Name() string

    // ID returns the identifier, of the Property, as an ID interface
   ID() ID

   // Fact returns the Fact associated with the Property
   Fact() Fact
}

属性界面

属性集合容器的接口。接口处理属性集合的确定性操作。

Properties interface {

    // ID returns the identifier, of the Properties, as an ID interface
   Get(ID) Property

    // Add appends the given Property with the Properties collection 
   Add(Property) error
   
   // Add removes the given Property from the Property collection
   Remove(Property) error
   
   // Add mutates the given Property in the Property collection
   Mutate(Property) error
}

属性界面

与国际贸易机密分类相关的任何类型的特质的界面

Trait interface {

    // Name returns the name of the Trait
   Name() string

   // ID returns the identifier, for a Trait, as an ID interface
   ID() ID

    // IsMutable returns a Boolean to tell if a property value of Trait can be mutated or not
   IsMutable() bool
}

特质界面

一组特征的容器的接口。接口处理特蕾特集合上的确定性操作。

Traits interface {

    // Get returns a Trait for the given ID
   Get(ID) Trait
}

分类界面

表示国贸会议类型/类别/面额的界面

Classification interface {

    // Name returns a human redable name for the classification
   Name() string

    // ID return the identifier, for the classification, as an ID interface
   ID() ID

    // Traits returns the traits associated with the Classification
   Traits() Traits
}

向后兼容性

此接口定义与nft-rfc-003中定义的 NFT 界面向后兼容

转发兼容性

不適用

示例实现

待定

其他实施

引用

  1. 威廉·恩特里肯,迪特尔·雪莉,雅各布·埃文斯,纳斯塔西亚·萨克斯2018.ERC-721不可燃令牌标准。从https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md中检索

历史

2020/11/19 - 初稿

版权

此处的所有内容均根据Apache 2.0 获得许可。