CN116226277A - NFT resource transfer method and block chain link point - Google Patents

NFT resource transfer method and block chain link point Download PDF

Info

Publication number
CN116226277A
CN116226277A CN202211738659.8A CN202211738659A CN116226277A CN 116226277 A CN116226277 A CN 116226277A CN 202211738659 A CN202211738659 A CN 202211738659A CN 116226277 A CN116226277 A CN 116226277A
Authority
CN
China
Prior art keywords
account
nft
resource
transaction
information corresponding
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.)
Pending
Application number
CN202211738659.8A
Other languages
Chinese (zh)
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.)
Whale Exploration Technology Shanghai Co ltd
Original Assignee
Ant Blockchain Technology Shanghai 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 Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Priority to CN202211738659.8A priority Critical patent/CN116226277A/en
Publication of CN116226277A publication Critical patent/CN116226277A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Finance (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Accounting & Taxation (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

An NFT resource transfer method and blockchain node, the method comprising: receiving a first transaction, wherein the first transaction is used for transferring the NFT resources of a first account to a second account, and account information corresponding to the first account stored in a blockchain comprises resource identifiers of the NFT resources; and deleting the resource identifier of the NFT resource in the account information corresponding to the first account according to the first transaction, and adding the resource identifier of the NFT resource in the account information corresponding to the second account stored in the blockchain.

Description

一种NFT资源转移方法和区块链节点A NFT resource transfer method and blockchain nodes

技术领域technical field

本说明书实施例属于区块链技术领域,尤其涉及一种NFT资源转移方法和区块链节点。The embodiment of this description belongs to the technical field of blockchain, and in particular relates to a NFT resource transfer method and blockchain nodes.

背景技术Background technique

区块链(Blockchain)是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链系统中按照时间顺序将数据区块以顺序相连的方式组合成链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。由于区块链具有去中心化、信息不可篡改、自治性等特性,区块链也受到人们越来越多的重视和应用。Blockchain is a new application model of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. In the blockchain system, the data blocks are combined into a chained data structure in a sequentially connected manner in chronological order, and a non-tamperable and unforgeable distributed ledger is cryptographically guaranteed. Due to the characteristics of decentralization, non-tamperable information, and autonomy, the blockchain has also received more and more attention and application.

在区块链中可以基于非同质化通证(Non-Fungible Tokens,NFT)技术生成数字资源,该数字资源通常具有不可替换性、限量性、不可分割等特征。不同的区块链可以使用不同的NFT协议标准来生成数字资源。当前主流的协议标准包括ERC721、ERC1155和ERC998等。其中,ERC721为最常用的NFT协议标准,在ERC721标准下,生成的每个数字资源都具有唯一标识,不同的数字资源相互之间不可替换。在上述协议标准中,通常将NFT资源的归属账户记录在合约状态中。In the blockchain, digital resources can be generated based on Non-Fungible Tokens (NFT) technology, which are usually irreplaceable, limited, and indivisible. Different blockchains can use different NFT protocol standards to generate digital resources. The current mainstream protocol standards include ERC721, ERC1155, and ERC998. Among them, ERC721 is the most commonly used NFT protocol standard. Under the ERC721 standard, each digital resource generated has a unique identifier, and different digital resources are irreplaceable with each other. In the above protocol standards, the attribution account of NFT resources is usually recorded in the contract state.

发明内容Contents of the invention

本发明的目的在于提供一种NFT资源转移的方案,提高了NFT资源的转移效率。The purpose of the present invention is to provide a solution for transferring NFT resources, which improves the transfer efficiency of NFT resources.

本说明书第一方面提供一种NFT资源转移方法,由区块链节点执行,包括:The first aspect of this specification provides a method for transferring NFT resources, which is executed by blockchain nodes, including:

接收第一交易,所述第一交易用于将第一账户的NFT资源转移给第二账户,所述区块链中存储的所述第一账户对应的账户信息中包括所述NFT资源的资源标识;Receive a first transaction, the first transaction is used to transfer the NFT resources of the first account to the second account, and the account information corresponding to the first account stored in the blockchain includes the resources of the NFT resources logo;

根据所述第一交易,在所述第一账户对应的账户信息中删除所述NFT资源的资源标识,在所述区块链中存储的所述第二账户对应的账户信息中添加所述NFT资源的资源标识。According to the first transaction, delete the resource identifier of the NFT resource in the account information corresponding to the first account, and add the NFT in the account information corresponding to the second account stored in the blockchain The resource ID of the resource.

在一种实施方式中,所述第一账户对应的账户信息包括所述第一账户关联的第一NFT账户的账户地址,所述在所述第一账户对应的账户信息中删除所述NFT资源的资源标识包括:根据所述第一NFT账户的账户地址,在所述第一NFT账户的账户信息中删除所述NFT资源的资源标识。In one embodiment, the account information corresponding to the first account includes the account address of the first NFT account associated with the first account, and the deletion of the NFT resource in the account information corresponding to the first account The resource identification includes: deleting the resource identification of the NFT resource in the account information of the first NFT account according to the account address of the first NFT account.

在一种实施方式中,所述第二账户对应的账户信息包括所述第二账户关联的第二NFT账户的账户地址,所述第一交易中包括所述第一NFT账户的账户地址和所述第二NFT账户的账户地址。In one embodiment, the account information corresponding to the second account includes the account address of the second NFT account associated with the second account, and the first transaction includes the account address of the first NFT account and the account address of the first NFT account. The account address of the second NFT account.

在一种实施方式中,所述方法还包括:接收基于所述第一账户的私钥生成的所述第一交易的签名,基于所述第一账户的公钥对所述签名进行验证。In one embodiment, the method further includes: receiving a signature of the first transaction generated based on the private key of the first account, and verifying the signature based on the public key of the first account.

在一种实施方式中,所述方法还包括:获取所述第一交易所属区块对应的状态树的状态根哈希值,在所述第一账户对应的账户信息和所述第二账户对应的账户信息中分别更新状态树的状态根哈希值。In one embodiment, the method further includes: obtaining the state root hash value of the state tree corresponding to the block to which the first transaction belongs, and the account information corresponding to the first account is corresponding to the second account Update the state root hash value of the state tree in the account information of the state tree.

在一种实施方式中,所述方法还包括:In one embodiment, the method also includes:

接收第二交易,所述第二交易由所述第一账户发送,用于铸造所述NFT资源;receiving a second transaction sent by the first account for minting the NFT resource;

根据所述第二交易,生成所述NFT资源的资源标识,在所述第一账户对应的账户信息中添加所述NFT资源的资源标识。According to the second transaction, a resource identifier of the NFT resource is generated, and the resource identifier of the NFT resource is added to the account information corresponding to the first account.

在一种实施方式中,所述方法还包括:In one embodiment, the method also includes:

接收第三交易,所述第三交易用于查询所述第一账户拥有的NFT资源;receiving a third transaction, the third transaction is used to query the NFT resources owned by the first account;

根据所述第三交易,在所述第一账户对应的账户信息中获取所述第一账户拥有的NFT资源的资源标识,根据所述第一账户拥有的NFT资源的资源标识返回查询结果。According to the third transaction, the resource identifier of the NFT resource owned by the first account is obtained from the account information corresponding to the first account, and a query result is returned according to the resource identifier of the NFT resource owned by the first account.

本说明书第二方面提供一种区块链节点,包括:The second aspect of this specification provides a blockchain node, including:

接收单元,用于接收第一交易,所述第一交易用于将第一账户的NFT资源转移给第二账户,所述区块链中存储的所述第一账户对应的账户信息中包括所述NFT资源的资源标识;A receiving unit, configured to receive a first transaction, the first transaction is used to transfer the NFT resources of the first account to the second account, and the account information corresponding to the first account stored in the blockchain includes the The resource identifier of the NFT resource;

转移单元,用于根据所述第一交易,在所述第一账户对应的账户信息中删除所述NFT资源的资源标识,在所述区块链中存储的所述第二账户对应的账户信息中添加所述NFT资源的资源标识。A transfer unit, configured to delete the resource identifier of the NFT resource in the account information corresponding to the first account according to the first transaction, and delete the account information corresponding to the second account stored in the blockchain Add the resource identifier of the NFT resource in .

本说明书第三方面提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行第一方面所述的方法。A third aspect of the present specification provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed in a computer, the computer is instructed to execute the method described in the first aspect.

本说明书第四方面提供一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现第一方面所述的方法。A fourth aspect of the specification provides a computing device, including a memory and a processor, where executable codes are stored in the memory, and when the processor executes the executable codes, the method described in the first aspect is implemented.

在本说明书实施例中,提出一种新的账户模式,外部账户中包含NFT资源信息,从而可以直接在外部账户之间进行NFT资源的转移,有效的减少了合约之间的交互,也降低了交易的成本,提高了对NFT资源的查询效率。In the embodiment of this specification, a new account model is proposed. The external account contains NFT resource information, so that the NFT resource can be transferred directly between external accounts, which effectively reduces the interaction between contracts and reduces the The cost of the transaction improves the query efficiency of NFT resources.

附图说明Description of drawings

为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments recorded in this specification. , for those skilled in the art, other drawings can also be obtained according to these drawings without paying creative labor.

图1示出了一实施例中的区块链架构图;Fig. 1 shows a blockchain architecture diagram in an embodiment;

图2为本说明书实施例中的NFT资源转移方法的流程图;Fig. 2 is a flow chart of the NFT resource transfer method in the embodiment of this specification;

图3为本说明书实施例中的账户的账户信息的示意图;FIG. 3 is a schematic diagram of account information of an account in an embodiment of this specification;

图4为本说明书实施例中的查询账户对应的NFT资源的方法流程图;FIG. 4 is a flowchart of a method for querying NFT resources corresponding to an account in an embodiment of this specification;

图5为本说明书实施例中的一种区块链节点的架构图。Fig. 5 is an architecture diagram of a block chain node in the embodiment of this specification.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described The embodiments are only some of the embodiments in this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the protection scope of this specification.

图1示出了一实施例中的区块链架构图。在图1所示的区块链架构图中,区块链中例如包含节点1-节点6共6个节点。节点之间的连线示意性的表示P2P(Peer to Peer,点对点)连接。这些节点上可存储全量的账本,即存储全部区块和全部账户的状态。其中,区块链中的每个节点可通过执行相同的交易而产生区块链中的相同的状态,区块链中的每个节点可存储相同的状态数据库。可以理解,图1中虽然示出了区块链中包括6个节点,本说明书实施例不限于此,而是可以包括其他数目的节点。具体是,区块链中包含的节点可以满足拜占庭容错(Byzantine Fault Tolerance,BFT)要求。所述的拜占庭容错要求可以理解为在区块链内部可以存在拜占庭节点,而区块链对外不体现拜占庭行为。一般的,一些拜占庭容错算法中要求节点个数大于3f+1,f为拜占庭节点个数,例如实用拜占庭容错算法PBFT(Practical Byzantine Fault Tolerance)。Fig. 1 shows a block chain architecture diagram in an embodiment. In the blockchain architecture diagram shown in FIG. 1 , the blockchain includes, for example, 6 nodes from node 1 to node 6 . The connection between the nodes schematically represents a P2P (Peer to Peer, point-to-point) connection. These nodes can store a full amount of books, that is, store the status of all blocks and all accounts. Wherein, each node in the blockchain can generate the same state in the blockchain by executing the same transaction, and each node in the blockchain can store the same state database. It can be understood that although it is shown in FIG. 1 that the block chain includes 6 nodes, this embodiment of the specification is not limited thereto, but may include other numbers of nodes. Specifically, the nodes included in the blockchain can meet Byzantine Fault Tolerance (BFT) requirements. The Byzantine fault tolerance requirement can be understood as that there may be Byzantine nodes inside the blockchain, but the blockchain does not reflect Byzantine behavior externally. Generally, some Byzantine fault-tolerant algorithms require the number of nodes to be greater than 3f+1, where f is the number of Byzantine nodes, such as the practical Byzantine fault-tolerant algorithm PBFT (Practical Byzantine Fault Tolerance).

区块链领域中的交易可以指在区块链中执行并记录在区块链中的任务单元。交易中通常包括发送字段(From)、接收字段(To)和数据字段(Data)。其中,在交易为转账交易的情况中,From字段表示发起该交易(即发起对另一个账户的转账任务)的账户地址,To字段表示接收该交易(即接收转账)的账户地址,Data字段中包括转账金额。在交易调用区块链中的智能合约的情况中,From字段表示发起该交易的账户地址,To字段表示交易所调用的合约的账户地址,Data字段中包括调用合约中的函数名、及对该函数的传入参数等数据,以用于在交易执行时从区块链中获取该函数的代码并执行该函数的代码。A transaction in the blockchain field may refer to a unit of tasks performed and recorded in the blockchain. A transaction usually includes a sending field (From), a receiving field (To) and a data field (Data). Among them, when the transaction is a transfer transaction, the From field indicates the account address that initiated the transaction (that is, initiates a transfer task to another account), the To field indicates the account address that received the transaction (that is, received the transfer), and the Data field Include the transfer amount. In the case of a transaction calling a smart contract in the blockchain, the From field indicates the account address that initiated the transaction, the To field indicates the account address of the contract called by the transaction, and the Data field includes the function name in the calling contract, and the Data such as the incoming parameters of the function are used to obtain the code of the function from the blockchain and execute the code of the function when the transaction is executed.

区块链中可提供智能合约的功能。区块链上的智能合约是在区块链系统上可以被交易触发执行的合约。智能合约可以通过代码的形式定义。在区块链中调用智能合约,是发起一笔指向智能合约地址的交易,使得区块链中每个节点分布式地运行智能合约代码。需要说明的是,除了可以由用户创建智能合约,也可以在创世块中由系统设置智能合约。这类合约一般称为创世合约。一般的,创世合约中可以设置一些区块链的数据结构、参数、属性和方法。此外,具有系统管理员权限的账户可以创建系统级的合约,或者修改系统级的合约(简称为系统合约)。其中,所述系统合约可用于在区块链中增加不同业务的数据的数据结构。The function of smart contracts can be provided in the blockchain. Smart contracts on the blockchain are contracts that can be triggered by transactions on the blockchain system. Smart contracts can be defined in the form of code. Invoking a smart contract in the blockchain is to initiate a transaction pointing to the address of the smart contract, so that each node in the blockchain runs the smart contract code in a distributed manner. It should be noted that in addition to creating smart contracts by users, smart contracts can also be set by the system in the genesis block. This type of contract is generally called a genesis contract. Generally, some blockchain data structures, parameters, attributes and methods can be set in the genesis contract. In addition, accounts with system administrator privileges can create system-level contracts or modify system-level contracts (referred to as system contracts). Wherein, the system contract can be used to add data structures of different business data in the blockchain.

在部署合约的场景中,例如,Bob将一个包含创建智能合约信息(即部署合约)的交易发送到如图1所示的区块链中,该交易的data字段包括待创建的合约的代码(如字节码或者机器码),交易的to字段为空,以表示该交易用于部署合约。节点间通过共识机制达成一致后,确定合约的合约地址“0x6f8ae93…”,各个节点在状态数据库中添加与该智能合约的合约地址对应的合约账户,分配与该合约账户对应的状态存储,并将合约代码保存在该合约的状态存储中,从而合约创建成功。In the scenario of deploying a contract, for example, Bob sends a transaction containing information about creating a smart contract (that is, deploying a contract) to the blockchain shown in Figure 1, and the data field of the transaction includes the code of the contract to be created ( Such as bytecode or machine code), the to field of the transaction is empty to indicate that the transaction is used to deploy the contract. After the nodes reach an agreement through the consensus mechanism, determine the contract address "0x6f8ae93...", each node adds the contract account corresponding to the contract address of the smart contract in the state database, allocates the state storage corresponding to the contract account, and The contract code is saved in the state storage of the contract, so the contract is created successfully.

在调用合约的场景中,例如,Bob将一个用于调用智能合约的交易发送到如图1所示的区块链中,该交易的from字段是交易发起方(即Bob)的账户的地址,to字段中的“0x6f8ae93…”代表了被调用的智能合约的地址,交易的data字段包括调用智能合约的方法和参数。在区块链中对该交易进行共识之后,区块链中的各个节点可分别执行该交易,从而分别执行该合约,基于该合约的执行更新状态数据库。In the scenario of calling the contract, for example, Bob sends a transaction for calling the smart contract to the blockchain shown in Figure 1, the from field of the transaction is the address of the account of the transaction initiator (ie Bob), "0x6f8ae93..." in the to field represents the address of the called smart contract, and the data field of the transaction includes the method and parameters of calling the smart contract. After consensus is reached on the transaction in the blockchain, each node in the blockchain can respectively execute the transaction, thereby respectively executing the contract, and updating the state database based on the execution of the contract.

在区块链中部署的智能合约可以包括NFT智能合约,NFT智能合约可以是能实现NFT功能的、在区块链上的代码。举例来说,NFT功能可以包括铸币功能、转移功能、查询功能等等。这里,铸币功能可以用于在区块链中创建NFT资源,具体是,在区块链中NFT智能合约的合约状态中记载NFT资源的资源标识及属性。转移功能可用于将NFT资源从当前所有者转移给另一用户。查询功能可用于查询NFT资源的属性信息。Smart contracts deployed in the blockchain can include NFT smart contracts, and NFT smart contracts can be codes on the blockchain that can realize NFT functions. For example, NFT functions may include minting functions, transfer functions, query functions, and so on. Here, the minting function can be used to create NFT resources in the blockchain, specifically, the resource identification and attributes of the NFT resources are recorded in the contract state of the NFT smart contract in the blockchain. The transfer function can be used to transfer NFT resources from the current owner to another user. The query function can be used to query the attribute information of NFT resources.

在相关技术中,基于ERC1155协议进行对NFT资源的处理,ERC1155协议支持多种类型的通证,基于ERC1155协议的NFT合约在一次调用中可以转移多种资源在该相关技术中,在NFT合约的合约状态中存储有NFT资源的归属账户,当其他账户希望查询特定账户是否拥有该NFT资源时,需要通过调用该NFT合约查询NFT资源的归属账户是否为该特定账户,而当归属账户希望将NFT资源转移给其他账户时,需要通过调用该NFT合约进行NFT资源的转移,这种查询或者转移方式的效率低下,降低了区块链系统的交易执行效率。In related technologies, NFT resources are processed based on the ERC1155 protocol. The ERC1155 protocol supports multiple types of certificates. The NFT contract based on the ERC1155 protocol can transfer multiple resources in one call. In this related technology, in the NFT contract The attribution account of the NFT resource is stored in the contract state. When other accounts want to check whether a specific account owns the NFT resource, they need to call the NFT contract to check whether the attribution account of the NFT resource is the specific account. When resources are transferred to other accounts, it is necessary to transfer NFT resources by calling the NFT contract. This query or transfer method is inefficient and reduces the transaction execution efficiency of the blockchain system.

本说明书实施例提供一种NFT资源的转移方案,通过在外部账户对应的账户信息中包括该外部账户拥有的NFT资源的信息,从而可通过查询外部账户对应的信息来确定外部账户是否拥有NFT资源,并可直接在外部账户之间进行NFT资源的转移,有效提高了NFT资源的处理效率。The embodiment of this specification provides a transfer scheme of NFT resources. By including the information of the NFT resources owned by the external account in the account information corresponding to the external account, it can be determined whether the external account owns NFT resources by querying the information corresponding to the external account , and can directly transfer NFT resources between external accounts, effectively improving the processing efficiency of NFT resources.

图2为本说明书实施例中的NFT资源转移方法的流程图,该方法可由区块链中的任一节点执行,包括以下步骤S201和步骤S203。Fig. 2 is a flow chart of the NFT resource transfer method in the embodiment of this specification, which can be executed by any node in the blockchain, including the following steps S201 and S203.

首先,在步骤S201,区块链节点接收交易Tx1,交易Tx1用于将账户Account1的NFT资源转移给账户Account2。First, in step S201, the blockchain node receives transaction Tx1, which is used to transfer the NFT resource of account Account1 to account Account2.

假设账户Account1为用户A的账户,用户A可通过向区块链发送调用智能合约的交易,以铸造NFT资源,该交易的发送账户为Account1。区块链中的节点在接收该交易之后执行该交易,生成新铸造的NFT资源的资源标识(例如为tokenID1),基于本说明书实施例中的账户模式,在账户Account1对应的账户信息中添加该新铸造的NFT资源的资源标识,以指示账户Account1拥有该NFT资源。Assuming that account Account1 is the account of user A, user A can mint NFT resources by sending a transaction calling a smart contract to the blockchain, and the sending account of the transaction is Account1. After receiving the transaction, the nodes in the blockchain execute the transaction, generate the resource identifier (for example, tokenID1) of the newly minted NFT resource, and add this to the account information corresponding to the account Account1 based on the account mode in the embodiment of this specification. The resource identifier of the newly minted NFT resource to indicate that Account1 owns the NFT resource.

图3为本说明书实施例中的账户(例如Account1)的账户信息的示意图。其中,图3所示的账户信息存储于区块链中的每个节点中存储的状态数据库中,状态数据库中包括区块链中各个账户(包括外部账户和合约账户)的账户状态,这些账户的账户状态以状态树的形式存储。如图3所示,Account1为外部账户,即用户的账户。在Account1的状态信息中包括NFT资源信息。FIG. 3 is a schematic diagram of account information of an account (for example, Account1) in the embodiment of this specification. Among them, the account information shown in Figure 3 is stored in the state database stored in each node in the blockchain, and the state database includes the account status of each account (including external accounts and contract accounts) in the blockchain. These accounts The account state of is stored in the form of a state tree. As shown in FIG. 3 , Account1 is an external account, that is, the user's account. Include NFT resource information in the status information of Account1.

在一种实施方式中,图3所示的NFT资源信息包括通过虚线指示的账户Account1拥有的NFT资源的相关信息,例如包括一个或多个NFT资源的资源标识(例如tokenId1等)。对应于该实施方式,交易Tx1可以为NFT资源转移交易,其中交易Tx1中的from字段为账户Account1,to字段为账户Account2,data字段例如包括一个或多个待转移的NFT资源的资源标识(例如tokenId),以用于将NFT资源从账户Account1转移到账户Account2。交易Tx1中还可以包括用于指示tokenId为NFT资源的资源标识的指示信息。该交易Tx1例如可由账户Account1对应的用户设备发送给区块链中的任一节点,使得在区块链广播该交易Tx1,从而区块链中的各个节点都可以接收到该交易,该用户设备同时还将对交易Tx1的签名发送给区块链中的任一节点,该签名可通过使用账户Account1的私钥对交易Tx1的交易体进行签名而生成。In one embodiment, the NFT resource information shown in FIG. 3 includes information about NFT resources owned by the account Account1 indicated by the dotted line, for example, resource identifiers (such as tokenId1 ) of one or more NFT resources. Corresponding to this embodiment, the transaction Tx1 may be an NFT resource transfer transaction, where the from field in the transaction Tx1 is account Account1, the to field is account Account2, and the data field includes, for example, resource identifiers of one or more NFT resources to be transferred (for example tokenId) to transfer NFT resources from Account1 to Account2. The transaction Tx1 may also include indication information for indicating that the tokenId is the resource identifier of the NFT resource. For example, the transaction Tx1 can be sent by the user equipment corresponding to the account Account1 to any node in the blockchain, so that the transaction Tx1 can be broadcast on the blockchain, so that each node in the blockchain can receive the transaction, and the user equipment At the same time, the signature of the transaction Tx1 will be sent to any node in the blockchain. The signature can be generated by signing the transaction body of the transaction Tx1 with the private key of the account Account1.

在另一种实施方式中,NFT资源信息例如为账户Account1对应的NFT账户的账户地址,例如nft_address1。同时,在状态数据库中存储有与地址nft_address1对应的状态数据,其中,与地址nft_address1对应的状态数据例如包括图3中通过虚线指示的与NFT资源信息对应的表格信息。类似地,账户Account2的账户信息中可包括账户Account2对应的NFT账户的账户地址nft_address2。In another embodiment, the NFT resource information is, for example, the account address of the NFT account corresponding to the account Account1, such as nft_address1. Meanwhile, state data corresponding to the address nft_address1 is stored in the state database, wherein the state data corresponding to the address nft_address1 includes, for example, table information corresponding to NFT resource information indicated by a dotted line in FIG. 3 . Similarly, the account information of the account Account2 may include the account address nft_address2 of the NFT account corresponding to the account Account2.

对应于该实施方式,交易Tx1中的from字段为账户Account1,to字段为账户Account2,data字段例如包括NFT资源的资源标识(例如tokenId),以用于将该NFT资源从账户Account1的NFT账户转移到账户Account2的NFT账户。在一种实施方式中,交易Tx1中还可以包括账户Account1的NFT账户的账户地址nft_address1和账户Account2的NFT账户的账户地址nft_address2,以指示将该NFT资源从账户Account1的NFT账户nft_address1转移到账户Account2的NFT账户nft_address2。Corresponding to this embodiment, the from field in the transaction Tx1 is account Account1, the to field is account Account2, and the data field includes, for example, the resource identifier (such as tokenId) of the NFT resource, which is used to transfer the NFT resource from the NFT account of Account1 To the NFT account of account Account2. In one embodiment, the transaction Tx1 may also include the account address nft_address1 of the NFT account of Account1 and the account address nft_address2 of the NFT account of Account2, to indicate the transfer of the NFT resource from the NFT account nft_address1 of Account1 to Account2 NFT account nft_address2.

在一种实施方式中,如图3所示,账户Account1的账户信息中还可以包括与账户Account1当前的状态信息对应的状态根哈希值,以用于对账户Account1对应的账户信息进行验证,其中账户Account1对应的账户信息包括与NFT资源信息对应的表格内容。In one embodiment, as shown in FIG. 3 , the account information of the account Account1 may also include a state root hash value corresponding to the current state information of the account Account1, so as to verify the account information corresponding to the account Account1, The account information corresponding to the account Account1 includes the table content corresponding to the NFT resource information.

在步骤S203,区块链节点根据交易Tx1,在账户Account1对应的账户信息中删除NFT资源的资源标识,在账户Account2对应的账户信息中添加NFT资源的资源标识。In step S203, the blockchain node deletes the resource identifier of the NFT resource in the account information corresponding to Account1 according to the transaction Tx1, and adds the resource identifier of the NFT resource in the account information corresponding to Account2.

区块链中的各个节点在接收到交易Tx1之后,可使用账户Account1的公钥对交易Tx1的签名进行验证,在验证通过之后,可进行对交易Tx1的共识。区块链中的各个节点在对交易Tx1的共识通过之后,执行交易Tx1,得到交易Tx1的执行结果。该交易Tx1的执行结果用于指示在账户Account1对应的账户信息中删除NFT资源的资源标识,在账户Account2对应的账户信息中添加NFT资源的资源标识。之后,区块链节点可根据交易Tx1的执行结果更新状态数据库,即在账户Account1对应的账户信息中删除NFT资源的资源标识,在账户Account2对应的账户信息中添加NFT资源的资源标识。After each node in the blockchain receives the transaction Tx1, it can use the public key of the account Account1 to verify the signature of the transaction Tx1. After the verification is passed, a consensus on the transaction Tx1 can be carried out. Each node in the blockchain executes the transaction Tx1 after the consensus on the transaction Tx1 is passed, and obtains the execution result of the transaction Tx1. The execution result of the transaction Tx1 is used to instruct to delete the resource identifier of the NFT resource in the account information corresponding to the account Account1, and to add the resource identifier of the NFT resource in the account information corresponding to the account Account2. Afterwards, the blockchain node can update the state database according to the execution result of the transaction Tx1, that is, delete the resource identifier of the NFT resource in the account information corresponding to Account1, and add the resource identifier of the NFT resource in the account information corresponding to Account2.

具体是,在账户Account1的账户信息中包括NFT资源标识列表的情况中,假设待转移的NFT资源的资源标识为tonkeID1,区块链节点可直接将账户Account1的NFT资源标识列表中的资源标识tokenID1删除,在账户Account2的NFT资源标识列表中添加资源标识tokenID1,以实现将与tonkeID1对应的NFT资源从账户Account1转移到账户Account2。Specifically, in the case where the account information of Account1 includes a list of NFT resource identifiers, assuming that the resource identifier of the NFT resource to be transferred is tonkeID1, the blockchain node can directly assign the resource identifier tokenID1 in the NFT resource identifier list of Account1 Delete, add the resource identifier tokenID1 in the NFT resource identifier list of account Account2, so as to transfer the NFT resource corresponding to toneID1 from Account1 to Account2.

在账户Account1的账户信息中包括其关联的NFT账户的账户地址nft_address1、账户Account2的账户信息中包括其关联的NFT账户的账户地址nft_address2的情况中,区块链节点可通过地址nft_address1读取该地址对应的NFT资源标识列表,在该NFT资源标识列表中删除NFT资源标识tokenID1,通过地址nft_address2读取该地址对应的NFT资源标识列表,在该NFT资源标识列表中添加NFT资源标识tokenID1,以实现将与tonkeID1对应的NFT资源从账户Account1转移到账户Account2。In the case where the account information of account Account1 includes the account address nft_address1 of its associated NFT account, and the account information of account Account2 includes the account address nft_address2 of its associated NFT account, the blockchain node can read the address through address nft_address1 The corresponding NFT resource identifier list, delete the NFT resource identifier tokenID1 in the NFT resource identifier list, read the NFT resource identifier list corresponding to the address through the address nft_address2, and add the NFT resource identifier tokenID1 in the NFT resource identifier list to realize the The NFT resource corresponding to tonkeID1 is transferred from account Account1 to account Account2.

在本说明书实施例中,提出一种新的账户模式,外部账户中包含NFT资源信息,从而可以直接在外部账户之间进行NFT资源的转移,有效的减少了合约之间的交互,也降低了交易的成本。In the embodiment of this specification, a new account model is proposed. The external account contains NFT resource information, so that the NFT resource can be transferred directly between external accounts, which effectively reduces the interaction between contracts and reduces the the cost of the transaction.

图4为本说明书实施例中的查询账户对应的NFT资源的方法流程图。该方法由区块链中的任一节点执行。Fig. 4 is a flowchart of a method for querying an NFT resource corresponding to an account in an embodiment of this specification. This method is executed by any node in the blockchain.

如图4所示,首先在步骤S401,区块链节点接收交易Tx2,交易Tx2用于查询账户Account1拥有的NFT资源。As shown in Figure 4, first in step S401, the blockchain node receives transaction Tx2, which is used to query the NFT resources owned by account Account1.

假设账户Account1为用户A的账户,账户Account2为用户B的账户,用户B在购买用户A拥有的NFT资源之前,可以首先查询用户B是否拥有该NFT资源。用户B可向区块链中的任一节点(例如节点1)发送交易Tx2,交易Tx2的发送账户为账户Account2,接收账户可以为节点1对应的账户。Assuming that account Account1 is the account of user A, and account Account2 is the account of user B, user B can first inquire whether user B owns the NFT resource before purchasing the NFT resource owned by user A. User B can send transaction Tx2 to any node in the blockchain (for example, node 1). The sending account of transaction Tx2 is account Account2, and the receiving account can be the account corresponding to node 1.

在一种实施方式中,交易Tx2可包括账户Account1和指示信息,该指示信息用于指示查询账户Account1拥有的全部NFT资源。In one embodiment, the transaction Tx2 may include the account Account1 and indication information, and the indication information is used to indicate the query of all NFT resources owned by the account Account1.

在另一种实施方式中,交易Tx2可包括账户Account1、待查询的NFT资源的资源标识(例如tokenID1),以用于查询账户Account1是否拥有特定NFT资源(tokenID1)。In another embodiment, the transaction Tx2 may include the account Account1 and the resource identifier (for example, tokenID1) of the NFT resource to be queried, so as to query whether the account Account1 owns a specific NFT resource (tokenID1).

在步骤S405,区块链节点根据交易Tx2,在账户Account1对应的账户信息中获取账户Account1拥有的NFT资源的标识,根据账户Account1拥有的NFT资源的标识返回查询结果。In step S405, the blockchain node obtains the identifier of the NFT resource owned by the account Account1 from the account information corresponding to the account Account1 according to the transaction Tx2, and returns the query result according to the identifier of the NFT resource owned by the account Account1.

节点1在接收到交易Tx2之后,在确定交易Tx2为查询交易之后,可直接获取查询结果返回给用户B的设备,而不需要将交易Tx2广播到区块链中。具体是,节点1可从状态数据库中查询账户Account1对应的账户信息,该账户信息例如如图3所示包括Account1拥有的NFT资源的资源列表。在交易Tx2用于查询账户Account1拥有的全部NFT资源的情况下,节点1可将Account1拥有的NFT资源的资源列表返回给用户B的设备。在交易Tx2用于查询Account1是否拥有的tokenID1对应的NFT资源的情况下,节点1可根据Account1拥有的NFT资源的资源列表确定该资源列表中是否包括tokneID1,如果包括,则向用户B的设备返回Account1拥有的tokenID1对应的NFT资源,否则则向用户B的设备返回Account1不拥有的tokenID1对应的NFT资源。After node 1 receives transaction Tx2 and determines that transaction Tx2 is a query transaction, it can directly obtain the query result and return it to user B's device without broadcasting transaction Tx2 to the blockchain. Specifically, node 1 may query the account information corresponding to account Account1 from the state database. The account information includes, for example, a resource list of NFT resources owned by Account1 as shown in FIG. 3 . In the case that transaction Tx2 is used to query all NFT resources owned by account Account1, node 1 can return the resource list of NFT resources owned by Account1 to user B's device. In the case that transaction Tx2 is used to query whether Account1 owns the NFT resource corresponding to tokenID1, node 1 can determine whether tokenID1 is included in the resource list according to the resource list of the NFT resource owned by Account1, and if so, return it to user B’s device The NFT resource corresponding to tokenID1 owned by Account1, otherwise, the NFT resource corresponding to tokenID1 not owned by Account1 is returned to user B's device.

在该说明书实施例中,当其他账户希望查询特定账户拥有的NFT资源的信息时,可以直接基于特定账户的地址获取该特定账户对应的账户信息,并从该账户信息中获取该特定账户拥有的NFT资源的信息,而不需要通过调用NFT合约查询NFT资源的归属账户,提高了NFT资源的查询效率。In the embodiment of this specification, when other accounts want to query the information of NFT resources owned by a specific account, they can directly obtain the account information corresponding to the specific account based on the address of the specific account, and obtain the NFT resources owned by the specific account from the account information. The information of NFT resources does not need to call the NFT contract to query the attribution account of NFT resources, which improves the query efficiency of NFT resources.

图5为本说明书实施例中的一种区块链节点的架构图,所述区块链节点用于执行如图2或图4所示方法,所述区块链节点包括:Fig. 5 is an architecture diagram of a block chain node in the embodiment of this specification, the block chain node is used to execute the method shown in Fig. 2 or Fig. 4, and the block chain node includes:

接收单元51,用于接收第一交易,所述第一交易用于将第一账户的NFT资源转移给第二账户,所述区块链中存储的所述第一账户对应的账户信息中包括所述NFT资源的资源标识;The receiving unit 51 is configured to receive a first transaction, the first transaction is used to transfer the NFT resource of the first account to the second account, and the account information corresponding to the first account stored in the blockchain includes A resource identifier of the NFT resource;

转移单元52,用于根据所述第一交易,在所述第一账户对应的账户信息中删除所述NFT资源的资源标识,在所述区块链中存储的所述第二账户对应的账户信息中添加所述NFT资源的资源标识。The transfer unit 52 is configured to delete the resource identifier of the NFT resource in the account information corresponding to the first account according to the first transaction, and the account corresponding to the second account stored in the blockchain The resource identifier of the NFT resource is added to the information.

在一种实施方式中,所述第一账户对应的账户信息包括所述第一账户关联的第一NFT账户的账户地址,所述转移单元52具体用于:根据所述第一NFT账户的账户地址,在所述第一NFT账户的账户信息中删除所述NFT资源的资源标识。In one embodiment, the account information corresponding to the first account includes an account address of a first NFT account associated with the first account, and the transfer unit 52 is specifically configured to: according to the account address of the first NFT account Address, delete the resource identifier of the NFT resource in the account information of the first NFT account.

在一种实施方式中,所述第二账户对应的账户信息包括所述第二账户关联的第二NFT账户的账户地址,所述第一交易中包括所述第一NFT账户的账户地址和所述第二NFT账户的账户地址。In one embodiment, the account information corresponding to the second account includes the account address of the second NFT account associated with the second account, and the first transaction includes the account address of the first NFT account and the account address of the first NFT account. The account address of the second NFT account.

在一种实施方式中,所述接收单元51还用于:接收基于所述第一账户的私钥生成的所述第一交易的签名,基于所述第一账户的公钥对所述签名进行验证。In one embodiment, the receiving unit 51 is further configured to: receive the signature of the first transaction generated based on the private key of the first account, and perform the signature on the signature based on the public key of the first account. verify.

在一种实施方式中,所述区块链节点还包括:获取单元,用于获取所述第一交易所属区块对应的状态树的状态根哈希值,在所述第一账户对应的账户信息和所述第二账户对应的账户信息中分别更新状态树的状态根哈希值。In one embodiment, the blockchain node further includes: an acquisition unit, configured to acquire the state root hash value of the state tree corresponding to the block to which the first transaction belongs, and the account corresponding to the first account The state root hash value of the state tree is updated respectively in the information and the account information corresponding to the second account.

在一种实施方式中,所述接收单元51还用于:接收第二交易,所述第二交易由所述第一账户发送,用于铸造所述NFT资源;In one embodiment, the receiving unit 51 is further configured to: receive a second transaction, the second transaction is sent by the first account, and is used to mint the NFT resource;

所述区块链节点还包括:生成单元,用于根据所述第二交易,生成所述NFT资源的资源标识,在所述第一账户对应的账户信息中添加所述NFT资源的资源标识。The blockchain node further includes: a generating unit, configured to generate a resource identifier of the NFT resource according to the second transaction, and add the resource identifier of the NFT resource to the account information corresponding to the first account.

在一种实施方式中,所述接收单元还用于,接收第三交易,所述第三交易用于查询所述第一账户拥有的NFT资源;In one embodiment, the receiving unit is further configured to receive a third transaction, and the third transaction is used to query the NFT resources owned by the first account;

所述获取单元还用于,根据所述第三交易,在所述第一账户对应的账户信息中获取所述第一账户拥有的NFT资源的资源标识,根据所述第一账户拥有的NFT资源的资源标识返回查询结果。The acquiring unit is further configured to, according to the third transaction, acquire the resource identifier of the NFT resource owned by the first account from the account information corresponding to the first account, and according to the NFT resource owned by the first account The resource ID for returns query results.

本说明书实施例还提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行如图2和图4所示的方法。The embodiment of this specification also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed in a computer, the computer is made to execute the methods shown in FIG. 2 and FIG. 4 .

本说明书实施例还提供一种区块链节点,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现如图2和图4所示的方法。The embodiment of this specification also provides a block chain node, including a memory and a processor, the memory stores executable code, and when the processor executes the executable code, the implementation is shown in Figure 2 and Figure 4 Methods.

在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable GateArray,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware DescriptionLanguage)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(RubyHardware Description Language)等,目前最普遍使用的是VHDL(Very-High-SpeedIntegrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, the improvement of a technology can be clearly distinguished as an improvement in hardware (for example, improvements in circuit structures such as diodes, transistors, and switches) or improvements in software (improvement in method flow). However, with the development of technology, the improvement of many current method flows can be regarded as the direct improvement of the hardware circuit structure. Designers almost always get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (Programmable Logic Device, PLD) (such as a Field Programmable Gate Array (Field Programmable Gate Array, FPGA)) is such an integrated circuit, and its logic function is determined by programming the device by a user. It is programmed by the designer to "integrate" a digital system on a PLD, instead of asking a chip manufacturer to design and make a dedicated integrated circuit chip. Moreover, nowadays, instead of making integrated circuit chips by hand, this kind of programming is mostly realized by "logic compiler (logic compiler)" software, which is similar to the software compiler used when writing programs. The original code of the computer must also be written in a specific programming language, which is called a hardware description language (Hardware Description Language, HDL), and there is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language) , AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., currently the most commonly used is VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. It should also be clear to those skilled in the art that only a little logical programming of the method flow in the above-mentioned hardware description languages and programming into an integrated circuit can easily obtain a hardware circuit for realizing the logic method flow.

控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。The controller may be implemented in any suitable way, for example the controller may take the form of a microprocessor or processor and a computer readable medium storing computer readable program code (such as software or firmware) executable by the (micro)processor , logic gates, switches, Application Specific Integrated Circuit (ASIC), programmable logic controllers, and embedded microcontrollers, examples of controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic. Those skilled in the art also know that, in addition to realizing the controller in a purely computer-readable program code mode, it is entirely possible to make the controller use logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded The same function can be realized in the form of a microcontroller or the like. Therefore, such a controller can be regarded as a hardware component, and the devices included in it for realizing various functions can also be regarded as structures within the hardware component. Or even, means for realizing various functions can be regarded as a structure within both a software module realizing a method and a hardware component.

上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为服务器系统。当然,本申请不排除随着未来计算机技术的发展,实现上述实施例功能的计算机例如可以为个人计算机、膝上型计算机、车载人机交互设备、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The systems, devices, modules, or units described in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, the present application does not exclude that with the development of future computer technology, the computer that realizes the functions of the above embodiments can be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant , media players, navigation devices, email devices, game consoles, tablet computers, wearable devices, or any combination of these devices.

虽然本说明书一个或多个实施例提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的手段可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或终端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境,甚至为分布式数据处理环境)。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、产品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、产品或者设备所固有的要素。在没有更多限制的情况下,并不排除在包括所述要素的过程、方法、产品或者设备中还存在另外的相同或等同要素。例如若使用到第一,第二等词语用来表示名称,而并不表示任何特定的顺序。Although one or more embodiments of the present specification provide the operation steps of the method described in the embodiment or the flowchart, more or fewer operation steps may be included based on conventional or non-inventive means. The sequence of steps enumerated in the embodiments is only one of the execution sequences of many steps, and does not represent the only execution sequence. When an actual device or terminal product is executed, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (such as a parallel processor or multi-thread processing environment, or even a distributed data processing environment). The term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, product, or apparatus comprising a set of elements includes not only those elements, but also other elements not expressly listed elements, or also elements inherent in such a process, method, product, or apparatus. Without further limitations, it is not excluded that there are additional identical or equivalent elements in a process, method, product or device comprising said elements. For example, if the words first, second, etc. are used, they are used to indicate names and do not indicate any specific order.

为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书一个或多个时可以把各模块的功能在同一个或多个软件和/或硬件中实现,也可以将实现同一功能的模块由多个子模块或子单元的组合实现等。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。For the convenience of description, when describing the above devices, functions are divided into various modules and described separately. Of course, when implementing one or more of the present specification, the functions of each module can be realized in the same or more software and/or hardware, and the modules that realize the same function can also be realized by a combination of multiple submodules or subunits, etc. . The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated. to another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

本发明是参照根据本发明实施例的方法、装置(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram. These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.

在一个典型的配置中,计算设备包括一个或多个处理器、输入/输出接口、网络接口和内存。内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。In a typical configuration, a computing device includes one or more processors, input/output interfaces, network interfaces, and memory. Memory may include non-permanent storage in computer readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read only memory (ROM) or flash RAM. Memory is an example of computer readable media.

计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储、石墨烯存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information. Information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape disk storage, graphene storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by computing devices. As defined herein, computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.

本领域技术人员应明白,本说明书一个或多个实施例可提供为方法、系统或计算机程序产品。因此,本说明书一个或多个实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书一个或多个实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that one or more embodiments of this specification may be provided as a method, system or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description may employ a computer program embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. The form of the product.

本说明书一个或多个实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本说明书一个或多个实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。One or more embodiments of this specification may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the present description may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including storage devices.

本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本说明书的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。Each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for relevant parts, refer to part of the description of the method embodiment. In the description of this specification, descriptions referring to the terms "one embodiment", "some embodiments", "example", "specific examples", or "some examples" mean that specific features described in connection with the embodiment or example , structures, materials or features are included in at least one embodiment or example of this specification. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the described specific features, structures, materials or characteristics may be combined in any suitable manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine different embodiments or examples and features of different embodiments or examples described in this specification without conflicting with each other.

以上所述仅为本说明书一个或多个实施例的实施例而已,并不用于限制本说明书一个或多个实施例。对于本领域技术人员来说,本说明书一个或多个实施例可以有各种更改和变化。凡在本说明书的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在权利要求范围之内。The above description is only an example of one or more embodiments of this specification, and is not intended to limit one or more embodiments of this specification. For those skilled in the art, various modifications and changes may occur in one or more embodiments of this description. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this specification shall be included in the scope of the claims.

Claims (10)

1.一种NFT资源转移方法,由区块链节点执行,包括:1. A NFT resource transfer method, executed by blockchain nodes, including: 接收第一交易,所述第一交易用于将第一账户的NFT资源转移给第二账户,所述区块链中存储的所述第一账户对应的账户信息中包括所述NFT资源的资源标识;Receive a first transaction, the first transaction is used to transfer the NFT resources of the first account to the second account, and the account information corresponding to the first account stored in the blockchain includes the resources of the NFT resources logo; 根据所述第一交易,在所述第一账户对应的账户信息中删除所述NFT资源的资源标识,在所述区块链中存储的所述第二账户对应的账户信息中添加所述NFT资源的资源标识。According to the first transaction, delete the resource identifier of the NFT resource in the account information corresponding to the first account, and add the NFT in the account information corresponding to the second account stored in the blockchain The resource ID of the resource. 2.根据权利要求1所述的方法,所述第一账户对应的账户信息包括所述第一账户关联的第一NFT账户的账户地址,所述在所述第一账户对应的账户信息中删除所述NFT资源的资源标识包括:根据所述第一NFT账户的账户地址,在所述第一NFT账户的账户信息中删除所述NFT资源的资源标识。2. The method according to claim 1, wherein the account information corresponding to the first account includes the account address of the first NFT account associated with the first account, and the account information corresponding to the first account is deleted The resource identification of the NFT resource includes: deleting the resource identification of the NFT resource in the account information of the first NFT account according to the account address of the first NFT account. 3.根据权利要求2所述的方法,其中,所述第二账户对应的账户信息包括所述第二账户关联的第二NFT账户的账户地址,所述第一交易中包括所述第一NFT账户的账户地址和所述第二NFT账户的账户地址。3. The method according to claim 2, wherein the account information corresponding to the second account includes the account address of the second NFT account associated with the second account, and the first transaction includes the first NFT The account address of the account and the account address of the second NFT account. 4.根据权利要求1或2所述的方法,还包括:获取所述第一交易所属区块对应的状态树的状态根哈希值,在所述第一账户对应的账户信息和所述第二账户对应的账户信息中分别更新状态树的状态根哈希值。4. The method according to claim 1 or 2, further comprising: obtaining the hash value of the state root of the state tree corresponding to the block to which the first transaction belongs, the account information corresponding to the first account and the The state root hash value of the state tree is updated in the account information corresponding to the two accounts. 5.根据权利要求1或2所述的方法,还包括:5. The method of claim 1 or 2, further comprising: 接收第二交易,所述第二交易由所述第一账户发送,用于铸造所述NFT资源;receiving a second transaction sent by the first account for minting the NFT resource; 根据所述第二交易,生成所述NFT资源的资源标识,在所述第一账户对应的账户信息中添加所述NFT资源的资源标识。According to the second transaction, a resource identifier of the NFT resource is generated, and the resource identifier of the NFT resource is added to the account information corresponding to the first account. 6.根据权利要求1或2所述的方法,还包括:6. The method of claim 1 or 2, further comprising: 接收第三交易,所述第三交易用于查询所述第一账户拥有的NFT资源;receiving a third transaction, the third transaction is used to query the NFT resources owned by the first account; 根据所述第三交易,在所述第一账户对应的账户信息中获取所述第一账户拥有的NFT资源的资源标识,根据所述第一账户拥有的NFT资源的资源标识返回查询结果。According to the third transaction, the resource identifier of the NFT resource owned by the first account is obtained from the account information corresponding to the first account, and a query result is returned according to the resource identifier of the NFT resource owned by the first account. 7.一种区块链节点,包括:7. A blockchain node, comprising: 接收单元,用于接收第一交易,所述第一交易用于将第一账户的NFT资源转移给第二账户,所述区块链中存储的所述第一账户对应的账户信息中包括所述NFT资源的资源标识;A receiving unit, configured to receive a first transaction, the first transaction is used to transfer the NFT resources of the first account to the second account, and the account information corresponding to the first account stored in the blockchain includes the The resource identifier of the NFT resource; 转移单元,用于根据所述第一交易,在所述第一账户对应的账户信息中删除所述NFT资源的资源标识,在所述区块链中存储的所述第二账户对应的账户信息中添加所述NFT资源的资源标识。A transfer unit, configured to delete the resource identifier of the NFT resource in the account information corresponding to the first account according to the first transaction, and delete the account information corresponding to the second account stored in the blockchain Add the resource identifier of the NFT resource in . 8.根据权利要求7所述的区块链节点,所述第一账户对应的账户信息包括所述第一账户关联的第一NFT账户的账户地址,所述转移单元具体用于:根据所述第一NFT账户的账户地址,在所述第一NFT账户的账户信息中删除所述NFT资源的资源标识。8. The blockchain node according to claim 7, the account information corresponding to the first account includes the account address of the first NFT account associated with the first account, and the transfer unit is specifically configured to: according to the The account address of the first NFT account, and the resource identifier of the NFT resource is deleted in the account information of the first NFT account. 9.一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行权利要求1-6中任一项的所述的方法。9. A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed in a computer, it causes the computer to execute the method according to any one of claims 1-6. 10.一种区块链节点,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现权利要求1-6中任一项所述的方法。10. A block chain node, comprising a memory and a processor, wherein executable code is stored in the memory, and when the processor executes the executable code, the method described in any one of claims 1-6 is realized. method.
CN202211738659.8A 2022-12-30 2022-12-30 NFT resource transfer method and block chain link point Pending CN116226277A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211738659.8A CN116226277A (en) 2022-12-30 2022-12-30 NFT resource transfer method and block chain link point

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211738659.8A CN116226277A (en) 2022-12-30 2022-12-30 NFT resource transfer method and block chain link point

Publications (1)

Publication Number Publication Date
CN116226277A true CN116226277A (en) 2023-06-06

Family

ID=86576057

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211738659.8A Pending CN116226277A (en) 2022-12-30 2022-12-30 NFT resource transfer method and block chain link point

Country Status (1)

Country Link
CN (1) CN116226277A (en)

Similar Documents

Publication Publication Date Title
CN109669709B (en) Data migration method and data migration system for block chain upgrading
CN114827165B (en) Method and block link point for grouping multiple transactions
WO2024092932A1 (en) Transaction execution method and blockchain node
CN113888173B (en) Blockchain-based smart contract calling method, device and device
CN115150409B (en) Method for executing transaction in blockchain system, node and computer readable storage medium
CN114547203B (en) Methods for executing transactions, blockchain, master nodes and slave nodes
WO2023160083A1 (en) Method for executing transactions, blockchain, master node, and slave node
WO2025000878A1 (en) Transaction execution method, node, and blockchain system
WO2024198450A1 (en) Method for deploying contract in blockchain, and blockchain node
WO2025025436A1 (en) Data management method based on blockchain system, and blockchain node
CN116032756A (en) Method and blockchain node for updating configuration information of application program based on blockchain
WO2024244342A1 (en) Transaction processing method in blockchain, and blockchain node
CN117273924A (en) Transaction execution method and device and electronic equipment
CN114785800B (en) Cross-link communication method, device, storage medium and computing equipment
CN116226277A (en) NFT resource transfer method and block chain link point
WO2024066011A1 (en) Consensus node type conversion method and consensus node
CN115098483A (en) A pre-execution cache data cleaning method and blockchain node
CN115731040A (en) Block chain-based collection management method, block chain node and system
CN114782016A (en) Creditor data processing method and device based on intelligent contract and block chain system
CN115865365B (en) Block chain-based account dividing processing method, device and system
CN115114334B (en) Method and device for querying data in blockchain
CN115063238A (en) Method for processing digital resources based on blockchain and nodes of blockchain
CN115665164A (en) Transaction processing method and device in block chain system and block chain system
WO2025139351A1 (en) Calling of smart contract
CN115880071A (en) Method for processing digital resources and nodes of block chain

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20241101

Address after: Room 1140, 11th Floor, No. 447 Nanquan North Road, Pudong New Area Pilot Free Trade Zone, Shanghai, 200120

Applicant after: Whale Exploration Technology (Shanghai) Co.,Ltd.

Country or region after: China

Address before: Room 803, floor 8, No. 618 Wai Road, Huangpu District, Shanghai 200010

Applicant before: Ant blockchain Technology (Shanghai) Co.,Ltd.

Country or region before: China