[go: up one dir, main page]

CN113421094B - A blockchain-based method for implementing smart contracts for indivisible assets - Google Patents

A blockchain-based method for implementing smart contracts for indivisible assets Download PDF

Info

Publication number
CN113421094B
CN113421094B CN202110762944.2A CN202110762944A CN113421094B CN 113421094 B CN113421094 B CN 113421094B CN 202110762944 A CN202110762944 A CN 202110762944A CN 113421094 B CN113421094 B CN 113421094B
Authority
CN
China
Prior art keywords
asset
interface
assets
indivisible
attribute
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110762944.2A
Other languages
Chinese (zh)
Other versions
CN113421094A (en
Inventor
刘在爽
邱钰超
白健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Electronic Technology Cyber Security Co Ltd
Original Assignee
China Electronic Technology Cyber Security Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Electronic Technology Cyber Security Co Ltd filed Critical China Electronic Technology Cyber Security Co Ltd
Publication of CN113421094A publication Critical patent/CN113421094A/en
Application granted granted Critical
Publication of CN113421094B publication Critical patent/CN113421094B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/405Establishing or using transaction specific rules

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • Development Economics (AREA)
  • Computational Linguistics (AREA)
  • Economics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a block chain-based indivisible asset intelligent contract implementation method, which comprises the following steps: based on the digital asset basic framework, the indivisible asset father intelligent contract is realized, so that the business logic of the core is realized, and the father intelligent contract is provided for a user in an open source mode; the user inherits the parent class intelligent contract through a new subclass and realizes related atomic operation of the inseparable asset through block chain deployment; the indivisible asset is a non-homogeneous digital asset. The invention defines an atomic operation scheme of a standard set of atomic operation schemes for the indivisible assets of the blockchain platform, accurately defines attribute information and atomic operation of each asset, reduces the cost of application development and docking for a blockchain application developer, enables the uplink application to be rapidly docked and deployed, greatly shortens the research and development period, and provides a unified standard for cooperation of data between applications.

Description

一种基于区块链的不可分割资产智能合约实现方法A blockchain-based method for implementing smart contracts for indivisible assets

技术领域technical field

本发明涉及区块链技术领域,具体而言,涉及一种基于区块链的不可分割资产智能合约实现方法。The present invention relates to the field of block chain technology, in particular, to a block chain-based method for realizing an indivisible asset smart contract.

背景技术Background technique

基于区块链的不可分割资产也称为非同质化资产,非同质代表独一无二,以加密猫为例,每只猫都被赋予拥有基因,是独一无二的(一只猫就是一个NFT),猫之间是不能置换的。这种独特性使得某些稀有猫具有收藏价值,也因此受到追捧。Indivisible assets based on the blockchain are also called non-homogeneous assets. Non-homogeneity represents uniqueness. Taking encrypted cats as an example, each cat is endowed with genes and is unique (a cat is an NFT). Cats are not interchangeable. This uniqueness makes certain rare cats collectible and therefore highly sought after.

目前,区块链行业并无不可分割资产的统一标准,仅有ERC721的规范可参考,同时ERC721仅基于以太坊开发,并不具备跨平台的能力,其中相应的接口并无完成实现,还需开发者实现接口完成相应的功能。如果各个不可分割资产的发行方都使用自有标准去发行资产,那对于链上应用的开发者以及交易所对接成本是极其高昂的,因为应用上链需要对每一种资产去独立进行对接。At present, there is no uniform standard for indivisible assets in the blockchain industry. Only the ERC721 specification can be referred to. At the same time, ERC721 is only developed based on Ethereum and does not have the ability to cross platforms. The corresponding interface has not been implemented yet. Developers implement the interface to complete the corresponding functions. If the issuers of each indivisible asset use their own standards to issue assets, it will be extremely costly for on-chain application developers and exchange docking costs, because application on-chain requires independent docking of each asset.

发明内容Contents of the invention

本发明旨在提供一种基于区块链的不可分割资产智能合约实现方法,以降低链上应用开发者对接的成本。The present invention aims to provide a block chain-based method for implementing smart contracts for indivisible assets, so as to reduce the cost of docking application developers on the chain.

本发明提供的一种基于区块链的不可分割资产智能合约实现方法,包括:The present invention provides a blockchain-based method for implementing an indivisible asset smart contract, including:

基于数字资产基本框架,实现不可分割资产父类智能合约,以此实现核心的业务逻辑,并将父类智能合约通过开源的方式提供给用户;Based on the basic framework of digital assets, realize the parent smart contract of indivisible assets, so as to realize the core business logic, and provide the parent smart contract to users through open source;

用户通过新建子类继承所述父类智能合约,并通过区块链部署,实现所述不可分割资产的相关原子操作;所述不可分割资产即非同质化数字资产。The user inherits the smart contract of the parent class by creating a new subclass, and deploys it through the blockchain to realize the relevant atomic operations of the indivisible assets; the indivisible assets are non-homogeneous digital assets.

所述不可分割资产定义有如下属性字段:资产名称、资产符号、资产编号、资产源数据、资产状态、资产属性以及资产所有人;其中,所述资产属性为自定义的接口体,由资产创建用户自行定义;所述资产所有权人为自定义结构数组,包含资产所有人地址与资产所有人所占资产份额,所有资产所有人的总份额必须为100%。The indivisible asset definition has the following attribute fields: asset name, asset symbol, asset number, asset source data, asset status, asset attribute, and asset owner; wherein, the asset attribute is a self-defined interface body created by the asset Defined by the user; the asset owner is a custom structure array, including the address of the asset owner and the asset share of the asset owner. The total share of all asset owners must be 100%.

所述不可分割资产的相关原子操作包括资产创建,即创建所述不可分割资产,包括如下步骤:The relevant atomic operations of the indivisible assets include asset creation, that is, the creation of the indivisible assets, including the following steps:

首先,通过初始化接口init初始化资产信息;其中,初始化接口init的传入参数包括资产名称和资产符号,初始化接口init返回区块链交易信息;First, initialize asset information through the initialization interface init; wherein, the incoming parameters of the initialization interface init include asset names and asset symbols, and the initialization interface init returns blockchain transaction information;

然后,通过资产创建接口issue创建资产;其中,资产创建接口issue的传入参数分别为资产接收地址列表、资产属性、资产源数据,接口返回全局唯一的资产编号与错误信息。Then, create an asset through the asset creation interface issue; the incoming parameters of the asset creation interface issue are the asset receiving address list, asset attributes, and asset source data, and the interface returns a globally unique asset number and error message.

所述不可分割资产的相关原子操作包括资产转移,即设计资产转移接口transfer实现资产的转移;其中,资产转移接口transfer的传入参数分别为资产支付方用户地址、资产接收方用户地址、资产编号、资产份额、已经交易发起人的签名;资产转移接口transfer返回区块链交易信息。The relevant atomic operations of the indivisible assets include asset transfer, that is, designing the asset transfer interface transfer to realize the transfer of assets; wherein, the incoming parameters of the asset transfer interface transfer are the user address of the asset payer, the user address of the asset receiver, and the asset number , asset share, and the signature of the initiator of the transaction; the asset transfer interface transfer returns the blockchain transaction information.

所述不可分割资产的相关原子操作包括资产所有人查询,即设计资产所有人查询接口ownerOf查询对应资产的所有人;资产所有人查询接口ownerOf的传入参数为资产编号;资产所有人查询接口ownerOf的返回资产所有人的地址列表及对应所占资产份额。The relevant atomic operations of the indivisible assets include asset owner query, that is, designing the asset owner query interface ownerOf to query the owner of the corresponding asset; the incoming parameter of the asset owner query interface ownerOf is the asset number; the asset owner query interface ownerOf Returns a list of addresses of asset owners and their corresponding asset shares.

所述不可分割资产的相关原子操作包括资产检索,即设计资产检索接口tokenOfOwnerByIndex查询指定用户的所有资产信息;资产检索接口tokenOfOwnerByIndex的传入参数包括用户资产地址;资产检索接口tokenOfOwnerByIndex返回资产信息数组。The relevant atomic operations of the indivisible assets include asset retrieval, that is, design an asset retrieval interface tokenOfOwnerByIndex to query all asset information of a specified user; the incoming parameters of the asset retrieval interface tokenOfOwnerByIndex include user asset addresses; the asset retrieval interface tokenOfOwnerByIndex returns an array of asset information.

所述不可分割资产的相关原子操作包括资产信息获取,即设计资产信息获取接口infoByID查询资产的详细信息;资产信息获取接口infoByID的传入参数为资产编号,资产信息获取接口infoByID返回资产信息结构体。The relevant atomic operations of the indivisible assets include asset information acquisition, that is, designing the asset information acquisition interface infoByID to query the detailed information of the asset; the incoming parameter of the asset information acquisition interface infoByID is the asset number, and the asset information acquisition interface infoByID returns the asset information structure .

所述不可分割资产的相关原子操作包括资产总量获取,即设计资产总量接口totalSupply获取当前链上资产总量;资产总量接口totalSupply返回链上资产总量。The relevant atomic operations of the indivisible assets include obtaining the total amount of assets, that is, designing the interface totalSupply of the total amount of assets to obtain the total amount of assets on the current chain; the interface totalSupply of the total amount of assets returns the total amount of assets on the chain.

所述不可分割资产的相关原子操作包括资产属性、符号、名称查询,即设计资产属性、符号、名称查询接口;所述资产属性、符号、名称查询接口返回资产编号的数组。The relevant atomic operations of the indivisible assets include asset attribute, symbol, and name query, that is, designing an asset attribute, symbol, and name query interface; the asset attribute, symbol, and name query interface returns an array of asset numbers.

所述不可分割资产的相关原子操作包括资产销毁,即设计资产销毁接口destroy销毁指定资产编号的资产;资产销毁接口destroy的传入参数为资产编号,资产销毁接口destroy返回区块链交易信息;The relevant atomic operations of the indivisible assets include asset destruction, that is, the asset destruction interface destroy is designed to destroy the asset with the specified asset number; the incoming parameter of the asset destruction interface destroy is the asset number, and the asset destruction interface destroy returns the block chain transaction information;

所述不可分割资产的相关原子操作包括资产属性更新,即设计资产属性更新接口,包括更新属性与源数据接口、仅更新源数据接口、仅更新属性接口;所述资产属性更新接口返回区块链交易信息。The relevant atomic operations of the indivisible assets include asset attribute update, that is, the design of asset attribute update interface, including update attribute and source data interface, only update source data interface, and only update attribute interface; the asset attribute update interface returns the block chain Trading Information.

综上所述,由于采用了上述技术方案,本发明的有益效果是:In summary, owing to adopting above-mentioned technical scheme, the beneficial effect of the present invention is:

本发明定义了一套规范标准的对于区块链平台不可分割资产的原子操作方案,同时精确的定义了各个资产的属性信息及原子操作,为区块链应用开发者降低了应用开发及对接的成本,上链应用可快速对接部署,极大的缩短的研发周期,更为应用间数据的协同提供了统一的标准。The present invention defines a set of normative and standard atomic operation schemes for indivisible assets of the blockchain platform, and at the same time accurately defines the attribute information and atomic operations of each asset, reducing the application development and docking costs for blockchain application developers. Cost, on-chain applications can be quickly docked and deployed, greatly shortening the R&D cycle, and providing a unified standard for data collaboration between applications.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对实施例中的附图作简单地介绍,应当理解,以下附图仅示出了本发明的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention, and therefore should not be viewed The scope is limited, and those skilled in the art can also obtain other related drawings based on these drawings without creative work.

图1为本发明实施例的基于区块链的不可分割资产智能合约实现方法的原理图。FIG. 1 is a schematic diagram of a blockchain-based indivisible asset smart contract implementation method according to an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本发明实施例的组件可以以各种不同的配置来布置和设计。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. The components of the embodiments of the invention generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations.

因此,以下对在附图中提供的本发明的实施例的详细描述并非旨在限制要求保护的本发明的范围,而是仅仅表示本发明的选定实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。Accordingly, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

实施例Example

非同质化数字资产(XLNFT)的特性为不可分割、不可替代、独一无二的,代表的协议框架如以太坊的ERC721。可以被应用于有形的资产中,例如艺术品、农产品、汽车、房产等。如图1所示,本实施例提出一种基于区块链的不可分割资产智能合约实现方法,包括:The characteristics of non-homogeneous digital assets (XLNFT) are indivisible, irreplaceable, and unique, and the representative agreement framework is such as ERC721 of Ethereum. Can be applied to tangible assets such as art, agricultural products, cars, real estate, etc. As shown in Figure 1, this embodiment proposes a blockchain-based implementation method for an indivisible asset smart contract, including:

基于数字资产基本框架,实现不可分割资产父类智能合约,以此实现核心的业务逻辑,并将父类智能合约通过开源的方式提供给用户;Based on the basic framework of digital assets, realize the parent smart contract of indivisible assets, so as to realize the core business logic, and provide the parent smart contract to users through open source;

用户通过新建子类继承所述父类智能合约,并通过区块链部署,实现所述不可分割资产的相关原子操作;所述不可分割资产即非同质化数字资产。The user inherits the smart contract of the parent class by creating a new subclass, and deploys it through the blockchain to realize the relevant atomic operations of the indivisible assets; the indivisible assets are non-homogeneous digital assets.

为所述不可分割资产定义如下属性字段:资产名称、资产符号、资产编号、资产源数据、资产状态(正常、冻结、销毁)、资产属性以及资产所有人;其中,所述资产属性为自定义的接口体,由资产创建用户自行定义;所述资产所有权人为自定义结构数组,包含资产所有人地址与资产所有人所占资产份额,所有资产所有人的总份额必须为100%。Define the following attribute fields for the indivisible asset: asset name, asset symbol, asset number, asset source data, asset status (normal, frozen, destroyed), asset attribute, and asset owner; wherein, the asset attribute is a custom The interface body is defined by the asset creation user; the asset owner is a custom structure array, including the address of the asset owner and the asset share of the asset owner. The total share of all asset owners must be 100%.

所述不可分割资产的相关原子操作包括:The relevant atomic operations of the indivisible assets include:

(1)资产创建(1) Asset Creation

所述不可分割资产的相关原子操作包括资产创建,即创建所述不可分割资产,包括如下步骤:The relevant atomic operations of the indivisible assets include asset creation, that is, the creation of the indivisible assets, including the following steps:

首先,通过初始化接口init初始化资产信息;其中,初始化接口init的传入参数包括资产名称和资产符号,初始化接口init返回区块链交易信息;First, initialize asset information through the initialization interface init; wherein, the incoming parameters of the initialization interface init include asset names and asset symbols, and the initialization interface init returns blockchain transaction information;

本实施例中,所述初始化接口init为:In this embodiment, the initialization interface init is:

init(name string,symbol string)pb.Response;init(name string, symbol string) pb. Response;

其中,参数name表示资产名称;symbol表示资产符号;Among them, the parameter name indicates the asset name; symbol indicates the asset symbol;

然后,通过资产创建接口issue创建资产;其中,资产创建接口issue的传入参数分别为资产接收地址、资产属性、资产源数据(一般为URL),接口返回全局唯一的资产编号与错误信息(如无则为空)。Then, create an asset through the asset creation interface issue; where, the incoming parameters of the asset creation interface issue are asset receiving address, asset attribute, asset source data (usually URL), and the interface returns a globally unique asset number and error information (such as empty if none).

本实施例中,所述资产创建接口issue为:In this embodiment, the asset creation interface issue is:

issue(to[]addressAndshare,attribute struct,metaData string)(uint,error);issue(to[]addressAndshare, attribute struct, metaData string)(uint, error);

或,or,

issue(to[]addressAndshare,attribute struct)(uint,error);issue(to[]addressAndshare, attribute struct)(uint, error);

其中,参数[]address表示资产接收地址列表;attribute表示资产属性;metaData表示资产原数据;uint表示资产编号;error表示错误信息。Among them, the parameter []address indicates the asset receiving address list; attribute indicates the asset attribute; metaData indicates the original data of the asset; uint indicates the asset number; error indicates the error message.

(2)资产转移(2) Asset transfer

所述不可分割资产的相关原子操作包括资产转移,即设计资产转移接口transfer实现资产的转移;其中,资产转移接口transfer的传入参数分别为资产支付方用户地址、资产接收方用户地址、资产编号、资产份额、已经交易发起人的签名;资产转移接口transfer返回区块链交易信息。The relevant atomic operations of the indivisible assets include asset transfer, that is, designing the asset transfer interface transfer to realize the transfer of assets; wherein, the incoming parameters of the asset transfer interface transfer are the user address of the asset payer, the user address of the asset receiver, and the asset number , asset share, and the signature of the initiator of the transaction; the asset transfer interface transfer returns the blockchain transaction information.

本实施例中,所述资产转移接口transfer为:In this embodiment, the asset transfer interface transfer is:

transfer(owner address,to address,ID uint,share float,sign string)pb.Response。transfer(owner address,to address,ID uint,share float,sign string)pb.Response.

其中,参数owner address表示资产支付方地址;to address表示资产接收方地址;ID uint表示资产编号;share float表示交易份额;sign表示已经交易发起人的签名。Among them, the parameter owner address indicates the address of the asset payer; to address indicates the address of the asset receiver; ID uint indicates the asset number; share float indicates the transaction share; sign indicates the signature of the transaction initiator.

(3)资产所有人查询(3) Asset owner inquiry

所述不可分割资产的相关原子操作包括资产所有人查询,即设计资产所有人查询接口ownerOf查询对应资产的所有人;资产所有人查询接口ownerOf的传入参数为资产编号;资产所有人查询接口ownerOf的返回资产所有人的地址列表及对应所占资产份额。The relevant atomic operations of the indivisible assets include asset owner query, that is, designing the asset owner query interface ownerOf to query the owner of the corresponding asset; the incoming parameter of the asset owner query interface ownerOf is the asset number; the asset owner query interface ownerOf Returns a list of addresses of asset owners and their corresponding asset shares.

本实施例中,所述资产所有人查询接口ownerOf为:In this embodiment, the asset owner query interface ownerOf is:

ownerOf(ID uint)([]address,error);ownerOf(ID uint)([]address, error);

其中,参数ID uint表示资产编号;[]address表示资产持有人地址列表。Among them, the parameter ID uint indicates the asset number; []address indicates the address list of the asset holder.

(4)资产检索(4) Asset retrieval

所述不可分割资产的相关原子操作包括资产检索,即设计资产检索接口tokenOfOwnerByIndex查询指定用户的所有资产信息;资产检索接口tokenOfOwnerByIndex的传入参数包括用户资产地址;资产检索接口tokenOfOwnerByIndex返回资产信息数组。The relevant atomic operations of the indivisible assets include asset retrieval, that is, design an asset retrieval interface tokenOfOwnerByIndex to query all asset information of a specified user; the incoming parameters of the asset retrieval interface tokenOfOwnerByIndex include user asset addresses; the asset retrieval interface tokenOfOwnerByIndex returns an array of asset information.

在本市实施例中,所述资产检索接口tokenOfOwnerByIndex为:In the embodiment of this city, the asset retrieval interface tokenOfOwnerByIndex is:

tokenOfOwnerByIndex(user address)([]struct,error);tokenOfOwnerByIndex(user address)([]struct, error);

其中,参数user address表示用户资产地址;[]struct表示资产信息数组,资产信息数据定义如下:Among them, the parameter user address represents the user asset address; []struct represents the asset information array, and the asset information data is defined as follows:

type token struct{type token struct{

ID uintID uint

Share floatShare float

}}

(5)资产信息获取(5) Acquisition of asset information

所述不可分割资产的相关原子操作包括资产信息获取,即设计资产信息获取接口infoByID查询资产的详细信息;资产信息获取接口infoByID的传入参数为资产编号,资产信息获取接口infoByID返回资产信息结构体。The relevant atomic operations of the indivisible assets include asset information acquisition, that is, designing the asset information acquisition interface infoByID to query the detailed information of the asset; the incoming parameter of the asset information acquisition interface infoByID is the asset number, and the asset information acquisition interface infoByID returns the asset information structure .

在本实施例中,所述资产信息获取接口infoByID为:In this embodiment, the asset information acquisition interface infoByID is:

infoByID(ID uint)(struct,error);infoByID(ID uint)(struct, error);

其中,参数ID uint表示资产编号;struct表示资产信息结构体,该资产信息结构体定义如下:Among them, the parameter ID uint represents the asset number; struct represents the asset information structure, which is defined as follows:

type info struct{type info struct{

Name stringName string

Symbol stringSymbol string

metaData stringmetaData string

Attribute structAttribute struct

}}

(6)资产总量获取(6) Acquisition of total assets

所述不可分割资产的相关原子操作包括资产总量获取,即设计资产总量接口totalSupply获取当前链上资产总量;资产总量接口totalSupply返回链上资产总量。The relevant atomic operations of the indivisible assets include obtaining the total amount of assets, that is, designing the interface totalSupply of the total amount of assets to obtain the total amount of assets on the current chain; the interface totalSupply of the total amount of assets returns the total amount of assets on the chain.

在本实施例中,所述资产总量接口totalSupply为:In this embodiment, the interface totalSupply of the total amount of assets is:

totalSupply()(uint,error);totalSupply()(uint, error);

其中,uint表示资产总量。Among them, uint represents the total amount of assets.

(7)资产属性、符号、名称查询(7) Asset attribute, symbol, name query

所述不可分割资产的相关原子操作包括资产属性、符号、名称查询,即设计资产属性、符号、名称查询接口;所述资产属性、符号、名称查询接口返回资产编号的数组。The relevant atomic operations of the indivisible assets include asset attribute, symbol, and name query, that is, designing an asset attribute, symbol, and name query interface; the asset attribute, symbol, and name query interface returns an array of asset numbers.

在本实施例中,所述资产属性、符号、名称查询接口为:In this embodiment, the asset attribute, symbol, name query interface is:

queryInfoByAttribute(attribute struct)([]uint,error),即资产属性查询;queryInfoByAttribute(attribute struct)([]uint, error), that is, asset attribute query;

queryInfoBySymbol(symbol string)([]uint,error),即资产符号查询;queryInfoBySymbol(symbol string)([]uint, error), that is, asset symbol query;

queryInfoByName(name string)([]uint,error),即资产名称查询。queryInfoByName(name string)([]uint, error), namely asset name query.

其中,参数attribute表示资产属性;symbol表示资产符号;name表示资产名称。Among them, the parameter attribute indicates the asset attribute; symbol indicates the asset symbol; name indicates the asset name.

(8)资产销毁(8) Destruction of assets

所述不可分割资产的相关原子操作包括资产销毁,即设计资产销毁接口destroy销毁指定资产编号的资产;资产销毁接口destroy的传入参数为资产编号,资产销毁接口destroy返回区块链交易信息。The atomic operations related to the indivisible assets include asset destruction, that is, the asset destruction interface destroy is designed to destroy the asset with the specified asset number; the input parameter of the asset destruction interface destroy is the asset number, and the asset destruction interface destroy returns the blockchain transaction information.

在本实施例中,所述资产销毁接口destroy为:In this embodiment, the asset destruction interface destroy is:

destroy(ID uint)pb.Response;destroy(ID uint) pb. Response;

其中,参数ID uint表示资产编号。Among them, the parameter ID uint represents the asset number.

(9)资产属性更新(9) Asset attribute update

所述不可分割资产的相关原子操作包括资产属性更新,即设计资产属性更新接口,包括更新属性与源数据接口、仅更新源数据接口、仅更新属性接口;所述资产属性更新接口返回区块链交易信息。The relevant atomic operations of the indivisible assets include asset attribute update, that is, the design of asset attribute update interface, including update attribute and source data interface, only update source data interface, and only update attribute interface; the asset attribute update interface returns the block chain Trading Information.

在本实施例中,所述资产属性更新接口为:In this embodiment, the asset attribute update interface is:

update(ID uint,attribute struct,metaData string)pb.Response,即更新属性与源数据接口;update(ID uint, attribute struct, metaData string) pb.Response, that is, to update the interface between the attribute and the source data;

update(ID uint,metaData string)pb.Response,即仅更新源数据接口;update(ID uint, metaData string)pb.Response, that is, only update the source data interface;

update(ID uint,attribute struct)pb.Response,即仅更新属性接口。update(ID uint, attribute struct)pb.Response, which only updates the attribute interface.

其中,参数ID uint表示资产编号;attribute表示资产属性;metaData表示资产源数据。Among them, the parameter ID uint indicates the asset number; attribute indicates the asset attribute; metaData indicates the asset source data.

通过上述内容可知,本发明定义了一套规范标准的对于区块链平台不可分割资产的原子操作方案,同时精确的定义了各个资产的属性信息及原子操作,为区块链应用开发者降低了应用开发及对接的成本,上链应用可快速对接部署,极大的缩短的研发周期,更为应用间数据的协同提供了统一的标准。From the above content, it can be seen that the present invention defines a set of standardized atomic operation schemes for indivisible assets of the blockchain platform, and at the same time accurately defines the attribute information and atomic operations of each asset, which reduces the time for blockchain application developers. The cost of application development and docking, on-chain applications can be quickly docked and deployed, greatly shortening the research and development cycle, and providing a unified standard for data collaboration between applications.

以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (1)

1.一种基于区块链的不可分割资产智能合约实现方法,其特征在于,包括:1. A blockchain-based method for implementing an indivisible asset smart contract, characterized in that it includes: 基于数字资产基本框架,实现不可分割资产父类智能合约,以此实现核心的业务逻辑,并将父类智能合约通过开源的方式提供给用户;Based on the basic framework of digital assets, realize the parent smart contract of indivisible assets, so as to realize the core business logic, and provide the parent smart contract to users through open source; 用户通过新建子类继承所述父类智能合约,并通过区块链部署,实现所述不可分割资产的相关原子操作;所述不可分割资产即非同质化数字资产;The user inherits the smart contract of the parent class by creating a new subclass, and deploys it through the blockchain to realize the relevant atomic operations of the indivisible assets; the indivisible assets are non-homogeneous digital assets; 所述不可分割资产定义有如下属性字段:资产名称、资产符号、资产编号、资产源数据、资产状态、资产属性以及资产所有人;其中,所述资产属性为自定义的接口体,由资产创建用户自行定义;所述资产所有权人为自定义结构数组,包含资产所有人地址与资产所有人所占资产份额,所有资产所有人的总份额必须为100%;The indivisible asset definition has the following attribute fields: asset name, asset symbol, asset number, asset source data, asset status, asset attribute, and asset owner; wherein, the asset attribute is a self-defined interface body created by the asset Defined by the user; the asset owner is a custom structure array, including the address of the asset owner and the asset share of the asset owner. The total share of all asset owners must be 100%; 所述不可分割资产的相关原子操作包括资产创建,即创建所述不可分割资产,包括如下步骤:The relevant atomic operations of the indivisible assets include asset creation, that is, the creation of the indivisible assets, including the following steps: 首先,通过初始化接口init初始化资产信息;其中,初始化接口init的传入参数包括资产名称和资产符号,初始化接口init返回区块链交易信息;First, initialize asset information through the initialization interface init; wherein, the incoming parameters of the initialization interface init include asset names and asset symbols, and the initialization interface init returns blockchain transaction information; 然后,通过资产创建接口issue创建资产;其中,资产创建接口issue的传入参数分别为资产接收地址列表、资产属性、资产源数据,接口返回全局唯一的资产编号与错误信息;Then, create an asset through the asset creation interface issue; where, the incoming parameters of the asset creation interface issue are the asset receiving address list, asset attributes, and asset source data, and the interface returns a globally unique asset number and error message; 所述不可分割资产的相关原子操作包括资产转移,即设计资产转移接口transfer实现资产的转移;其中,资产转移接口transfer的传入参数分别为资产支付方用户地址、资产接收方用户地址、资产编号、资产份额、已经交易发起人的签名;资产转移接口transfer返回区块链交易信息;The relevant atomic operations of the indivisible assets include asset transfer, that is, designing the asset transfer interface transfer to realize the transfer of assets; wherein, the incoming parameters of the asset transfer interface transfer are the user address of the asset payer, the user address of the asset receiver, and the asset number , asset share, and the signature of the initiator of the transaction; the asset transfer interface transfer returns the blockchain transaction information; 所述不可分割资产的相关原子操作包括资产所有人查询,即设计资产所有人查询接口ownerOf查询对应资产的所有人;资产所有人查询接口ownerOf的传入参数为资产编号;资产所有人查询接口ownerOf的返回资产所有人的地址列表及对应所占资产份额;The relevant atomic operations of the indivisible assets include asset owner query, that is, designing the asset owner query interface ownerOf to query the owner of the corresponding asset; the incoming parameter of the asset owner query interface ownerOf is the asset number; the asset owner query interface ownerOf The address list of the returned asset owner and the corresponding asset share; 所述不可分割资产的相关原子操作包括资产检索,即设计资产检索接口tokenOfOwnerByIndex查询指定用户的所有资产信息;资产检索接口tokenOfOwnerByIndex的传入参数包括用户资产地址;资产检索接口tokenOfOwnerByIndex返回资产信息数组;The relevant atomic operations of the indivisible assets include asset retrieval, that is, design an asset retrieval interface tokenOfOwnerByIndex to query all asset information of a specified user; the incoming parameters of the asset retrieval interface tokenOfOwnerByIndex include user asset addresses; the asset retrieval interface tokenOfOwnerByIndex returns an array of asset information; 所述不可分割资产的相关原子操作包括资产信息获取,即设计资产信息获取接口infoByID查询资产的详细信息;资产信息获取接口infoByID的传入参数为资产编号,资产信息获取接口infoByID返回资产信息结构体;The relevant atomic operations of the indivisible assets include asset information acquisition, that is, designing the asset information acquisition interface infoByID to query the detailed information of the asset; the incoming parameter of the asset information acquisition interface infoByID is the asset number, and the asset information acquisition interface infoByID returns the asset information structure ; 所述不可分割资产的相关原子操作包括资产总量获取,即设计资产总量接口totalSupply获取当前链上资产总量;资产总量接口totalSupply返回链上资产总量;The relevant atomic operations of the indivisible assets include obtaining the total amount of assets, that is, designing the total amount of assets interface totalSupply to obtain the current total amount of assets on the chain; the total amount of assets interface totalSupply returns the total amount of assets on the chain; 所述不可分割资产的相关原子操作包括资产属性、符号、名称查询,即设计资产属性、符号、名称查询接口;所述资产属性、符号、名称查询接口返回资产编号的数组;The relevant atomic operations of the indivisible assets include asset attribute, symbol, and name query, that is, designing an asset attribute, symbol, and name query interface; the asset attribute, symbol, and name query interface returns an array of asset numbers; 所述不可分割资产的相关原子操作包括资产销毁,即设计资产销毁接口destroy销毁指定资产编号的资产;资产销毁接口destroy的传入参数为资产编号,资产销毁接口destroy返回区块链交易信息;The relevant atomic operations of the indivisible assets include asset destruction, that is, the asset destruction interface destroy is designed to destroy the asset with the specified asset number; the incoming parameter of the asset destruction interface destroy is the asset number, and the asset destruction interface destroy returns the block chain transaction information; 所述不可分割资产的相关原子操作包括资产属性更新,即设计资产属性更新接口,包括更新属性与源数据接口、仅更新源数据接口、仅更新属性接口;所述资产属性更新接口返回区块链交易信息。The relevant atomic operations of the indivisible assets include asset attribute update, that is, the design of asset attribute update interface, including update attribute and source data interface, only update source data interface, and only update attribute interface; the asset attribute update interface returns the block chain Trading Information.
CN202110762944.2A 2021-04-28 2021-07-06 A blockchain-based method for implementing smart contracts for indivisible assets Active CN113421094B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2021104644900 2021-04-28
CN202110464490 2021-04-28

Publications (2)

Publication Number Publication Date
CN113421094A CN113421094A (en) 2021-09-21
CN113421094B true CN113421094B (en) 2023-05-09

Family

ID=77720320

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110762944.2A Active CN113421094B (en) 2021-04-28 2021-07-06 A blockchain-based method for implementing smart contracts for indivisible assets

Country Status (1)

Country Link
CN (1) CN113421094B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113987538B (en) * 2021-10-29 2023-06-27 上海对外经贸大学 Device based on block chain decomposition and combination NFT

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106022741A (en) * 2016-05-19 2016-10-12 北京太云科技有限公司 Indivisible digital asset transfer method based on block chain
CN106850190A (en) * 2017-02-14 2017-06-13 北京乐酷达网络科技有限公司 It is a kind of to the destroying method based on block chain digital certificate
CN112035875A (en) * 2020-08-28 2020-12-04 江苏恒为信息科技有限公司 Method for realizing native non-homogeneous assets

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
PH12021552432A1 (en) * 2017-10-31 2022-07-18 Americorp Invest Llc Distributed multi-ledger gambling architecture
CN110288357A (en) * 2019-03-25 2019-09-27 上海分布信息科技有限公司 A kind of source tracing method based on Data token
TWI716236B (en) * 2019-12-24 2021-01-11 天宿智能科技股份有限公司 Electronic receipt/invoice confirming and escrow system based on blockchain and method thereof
CN111105236A (en) * 2020-01-06 2020-05-05 江苏恒为信息科技有限公司 Realization algorithm of non-homogeneity evidence
CN111130808B (en) * 2020-03-26 2021-02-02 杭州智块网络科技有限公司 Cross-chain asset mapping method and system for block chain
CN112308553A (en) * 2020-09-16 2021-02-02 电子科技大学 Digital asset classification management method based on block chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106022741A (en) * 2016-05-19 2016-10-12 北京太云科技有限公司 Indivisible digital asset transfer method based on block chain
CN106850190A (en) * 2017-02-14 2017-06-13 北京乐酷达网络科技有限公司 It is a kind of to the destroying method based on block chain digital certificate
CN112035875A (en) * 2020-08-28 2020-12-04 江苏恒为信息科技有限公司 Method for realizing native non-homogeneous assets

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
吕坤 ; 鲍可进 ; .基于区块链的数字资产交易系统设计与实现.软件导刊.2018,(第07期),第213-217页. *
高泽龙 等."非同质化代币的应用原理及身份识别场景解析".《网络空间安全》.2021,第12卷(第Z1期),第63-66页. *

Also Published As

Publication number Publication date
CN113421094A (en) 2021-09-21

Similar Documents

Publication Publication Date Title
WO2020233048A1 (en) Customized software generation method and system, and electronic device and storage medium
CN102609813B (en) based on the master data management architecture of cloud
JP5162094B2 (en) Method and apparatus for metadata-driven business logic processing
US10740808B2 (en) Beacon network with enterprise smart contracts having a centralized ledger
US8656354B2 (en) Compound versioning and identification scheme for composite application development
CN101802815A (en) data-driven synchronization
Bussler The role of Semantic Web technology in enterprise application integration.
US20200004530A1 (en) Melding of mediation flow service component architecture (sca) components
CN113421094B (en) A blockchain-based method for implementing smart contracts for indivisible assets
CN118796182A (en) A business arrangement method, device, equipment, medium and product
Abbas et al. A Model-Driven Framework for Security Labs using Blockchain Methodology.
CN101213572B (en) Using messages to extend CRM functionality
CN111277983A (en) A kind of RFID middleware, publish and subscribe system and data transmission method
CN112308539B (en) Communication service opening method and server
CN115437704A (en) Business process orchestration method, device, device and storage medium
CN108153564B (en) Interface management method, device and system and computer readable storage medium
CN114444478A (en) A credential visualization method, device, electronic device and storage medium
CN103678687A (en) Project establishment method and device based on configuration system
US20020059390A1 (en) Integration messaging system
CN113467760B (en) Method for creating order model the device storage medium and computer device
CN100470470C (en) Method and system for integrating applications into templateable solutions
CN116128621A (en) Product model generation method, generation device, processor and banking system
CN115033853A (en) Function access authority control method and device based on intelligent contract
Bhat et al. Network service orchestration in heterogeneous 5G networks using an open marketplace
CN106447279A (en) Electronic bill online generation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant