Data processing method and device based on block chain and readable storage medium
By introducing multiple digital asset types into the blockchain network and performing asset type identification and pre-consumption quantity calculation, the problem that the blockchain network can only support a single digital asset type is solved, realizing the packaging and verification of multiple assets and expanding the application scenarios of the blockchain network.
Patent Information
- Application Number
- CN202410631071.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2025-11-21
AI Technical Summary
Existing blockchain networks can only support a single type of digital asset and cannot be adapted to multiple business scenarios, thus limiting the application scope of blockchain networks.
By introducing multiple digital asset types into the blockchain network, using asset type identifiers to distinguish and calculate the amount of pre-consumed assets, multi-asset pre-consumed transaction data is generated, enabling the packaging and verification of multiple assets.
This enriches the types of digital assets available on blockchain networks, enabling them to adapt to various business scenarios and expanding the application scope of blockchain networks.
Smart Images

Figure CN120996804A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of blockchains, and particularly relates to a data processing method and device based on a blockchain and a readable storage medium. BACKGROUND
[0002] The existing blockchain network can support a single digital asset type of digital assets on a blockchain, however, the single digital asset type cannot be adapted to some business scenarios (for example, a game scenario can only use a game helmet as a digital asset, but cannot use a game clothes as a digital asset), thereby limiting the business scenarios of the blockchain network. SUMMARY
[0003] The embodiments of the present application provide a data processing method and device based on a blockchain and a readable storage medium, which can enrich the digital asset types of the blockchain, thereby expanding the business scenarios of the blockchain network.
[0004] The embodiments of the present application provide a data processing method based on a blockchain, which is executed by a packaging node and includes the following steps.
[0005] Transaction verification is performed on N pieces of transaction data to be packaged into a proposed block, and a transaction verification result is obtained; the N pieces of transaction data are associated with asset type identifiers of K digital asset types; N is a positive integer, and K is an integer greater than 1;
[0006] If the transaction verification result indicates that the N pieces of transaction data are all verified successfully, asset consumption operations are performed on the N pieces of transaction data according to the asset type identifiers associated with the N pieces of transaction data, and K pieces of pre-consumed asset quantities corresponding to the K digital asset types are obtained;
[0007] According to the K pieces of pre-consumed asset quantities and the asset type identifiers corresponding to the K digital asset types, multi-asset pre-consumption transaction data corresponding to the proposed block is generated;
[0008] The proposed block carrying the multi-asset pre-consumption transaction data and the N pieces of transaction data is sent to a verification node; the verification node is used for performing asset verification on the K pieces of pre-consumed asset quantities in the multi-asset pre-consumption transaction data according to the N pieces of transaction data; and the verification node belongs to a blockchain network to which the packaging node belongs.
[0009] The embodiments of the present application provide a data processing device based on a blockchain, which runs on a packaging node and includes the following steps.
[0010] A transaction verification module is configured to perform transaction verification on N pieces of transaction data to be packaged into a proposed block, and obtain a transaction verification result; the N pieces of transaction data are associated with asset type identifiers of K digital asset types; N is a positive integer, and K is an integer greater than 1;
[0011] The pre-consumption operation module is configured to, if the transaction verification result indicates that the N pieces of transaction data are all verified successfully, perform asset consumption operation on the N pieces of transaction data according to the asset type identifiers associated with the N pieces of transaction data, to obtain K pieces of pre-consumed asset quantities corresponding to the K pieces of digital asset types respectively;
[0012] The transaction generation module is configured to generate multi-asset pre-consumption transaction data corresponding to the proposed block according to the K pieces of pre-consumed asset quantities and the asset type identifiers corresponding to the K pieces of digital asset types.
[0013] The block sending module is configured to send the proposed block carrying the multi-asset pre-consumption transaction data and the N pieces of transaction data to a verification node; the verification node is configured to perform asset verification on the K pieces of pre-consumed asset quantities in the multi-asset pre-consumption transaction data according to the N pieces of transaction data; and the verification node belongs to a blockchain network to which the packaging node belongs.
[0014] The N pieces of transaction data include target transaction data, the target transaction data includes target input data and target output data, the target input data includes a target input script and a target transaction output identifier, and the target output data includes a target output script, a target digital asset quantity, and a target asset type identifier; the target transaction output identifier is used to point to a previous output data of a previous transaction data corresponding to the target transaction data, the previous output data is used to provide a digital asset used by the target transaction data; the target asset type identifier is used to indicate a digital asset type of a digital asset generated by the target transaction data; the target digital asset quantity is used to indicate a quantity of the digital asset generated by the target transaction data; and the target input script and the target output script are used for transaction verification.
[0015] The transaction verification module is specifically configured to obtain the target asset type identifier from the target output data of the target transaction data from the N pieces of transaction data to be packaged into the proposed block.
[0016] The transaction verification module is specifically configured to perform identification matching between the target asset type identifier and an asset type identifier set maintained by the packaging node, and if the asset type identifier set contains the target asset type identifier, determine that the target transaction data is asset transfer transaction data, perform transaction verification on the asset transfer transaction data, and obtain a transaction verification result corresponding to the asset transfer transaction data.
[0017] The transaction verification module is specifically configured to, if the asset type identifier set does not contain the target asset type identifier, determine that the target transaction data is asset issuance transaction data, add the target asset type identifier to the asset type identifier set, perform transaction verification on the asset issuance transaction data, and obtain a transaction verification result corresponding to the asset issuance transaction data.
[0018] The target transaction data is associated with H digital asset types in K digital asset types; H is a positive integer less than or equal to K; the number of target input data of the target transaction data is R; R is a positive integer;
[0019] The transaction verification module is specifically configured to obtain target transaction output identifiers from R target input data of the target transaction data to be packaged into the proposed block, obtain the previous output data pointed to by the R target transaction output identifiers respectively, and obtain the previous asset type identifiers associated with the previous transaction data from the R previous output data respectively;
[0020] The transaction verification module is specifically configured to obtain H target asset type identifiers corresponding to the H digital asset types from the target output data of the target transaction data;
[0021] The transaction verification module is specifically configured to perform identifier matching on the H target asset type identifiers and the R previous asset type identifiers, and if the H target asset type identifiers exist in the R previous asset type identifiers, generate a transaction verification result indicating that the target transaction data is verified successfully;
[0022] The transaction verification module is specifically configured to, if the H target asset type identifiers do not exist in the R previous asset type identifiers, generate a transaction verification result indicating that the target transaction data is verified unsuccessfully.
[0023] The target transaction data is associated with H digital asset types in K digital asset types; H is a positive integer less than or equal to K;
[0024] The transaction verification module is specifically configured to obtain the input asset quantity of the target transaction data for the H digital asset types, and obtain the output asset quantity of the target transaction data for the H digital asset types;
[0025] The transaction verification module is specifically configured to traverse the H digital asset types to obtain a digital asset type D i ; i is a positive integer less than or equal to H;
[0026] The transaction verification module is specifically configured to, if the input asset quantity of the target transaction data for the digital asset type D i is greater than or equal to the output asset quantity of the target transaction data for the digital asset type D i , determine that the digital asset type D i is verified successfully, and continue to traverse the H digital asset types until it is determined that the H digital asset types are all verified successfully, and generate a transaction verification result indicating that the target transaction data is verified successfully;
[0027] The transaction verification module is specifically configured to determine that the digital asset type D i fails to pass the verification if the number of input assets of the target transaction data for the digital asset type D i is less than the number of output assets of the target transaction data for the digital asset type D i , and generate a transaction verification result indicating that the target transaction data fails to pass the verification.
[0028] The H digital asset types include the digital asset type to be traversed; the number of target input data of the target transaction data is R; R is a positive integer; the R target input data include W target input data associated with the digital asset type to be traversed; W is a positive integer less than or equal to R;
[0029] The transaction verification module is specifically configured to acquire, from the W target input data of the target transaction data to be packed into the proposed block, target transaction output identifiers respectively, acquire, from W previous output data respectively pointed to by the W target transaction output identifiers, previous digital asset numbers, and acquire, from the W previous digital asset numbers, the number of input assets of the target transaction data for the digital asset type to be traversed.
[0030] The transaction verification module is specifically configured to perform summation operation on the W previous digital asset numbers to obtain the number of input assets of the target transaction data for the digital asset type to be traversed.
[0031] The number of target input data of the target transaction data is R; R is a positive integer;
[0032] The transaction verification module is specifically configured to acquire, from the R target input data of the target transaction data to be packed into the proposed block, target transaction output identifiers and target input scripts respectively, acquire, from R previous output data respectively pointed to by the R target transaction output identifiers, previous output scripts, and acquire, from the R previous output scripts, previous public key information of an operation object;
[0033] The transaction verification module is specifically configured to acquire, from the R target input scripts respectively, target signature information of the target transaction data, and acquire, from the R previous output scripts, the previous public key information of the operation object; the digital asset used by the target transaction data belongs to the operation object.
[0034] The transaction verification module is specifically configured to perform signature verification processing on the R target signature information according to the R previous public key information to obtain a signature verification result.
[0035] The transaction verification module is specifically configured to generate a transaction verification result indicating that the target transaction data passes the verification if the signature verification result indicates that the R target signature information all pass the signature verification.
[0036] The transaction verification module is specifically configured to generate a transaction verification result indicating that the target transaction data verification fails, if the signature verification result indicates that there is a target signature information verification failure in the R target signature information.
[0037] The K digital asset types include the target digital asset type.
[0038] The pre-consumption operation module is specifically configured to obtain G transaction data associated with the target digital asset type from the N transaction data according to asset type identifiers associated with the N transaction data; G is a positive integer less than or equal to N.
[0039] The pre-consumption operation module is specifically configured to obtain G consumption asset quantities of the G transaction data for the target digital asset type, and perform summation operation on the G consumption asset quantities to obtain a pre-consumption asset quantity corresponding to the target digital asset type.
[0040] The G transaction data include the candidate transaction data.
[0041] The pre-consumption operation module is specifically configured to, if the candidate transaction data is asset transfer transaction data, obtain an input asset quantity of the candidate transaction data for the target digital asset type, obtain an output asset quantity of the candidate transaction data for the target digital asset type, and perform difference operation on the input asset quantity and the output asset quantity to obtain a consumption asset quantity of the candidate transaction data for the target digital asset type.
[0042] The pre-consumption operation module is specifically configured to, if the candidate transaction data is asset issuance transaction data, obtain an input asset quantity of the candidate transaction data for the target digital asset type, and determine the input asset quantity as a consumption asset quantity of the candidate transaction data for the target digital asset type.
[0043] The transaction generation module is specifically configured to generate K pre-consumption output data according to the K pre-consumption asset quantities, asset type identifiers corresponding to the K digital asset types, and public key information of the packaging node; the K pre-consumption output data include candidate pre-consumption output data, the candidate pre-consumption output data being associated with a candidate digital asset type in the K digital asset types; the candidate pre-consumption output data includes a pre-consumption asset quantity corresponding to the candidate digital asset type, an asset type identifier of the candidate digital asset type, and a pre-consumption output script; the pre-consumption output script is determined by the public key information of the packaging node.
[0044] The transaction generation module is specifically configured to generate multi-asset pre-consumption transaction data corresponding to the proposed block according to the default input data and the K pre-consumption output data; the default input data is a null value or a default identifier.
[0045] The embodiment of the application provides a data processing method based on a block chain, which is executed by a verification node and comprises the following steps:
[0046] receiving a proposal block carrying multi-asset pre-consumption transaction data and N transaction data sent by a packaging node; the N transaction data is associated with asset type identifiers of K digital asset types; N is a positive integer, and K is an integer greater than 1; the multi-asset pre-consumption transaction data is generated by the packaging node according to pre-consumption asset quantities of the K digital asset types and the asset type identifiers of the K digital asset types; the K pre-consumption asset quantities are obtained by performing asset consumption operation on the N transaction data according to the asset type identifiers associated with the N transaction data when the N transaction data are all verified successfully; and the packaging node belongs to a block chain network to which the verification node belongs;
[0047] performing asset consumption operation on the N transaction data according to the asset type identifiers associated with the N transaction data to obtain consumable asset quantities of the K digital asset types;
[0048] performing asset verification on the K pre-consumption asset quantities in the multi-asset pre-consumption transaction data according to the K consumable asset quantities to obtain an asset verification result.
[0049] The embodiment of the application provides a data processing device based on a block chain, which is executed by a verification node and comprises the following steps:
[0050] a block receiving module, configured to receive a proposal block carrying multi-asset pre-consumption transaction data and N transaction data sent by a packaging node; the N transaction data is associated with asset type identifiers of K digital asset types; N is a positive integer, and K is an integer greater than 1; the multi-asset pre-consumption transaction data is generated by the packaging node according to pre-consumption asset quantities of the K digital asset types and the asset type identifiers of the K digital asset types; the K pre-consumption asset quantities are obtained by performing asset consumption operation on the N transaction data according to the asset type identifiers associated with the N transaction data when the N transaction data are all verified successfully; and the packaging node belongs to a block chain network to which the verification node belongs;
[0051] a consumable operation module, configured to perform asset consumption operation on the N transaction data according to the asset type identifiers associated with the N transaction data to obtain consumable asset quantities of the K digital asset types;
[0052] an asset verification module, configured to perform asset verification on the K pre-consumption asset quantities in the multi-asset pre-consumption transaction data according to the K consumable asset quantities to obtain an asset verification result.
[0053] The asset verification module is specifically configured to perform asset verification on the K pre-consumed asset quantities in the multi-asset pre-consumption transaction data according to the K consumable asset quantities, to obtain type verification results respectively corresponding to the K digital asset types.
[0054] The asset verification module is specifically configured to generate an asset verification result indicating verification success, if the K type verification results all indicate verification success.
[0055] The asset verification module is specifically configured to generate an asset verification result indicating verification failure, if there is a type verification result indicating verification failure in the K type verification results.
[0056] The K digital asset types include a to-be-verified digital asset type; the K consumable asset quantities include a consumable asset quantity corresponding to the to-be-verified digital asset type; and the K pre-consumed asset quantities in the multi-asset pre-consumption transaction data include a pre-consumed asset quantity corresponding to the to-be-verified digital asset type.
[0057] The asset verification module is specifically configured to generate a type verification result indicating verification success for the to-be-verified digital asset type, if the consumable asset quantity corresponding to the to-be-verified digital asset type is greater than or equal to the pre-consumed asset quantity corresponding to the to-be-verified digital asset type.
[0058] The asset verification module is specifically configured to generate a type verification result indicating verification failure for the to-be-verified digital asset type, if the consumable asset quantity corresponding to the to-be-verified digital asset type is less than the pre-consumed asset quantity corresponding to the to-be-verified digital asset type.
[0059] The device further includes:
[0060] The data processing module is configured to add the proposed block into a blockchain of the blockchain network, if the asset verification result indicates verification success.
[0061] The data processing module is configured to discard the proposed block, if the asset verification result indicates verification failure.
[0062] The computer device provided in the embodiment of the present application includes a processor and a memory.
[0063] The processor is connected with the memory, and the memory is configured to store a computer program, which is executed by the processor to enable the computer device to perform the method provided in the embodiment of the present application.
[0064] The computer readable storage medium provided in the embodiment of the present application stores a computer program, which is adapted to be loaded and executed by a processor, to enable a computer device having the processor to perform the method provided in the embodiment of the present application.
[0065] The computer program product provided by the embodiment of the present application comprises a computer program stored in a computer readable storage medium. The processor of the computer device reads the computer program from the computer readable storage medium, and the processor executes the computer program, so that the computer device executes the method provided by the embodiment of the present application.
[0066] The embodiment of the present application can introduce digital assets of multiple digital asset types in a blockchain network. The digital assets of the multiple digital asset types can be distinguished by asset type identifiers, and the corresponding pre-consumed asset quantities can be calculated for each asset type identifier to generate multi-asset pre-consumed transaction data, thereby realizing the packaging and verification of a proposed block with multiple digital asset types. Therefore, the embodiment of the present application can support digital assets of multiple digital asset types on a blockchain, enrich the types of digital assets of the blockchain, and adapt the blockchain network to a multi-asset business scenario (i.e., a business scenario supporting digital assets of multiple digital asset types), thereby expanding the business scenarios of the blockchain network. BRIEF DESCRIPTION OF DRAWINGS
[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the embodiment or related art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0068] Figure 1 is a structural schematic diagram of a network architecture provided by the embodiment of the present application;
[0069] Figure 2a is a structural schematic diagram of a network architecture provided by the embodiment of the present application;
[0070] Figure 2b is a structural schematic diagram of a network architecture provided by the embodiment of the present application;
[0071] Figure 3 is a flowchart of a data processing method based on a blockchain provided by the embodiment of the present application;
[0072] Figure 4 is a structural schematic diagram of an asset transfer transaction data provided by the embodiment of the present application;
[0073] Figure 5 is a structural schematic diagram of an asset transfer transaction data provided by the embodiment of the present application;
[0074] Figure 6is a scene schematic diagram of asset consumption operation provided by an embodiment of the present application;
[0075] Figure 7 is a scene schematic diagram of multi-asset pre-consumption transaction data provided by an embodiment of the present application;
[0076] Figure 8 is a flow schematic diagram of a data processing method based on a block chain provided by an embodiment of the present application;
[0077] Figure 9 is a scene schematic diagram of identity verification provided by an embodiment of the present application;
[0078] Figure 10 is a scene schematic diagram of quantity verification provided by an embodiment of the present application;
[0079] Figure 11 is a scene schematic diagram of script verification provided by an embodiment of the present application;
[0080] Figure 12 is a flow schematic diagram of a data processing method based on a block chain provided by an embodiment of the present application;
[0081] Figure 13 is a scene schematic diagram of asset verification provided by an embodiment of the present application;
[0082] Figure 14 is a structure schematic diagram of a data processing apparatus based on a block chain provided by an embodiment of the present application;
[0083] Figure 15 is a structure schematic diagram of a data processing apparatus based on a block chain provided by an embodiment of the present application;
[0084] Figure 16 is a structure schematic diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0085] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0086] Blockchain is a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm and other computer technologies. Blockchain is essentially a decentralized database, which is a chain of data blocks associated using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity of the information (anti-fake) and generate the next block. Blockchain is a data structure composed of several blocks connected by hash values in front and back. Each block is composed of transactions generated in a period of time, packaged by a blockchain node with the right to record, and independently verified by each blockchain node. Blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer.
[0087] Blockchain node: The blockchain network distinguishes nodes into consensus nodes and synchronization nodes. Among them, the consensus node is responsible for the consensus business of the entire blockchain network; the synchronization node is responsible for synchronizing the ledger information of the consensus node, that is, synchronizing the latest block data. Whether it is a consensus node or a synchronization node, its internal structure includes a network communication component, because the blockchain network is essentially a peer-to-peer (Peer to Peer) network, and needs to communicate with other nodes in the blockchain network through the peer-to-peer component. The resources and services in the blockchain network are distributed on each node, and the transmission of information and the implementation of services are directly between nodes, without the need for intermediate links or centralized servers (third parties) to intervene. The blockchain node can be responsible for verifying transactions, packaging blocks, and maintaining the consistency of the entire blockchain, ensuring the safe and stable operation of the entire system.
[0088] Specifically, please refer to Figure 1 , Figure 1 is a structural diagram of a network architecture provided by an embodiment of the present application. As Figure 1 indicated, the network architecture can include a blockchain network 100a, a terminal device cluster 100b, and a resource server 100c. Among them, the blockchain network 100a can specifically include one or more blockchain nodes, which will not be limited in number in the blockchain network 100a. As Figure 1As shown, the plurality of blockchain nodes can specifically include a blockchain node 110a, a blockchain node 110b, a blockchain node 110c, …, and a blockchain node 110n; in order to ensure information intercommunication within the blockchain network 100a, each of the blockchain nodes in the blockchain network 100a can be directly or indirectly network-connected through wired or wireless communication (for example, there can be a network connection between the blockchain node 110a and the blockchain node 110b), so that the blockchain nodes can interact with each other through the network connection (for example, block transmission); the blockchain node can be a server or a terminal device accessing the blockchain network 100a, and the specific form of the blockchain node is not limited here.
[0089] It can be understood that each blockchain node in the blockchain network 100a can receive the to-be-chained data sent by the off-chain device (for example, the resource server 100c and the terminal device cluster 100b) when working normally, and generate a block based on the received to-be-chained data, and then perform a chaining process on the block. It can be understood that the collection and processing of related data (for example, asset issuance transaction data and asset transfer transaction data) in this application should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and within the scope of authorization of laws and regulations and the personal information subject, carry out subsequent data use and processing behavior.
[0090] The terminal device cluster 100b specifically can include one or more terminal devices, and the number of terminal devices in the terminal device cluster 100b will not be limited here. Figure 1 As shown, the plurality of terminal devices can specifically include a terminal device 120a, a terminal device 120b, …, and a terminal device 120m; the terminal device 120a, the terminal device 120b, …, and the terminal device 120m can be directly or indirectly network-connected with the resource server 100c through wired or wireless communication, so that each terminal device can interact with the resource server 100c through the network connection. At the same time, the terminal device cluster 100b and the blockchain network 100a can be directly or indirectly network-connected through wired or wireless communication, so that the terminal devices in the terminal device cluster 100b and the blockchain nodes in the blockchain network 100a can interact with each other through the network connection, for example, there can be a network connection between the terminal device 120b in the terminal device cluster 100b and the blockchain node 110a in the blockchain network 100a.
[0091] Among them, the terminal devices in the embodiments of the present application can all include smart phones, tablet computers, notebook computers, desktop computers, smart voice interaction devices, smart home appliances (for example, smart televisions), wearable devices, vehicle-mounted terminals, aircrafts and other smart terminals with data processing functions. It should be understood that each terminal device in the terminal device cluster 100b can be installed with an application client with data processing function, and when the application client runs in each terminal device, it can respectively interact with the resource server 100c shown above. Figure 1 The application client can specifically include a vehicle-mounted client, a smart home client, an entertainment client (for example, a game client), a multimedia client (for example, a video client), a payment client (that is, a payment application), an information client (for example, a news client), a resource client, a decentralized application client (Decentralized Application, DAPP), a browser, etc. Among them, the application client can be a sub-client integrated in a certain client (for example, a browser), and the application client can also be an independent client (for example, a resource client), and the embodiments of the present application do not limit the type of application client.
[0092] Among them, the server (for example, the resource server 100c) in the embodiments of the present application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms. Among them, the resource server 100c can be connected with the blockchain network 100a, so that the resource server 100c can interact with the blockchain network 100a through network connection.
[0093] For ease of understanding, the embodiments of the present application take the application client as an example to illustrate the resource client. Among them, the resource client can be the front end, the resource server 100c can be the back end corresponding to the front end, and the terminal device can realize data interaction between the resource client and the resource server 100c (for example, the terminal device can send a digital asset transfer request and a digital asset issuance request to the resource server 100c through the resource client, and the resource server 100c can return a blockchain address to the resource client in the terminal device), and the resource server 100c can be used to store the blockchain private key and the blockchain address in the resource client.
[0094] The resource client can be used to store a user's blockchain private key on a blockchain, the blockchain can identify the user's identity through the blockchain private key, and the user's digital assets are managed through the blockchain private key. The operation (for example, digital asset transfer, digital asset issuance) can be signed and confirmed through the blockchain private key, and the signed transaction (for example, asset transfer transaction data, asset issuance transaction data) can be sent to the blockchain node by the resource client. Only correct transactions will be executed by the blockchain, and fake signed blockchains will be rejected and prompted to fail. Among them, the terminal device can send the signed transaction directly to the blockchain node; the terminal device can also send the signed transaction to the resource server 100c to make the resource server 100c forward the signed transaction to the blockchain node; the terminal device can also generate the signed transaction through the resource server 100c and forward the signed transaction to the blockchain node. In addition, the chain is publicly queryable by all accounts, so the resource client can also help users record changes in account assets. Common installation forms of resource clients include browser extension plugins (i.e., browser applications that rely on browsers to run, also known as browser sub-clients) and APPs (i.e., Applications).
[0095] It should be understood that the resource client can be a hardware device or a software program. The resource client can be used to implement a resource management business function and communicate with a decentralized application client (referred to as a decentralized application, which can be a blockchain application) based on the resource management business function to implement user authorization login and other related operations. Among them, the resource client is a tool used to manage, store user digital assets, initiate transactions, and participate in voting. For example, digital assets can be transferred to other accounts based on the resource client, and digital assets received from other accounts can be received based on the resource client. With the widespread deployment of various decentralized applications on the blockchain, user activity on the blockchain has increased. When using a decentralized application, a user can use a blockchain key management tool (i.e., a resource client) to log in. Digital assets refer to new intangible assets issued, registered, stored, held, transferred, or traded based on blockchain technology. These intangible assets exist in a specific system in digital form as a digital representation of value or rights.
[0096] As Figure 1The blockchain nodes 110a, 110b, 110c, ..., 110n shown can each have a one-to-one correspondence with the corresponding roles (i.e., entity objects in the corresponding business scenarios) in the blockchain network 100a that need to be accessed. This embodiment of the application can be applied to block generation services. The applicable business scenarios for block generation services can include gaming, medical, government affairs, and payment scenarios, etc. The specific business scenarios applicable to this embodiment will not be listed here. Block generation services can include block packaging and block verification.
[0097] For ease of understanding, the embodiments of this application may be described in detail below. Figure 1 In the blockchain network 100a shown, a consensus node is selected as the packaging node (for example, in the embodiments of this application, a consensus node can be selected as the packaging node). Figure 1 The blockchain node 110a shown is used as the packaging node, and the consensus nodes in the blockchain network 100a other than the packaging node are used as verification nodes (for example, in the embodiments of this application, the consensus nodes other than the packaging node can be used as verification nodes). Figure 1 Blockchain nodes 110b and 110c are shown as verification nodes. Packaging nodes are used to package blocks, while verification nodes are used to verify blocks. Packaging nodes are those that actually run the blockchain accounting program, maintain the digital asset set (which can be used to store digital assets), process blockchain transactions, and have the right to record new blocks. Verification nodes are those that do not have the right to record the current block. Both packaging and verification nodes are full nodes in the blockchain network. A full node is a node that maintains the entire blockchain and can independently complete the packaging and verification of transactions, as well as handle read and write requests from application clients for the smart contract state.
[0098] For easier understanding, please refer to Figure 2a and Figure 2b , Figure 2a and Figure 2b This is a schematic diagram illustrating a data interaction scenario provided in an embodiment of this application. For example... Figure 2a and Figure 2b The blockchain node 20a shown can be the above Figure 1 The packaging node (i.e., packaging node 20a) in the corresponding embodiment, such as Figure 2b The blockchain nodes 20b, ..., 20c shown can be the above-mentioned Figure 1 The verification nodes in the corresponding embodiments (i.e., verification node 20b, ..., verification node 20c) are as follows: Figure 2a The terminal devices 25a, ..., 25b shown can be the aforementioned Figure 1Any one of the terminal devices in the terminal device cluster 100b of the corresponding embodiment. Wherein, the terminal device 25a, …, the terminal device 25b can be installed with a resource client, and the number of terminal devices will not be limited here.
[0099] As shown in Figure 2a The terminal device 25a, …, the terminal device 25b can send transaction data to the packaging node 20a through the resource client (for example, the terminal device 25a can send transaction data 21a to the packaging node 20a), so that the packaging node 20a can store the received transaction data into the transaction pool when receiving the transaction data sent by the terminal device 25a, …, the terminal device 25b. Further, the packaging node 20a can obtain N transaction data to be packaged into the proposed block from the transaction pool, perform transaction verification on the N transaction data, and obtain a transaction verification result. Wherein, the N transaction data can specifically include transaction data 21a, …, transaction data 21b, the transaction data 21a, …, the transaction data 21b are associated with the asset type identifier of K digital asset types, and the K digital asset types can specifically include digital asset type 22a, …, digital asset type 22b. The asset type identifier of the digital asset type 22a can be asset type identifier 23a, …, and the asset type identifier of the digital asset type 22b can be asset type identifier 23b.
[0100] Further, if the transaction verification result indicates that the N transaction data (i.e. transaction data 21a, …, transaction data 21b) are all verified successfully, the packaging node 20a can package the N transaction data into the proposed block, and then perform asset consumption operation on the N transaction data according to the asset type identifier (i.e. asset type identifier 23a, …, asset type identifier 23b) associated with the N transaction data, to obtain the pre-consumed asset quantity corresponding to each of the K digital asset types. Wherein, the pre-consumed asset quantity corresponding to the digital asset type 22a can be pre-consumed asset quantity 24a, …, and the pre-consumed asset quantity corresponding to the digital asset type 22b can be pre-consumed asset quantity 24b.
[0101] Further, the packaging node 20a can generate the multi-asset pre-consumption transaction data (i.e. Coinbase transaction) corresponding to the proposed block according to the K pre-consumed asset quantities (i.e. pre-consumed asset quantity 24a, …, pre-consumed asset quantity 24b) and the asset type identifier (i.e. asset type identifier 23a, …, asset type identifier 23b) corresponding to each of the K digital asset types, and then add the multi-asset pre-consumption transaction data to the proposed block. Wherein, the proposed block can carry the multi-asset pre-consumption transaction data, transaction data 21a, …, transaction data 21b.
[0102] As shown in Figure 2bAs shown, the packaging node 20a can send the proposed block carrying the multi-asset pre-consumption transaction data, the transaction data 21a, …, the transaction data 21b to the verification node 20b, …, the verification node 20c, and here the verification node 20b is taken as an example for illustration. In this way, the verification node 20b can receive the proposed block sent by the packaging node 20a, and perform asset consumption operation on the N transaction data (i.e., the transaction data 21a, …, the transaction data 21b) according to the asset type identifiers (i.e., the asset type identifier 23a, …, the asset type identifier 23b) associated with the N transaction data in the proposed block, to obtain the consumable asset quantity corresponding to each of the K digital asset types. The consumable asset quantity corresponding to the digital asset type 22a can be the consumable asset quantity 26a, and the consumable asset quantity corresponding to the digital asset type 22b can be the consumable asset quantity 26b.
[0103] Further, the verification node 20b can perform asset verification on the K pre-consumption asset quantities (i.e., the pre-consumption asset quantity 24a, …, the pre-consumption asset quantity 24b) in the multi-asset pre-consumption transaction data according to the K consumable asset quantities (i.e., the consumable asset quantity 26a, …, the consumable asset quantity 26b), to obtain an asset verification result. The asset verification result can be used to verify the validity of the proposed block, and can also be used to verify the validity of the consumption asset quantity (including the pre-consumption asset quantity and the consumable asset quantity).
[0104] Further, if the asset verification result indicates a verification success, the verification node 20b can add the proposed block to the blockchain of the blockchain network. Alternatively, if the asset verification result indicates a verification failure, the verification node 20b can discard the proposed block.
[0105] Similarly, other verification nodes (e.g., the verification node 20c) except the verification node 20b can independently verify the validity of the proposed block when receiving the proposed block sent by the packaging node 20a. The specific process of verifying the validity of the proposed block by other verification nodes except the verification node 20b can refer to the description of verifying the validity of the proposed block by the verification node 20b, which will not be described here in detail.
[0106] It can be seen that the embodiment of the application can introduce a plurality of digital asset types in the N transaction data to be packaged into the proposed block, and the plurality of digital asset types can be distinguished by asset type identifiers, thereby enriching the digital asset types of the blockchain and realizing the diversity of digital assets. In this way, the packaging node can obtain multi-asset pre-consumption transaction data for representing the pre-consumed asset quantity of the plurality of digital asset types, package the N transaction data and the multi-asset pre-consumption transaction data, obtain the proposed block, and enable the verification node to verify the pre-consumed asset quantity in the multi-asset pre-consumption transaction data according to the N transaction data. Therefore, the embodiment of the application can normally realize the packaging and verification of the block after introducing a plurality of digital asset types, so that the digital assets of the plurality of digital asset types can normally circulate in the blockchain network, and the business scenarios of the blockchain network can use digital assets of a plurality of digital asset types at the same time, thereby expanding the business scenarios of the blockchain network.
[0107] Further, please refer to Figure 3 , Figure 3 is a flow diagram of a data processing method based on a blockchain provided by the embodiment of the application. The data processing method can be executed by a packaging node, which can be the packaging node 20a of the embodiment corresponding to the above Figure 2a and Figure 2b . The data processing method can include steps S101-S104:
[0108] Step S101, transaction verification is performed on N transaction data to be packaged into a proposed block to obtain a transaction verification result;
[0109] Wherein, the N transaction data is associated with the asset type identifiers (i.e. asset IDs) of the K digital asset types (i.e. the N transaction data is associated with the K digital asset types), different digital asset types can have different asset type identifiers, each transaction data can be associated with the asset type identifiers of one or more digital asset types in the K digital asset types (i.e. each transaction data can be associated with one or more digital asset types in the K digital asset types), and the K digital asset types include a target digital asset type. Here, N can be a positive integer, and here K can be an integer greater than 1.
[0110] The N pieces of transaction data include target transaction data, the target transaction data includes target input data (i.e., input data of the target transaction data) and target output data (i.e., output data of the target transaction data), the target input data includes a target input script (i.e., an input script of the target input data, the input script can also be referred to as an unlocking script) and a target transaction output identifier (i.e., a transaction output identifier of the target input data), and the target output data includes a target output script (i.e., an output script of the target output data, the output script can also be referred to as a locking script), a target number of digital assets (i.e., a number of digital assets of the target output data), and a target asset type identifier (i.e., an asset type identifier of the target output data). The target transaction output identifier is used to point to (i.e., locate) the previous output data (i.e., output data of the previous transaction data) of the previous transaction data (the previous transaction data can or can not belong to the N pieces of transaction data) corresponding to the target transaction data, and the target transaction output identifier can include a previous transaction identifier (i.e., a transaction identifier of the previous transaction data, the transaction identifier can represent a transaction hash value) and a previous output identifier (i.e., an output identifier of the output data of the previous transaction data), the previous transaction identifier is used to point to the previous transaction data corresponding to the target transaction data, the previous output identifier is used to point to the previous output data of the previous transaction data (i.e., the previous output identifier is used to indicate the previous output data in the previous transaction data), and the previous output data is used to provide a digital asset used by the target transaction data, the target transaction data can realize asset transfer or asset issuance through the digital asset provided by the previous output data, and the digital asset provided by the previous output data cannot be used by other transaction data after being used by the target transaction data; the previous transaction data can be asset issuance transaction data, asset transfer transaction data, or multi-asset pre-consumption transaction data, and the multi-asset pre-consumption transaction data herein is multi-asset pre-consumption transaction data in a block other than a proposal block; the target asset type identifier is used to indicate the digital asset type of the digital asset generated by the target transaction data (i.e., the asset type identifier of the target asset type identifier is used to indicate the digital asset type of the digital asset generated by the target transaction data), the target number of digital assets is used to indicate the number of digital assets generated by the target transaction data, and the digital asset generated by the target transaction data can be a digital asset issued by the target transaction data or a digital asset transferred by the target transaction data; the target input script and the target output script are used for transaction verification, the input script and the output script can be collectively referred to as a transaction script, and the transaction script is used to define the conditions and restrictions of the transaction.
[0111] If the target transaction data is executed successfully, the digital assets in the target input data (i.e. the digital assets in the previous output data pointed to by the target transaction output identifier in the target input data) will be used and replaced by the digital assets in the target output data. The operation object (e.g. a user or an institution) initiating the target transaction data can be referred to as an asset transfer party (referred to as a transfer party) or an asset issuing party (referred to as an issuing party). When the target transaction data is asset transfer transaction data, the operation object initiating the target transaction data can be referred to as an asset transfer party. When the target transaction data is asset issuing transaction data, the operation object initiating the target transaction data can be referred to as an asset issuing party. Among them, the asset issuing party uses the old digital assets (i.e. the digital assets in the previous output data) in the input data as issuing consumption assets, and issues new assets (i.e. newly issued digital assets) into the output data; the asset transfer party uses the old digital assets (i.e. the digital assets in the previous output data) in the input data as transfer digital assets (i.e. transferred digital assets) and transfer consumption assets, and transfers the transfer digital assets into the output data. In other words, the digital assets in the previous output data are the issuing consumption assets paid (i.e. provided) by the asset issuing party for issuing digital assets, and the digital assets in the previous output data are the transfer digital assets and transfer consumption assets paid (i.e. provided) by the asset transfer party for transferring digital assets. Among them, the issuing consumption assets represent the consumption assets for issuing digital assets, and the transfer consumption assets represent the consumption assets for transferring digital assets. The issuing consumption assets and the transfer consumption assets can be collectively referred to as consumption assets, and the consumption assets can also be referred to as a service fee. The amount of the service fee can also be referred to as the number of consumption assets (i.e. the number of consumption assets).
[0112] Therefore, the present application can use unspent (i.e. used) outputs as a blockchain transaction model, which can reference the location of the previous output (e.g. the output data of the previous transaction data) in the input (e.g. the input data of the target transaction data). A transaction (e.g. the target transaction data) will spend (i.e. use) a certain output (e.g. the output data of the previous transaction data), and generate a certain unspent (i.e. used) output (e.g. the output data of the target transaction data) for the next transaction, thereby ensuring the constant total number of digital assets in the blockchain network.
[0113] It can be understood that the target transaction data can be associated with one or more asset type identifiers of the K digital asset types (i.e., the target transaction data can be associated with one or more digital asset types of the K digital asset types), the one or more digital asset types associated with the target transaction data are the digital asset types of the digital assets used by the target transaction data or the digital asset types of the digital assets generated by the target transaction data, and the one or more asset type identifiers associated with the target transaction data include the target asset type identifier in the target output data and the previous asset type identifier in the previous output data. Wherein, the digital asset types of the digital assets used by the target transaction data and the digital asset types of the digital assets generated by the target transaction data can be the same or different.
[0114] The content of the target input data (i.e., transaction input) can be seen from formula (1):
[0115] TX.Input = <Txid:Vout, InputScript> (1)
[0116] Wherein, TX represents the target transaction data, Input represents the target input data, Txid:Vout represents the target transaction output identifier, InputScript represents the target input script, Txid represents the previous transaction identifier, and Vout represents the previous output identifier. For ease of understanding, an example is taken here that the number of target input data in the target transaction data is one, and the embodiments of the present application do not limit the number of target input data in the target transaction data.
[0117] The content of the target output data (i.e., transaction output) can be seen from formula (2):
[0118] TX.Output = <OutputScript, Amount, AssetID> (2)
[0119] Wherein, TX represents the target transaction data, Output represents the target output data, OutputScript represents the target output script, Amount represents the target digital asset quantity, and AssetID represents the target asset type identifier. For ease of understanding, an example is taken here that the number of target output data in the target transaction data is one, and the embodiments of the present application do not limit the number of target output data in the target transaction data.
[0120] It should be understood that the embodiments of the present application do not limit the content in the target input script, and the embodiments of the present application do not limit the content in the target output script. For ease of understanding, the embodiments of the present application are described by taking an example that the target output script includes the public key information of the target operation object, and the embodiments of the present application are described by taking an example that the target input script includes the target signature information of the target transaction data (i.e. the signature information of the target transaction data). The content of the target output script can be seen from formula (3):
[0121] OutputScript= <pubkey>(3)
[0122] The target transaction data is asset transfer transaction data or asset issuance transaction data. The target operation object is a user or an institution to which the digital asset generated by the target transaction data belongs. When the target transaction data is asset transfer transaction data, the target operation object is a user or an institution to which the digital asset is transferred (i.e., a user or an institution receiving the transferred digital asset). When the target transaction data is asset issuance transaction data, the target operation object is a user or an institution issuing the digital asset, so as to realize issuance of the new asset to the asset issuance party's own address (i.e., the asset issuance party's blockchain address). At this time, the target operation object is the asset issuance party.
[0123] Specifically, the packaging node can obtain the target transaction data from the N transaction data to be packaged into the proposed block, and obtain the target asset type identifier from the target output data of the target transaction data. Further, the packaging node can perform identifier matching on the target asset type identifier and an asset type identifier set maintained by the packaging node. The asset type identifier set is a global set maintained by the blockchain nodes in the blockchain network, and is used to record the asset type identifiers of the assets generated in the history of the blockchain. The asset type identifier set includes asset type identifiers of all digital asset types in the blockchain network, and all digital asset types can include K digital asset types that have been issued (the digital asset types that have been issued represent the digital asset types of the digital assets generated by the asset transfer transaction data) and do not include K digital asset types that have not been issued (the digital asset types that have not been issued represent the digital asset types of the digital assets generated by the asset issuance transaction data). Further, if the asset type identifier set includes the target asset type identifier (i.e., the blockchain network includes the digital asset type corresponding to the target asset type identifier), the packaging node can determine that the target transaction data is asset transfer transaction data, perform transaction verification on the asset transfer transaction data, and obtain a transaction verification result corresponding to the asset transfer transaction data. Alternatively, if the asset type identifier set does not include the target asset type identifier (i.e., the blockchain network does not include the digital asset type corresponding to the target asset type identifier), the packaging node can determine that the target transaction data is asset issuance transaction data, add the target asset type identifier to the asset type identifier set, perform transaction verification on the asset issuance transaction data, and obtain a transaction verification result corresponding to the asset issuance transaction data.
[0124] Therefore, the blockchain of the present application can support the issuance and transfer of multiple digital assets on a single chain. In addition, to ensure the security of the issued digital asset type of digital asset, so that the issued digital asset type of digital asset cannot be maliciously issued, the embodiments of the present application cannot issue the digital asset of the issued digital asset type in the blockchain, that is, multiple digital assets cannot be issued for the same digital asset type.
[0125] The specific process of the packaging node performing transaction verification on the asset transfer transaction data can be seen from the description of step S1012 in the corresponding embodiment. Figure 8 The specific process of the packaging node performing transaction verification on the asset issuance transaction data can be seen from the description of step S1013 in the corresponding embodiment. Figure 8 The specific process of the packaging node performing transaction verification on the asset issuance transaction data can be seen from the description of step S1013 in the corresponding embodiment.
[0126] The specific process of the packaging node performing identification matching between the target asset type identifier and the asset type identifier set can be seen from formula (4):
[0127] IsNewID = NOT(TX.Output.AssetID ∈ AssetIDs) (4)
[0128] Wherein, TX represents the target transaction data, Output represents the target output data, AssetID represents the target asset type identifier, AssetIDs represents the asset type identifier set, NOT represents the NOT function, and ∈ represents belongs to. If the asset type identifier set exists the target asset type identifier, TX.Output.AssetID ∈ AssetIDs is true, and NOT(TX.Output.AssetID ∈ AssetIDs) is false (i.e. IsNewID is false); if the asset type identifier set does not exist the target asset type identifier, TX.Output.AssetID ∈ AssetIDs is false, and NOT(TX.Output.AssetID ∈ AssetIDs) is true (i.e. IsNewID is true).
[0129] Therefore, if IsNewID is false, the packaging node can determine that the target transaction data is asset transfer transaction data; if IsNewID is true, the packaging node can determine that the target transaction data is asset issuance transaction data, and add the target asset type identifier to the asset type identifier set to avoid the digital asset of the digital asset type corresponding to the target asset type identifier being issued twice. The specific process of the packaging node adding the target asset type identifier to the asset type identifier set can be seen from formula (5):
[0130] AssetIDs = AssetIDs.ADD(TX.Output.AssetID) (5)
[0131] Wherein, TX represents target transaction data, Output represents target output data, AssetID represents target asset type identifier, AssetIDs represents asset type identifier set, ADD is a function of adding asset type identifier (for example, target asset type identifier) in asset type identifier set.
[0132] For better understanding, please refer to Figure 4 , Figure 4 is a scene schematic diagram of asset transfer transaction data provided by an embodiment of the present application. As shown in Figure 4 , taking target transaction data and previous transaction data as asset transfer transaction data (i.e. multi-asset transfer transaction) for example, asset transfer is realized through target transaction data (i.e. transfer of digital assets in the presence of digital assets), and the target transaction data is asset transfer transaction data corresponding to transaction identifier 40b, and the previous transaction data is asset transfer transaction data corresponding to transaction identifier 40a.
[0133] Wherein, taking one as the number of input data of target transaction data and one as the number of output data of target transaction data for example, one input data can include input data 42a, and one output data can include output data 42b; taking three as the number of input data of previous transaction data and three as the number of output data of previous transaction data for example, three input data can include input data 41a, input data 41b and input data 41c, and three output data can include output data 43a, output data 43b and output data 43c. In other words, input data 42a can also be referred to as target input data 42a, and output data 42b can also be referred to as target output data 42b, and input data 41a, input data 41b and input data 41c can also be referred to as previous input data 41a, previous input data 41b and previous input data 41c, and output data 43a, output data 43b and output data 43c can also be referred to as previous output data 43a, previous output data 43b and previous output data 43c.
[0134] As shown in Figure 4 , input data can include input script and transaction output identifier (transaction output identifier can include transaction identifier and output identifier), and output data can include output script, digital asset quantity and asset type identifier. Wherein, the transaction output identifier in input data 42a is used to point to output data 43a of previous transaction data, the transaction identifier in input data 42a can be the transaction identifier of previous transaction data (i.e. transaction identifier 40a), and the output identifier in input data 42a can be the output identifier of output data 43a (for example, the output identifier of output data 43a can be 0).
[0135] For ease of understanding, please refer to Figure 5 , Figure 5 is a scene schematic diagram of asset issuance transaction data provided by an embodiment of the present application. As shown in Figure 5 , taking the target transaction data as an asset issuance transaction data (i.e. new asset issuance transaction) for example, the asset issuance is realized through the target transaction data (i.e. creating a digital asset in the case of no digital asset), and the transaction identifier of the target transaction data is transaction identifier 50a. Among them, taking the number of input data of the target transaction data as one and the number of output data of the target transaction data as one for example, one input data can include input data 50b, and one output data can include output data 50c. In other words, the input data 50b can also be called the target input data 50b, and the output data 50c can also be called the target output data 50c.
[0136] Step S102, if the transaction verification result indicates that N transaction data are all verified successfully, then according to the asset type identifier associated with the N transaction data, the asset consumption operation is performed on the N transaction data to obtain the pre-consumed asset quantity corresponding to K digital asset types respectively;
[0137] Specifically, if the transaction verification result indicates that N transaction data are all verified successfully, then the packaging node can obtain G transaction data associated with the target digital asset type from the N transaction data according to the asset type identifier associated with the N transaction data. Among them, G can be a positive integer less than or equal to N; if the G transaction data includes the target transaction data, then the target asset type identifier or the previous asset type identifier includes the asset type identifier of the target digital asset type; if the G transaction data does not include the target transaction data, then the target asset type identifier and the previous asset type identifier do not include the asset type identifier of the target digital asset type. Further, the packaging node can obtain the consumption asset quantity of the G transaction data for the target digital asset type, and perform summation operation (i.e. addition operation) on the G consumption asset quantities to obtain the pre-consumed asset quantity corresponding to the target digital asset type. Among them, the pre-consumed asset quantity refers to the consumption asset expected by the packaging node.
[0138] The G pieces of transaction data associated with the target digital asset type include the candidate transaction data. It can be understood that if the candidate transaction data is asset transfer transaction data, the packaging node can obtain the input asset quantity of the candidate transaction data for the target digital asset type, obtain the output asset quantity of the candidate transaction data for the target digital asset type, and perform difference operation (i.e. subtraction operation) on the input asset quantity of the candidate transaction data for the target digital asset type and the output asset quantity of the candidate transaction data for the target digital asset type to obtain the consumed asset quantity of the candidate transaction data for the target digital asset type. The consumed asset quantity represents the consumed asset (i.e. transfer consumed asset) paid for asset transfer. Optionally, if the candidate transaction data is asset issuance transaction data, the packaging node can obtain the input asset quantity of the candidate transaction data for the target digital asset type, and determine the input asset quantity of the candidate transaction data for the target digital asset type as the consumed asset quantity of the candidate transaction data for the target digital asset type. The consumed asset quantity represents the consumed asset (i.e. issuance consumed asset) paid for asset issuance.
[0139] The specific process of the packaging node obtaining the input asset quantity of the candidate transaction data for the target digital asset type can be referred to the description of obtaining the input asset quantity of the target transaction data for the digital asset type to be traversed below. The specific process of the packaging node obtaining the output asset quantity of the candidate transaction data for the target digital asset type can be referred to the description of obtaining the output asset quantity of the target transaction data for the digital asset type to be traversed below.
[0140] The specific process of the packaging node performing asset consumption operation on the N pieces of transaction data can be referred to formula (6):
[0141] Fees[AssetID] += TX i .Input[AssetID].Amount - TX i .Output[AssetID].Amount (6)
[0142] Wherein, AssetID represents an asset type identifier (for example, an asset type identifier of the target digital asset type), TX i represents the i-th piece of transaction data (for example, candidate transaction data) in the N pieces of transaction data, Input represents the input data of the i-th piece of transaction data, and Output represents the output data of the i-th piece of transaction data, TX i .Input[AssetID].Amount represents the input asset quantity of the i-th piece of transaction data for the digital asset type (for example, the target digital asset type), TX i Output[AssetID].Amount represents the output asset quantity of the i th transaction data for the digital asset type (e.g., the target digital asset type), TX i .Input[AssetID].Amount-TX i Output[AssetID].Amount represents the output asset quantity of the i th transaction data for the digital asset type (e.g., the target digital asset type), Fees[AssetID] represents the pre-consumed asset quantity corresponding to the digital asset type (e.g., the target digital asset type). Wherein, Fees represents the mapping of asset type identifier to pre-consumed asset quantity, which can also be regarded as an array.
[0143] For ease of understanding, please refer to Figure 6 , Figure 6 is a scenario diagram of asset consumption operation provided by an embodiment of the present application. As Figure 6 illustrated, taking the candidate transaction data as the asset transfer transaction data (i.e., multi-asset transfer transaction) as an example for illustration, the transaction identifier of the candidate transaction data is transaction identifier 60a. Wherein, taking the number of input data of the candidate transaction data as three and the number of output data of the candidate transaction data as three as an example for illustration, the three input data can include input data 63a, input data 63b and input data 63c, and the three output data can include output data 62a, output data 62b and output data 62c.
[0144] As Figure 6 illustrated, the transaction output identifier 64a in the input data 63a is used to point to the output data 65a, the transaction output identifier 64b in the input data 63b is used to point to the output data 65b, and the transaction output identifier 64c in the input data 63c is used to point to the output data 65c. The output data 65a, the output data 65b and the output data 65c can be output data in the same transaction data, or output data in different transaction data.
[0145] As Figure 6 illustrated, when the target digital asset type is the digital asset type corresponding to the asset type identifier 61a, the input asset quantity of the candidate transaction data for the target digital asset type is 37 (i.e., 18+19, 18 represents the digital asset quantity in the output data 65a, and 19 represents the digital asset quantity in the output data 65b), the output asset quantity of the candidate transaction data for the target digital asset type is 35 (35 represents the digital asset quantity in the output data 62a), and the consumed asset quantity of the candidate transaction data for the target digital asset type is 2 (i.e., 37-35).
[0146] As Figure 6 As shown, when the target digital asset type is the digital asset type corresponding to the asset type identifier 61b, the number of input assets of the candidate transaction data for the target digital asset type is 20 (20 represents the number of digital assets in the output data 65c), the number of output assets of the candidate transaction data for the target digital asset type is 18 (i.e., 9+9, the former 9 represents the number of digital assets in the output data 62b, and the latter 9 represents the number of digital assets in the output data 62c), and the number of consumed assets of the candidate transaction data for the target digital asset type is 2 (i.e., 20-18).
[0147] In step S103, the K pre-consumed asset quantities and the asset type identifiers corresponding to the K digital asset types are used to generate the multi-asset pre-consumed transaction data corresponding to the proposed block.
[0148] Specifically, the packaging node can generate K pre-consumed output data according to the K pre-consumed asset quantities, the asset type identifiers corresponding to the K digital asset types, and the public key information of the packaging node. In other words, the packaging node can combine the K pre-consumed asset quantities, the asset type identifiers corresponding to the K digital asset types, and the public key information of the packaging node one by one to obtain K pre-consumed output data. The K pre-consumed output data includes candidate pre-consumed output data, which is associated with a candidate digital asset type in the K digital asset types; the candidate pre-consumed output data includes the pre-consumed asset quantity corresponding to the candidate digital asset type, the asset type identifier of the candidate digital asset type, and a pre-consumed output script, which is determined by the public key information of the packaging node (for example, the pre-consumed output script can be the public key information of the packaging node). Further, the packaging node can generate the multi-asset pre-consumed transaction data corresponding to the proposed block according to the default input data and the K pre-consumed output data. The multi-asset pre-consumed transaction data can include the default input data and the K pre-consumed output data, and the default input data is a null value (i.e., NULL) or a default identifier. The null value and the default identifier are both used to indicate that the transaction data is multi-asset pre-consumed transaction data, and the default identifier is an identifier used to indicate multi-asset pre-consumed transaction data. The specific content of the default identifier is not limited in the embodiments of the present application, for example, the default identifier can be "COINBASE". Therefore, the embodiments of the present application can realize the calculation of consumed assets through multi-asset pre-consumed transaction data, that is, the consumed assets are collected through multi-asset pre-consumed transaction data, thereby ensuring the security of the calculation of consumed assets.
[0149] The specific process of the packaging node generating the K pre-consumed output data in the multi-asset pre-consumed transaction data can be referred to formula (7):
[0150] CoinbaseTX.Outputs=∪Vout j (7)
[0151] wherein Vout j represents the jth pre-spending output data in the K pre-spending output data, CoinbaseTX represents the multi-asset pre-spending transaction data, and Outputs represents the output data of the multi-asset pre-spending transaction data, which is the union of the K pre-spending output data.
[0152] The specific process of the packaging node generating the candidate pre-spending output data in the K pre-spending output data can be seen from formula (8):
[0153] Vout j = <Pubkey, Fees[AssetID j ], AssetID j > (8)
[0154] wherein Vout j represents the jth pre-spending output data (for example, the candidate pre-spending output data) in the K pre-spending output data, Pubkey represents the output script (i.e., the pre-spending output script) of the jth pre-spending output data, and here the output script of the jth pre-spending output data is taken as the public key information (i.e., Pubkey) of the packaging node for example, Fees[AssetID j ] represents the pre-spending asset quantity (for example, the pre-spending asset quantity corresponding to the candidate digital asset type) of the jth pre-spending output data, and AssetID j represents the asset type identifier (for example, the asset type identifier of the candidate digital asset type) of the jth pre-spending output data.
[0155] Please refer to Figure 5 , for example, Figure 5 As shown, the asset issuing party (i.e., the target operation object) can perform step S11 to obtain the number of digital assets in the output data (not shown in the figure) pointed to by the input data 50b, determine the number of digital assets in the output data (not shown in the figure) pointed to by the input data 50b as the number of consumed assets for issuing the digital assets (i.e., the number of consumed assets of the target transaction data). Further, the asset issuing party can perform step S12 to issue the digital assets (i.e., newly issued digital assets) to the address of the asset issuing party itself through step S12, and determine the subsequent asset transfer, i.e., set the output script in the output data 50c to the public key information of the asset issuing party. Further, the packaging node can perform step S13 to perform transaction verification (i.e., verify the transaction) on the N transaction data (the N transaction data including the target transaction data) to obtain a transaction verification result after obtaining the N transaction data. Further, the packaging node can perform step S14 to collect the number of consumed assets of the target transaction data and the number of consumed assets of other transaction data in the proposed block except the target transaction data through step S14 when the transaction verification result indicates that the N transaction data are all verified successfully.
[0156] For ease of understanding, please refer to Figure 7 , Figure 7 is a scene diagram of a multi-asset pre-consumption transaction data provided by an embodiment of the present application. As shown in Figure 7 , the transaction identifier of the multi-asset pre-consumption transaction data is transaction identifier 70a, and here, an example is taken that the number of input data of the multi-asset pre-consumption transaction data is one and the number of output data of the multi-asset pre-consumption transaction data is three (i.e., K is equal to 3) to illustrate that one input data can include input data 70b and three output data can include output data 70c, output data 70d and output data 70e. In other words, the input data 70b can also be referred to as the default input data 70b, and the output data 70c, the output data 70d and the output data 70e can also be referred to as the pre-consumption output data 70c, the pre-consumption output data 70d and the pre-consumption output data 70e.
[0157] Among them, one output data in the multi-asset pre-consumption transaction data can correspond to one digital asset type, and the output data can pay (i.e., provide) the consumed assets of the pre-consumption asset quantity (i.e., the pre-consumption asset quantity mapped by the asset type identifier) corresponding to the digital asset type to the packaging node (or the public key information of the packaging node), for example, the jth Vout (i.e., the jth output data) in the multi-asset pre-consumption transaction data can pay (i.e., provide) the consumed assets of the pre-consumption asset quantity mapped by the jth asset type identifier (i.e., the asset type identifier in the jth output data) in the Fees to the packaging node (or the public key information of the packaging node).
[0158] S104, sending the proposal block carrying the multi-asset pre-consumption transaction data and the N transaction data to a verification node.
[0159] The proposal block can include the multi-asset pre-consumption transaction data and the N transaction data, and the verification node is configured to verify the K pre-consumption asset quantities in the multi-asset pre-consumption transaction data according to the N transaction data. The verification node belongs to a blockchain network to which the packaging node belongs.
[0160] The specific process of verifying the K pre-consumption asset quantities in the multi-asset pre-consumption transaction data according to the N transaction data by the verification node can be found in the following Figure 12 The description of steps S202-S203 in the corresponding embodiment.
[0161] As can be seen, the embodiments of the present application can introduce digital assets of multiple digital asset types in the blockchain network, and the digital assets of multiple digital asset types can be distinguished by asset type identifiers. The corresponding pre-consumption asset quantities can be calculated for the multiple asset type identifiers to generate multi-asset pre-consumption transaction data, thereby realizing the packaging and verification of the proposal block with multiple digital asset types. Therefore, the embodiments of the present application can support digital assets of multiple digital asset types on one blockchain, enrich the types of digital assets of the blockchain, and make the blockchain network adaptable to a multi-asset business scenario (i.e., a business scenario supporting digital assets of multiple digital asset types), thereby expanding the business scenarios of the blockchain network.
[0162] Further, please refer to Figure 8 , Figure 8 is a flowchart of a data processing method based on a blockchain provided by an embodiment of the present application. The data processing method can include steps S1011-S1013, and steps S1011-S1013 are Figure 3 one specific embodiment of step S101 in the corresponding embodiment.
[0163] S1011, obtaining target transaction data from N transaction data to be packaged into a proposal block, and obtaining a target asset type identifier from target output data of the target transaction data;
[0164] The target transaction data is associated with H digital asset types in the K digital asset types (i.e., the sum of the number of digital asset types of the digital assets used by the target transaction data and the number of digital asset types of the digital assets generated by the target transaction data is equal to H), and the H digital asset types include the digital asset type to be traversed. Here, H can be a positive integer less than or equal to K; the number of target input data of the target transaction data is R, and the R target input data can be collectively referred to as an input set, and the R target input data includes W target input data associated with the digital asset type to be traversed. Here, R can be a positive integer, and W can be a positive integer less than or equal to R; the number of target output data of the target transaction data is Y, and the Y target output data can be collectively referred to as an output set, and the Y target output data includes F target output data associated with the digital asset type to be traversed. Here, Y can be a positive integer, and F can be a positive integer less than or equal to Y.
[0165] When the target transaction data is asset issuance transaction data, the plurality of target input data indicates that a plurality of digital assets are used as issuance consumption assets, and the plurality of target output data indicates that a plurality of new assets are simultaneously issued; when the target transaction data is asset transfer transaction data, the plurality of target input data indicates that a plurality of digital assets are used as transfer digital assets and transfer consumption assets, and the plurality of target output data indicates that the digital assets are transferred to a plurality of target operation objects or a plurality of digital assets of a plurality of digital asset types are transferred to one target operation object.
[0166] Since the number of target output data can be one or more, and one or more target output data each includes a target asset type identifier, the number of target asset type identifiers can be one or more. The packaging node can perform identification matching between the one or more target asset type identifiers and an asset type identifier set maintained by the packaging node. The asset type identifier set can simultaneously exist one or more target asset type identifiers, or the asset type identifier set can simultaneously not exist one or more target asset type identifiers.
[0167] In step S1012, the target asset type identifier is subjected to identification matching with an asset type identifier set maintained by the packaging node. If the asset type identifier set exists the target asset type identifier, it is determined that the target transaction data is asset transfer transaction data, and the asset transfer transaction data is subjected to transaction verification to obtain a transaction verification result corresponding to the asset transfer transaction data.
[0168] It can be understood that the specific process of the packaging node performing identity verification can be described as follows: the packaging node can obtain target transaction output identities from R target input data of target transaction data (here, the target transaction data can be asset transfer transaction data) to be packaged into the proposal block, obtain the previous output data pointed to by the R target transaction output identities respectively, and obtain the previous asset type identities associated with the previous transaction data from the R previous output data respectively. The R previous output data can be previous output data in the same previous transaction data, or previous output data in different previous transaction data, and the previous asset type identities in the R previous output data can be the same or different. Further, the packaging node can obtain H target asset type identities corresponding to H digital asset types from the target output data of the target transaction data. The target asset type identities in the Y target output data of the target transaction data can be the same or different. Further, the packaging node can perform identity matching on the H target asset type identities and the R previous asset type identities, and if the H target asset type identities exist in the R previous asset type identities (that is, the H target asset type identities exist in the R previous asset type identities at the same time, or the R previous asset type identities and the H target asset type identities are the same), a transaction verification result indicating that the target transaction data is verified successfully is generated. Optionally, if the H target asset type identities do not exist in the R previous asset type identities (that is, the H target asset type identities do not exist in the R previous asset type identities at the same time, or the R previous asset type identities and the H target asset type identities are different), the packaging node can generate a transaction verification result indicating that the target transaction data is verified unsuccessfully. For ease of understanding, the transaction verification result herein can be referred to as a first transaction verification result.
[0169] The specific process of the packaging node performing identity verification can be seen from formula (9):
[0170] Txid1.Vout i .AssetID==Txid2.Vout j .AssetID (9)
[0171] Wherein, Txid1 and Txid2 represent two related transaction data, Txid2 represents target transaction data, Txid1 represents previous transaction data, Vout i represents the i th output data of the previous transaction data, Vout j The jth output data representing the target transaction data, i and j represent the subscripts of the output (i.e., output identifier) respectively, AssetID represents the target asset type identifier, and "==" represents the same. Equation (9) indicates that in the asset transfer scenario, after a transaction (e.g., target transaction data) uses a certain asset type identifier of digital assets, only the same asset type identifier of digital assets can be generated.
[0172] For ease of understanding, please refer to Figure 9 , Figure 9 is a scenario diagram of identity verification provided by an embodiment of the present application. As shown in Figure 9 , taking the target transaction data and the previous transaction data as asset transfer transaction data (i.e., multi-asset transfer transaction) as an example for illustration, the target transaction data is the asset transfer transaction data corresponding to transaction identifier 90b, and the previous transaction data is the asset transfer transaction data corresponding to transaction identifier 90a. Here, taking the number of input data of the target transaction data as one and the number of output data of the target transaction data as one as an example for illustration, one input data can include input data 92a, and one output data can include output data 92b; here, taking the number of input data of the previous transaction data as one and the number of output data of the previous transaction data as one as an example for illustration, one input data can include input data 91a, and one output data can include output data 91b.
[0173] As shown in Figure 9 , the packaging node can obtain the target transaction output identifier from the input data 92a of the target transaction data, obtain the previous output data (i.e., output data 91b) pointed to by the target transaction output identifier, and obtain the previous asset type identifier (i.e., asset type identifier 93b) from the previous output data. Further, the packaging node can obtain the target asset type (i.e., asset type identifier 93a) from the output data 92b of the target transaction data, and perform identity matching on the asset type identifier 93a and the asset type identifier 93b. Further, if the asset type identifier 93a and the asset type identifier 93b are the same, the packaging node can generate a first transaction verification result indicating that the target transaction data is verified successfully. Alternatively, if the asset type identifier 93a and the asset type identifier 93b are not the same, the packaging node can generate a first transaction verification result indicating that the target transaction data is verified unsuccessfully.
[0174] Understandably, the specific process of quantity verification by the packaging node can be described as follows: The packaging node can obtain the target transaction data to be packaged into the proposal block (here, the target transaction data can be asset transfer transaction data) for the input asset quantity of each of the H digital asset types, and obtain the output asset quantity of each of the H digital asset types. Furthermore, the packaging node can iterate through the H digital asset types to obtain the digital asset type D among the H digital asset types. i Here, i can be a positive integer less than or equal to H. Furthermore, if the target transaction data pertains to digital asset type D... i The input asset quantity is greater than or equal to the target transaction data for digital asset type D. i If the output asset quantity is given, the packaging node can determine the digital asset type D. i If verification is successful, the process continues iterating through the H digital asset types until all H digital asset types have been successfully verified. At this point, a transaction verification result is generated to indicate that the target transaction data has been successfully verified. Optionally, if the target transaction data pertains to digital asset type D... i The number of input assets is less than the target transaction data for digital asset type D. i If the output asset quantity is given, the packaging node can determine the digital asset type D. i The verification fails, and a transaction verification result is generated to indicate that the target transaction data verification has failed. For ease of understanding, this transaction verification result can be referred to as the second transaction verification result in this embodiment.
[0175] The packaging node can then continue traversing the H digital asset types to obtain digital asset type D from the H digital asset types. i+1 (Digital Asset Type D) i+1 For digital asset type D i The next digital asset type), targeting transaction data for digital asset type D i+1 The input asset quantity and target transaction data are for digital asset type D. i+1 The output asset quantity is compared. Specifically, the packaging node will target the transaction data for digital asset type D. i+1 The input asset quantity and target transaction data are for digital asset type D. i+1 For a detailed process of comparing the output asset quantities, please refer to Targeting Transaction Data for Digital Asset Type D. i The input asset quantity and target transaction data are for digital asset type D. i The description of comparing the output asset quantities will not be repeated here.
[0176] The packaging node can obtain target transaction output identifiers from W target input data of the target transaction data (i.e., W target input data associated with the digital asset type to be traversed, for example, the digital asset type to be traversed can be digital asset type D i ), respectively, obtain the preceding output data pointed to by the W target transaction output identifiers, respectively, and obtain the preceding digital asset quantity from the W preceding output data, respectively. The W preceding output data can be preceding output data in the same preceding transaction data, or can be preceding output data in different preceding transaction data. The preceding digital asset quantity in the W preceding output data can be the same or different. The W preceding digital asset quantity is the quantity of digital assets of the digital asset type to be traversed. Further, the packaging node can perform a summation operation on the W preceding digital asset quantity to obtain the input asset quantity of the target transaction data for the digital asset type to be traversed. For example, when the target transaction data is a multi-asset transfer transaction in the embodiment corresponding to the above Figure 6 , the input asset quantity of the target transaction data for the digital asset type corresponding to the asset type identifier 61a in the embodiment corresponding to the above Figure 6 is 37 (i.e., 18 + 19). For another example, when the target transaction data is a multi-asset transfer transaction in the embodiment corresponding to the above Figure 6 , the input asset quantity of the target transaction data for the digital asset type corresponding to the asset type identifier 61b in the embodiment corresponding to the above Figure 6 is 20.
[0177] The packaging node can obtain target digital asset quantity from F target output data of the target transaction data (i.e., F target output data associated with the digital asset type to be traversed, for example, the digital asset type to be traversed can be digital asset type D i ), respectively. The target digital asset quantity in the F target output data can be the same or different. The F target digital asset quantity is the quantity of digital assets of the digital asset type to be traversed. Further, the packaging node can perform a summation operation on the F target digital asset quantity to obtain the output asset quantity of the target transaction data for the digital asset type to be traversed. For example, when the target transaction data is a multi-asset transfer transaction in the embodiment corresponding to the above Figure 6 , the output asset quantity of the target transaction data for the digital asset type corresponding to the asset type identifier 61a in the embodiment corresponding to the above Figure 6 is 35. For another example, when the target transaction data is a multi-asset transfer transaction in the embodiment corresponding to the above Figure 6 , the output asset quantity of the target transaction data for the digital asset type corresponding to the asset type identifier 61b in the embodiment corresponding to the above Figure 6 The asset type identifier 61b in the corresponding embodiment corresponds to the digital asset type, and the target transaction data is 18 (i.e., 9+9) for the output asset quantity of the digital asset type to be traversed.
[0178] For ease of understanding, please refer to Figure 10 , Figure 10 is a quantity verification scenario provided by an embodiment of the present application. As Figure 10 indicated, taking the target transaction data and the preceding transaction data as asset transfer transaction data (i.e., multi-asset transfer transaction) as an example for illustration, the target transaction data is the asset transfer transaction data corresponding to the transaction identifier 100b, and the preceding transaction data is the asset transfer transaction data corresponding to the transaction identifier 100a and the asset transfer transaction data corresponding to the transaction identifier 100c. Here, the quantity of the digital asset type associated with the target transaction data is one. Among them, taking the quantity of the input data of the target transaction data as two and the quantity of the output data of the target transaction data as one as an example for illustration, the two input data can include input data 102a and input data 102b, and the one output data can include output data 102c; taking the quantity of the input data of the preceding transaction data corresponding to the transaction identifier 100a as one and the quantity of the output data of the preceding transaction data corresponding to the transaction identifier 100a as one as an example for illustration, the one input data can include input data 101a, and the one output data can include output data 101b; taking the quantity of the input data of the preceding transaction data corresponding to the transaction identifier 100c as one and the quantity of the output data of the preceding transaction data corresponding to the transaction identifier 100c as one as an example for illustration, the one input data can include input data 103a, and the one output data can include output data 103b.
[0179] As Figure 10 indicated, the packaging node can obtain the target transaction output identifier from the input data 102a and the input data 102b of the target transaction data, respectively, obtain the preceding output data (i.e., the output data 101b and the output data 103b) pointed to by the target transaction output identifier in the input data 102a and the input data 102b, respectively, and obtain the preceding digital asset quantity (i.e., the digital asset quantity 104a and the digital asset quantity 104b) from the preceding output data. Further, the packaging node can perform a summation operation on the digital asset quantity 104a and the digital asset quantity 104b to obtain the input asset quantity of the target transaction data (i.e., the digital asset quantity 104a+the digital asset quantity 104b).
[0180] As Figure 10 As shown, the packaging node can obtain the target digital asset quantity (i.e., digital asset quantity 104c) from the output data 102c of the target transaction data, and determine the digital asset quantity 104c as the output asset quantity of the target transaction data.
[0181] like Figure 10 As shown, if the number of input assets in the target transaction data (i.e., the number of digital assets 104a + 104b) is greater than or equal to the number of output assets in the target transaction data (i.e., the number of digital assets 104c), the packaging node can generate a second transaction verification result indicating that the target transaction data has been successfully verified. Optionally, if the number of input assets in the target transaction data (i.e., the number of digital assets 104a + 104b) is less than the number of output assets in the target transaction data (i.e., the number of digital assets 104c), the packaging node can generate a second transaction verification result indicating that the target transaction data has failed to be verified.
[0182] It can be understood that the specific process of the packaging node performing script verification can be described as follows: the packaging node can obtain target transaction output identifiers and target input scripts from R target input data of target transaction data (here, the target transaction data can be asset transfer transaction data) to be packaged into a proposed block, obtain the previous output data pointed to by the R target transaction output identifiers respectively, and obtain the previous output scripts from the R previous output data respectively. The R previous output data can be previous output data in the same previous transaction data, or can be previous output data in different previous transaction data, and the previous output scripts in the R previous output data can be the same or different. Further, the packaging node can obtain target signature information of the target transaction data from the R target input scripts respectively, and obtain previous public key information of an operation object from the R previous output scripts. The target signature information in the R target input scripts can be the same or different, the previous public key information in the R previous output scripts can be the same or different, and the digital asset used by the target transaction data belongs to the operation object (which can also be referred to as a previous operation object). Further, the packaging node can perform signature verification on the R target signature information according to the R previous public key information to obtain a signature verification result. The previous public key information and the target signature information used for signature verification are associated, that is, the previous public key information and the target signature information used for signature verification are determined by the same target input data, and the target transaction output identifier in the target input data to which the target signature information belongs is used to point to the previous output data to which the previous public key information belongs. Further, if the signature verification result indicates that the R target signature information is successfully verified, the packaging node can generate a transaction verification result indicating that the target transaction data is successfully verified. Alternatively, if the signature verification result indicates that there is target signature information in the R target signature information that fails to be verified, the packaging node can generate a transaction verification result indicating that the target transaction data fails to be verified. For ease of understanding, the transaction verification result herein can be referred to as a third transaction verification result.
[0183] The digital asset used by the target transaction data can belong to the same operation object (i.e., a previous operation object) or different operation objects (i.e., a previous operation object). When the digital asset used by the target transaction data belongs to different operation objects, different operation objects can be used to generate different target signature information, and the different target signature information is obtained by signing the different operation objects by a block chain private key (i.e., private key information corresponding to the previous public key information).
[0184] For ease of understanding, please refer to Figure 11 , Figure 11 is a scenario diagram of script verification provided by an embodiment of the present application. As Figure 11 The following example illustrates a multi-asset transfer transaction, where the target transaction data and preceding transaction data are both asset transfer transaction data. The target transaction data is the asset transfer transaction data corresponding to transaction identifier 110b, and the preceding transaction data is the asset transfer transaction data corresponding to transaction identifier 110a. Specifically, this example uses one input data point and one output data point for the target transaction data. One input data point can include input data 112a, and one output data point can include output data 112b. Similarly, this example uses one input data point and one output data point for the preceding transaction data. One input data point can include input data 111a, and one output data point can include output data 111b.
[0185] like Figure 11 As shown, the packaging node can obtain the target transaction output identifier and target input script (i.e., input script 113b) from the input data 112a of the target transaction data, obtain the preceding output data (i.e., output data 111b) pointed to by the target transaction output identifier, and obtain the preceding output script (i.e., output script 113a) from the preceding output data. Further, the packaging node can obtain the target signature information (hereinafter referred to as signature information) of the target transaction data from the input script 113b, obtain the preceding public key information (hereinafter referred to as public key information) of the preceding operation object from the output script 113a, and perform signature verification processing on the signature information based on the public key information to obtain the signature verification result. Further, if the signature verification result indicates successful verification, the packaging node can generate a third transaction verification result indicating successful verification of the target transaction data. Optionally, if the signature verification result indicates failed verification, the packaging node can generate a third transaction verification result indicating failed verification of the target transaction data.
[0186] It should be understood that, in this application embodiment, a transaction verification result indicating successful verification of the asset transfer transaction data can be generated when the first transaction verification result, the second transaction verification result, and the third transaction verification result all indicate successful verification of the asset transfer transaction data. Optionally, in this application embodiment, a transaction verification result indicating failed verification of the asset transfer transaction data can be generated when the first transaction verification result, the second transaction verification result, or the third transaction verification result indicates failed verification of the asset transfer transaction data. In other words, the transaction verification result corresponding to the asset issuance transaction data is determined by the first transaction verification result, the second transaction verification result, and the third transaction verification result. Optionally, the transaction verification result corresponding to the asset issuance transaction data can also be determined by the first transaction verification result, the second transaction verification result, or the third transaction verification result.
[0187] In step S1013, if the target asset type identifier is not in the asset type identifier set, it is determined that the target transaction data is asset issuance transaction data, the target asset type identifier is added to the asset type identifier set, the asset issuance transaction data is verified, and a transaction verification result corresponding to the asset issuance transaction data is obtained.
[0188] It can be understood that the specific process of script verification by the packaging node can be described as follows: the packaging node can obtain target transaction output identifiers and target input scripts from R target input data of target transaction data (here, the target transaction data can be asset issuance transaction data) to be packaged into a proposed block, obtain R preceding output data pointed to by the R target transaction output identifiers, respectively, and obtain preceding output scripts from the R preceding output data, respectively. The R preceding output data can be preceding output data in the same preceding transaction data, or preceding output data in different preceding transaction data, and the preceding output scripts in the R preceding output data can be the same or different. Further, the packaging node can obtain target signature information of the target transaction data from the R target input scripts, respectively, and obtain preceding public key information of an operation object from the R preceding output scripts. The target signature information in the R target input scripts can be the same or different, the preceding public key information in the R preceding output scripts can be the same or different, and the digital asset used by the target transaction data belongs to the operation object (which can also be referred to as a preceding operation object). Further, the packaging node can perform signature verification on the R target signature information according to the R preceding public key information to obtain a signature verification result. The preceding public key information and the target signature information for signature verification are associated, that is, the preceding public key information and the target signature information for signature verification are determined by the same target input data, and the target transaction output identifier in the target input data to which the target signature information belongs is used to point to the preceding output data to which the preceding public key information belongs. Further, if the signature verification result indicates that the R target signature information is successfully verified, the packaging node can generate a transaction verification result indicating that the target transaction data is successfully verified. Alternatively, if the signature verification result indicates that there is target signature information in the R target signature information that fails to be verified, the packaging node can generate a transaction verification result indicating that the target transaction data fails to be verified. For ease of understanding, the transaction verification result herein can be referred to as a third transaction verification result.
[0189] It should be understood that the embodiments of the present application can generate a transaction verification result for indicating that the asset issuance transaction data is verified successfully when the third transaction verification result indicates that the asset issuance transaction data is verified successfully. Alternatively, the embodiments of the present application can generate a transaction verification result for indicating that the asset issuance transaction data is verified unsuccessfully when the third transaction verification result indicates that the asset issuance transaction data is verified unsuccessfully. In other words, the transaction verification result corresponding to the asset issuance transaction data is determined by the third transaction verification result.
[0190] Therefore, the embodiments of the present application can obtain the target asset type identifier from the target transaction data to be packaged into the proposed block, perform identifier matching between the target asset type identifier and the asset type identifier set, determine that the target transaction data is asset transfer transaction data or asset issuance transaction data, and then perform transaction verification on the target transaction data according to the transaction type (i.e., asset transfer transaction data or asset issuance transaction data) of the target transaction data, thereby improving the accuracy of transaction verification.
[0191] Further, please refer to Figure 12 , Figure 12 is a flow diagram of a data processing method based on a block chain provided by the embodiments of the present application. The data processing method can be executed by a verification node, which can be the verification node 20b of the above-mentioned Figure 2b embodiments. The data processing method can include steps S201-S203.
[0192] Step S201, receiving a proposed block carrying multi-asset pre-consumption transaction data and N transaction data sent by a packaging node;
[0193] Wherein, the N transaction data is associated with asset type identifiers of K digital asset types, and the K digital asset types include a target digital asset type. Here, N can be a positive integer, and K can be an integer greater than 1. The multi-asset pre-consumption transaction data is generated by the packaging node according to the pre-consumption asset quantity of the K digital asset types and the asset type identifier of the K digital asset types. The K pre-consumption asset quantities are obtained by performing asset consumption operation on the N transaction data according to the asset type identifiers associated with the N transaction data when the N transaction data is all verified successfully. The packaging node belongs to a block chain network to which the verification node belongs.
[0194] The specific process of generating the multi-asset pre-consumption transaction data by the packaging node according to the K pre-consumption asset quantities and the K asset type identifiers can be referred to the above-mentioned Figure 3 The description of step S103 in the corresponding embodiment will not be repeated here; the specific process of the packaging node performing asset consumption operation on the N pieces of transaction data according to the asset type identifier associated with the N pieces of transaction data can be referred to the above description Figure 3 The description of step S102 in the corresponding embodiment will not be repeated here.
[0195] It should be understood that the verification receiving can identify the multi-asset pre-consumption transaction data and the N pieces of transaction data in the proposed block after receiving the proposed block, and there is and only one multi-asset pre-consumption transaction data in the proposed block (i.e., there is and only one multi-asset pre-consumption transaction data in one block). Among them, the packaging node can take the multi-asset pre-consumption transaction data as the first transaction in the proposed block (i.e., add the multi-asset pre-consumption transaction data to the first position of the proposed block), and the verification node can obtain the first transaction in the proposed block as the multi-asset pre-consumption transaction data. Optionally, the packaging node can add the multi-asset pre-consumption transaction data to any position of the proposed block (for example, the end of the block), and the verification node can traverse the N+1 pieces of transaction data in the proposed block (the multi-asset pre-consumption transaction data is the transaction data used to calculate the consumed asset, and the multi-asset pre-consumption transaction data is a special transaction data) to identify the multi-asset pre-consumption transaction data and the N pieces of transaction data.
[0196] The specific process of the verification node identifying the multi-asset pre-consumption transaction data can be referred to formula (10) and formula (11):
[0197]
[0198]
[0199] Among them, "COINBASE" represents a default identifier, NULL represents a null value, TX i represents the i-th transaction data in the N+1 pieces of transaction data, TX j represents the j-th transaction data in the N+1 pieces of transaction data, TX i .Input represents the input data of the i-th transaction data, TX j .Input represents the input data of the j-th transaction data, or represents or, == represents equal,!= represents not equal, represents the existential quantifier, The formula (10) represents that there is i such that the input data of the i th transaction data is null or a default identifier, the formula (11) represents that there is no j (j is different from i) such that the input data of the j th transaction data is null or a default identifier, and the formula (10) and the formula (11) together represent that the verification node can determine that there is and only one i such that the input data of the i th transaction data is a default identifier or null, the i th transaction data is multi-asset pre-consumption transaction data, and the transaction data of the i th transaction data in the N+1 transaction data is N transaction data.
[0200] In step S202, asset consumption operations are performed on the N transaction data according to the asset type identifiers associated with the N transaction data, to obtain consumable asset quantities corresponding to K digital asset types respectively.
[0201] Specifically, the verification node can obtain G transaction data associated with a target digital asset type from the N transaction data according to the asset type identifiers associated with the N transaction data. Here, G can be a positive integer less than or equal to N; if the G transaction data include the target transaction data, the target asset type identifier or the previous asset type identifier includes the asset type identifier of the target digital asset type; if the G transaction data do not include the target transaction data, the target asset type identifier and the previous asset type identifier do not include the asset type identifier of the target digital asset type. Further, the verification node can obtain consumable asset quantities of the G transaction data with respect to the target digital asset type, and perform summation operations on the G consumable asset quantities to obtain a consumable asset quantity corresponding to the target digital asset type. The consumable asset quantity refers to the maximum value of the consumable asset allowed by the verification node.
[0202] The G transaction data associated with the target digital asset type include the candidate transaction data. It can be understood that if the candidate transaction data is asset transfer transaction data, the verification node can obtain the input asset quantity of the candidate transaction data with respect to the target digital asset type, obtain the output asset quantity of the candidate transaction data with respect to the target digital asset type, and perform difference operations on the input asset quantity of the candidate transaction data with respect to the target digital asset type and the output asset quantity of the candidate transaction data with respect to the target digital asset type to obtain the consumable asset quantity of the candidate transaction data with respect to the target digital asset type. The consumable asset quantity represents the maximum consumable asset (i.e., transfer consumable asset) that can be paid for asset transfer. Alternatively, if the candidate transaction data is asset issuance transaction data, the verification node can obtain the input asset quantity of the candidate transaction data with respect to the target digital asset type, and determine the input asset quantity of the candidate transaction data with respect to the target digital asset type as the consumable asset quantity of the candidate transaction data with respect to the target digital asset type. The consumable asset quantity represents the maximum consumable asset (i.e., issuance consumable asset) that can be paid for asset issuance.
[0203] The specific process of the verification node obtaining the number of input assets of the candidate transaction data for the target digital asset type can refer to the description of the packaging node obtaining the number of input assets of the target transaction data for the digital asset type to be traversed, which will not be described here. The specific process of the verification node obtaining the number of output assets of the candidate transaction data for the target digital asset type can refer to the description of the packaging node obtaining the number of output assets of the target transaction data for the digital asset type to be traversed, which will not be described here.
[0204] The specific process of the verification node performing asset consumption operation on the N pieces of transaction data can refer to formula (12):
[0205] MaxFees[AssetID] += TX i .Input[AssetID].Amount - TX i .Output[AssetID].Amount (12)
[0206] Wherein, AssetID represents an asset type identifier (for example, an asset type identifier of the target digital asset type), TX i represents the i-th transaction data (for example, candidate transaction data) in the N pieces of transaction data, Input represents the input data of the i-th transaction data, and Output represents the output data of the i-th transaction data, TX i .Input[AssetID].Amount represents the number of input assets of the i-th transaction data for the digital asset type (for example, the target digital asset type), TX i .Output[AssetID].Amount represents the number of output assets of the i-th transaction data for the digital asset type (for example, the target digital asset type), TX i .Input[AssetID].Amount - TX i .Output[AssetID].Amount represents the number of consumed assets of the i-th transaction data for the digital asset type (for example, the target digital asset type), MaxFees[AssetID]
[0207] represents the number of consumable assets corresponding to the digital asset type (for example, the target digital asset type). Wherein, MaxFees represents a mapping from the asset type identifier to the number of consumable assets, which can also be regarded as an array.
[0208] Optionally, the verification node can perform transaction verification on the N pieces of transaction data in the proposed block to obtain a transaction verification result. Further, if the transaction verification result indicates that the N pieces of transaction data are all successfully verified, the verification node can perform asset consumption operation on the N pieces of transaction data according to the asset type identifiers associated with the N pieces of transaction data to obtain K numbers of consumable assets corresponding to the K types of digital assets respectively. The specific process of the verification node performing transaction verification on the N pieces of transaction data in the proposed block can be referred to the description of the embodiment corresponding to the above. Figure 3 The description of the packaging node performing transaction verification on the N pieces of transaction data to be packaged into the proposed block in the embodiment corresponding to the above will not be repeated here.
[0209] In step S203, asset verification is performed on K numbers of pre-consumed asset amounts in the multi-asset pre-consumption transaction data according to the K numbers of consumable assets to obtain an asset verification result.
[0210] Specifically, the verification node can perform asset verification on the K numbers of pre-consumed asset amounts in the multi-asset pre-consumption transaction data according to the K numbers of consumable assets to obtain K type verification results corresponding to the K types of digital assets respectively. The verification node can traverse K pieces of output data (i.e., K pieces of pre-consumed output data) in the multi-asset pre-consumption transaction data to obtain the pre-consumed asset amounts in the K pieces of pre-consumed output data. Further, if the K type verification results all indicate successful verification, the verification node can generate an asset verification result indicating successful verification. Optionally, if there is a type verification result indicating failed verification in the K type verification results, the verification node can generate an asset verification result indicating failed verification. Therefore, the consensus of the consumed assets can be realized through the asset verification result in the embodiments of the present application, and the consensus security of the consumed assets is ensured.
[0211] K digital asset types include a to-be-verified digital asset type, K consumable asset quantities include a consumable asset quantity corresponding to the to-be-verified digital asset type, and K pre-consumed asset quantities in the multi-asset pre-consumption transaction data include a pre-consumed asset quantity corresponding to the to-be-verified digital asset type. It can be understood that if the consumable asset quantity corresponding to the to-be-verified digital asset type is greater than or equal to the pre-consumed asset quantity corresponding to the to-be-verified digital asset type, the verification node can generate a type verification result corresponding to the to-be-verified digital asset type indicating that the verification is successful (that is, the type verification result corresponding to the to-be-verified digital asset type indicates that the verification is successful), and determine that the consumed asset collected by the packaging node is reasonable. Optionally, if the consumable asset quantity corresponding to the to-be-verified digital asset type is less than the pre-consumed asset quantity corresponding to the to-be-verified digital asset type, the verification node can generate a type verification result corresponding to the to-be-verified digital asset type indicating that the verification fails (that is, the type verification result corresponding to the to-be-verified digital asset type indicates that the verification fails), and determine that the consumed asset collected by the packaging node is unreasonable.
[0212] The specific process in which the verification node obtains K digital asset types in the multi-asset pre-consumption transaction data can be referred to formula (13):
[0213] AssetID j =TX i .Outputs.Vout j .AssetID (13)
[0214] Wherein, TX i represents the multi-asset pre-consumption transaction data, Outputs represents the output data of the multi-asset pre-consumption transaction data (that is, K pre-consumption output data), Vout j represents the jth output data of the multi-asset pre-consumption transaction data, AssetID represents the asset type identifier in the jth output data, AssetID j represents the jth asset type identifier of the multi-asset pre-consumption transaction data, that is, AssetID j represents the jth digital asset type of the multi-asset pre-consumption transaction data.
[0215] The specific process in which the verification node performs asset verification on K pre-consumption asset quantities according to K consumable asset quantities can be referred to formula (14):
[0216] MaxFees[AssetID j ]≥TX i .Outputs.Vout j .Amount (14)
[0217] Wherein, TX i The multi-asset pre-spending transaction data, the Outputs represent output data of the multi-asset pre-spending transaction data (i.e., K pre-spending output data), Vout j The jth output data of the multi-asset pre-spending transaction data, the Amount represents the quantity of digital assets in the jth output data (i.e., the quantity of pre-spending assets corresponding to the jth digital asset type), MaxFees[AssetID j ] represents the quantity of consumable assets corresponding to the jth digital asset type.
[0218] For ease of understanding, please refer to Figure 13 , Figure 13 is a scene diagram of asset verification provided by an embodiment of the present application. As Figure 13 indicated, the verification node can obtain multi-asset pre-spending transaction data and N transaction data from the proposal block, and the N transaction data can specifically include transaction data 133a, …, transaction data 133b.
[0219] As Figure 13 indicated, the verification node can obtain asset type identifiers associated with the N transaction data, and here, the number of asset type identifiers associated with the N transaction data is taken as two for illustration, and the two asset type identifiers can include asset type identifier 131a and asset type identifier 131b. Further, the verification node can perform asset spending operation on the N transaction data according to the asset type identifiers associated with the N transaction data, to obtain the quantity of consumable assets corresponding to K digital asset types respectively (i.e., the quantity of consumable assets corresponding to K asset type identifiers respectively). The quantity of consumable assets corresponding to the asset type identifier 131a is the quantity of consumable assets 134a, and the quantity of consumable assets corresponding to the asset type identifier 131b is the quantity of consumable assets 134b.
[0220] As Figure 13 indicated, the verification node can obtain the quantity of pre-spending assets corresponding to K digital asset types respectively (i.e., the quantity of pre-spending assets corresponding to K asset type identifiers respectively) from the multi-asset pre-spending transaction data. The quantity of pre-spending assets corresponding to the asset type identifier 131a is the quantity of pre-spending assets 132a, and the quantity of pre-spending assets corresponding to the asset type identifier 131b is the quantity of pre-spending assets 132b.
[0221] As Figure 13 As shown, the verification node can perform asset verification on the K pre-consumable asset quantities based on the K consumable asset quantities (i.e., verify the pre-consumable asset quantity 132a based on consumable asset data 134a, and verify the pre-consumable asset quantity 132b based on consumable asset data 134b), and obtain the type verification results corresponding to the K digital asset types respectively. Then, the asset verification result of the proposed block is determined based on the type verification results corresponding to the K digital asset types respectively.
[0222] Please see again. Figure 7 ,like Figure 7 As shown, the packaging node can execute step S21, which involves calculating the pre-consumed asset quantity and generating multi-asset pre-consumed transaction data. Specifically, based on the asset type identifiers associated with N transaction data, asset consumption calculations are performed on the N transaction data to obtain the pre-consumed asset quantities corresponding to K digital asset types. Then, based on the K pre-consumed asset quantities and the asset type identifiers corresponding to the K digital asset types, multi-asset pre-consumed transaction data corresponding to the proposal block is generated. The N transaction data may specifically include transaction data 71a, ..., and transaction data 71b. Further, the packaging node can send the proposal block carrying the multi-asset pre-consumed transaction data and the N transaction data to the verification node.
[0223] like Figure 7 As shown, after receiving the proposal block sent by the packaging node, the verification node can execute step S22. Step S22 identifies the multi-asset pre-consumption transaction data and N transaction data in the proposal block, and then executes step S23. In step S23, when executing the N transaction data (i.e., transaction data 71a, ..., transaction data 71b), the number of consumable assets is calculated. Specifically, based on the asset type identifiers associated with the N transaction data, asset consumption calculations are performed on the N transaction data to obtain the consumable asset quantities corresponding to K digital asset types. Further, the verification node can execute step S24. In step S24, based on the K consumable asset quantities, asset verification is performed on the K pre-consumption asset quantities in the multi-asset pre-consumption transaction data to obtain the asset verification results.
[0224] It should be understood that if the asset verification result indicates successful verification, the verification node can determine that the proposed block is valid and add it to the blockchain of the blockchain network, and determine that N transactions were executed successfully. Optionally, if the asset verification result indicates failed verification, the verification node can determine that the proposed block is invalid and discard it, and determine that N transactions failed to execute.
[0225] It can be seen that the embodiment of the application can introduce a plurality of digital asset types of digital assets in the blockchain network, the plurality of digital asset types of digital assets can be distinguished by asset type identifiers, the plurality of asset type identifiers can calculate corresponding pre-consumed asset quantities to generate multi-asset pre-consumed transaction data, thereby realizing packaging and verification of a proposed block with a plurality of digital asset types. Therefore, the embodiment of the application can support a plurality of digital asset types of digital assets on a blockchain, enrich the types of digital assets of the blockchain, and enable the blockchain network to adapt to a multi-asset business scenario (i.e., a business scenario supporting a plurality of digital asset types of digital assets), thereby expanding the business scenarios of the blockchain network.
[0226] Further, please refer to Figure 14 , Figure 14 is a structural schematic diagram of a data processing device based on a blockchain provided by the embodiment of the application. The data processing device 1 can run on a packaging node, and the data processing device 1 can include a transaction verification module 11, a pre-consumption operation module 12, a transaction generation module 13, and a block sending module 14.
[0227] The transaction verification module 11 is configured to perform transaction verification on N transaction data to be packaged into a proposed block to obtain a transaction verification result; the N transaction data is associated with K asset type identifiers of digital asset types; N is a positive integer, and K is an integer greater than 1.
[0228] The N transaction data includes target transaction data, the target transaction data includes target input data and target output data, the target input data includes a target input script and a target transaction output identifier, and the target output data includes a target output script, a target digital asset quantity, and a target asset type identifier; the target transaction output identifier is used to point to the previous output data of the previous transaction data corresponding to the target transaction data, and the previous output data is used to provide the digital asset used by the target transaction data; the target asset type identifier is used to indicate the digital asset type of the digital asset generated by the target transaction data; the target digital asset quantity is used to indicate the quantity of the digital asset generated by the target transaction data; and the target input script and the target output script are used for transaction verification.
[0229] The transaction verification module 11 is specifically configured to obtain the target transaction data from the N transaction data to be packaged into the proposed block, and obtain the target asset type identifier from the target output data of the target transaction data.
[0230] The transaction verification module 11 is specifically configured to identify and match the target asset type identifier with an asset type identifier set maintained by the packaging node, and if the asset type identifier set contains the target asset type identifier, determine that the target transaction data is asset transfer transaction data, perform transaction verification on the asset transfer transaction data, and obtain a transaction verification result corresponding to the asset transfer transaction data.
[0231] The transaction verification module 11 is specifically configured to add the target asset type identifier to the asset type identifier set, perform transaction verification on the asset issuance transaction data, and obtain a transaction verification result corresponding to the asset issuance transaction data.
[0232] The target transaction data is associated with H digital asset types in the K digital asset types; H is a positive integer less than or equal to K; the target transaction data has R target input data; and R is a positive integer.
[0233] The transaction verification module 11 is specifically configured to obtain R target transaction output identifiers from the R target input data of the target transaction data to be packaged into the proposed block, obtain the preceding output data pointed to by the R target transaction output identifiers respectively, and obtain the preceding asset type identifiers associated with the preceding transaction data from the R preceding output data respectively.
[0234] The transaction verification module 11 is specifically configured to obtain the target asset type identifiers corresponding to the H digital asset types from the target output data of the target transaction data.
[0235] The transaction verification module 11 is specifically configured to identify and match the H target asset type identifiers with the R preceding asset type identifiers, and if the H target asset type identifiers exist in the R preceding asset type identifiers, generate a transaction verification result indicating that the target transaction data is verified successfully.
[0236] The transaction verification module 11 is specifically configured to generate a transaction verification result indicating that the target transaction data is verified unsuccessfully if the H target asset type identifiers do not exist in the R preceding asset type identifiers.
[0237] The target transaction data is associated with H digital asset types in the K digital asset types; H is a positive integer less than or equal to K.
[0238] The transaction verification module 11 is specifically configured to obtain the input asset quantity of the target transaction data for the H digital asset types to be packaged into the proposed block, and obtain the output asset quantity of the target transaction data for the H digital asset types.
[0239] The transaction verification module 11 is specifically configured to traverse H digital asset types to obtain a digital asset type D in the H digital asset types i ; i is a positive integer less than or equal to H;
[0240] The transaction verification module 11 is specifically configured to, if the number of input assets of the target transaction data for the digital asset type D i is greater than or equal to the number of output assets of the target transaction data for the digital asset type D i , determine that the digital asset type D i is verified successfully, and continue to traverse the H digital asset types until it is determined that the H digital asset types are all verified successfully, and generate a transaction verification result indicating that the target transaction data is verified successfully.
[0241] The transaction verification module 11 is specifically configured to, if the number of input assets of the target transaction data for the digital asset type D i is less than the number of output assets of the target transaction data for the digital asset type D i , determine that the digital asset type D i is verified unsuccessfully, and generate a transaction verification result indicating that the target transaction data is verified unsuccessfully.
[0242] The H digital asset types include a digital asset type to be traversed; the target transaction data has R target input data; R is a positive integer; the R target input data includes W target input data associated with the digital asset type to be traversed; W is a positive integer less than or equal to R;
[0243] The transaction verification module 11 is specifically configured to obtain, from the W target input data of the target transaction data to be packaged into the proposed block, target transaction output identifiers respectively, obtain the preceding output data respectively pointed to by the W target transaction output identifiers, and obtain the preceding digital asset quantities respectively from the W preceding output data; the W preceding digital asset quantities are the quantities of digital assets having the digital asset type to be traversed.
[0244] The transaction verification module 11 is specifically configured to perform summation operation on the W preceding digital asset quantities to obtain the number of input assets of the target transaction data for the digital asset type to be traversed.
[0245] The target transaction data has R target input data; R is a positive integer;
[0246] The transaction verification module 11 is specifically configured to obtain, from the R target input data of the target transaction data to be packaged into the proposed block, target transaction output identifiers and target input scripts respectively, obtain the preceding output data respectively pointed to by the R target transaction output identifiers, and obtain the preceding output scripts respectively from the R preceding output data.
[0247] The transaction verification module 11 is specifically configured to obtain target signature information of target transaction data from R target input scripts respectively, and obtain operation object pre-sequence public key information from R pre-sequence output scripts; the digital asset used by the target transaction data belongs to the operation object;
[0248] The transaction verification module 11 is specifically configured to perform signature verification processing on the R target signature information according to the R pre-sequence public key information, to obtain a signature verification result;
[0249] The transaction verification module 11 is specifically configured to, if the signature verification result indicates that the R target signature information are all successfully verified, generate a transaction verification result indicating that the target transaction data is successfully verified;
[0250] The transaction verification module 11 is specifically configured to, if the signature verification result indicates that there is target signature information in the R target signature information that fails to be verified, generate a transaction verification result indicating that the target transaction data fails to be verified.
[0251] The pre-consumption operation module 12 is configured to, if the transaction verification result indicates that the N transaction data are all successfully verified, perform asset consumption operation on the N transaction data according to asset type identifiers associated with the N transaction data, to obtain pre-consumption asset quantities corresponding to K digital asset types respectively;
[0252] The K digital asset types include a target digital asset type.
[0253] The pre-consumption operation module 12 is specifically configured to obtain, according to the asset type identifiers associated with the N transaction data, G transaction data associated with the target digital asset type from the N transaction data; G is a positive integer less than or equal to N;
[0254] The pre-consumption operation module 12 is specifically configured to obtain consumption asset quantities of the G transaction data for the target digital asset type respectively, and perform summation operation on the G consumption asset quantities to obtain a pre-consumption asset quantity corresponding to the target digital asset type.
[0255] The G transaction data include candidate transaction data.
[0256] The pre-consumption operation module 12 is specifically configured to, if the candidate transaction data is asset transfer transaction data, obtain an input asset quantity of the candidate transaction data for the target digital asset type, obtain an output asset quantity of the candidate transaction data for the target digital asset type, and perform difference operation on the input asset quantity of the candidate transaction data for the target digital asset type and the output asset quantity of the candidate transaction data for the target digital asset type, to obtain a consumption asset quantity of the candidate transaction data for the target digital asset type.
[0257] The pre-consumption operation module 12 is specifically configured to, if the candidate transaction data is asset issuance transaction data, acquire an input asset quantity of the candidate transaction data for a target digital asset type, determine the input asset quantity of the candidate transaction data for the target digital asset type as a consumption asset quantity of the candidate transaction data for the target digital asset type.
[0258] The transaction generation module 13 is configured to generate multi-asset pre-consumption transaction data corresponding to the proposed block according to the K pre-consumption asset quantities and asset type identifiers respectively corresponding to the K digital asset types.
[0259] The transaction generation module 13 is specifically configured to generate K pre-consumption output data according to the K pre-consumption asset quantities, asset type identifiers respectively corresponding to the K digital asset types, and public key information of the packaging node; the K pre-consumption output data includes candidate pre-consumption output data, the candidate pre-consumption output data is associated with a candidate digital asset type in the K digital asset types; the candidate pre-consumption output data includes a pre-consumption asset quantity corresponding to the candidate digital asset type, an asset type identifier of the candidate digital asset type, and a pre-consumption output script; the pre-consumption output script is determined by the public key information of the packaging node.
[0260] The transaction generation module 13 is specifically configured to generate multi-asset pre-consumption transaction data corresponding to the proposed block according to the default input data and the K pre-consumption output data; the default input data is a null value or a default identifier.
[0261] The block sending module 14 is configured to send the proposed block carrying the multi-asset pre-consumption transaction data and the N transaction data to a verification node; the verification node is configured to perform asset verification on the K pre-consumption asset quantities in the multi-asset pre-consumption transaction data according to the N transaction data; the verification node belongs to a blockchain network to which the packaging node belongs.
[0262] The specific implementation manners of the transaction verification module 11, the pre-consumption operation module 12, the transaction generation module 13, and the block sending module 14 can be referred to the descriptions of the specific implementation manners of the transaction verification module 11, the pre-consumption operation module 12, the transaction generation module 13, and the block sending module 14 in the above Figure 3 The descriptions of steps S101-S104 and steps S1011-S1013 in the above Figure 8 The descriptions of steps S101-S104 and steps S1011-S1013 in the above
[0263] Further, please refer to Figure 15 , Figure 15 Fig. 1 is a structural schematic diagram of a data processing device based on a block chain provided by an embodiment of the present application. The data processing device 2 can run on a verification node, and the data processing device 2 can include a block receiving module 21, a consumable operation module 22, and an asset verification module 23. Further, the data processing device 2 can also include a data processing module 24.
[0264] The block receiving module 21 is configured to receive a proposal block carrying multi-asset pre-consumption transaction data and N pieces of transaction data sent by a packaging node; the N pieces of transaction data are associated with asset type identifiers of K digital asset types; N is a positive integer, and K is an integer greater than 1; the multi-asset pre-consumption transaction data is generated by the packaging node according to pre-consumption asset quantities of the K digital asset types respectively and the asset type identifiers of the K digital asset types respectively; the K pre-consumption asset quantities are obtained by performing asset consumption operation on the N pieces of transaction data according to the asset type identifiers associated with the N pieces of transaction data when the N pieces of transaction data are all verified successfully; and the packaging node belongs to a block chain network to which the verification node belongs.
[0265] The consumable operation module 22 is configured to perform asset consumption operation on the N pieces of transaction data according to the asset type identifiers associated with the N pieces of transaction data, to obtain consumable asset quantities of the K digital asset types respectively.
[0266] The asset verification module 23 is configured to perform asset verification on the K pre-consumption asset quantities in the multi-asset pre-consumption transaction data according to the K consumable asset quantities, to obtain an asset verification result.
[0267] The asset verification module 23 is specifically configured to perform asset verification on the K pre-consumption asset quantities in the multi-asset pre-consumption transaction data according to the K consumable asset quantities, to obtain type verification results of the K digital asset types respectively.
[0268] The asset verification module 23 is specifically configured to generate an asset verification result indicating verification success if the K type verification results all indicate verification success.
[0269] The asset verification module 23 is specifically configured to generate an asset verification result indicating verification failure if there is a type verification result indicating verification failure in the K type verification results.
[0270] The K digital asset types include a to-be-verified digital asset type; the K consumable asset quantities include a consumable asset quantity corresponding to the to-be-verified digital asset type; and the K pre-consumption asset quantities in the multi-asset pre-consumption transaction data include a pre-consumption asset quantity corresponding to the to-be-verified digital asset type.
[0271] The asset verification module 23 is specifically configured to generate a type verification result corresponding to the type of the digital asset to be verified, if the consumable asset quantity corresponding to the type of the digital asset to be verified is greater than or equal to the pre-consumed asset quantity corresponding to the type of the digital asset to be verified, to indicate that the verification is successful.
[0272] The asset verification module 23 is specifically configured to generate a type verification result corresponding to the type of the digital asset to be verified, if the consumable asset quantity corresponding to the type of the digital asset to be verified is less than the pre-consumed asset quantity corresponding to the type of the digital asset to be verified, to indicate that the verification fails.
[0273] Optionally, the data processing module 24 is configured to add the proposed block into the blockchain of the blockchain network, if the asset verification result indicates that the verification is successful.
[0274] The data processing module 24 is configured to discard the proposed block, if the asset verification result indicates that the verification fails.
[0275] The specific implementation of the block receiving module 21, the consumable operation module 22, the asset verification module 23, and the data processing module 24 can refer to the description of steps S201-S203 in the above-mentioned Figure 12 The same beneficial effects of the same method are not described here.
[0276] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined target, and can be implemented entirely or partially by using software, hardware (such as a processing circuit or a memory) or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the functions of the module or unit.
[0277] Further, please refer to Figure 16 , Figure 16 is a structural schematic diagram of a computer device provided by the embodiments of the present application, which can be a packaged node or a verification node. As Figure 16 As shown, the computer device 1000 can include a processor 1001, a network interface 1004 and a memory 1005, and further include a user interface 1003 and at least one communication bus 1002. The communication bus 1002 is configured to realize the connection and communication between the components. In some embodiments, the user interface 1003 can include a display, a keyboard, and optionally a standard wired interface, a wireless interface. Optionally, the network interface 1004 can include a standard wired interface, a wireless interface (such as a WI-FI interface). The memory 1005 can be a high-speed RAM memory, or a non-volatile memory such as at least one disk memory. Optionally, the memory 1005 can be at least one storage device located away from the processor 1001. As shown Figure 16 Optionally, the memory 1005 can include an operating system, a network communication module, a user interface module and a device control application program.
[0278] As shown, the computer device 1000 can include a processor 1001, a network interface 1004 and a memory 1005, and further include a user interface 1003 and at least one communication bus 1002. The communication bus 1002 is configured to realize the connection and communication between the components. In some embodiments, the user interface 1003 can include a display, a keyboard, and optionally a standard wired interface, a wireless interface. Optionally, the network interface 1004 can include a standard wired interface, a wireless interface (such as a WI-FI interface). The memory 1005 can be a high-speed RAM memory, or a non-volatile memory such as at least one disk memory. Optionally, the memory 1005 can be at least one storage device located away from the processor 1001. As shown Figure 16 The network interface 1004 can provide network communication functions; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the computer program stored in the memory 1005 to realize the steps in the method of the embodiments of the present application.
[0279] It should be understood that the computer device 1000 described in the embodiments of the present application can execute the description of the data processing method in the embodiments corresponding to the foregoing Figure 3 , Figure 8 and Figure 12 , and can also execute the description of the data processing device 1 and Figure 15 in the embodiments corresponding to the foregoing Figure 14 , which will not be described here again. In addition, the description of the beneficial effects of using the same method will not be described again.
[0280] In addition, it should be pointed out that the embodiments of the present application also provide a computer readable storage medium, and the computer readable storage medium stores the computer program executed by the data processing device 1 and the data processing device 2 mentioned above. When the processor executes the computer program, the computer program can execute the description of the data processing method in the embodiments corresponding to the foregoing Figure 3 , Figure 8 and Figure 12 The data processing method is described in the corresponding embodiments, and thus will not be described here. In addition, the beneficial effects of using the same method are not described again. For technical details not disclosed in the computer-readable storage medium embodiments involved in the present application, please refer to the description of the method embodiments of the present application.
[0281] In addition, it should be noted that the present application also provides a computer program product, which can include a computer program that can be stored in a computer-readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor can execute the computer program to make the computer device execute the data processing method described in the corresponding embodiments of the foregoing Figure 3 、 Figure 8 and Figure 12 The data processing method is described in the corresponding embodiments, and thus will not be described here. In addition, the beneficial effects of using the same method are not described again. For technical details not disclosed in the computer program product embodiments involved in the present application, please refer to the description of the method embodiments of the present application.
[0282] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and the program can include the processes of the above-mentioned embodiments when executed. The storage medium can be a magnetic disc, an optical disc, a read-only memory (ROM), a random access memory (RAM), or the like.
[0283] The above only discloses the preferred embodiments of the present application, and of course cannot limit the scope of the rights of the present application, so the equivalent changes made according to the claims of the present application still fall within the scope of the present application.< / pubkey>
Claims
1. A data processing method based on blockchain, characterized in that, The method is executed by the packaging node and includes: The transaction data to be packaged into the proposal block is verified to obtain the transaction verification result; the N transaction data are associated with the asset type identifiers of K digital asset types; N is a positive integer and K is an integer greater than 1; If the transaction verification result indicates that all N transaction data are successfully verified, then according to the asset type identifier associated with the N transaction data, an asset consumption calculation is performed on the N transaction data to obtain the pre-consumed asset quantity corresponding to each of the K digital asset types. Based on the K quantities of the pre-consumed assets and the asset type identifiers corresponding to the K types of digital assets, generate multi-asset pre-consumed transaction data corresponding to the proposed block; The proposed block carrying the multi-asset pre-consumption transaction data and N of the transaction data is sent to the verification node; the verification node is used to verify the quantity of K of the pre-consumption assets in the multi-asset pre-consumption transaction data based on the N of the transaction data; the verification node belongs to the blockchain network to which the packaging node belongs.
2. The method according to claim 1, characterized in that, The N transaction data include target transaction data, which includes target input data and target output data. The target input data includes a target input script and a target transaction output identifier. The target output data includes a target output script, a target digital asset quantity, and a target asset type identifier. The target transaction output identifier points to the preceding output data of the preceding transaction data corresponding to the target transaction data. The preceding output data provides the digital asset used by the target transaction data. The target asset type identifier indicates the digital asset type generated by the target transaction data. The target digital asset quantity indicates the quantity of digital assets generated by the target transaction data. The target input script and the target output script are used for transaction verification.
3. The method according to claim 2, characterized in that, The process of verifying the N transaction data to be packaged into the proposed block to obtain transaction verification results includes: Obtain the target transaction data from the N transaction data to be packaged into the proposed block, and obtain the target asset type identifier from the target output data of the target transaction data; The target asset type identifier is matched with the set of asset type identifiers maintained by the packaging node. If the target asset type identifier exists in the set of asset type identifiers, the target transaction data is determined to be asset transfer transaction data. The asset transfer transaction data is then verified to obtain the transaction verification result corresponding to the asset transfer transaction data. If the target asset type identifier is not found in the asset type identifier set, the target transaction data is determined to be asset issuance transaction data. The target asset type identifier is added to the asset type identifier set, and transaction verification is performed on the asset issuance transaction data to obtain the transaction verification result corresponding to the asset issuance transaction data.
4. The method according to claim 2, characterized in that, The target transaction data is associated with H digital asset types out of the K digital asset types; H is a positive integer less than or equal to K; the number of target input data for the target transaction data is R. R is a positive integer; The process of verifying the N transaction data to be packaged into the proposed block to obtain transaction verification results includes: From the R target input data of the target transaction data to be packaged into the proposal block, obtain the target transaction output identifiers respectively, obtain the preceding output data pointed to by the R target transaction output identifiers respectively, and obtain the preceding asset type identifiers associated with the preceding transaction data from the R preceding output data respectively; Obtain the target asset type identifiers corresponding to H digital asset types from the target output data of the target transaction data; The H target asset type identifiers are matched with the R preceding asset type identifiers. If H target asset type identifiers exist among the R preceding asset type identifiers, a transaction verification result is generated to indicate that the target transaction data has been successfully verified. If none of the target asset type identifiers are present among the R preceding asset type identifiers, a transaction verification result is generated to indicate that the target transaction data verification has failed.
5. The method according to claim 2, characterized in that, The target transaction data is associated with H digital asset types out of the K digital asset types; where H is a positive integer less than or equal to K; The process of verifying the N transaction data to be packaged into the proposed block to obtain transaction verification results includes: Obtain the input asset quantity of the target transaction data to be packaged into the proposal block for each of the H digital asset types, and obtain the output asset quantity of the target transaction data for each of the H digital asset types; By iterating through the H digital asset types, we obtain digital asset type D from the H digital asset types. i The i is a positive integer less than or equal to the H; If the target transaction data is for the digital asset type D i The number of input assets is greater than or equal to the target transaction data for the digital asset type D. i If the number of output assets is determined, then the digital asset type D is determined. i If the verification is successful, continue to traverse the H digital asset types until it is determined that all H digital asset types have been successfully verified, and then generate a transaction verification result to indicate that the target transaction data has been successfully verified. If the target transaction data is for the digital asset type D i The number of input assets is less than the target transaction data for the digital asset type D. i If the number of output assets is determined, then the digital asset type D is determined. i The verification fails, and a transaction verification result is generated to indicate that the target transaction data verification has failed.
6. The method according to claim 5, characterized in that, The H digital asset types include the digital asset types to be traversed; the number of target input data for the target transaction data is R; R is a positive integer; the R target input data includes W target input data associated with the digital asset types to be traversed; W is a positive integer less than or equal to R; The acquisition of the target transaction data to be packaged into the proposal block, for each of the H digital asset types, includes the following: From the W target input data of the target transaction data to be packaged into the proposal block, obtain the target transaction output identifiers respectively, obtain the preceding output data pointed to by the W target transaction output identifiers respectively, and obtain the preceding digital asset quantity from the W preceding output data respectively; the W preceding digital asset quantity is the quantity of digital assets with the digital asset type to be traversed. The summation of the W preceding digital assets is performed to obtain the number of input assets for the target transaction data for the type of digital asset to be traversed.
7. The method according to claim 2, characterized in that, The number of target input data for the target transaction data is R; where R is a positive integer. The process of verifying the N transaction data to be packaged into the proposed block to obtain transaction verification results includes: From the R target input data of the target transaction data to be packaged into the proposal block, obtain the target transaction output identifier and the target input script respectively, obtain the preceding output data pointed to by the R target transaction output identifiers respectively, and obtain the preceding output script from the R preceding output data respectively; The target signature information of the target transaction data is obtained from each of the R target input scripts, and the preceding public key information of the operation object is obtained from the R preceding output scripts; the digital asset used by the target transaction data belongs to the operation object; The target signature information is verified based on the R prior public key information to obtain the verification result; If the signature verification result indicates that all R target signature information have been successfully verified, a transaction verification result is generated to indicate that the target transaction data has been successfully verified. If the signature verification result indicates that one of the R target signature information failed to be verified, a transaction verification result is generated to indicate that the target transaction data verification failed.
8. The method according to claim 1, characterized in that, The K digital asset types include the target digital asset type; The step of performing asset consumption calculations on the N transaction data based on asset type identifiers associated with the N transaction data to obtain the pre-consumed asset quantities corresponding to the K digital asset types includes: Based on the asset type identifier associated with N transaction data, obtain G transaction data associated with the target digital asset type from the N transaction data; where G is a positive integer less than or equal to N. Obtain the number of assets consumed for each of the G transaction data for the target digital asset type, and sum the G number of consumed assets to obtain the pre-consumed asset quantity corresponding to the target digital asset type.
9. The method according to claim 8, characterized in that, The G types of transaction data include candidate transaction data; The acquisition of the number of assets consumed for each of the G transaction data points for the target digital asset type includes: If the candidate transaction data is asset transfer transaction data, then obtain the input asset quantity of the candidate transaction data for the target digital asset type, obtain the output asset quantity of the candidate transaction data for the target digital asset type, perform a difference calculation on the input asset quantity of the candidate transaction data for the target digital asset type and the output asset quantity of the candidate transaction data for the target digital asset type, and obtain the consumed asset quantity of the candidate transaction data for the target digital asset type. If the candidate transaction data is asset issuance transaction data, then the input asset quantity of the candidate transaction data for the target digital asset type is obtained, and the input asset quantity of the candidate transaction data for the target digital asset type is determined as the consumed asset quantity of the candidate transaction data for the target digital asset type.
10. The method according to claim 1, characterized in that, The step of generating multi-asset pre-consumption transaction data corresponding to the proposed block based on the K quantities of the pre-consumed assets and the K asset type identifiers corresponding to the digital asset types includes: Based on the K quantities of pre-consumed assets, the asset type identifiers corresponding to the K digital asset types, and the public key information of the packaging node, K pre-consumed output data are generated. The K pre-consumed output data include candidate pre-consumed output data, which are associated with candidate digital asset types among the K digital asset types. Each candidate pre-consumed output data includes the quantity of pre-consumed assets corresponding to the candidate digital asset type, the asset type identifier of the candidate digital asset type, and a pre-consumed output script. The pre-consumed output script is determined by the public key information of the packaging node. Based on the default input data and K pre-consumption output data, generate multi-asset pre-consumption transaction data corresponding to the proposed block; the default input data is a null value or a default identifier.
11. A data processing method based on blockchain, characterized in that, The method is executed by the verification node and includes: The system receives a proposal block from a packaging node, carrying multi-asset pre-consumption transaction data and N transaction data. The N transaction data are associated with asset type identifiers of K digital asset types. N is a positive integer, and K is an integer greater than 1. The multi-asset pre-consumption transaction data is generated by the packaging node based on the pre-consumption asset quantities and asset type identifiers corresponding to the K digital asset types. The K pre-consumption asset quantities are obtained by the packaging node performing asset consumption calculations on the N transaction data based on the asset type identifiers associated with the N transaction data when all N transaction data have been successfully verified. The packaging node belongs to the blockchain network to which the verification node belongs. Based on the asset type identifier associated with the N transaction data, perform asset consumption calculations on the N transaction data to obtain the consumable asset quantities corresponding to the K digital asset types respectively; Based on the K quantities of consumable assets, asset verification is performed on the K quantities of pre-consumable assets in the multi-asset pre-consumable transaction data to obtain asset verification results.
12. The method according to claim 11, characterized in that, The step of verifying the K pre-consumable asset quantities in the multi-asset pre-consumable transaction data based on the K quantities of consumable assets to obtain asset verification results includes: Based on the K quantities of consumable assets, asset verification is performed on the K quantities of pre-consumable assets in the multi-asset pre-consumable transaction data to obtain the type verification results corresponding to the K digital asset types respectively. If all K verification results of the aforementioned type indicate successful verification, then an asset verification result is generated to indicate successful verification. If any of the K type verification results indicates a verification failure, then an asset verification result indicating a verification failure is generated.
13. The method according to claim 12, characterized in that, The K digital asset types include digital asset types to be verified; the K consumable asset quantities include consumable asset quantities corresponding to the digital asset types to be verified; and the K pre-consumable asset quantities in the multi-asset pre-consumable transaction data include pre-consumable asset quantities corresponding to the digital asset types to be verified. The step of verifying the K pre-consumable asset quantities in the multi-asset pre-consumable transaction data based on the K consumable asset quantities to obtain the type verification results corresponding to the K digital asset types includes: If the number of consumable assets corresponding to the digital asset type to be verified is greater than or equal to the number of pre-consumable assets corresponding to the digital asset type to be verified, a type verification result corresponding to the digital asset type to be verified is generated to indicate successful verification. If the number of consumable assets corresponding to the digital asset type to be verified is less than the number of pre-consumable assets corresponding to the digital asset type to be verified, a type verification result is generated to indicate that the verification failed.
14. The method according to claim 11, characterized in that, The method further includes: If the asset verification result indicates successful verification, the proposed block is added to the blockchain of the blockchain network. If the asset verification result indicates verification failure, the proposed block is discarded.
15. A data processing device based on blockchain, characterized in that, The device operates at the packaging node and includes: The transaction verification module is used to verify the N transaction data to be packaged into the proposal block and obtain the transaction verification result; the N transaction data are associated with the asset type identifiers of K digital asset types; N is a positive integer and K is an integer greater than 1; The pre-consumption calculation module is used to perform asset consumption calculation on the N transaction data according to the asset type identifier associated with the N transaction data if the transaction verification result indicates that all N transaction data have been successfully verified, so as to obtain the pre-consumption asset quantity corresponding to each of the K digital asset types. The transaction generation module is used to generate multi-asset pre-consumption transaction data corresponding to the proposed block based on the K quantities of the pre-consumed assets and the asset type identifiers corresponding to the K digital asset types. The block sending module is used to send a proposed block carrying the multi-asset pre-consumption transaction data and N of the transaction data to the verification node; the verification node is used to verify the quantity of K of the pre-consumption assets in the multi-asset pre-consumption transaction data based on the N of the transaction data; the verification node belongs to the blockchain network to which the packaging node belongs.
16. A data processing device based on blockchain, characterized in that, The device operates on a verification node and includes: The block receiving module is used to receive a proposed block sent by the packaging node, carrying multi-asset pre-consumption transaction data and N transaction data; the N transaction data are associated with asset type identifiers of K digital asset types; N is a positive integer, and K is an integer greater than 1; the multi-asset pre-consumption transaction data is generated by the packaging node based on the pre-consumption asset quantity corresponding to each of the K digital asset types and the asset type identifier corresponding to each of the K digital asset types; the K pre-consumption asset quantity is obtained by the packaging node performing asset consumption calculations on the N transaction data based on the asset type identifiers associated with the N transaction data when all N transaction data are successfully verified; the packaging node belongs to the blockchain network to which the verification node belongs; The consumable calculation module is used to perform asset consumption calculation on the N transaction data according to the asset type identifier associated with the N transaction data, and obtain the consumable asset quantity corresponding to each of the K digital asset types; The asset verification module is used to verify the K quantities of pre-consumable assets in the multi-asset pre-consumable transaction data based on the K quantities of consumable assets, and obtain the asset verification result.
17. A computer device, characterized in that, include: Processor and memory; The processor is connected to the memory, wherein the memory is used to store a computer program, and the processor is used to invoke the computer program to cause the computer device to perform the method according to any one of claims 1-14.
18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1-14.
19. A computer program product, characterized in that, The computer program product includes a computer program stored in a computer-readable storage medium and adapted to be read and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1-14.