3 Star 2 Fork 0

Bytom Blockchain/bmips

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bmip-0010.mediawiki 3.63 KB
一键复制 编辑 原始数据 按行查看 历史
比原技术 提交于 2021-12-09 14:23 . add bmip-0010

> BMIP: 10 > Title: Bytom NFT Protocol > Author: Lang Yu <[email protected]></[email protected]> > Comments-Summary: No comments yet. > Comments-URI: https://github.com/bytom/bmips/wiki/Comments:BMIP-0010(https://github.com/bytom/bmips/wiki/Comments:BMIP-0010) > Status: Draft > Type: Standards Track > Created: 2021-12-09

    1. Abstract
The following proposal describes a standard for issuing non-fungible token (NFT) on the Bytom blockchain. The standard provides the definition of basic chain data and the specification of management through smart contracts ​

    1. Motivation
There are a large number of unique and indivisible assets in the real world, such as estate, vehicles, works of art, props, etc. these assets cannot be described by the existing asset types. This standard providesstandard interfaces for wallet/agent/auction and other types of applications and provides users with a simple method to issue NFT. NFT which is compatible with this standard can be easily supported by applications. For example, the wallet can quickly display NFT assets issued by users according to this standard. ​

    1. Specification
      1. 1、NFT data definition
        1. 1.1 Name
Define the name of the NFT, for example: MyPunk The asset name cannot be longer than 30 characters. The name can represent an NFT or a series NFTs.​

        1. 1.2 Symbol
Define the abbreviations of the NFT name, such as MP Symbols are generally composed of capital letters.

        1. 1.3 Properties
Define NFT related information, such as type, creator, storage location, etc The properties use the Map(key -> value). In addition to the following, you can also add some custom data. ``` properties {

  type //the type of NFT,image, text or video, etc
  creator //creator name
  identity // The identity certificate of the creator, is obtained by signing raw_data_sha256 with the creator's private key
  raw_data_sha256 //original data hash to prevent tampering
  resource_uri //The storage link of original data, can be decentralized storage ipfs:// , can be centralized storage oss://

} ```

        1. 1.4 Metadata
Define the unique attributes of NFT The metadata uses Map(key -> value), developers can add custom data. For example: ``` metadata {

  raw_data
  avatar {
    skin
    eye
    hair
    mouse
  }

} ```

        1. 1.5 Example
A complete example describing the definition of an NFT asset is as follows: ``` {

  string name
  string symbol
  map<> properties {
    string type
    string creator
    string identity_key
    string raw_sha256
    string resource_uri
  }
  map<> metadata {
    bytes raw_data
    map avatar {
      string skin
      string eye
      string hair
      string mouse
    }
  }

} ```

      1. 2、NFT issuance

NFT asset issuance will inherit the standard of BAP, but requires additional settings to meet the requirements of NFT

BAP standard reference:https://github.com/Bytom/bmips/blob/master/bmip-0002.mediawiki#Implementation(https://github.com/Bytom/bmips/blob/master/bmip-0002.mediawiki#Implementation)

        1. 2.1 Set data accuracy
To ensure the indivisibility of NFT, you need to set the decimal of token to 0 ``` decimals = 0 ```
        1. 2.2 Disable additional issuance
To ensure the uniqueness of NFT, developers have to disable additional NFT issuance ``` reissue = false ```
        1. 2.3 Read NFT properties
The attributes and metadata of NFT will be put into the description field of BAP standard. Specific interfaces need to be implemented to facilitate application parsing and display.

The following interfaces can be designed: ``` func getProperties(string assetID) func getMetadata(string assetID) ``` For specific implementation, please refer to: (to do) ​

    1. Copyright
This document is placed in the public domain.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/BytomBlockchain/bmips.git
[email protected]:BytomBlockchain/bmips.git
BytomBlockchain
bmips
bmips
master

搜索帮助