Data processing method and device based on block chain, equipment and medium
By combining blockchain and trusted execution components, only the validity of digital signatures needs to be verified, which solves the problem of low verification efficiency in the resource transfer process in existing technologies and achieves more efficient resource verification.
Patent Information
- Application Number
- CN202410533857.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2025-10-31
AI Technical Summary
In resource transfer scenarios, existing technologies require verification of each resource transfer process of digital resources, resulting in low verification efficiency.
By using blockchain technology, transaction hashes are obtained and matching status verification information is acquired on the blockchain. Resource status verification is performed using trusted execution components, requiring only the validity of digital signatures to be verified, thus omitting the verification of all preceding transfer processes.
It improves the efficiency of digital resource verification, reduces verification steps, and increases the speed and efficiency of verification.
Smart Images

Figure CN120875876A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular to a data processing method, apparatus, device, and medium based on blockchain. Background Technology
[0002] In resource transfer scenarios, resource transfers typically involve different objects. For example, object A can initiate a resource transfer request to object B. When object B receives digital resources sent by object A, it needs to determine whether object A holds those digital resources. Currently, as the recipient of the digital resources, object B needs to trace back to the resource issuing object and, starting from that issuing object, verify each resource transfer process of the digital resources one by one to determine whether the digital resources received by object B are valid. It is evident that in each resource transfer process, the object receiving the digital resources needs to verify all preceding transfer processes, resulting in low verification efficiency for digital resources. Summary of the Invention
[0003] This application provides a blockchain-based data processing method, apparatus, device, and medium, which can improve the verification efficiency of digital resources.
[0004] One embodiment of this application provides a blockchain-based data processing method, which includes:
[0005] If a first resource transfer message initiated by a state submission object is received, the transaction hash carried by the first resource transfer message is obtained, and the first state verification message matching the transaction hash is obtained on the blockchain. The first state verification message includes the resource state verification result obtained by the trusted execution component in verifying the resource state of multiple state transition messages contained in the state transition trajectory. The state transition trajectory is used to characterize the pre-transfer process of the digital resource indicated by the first resource transfer message.
[0006] The validity of the digital signature carried in the first state verification information is verified based on the public key corresponding to the trusted execution component, and the signature verification result corresponding to the first state verification information is obtained.
[0007] If the signature verification result indicates that the verification is successful, then the resource status verification result in the first status verification information is determined as the verification result of the digital resource indicated by the first resource transfer information.
[0008] One embodiment of this application provides a blockchain-based data processing method, which includes:
[0009] The system obtains a resource transfer request initiated by a state submission object, determines multiple state transition information associated with the resource transfer request, generates a state transition trajectory containing multiple state transition information, and obtains the first state verification information corresponding to the state transition trajectory through a trusted execution component. The state transition trajectory is used to characterize the pre-transfer process of the digital resource indicated by the resource transfer request. The first state verification information includes the resource state verification result obtained by the trusted execution component in verifying the resource state of the state transition trajectory.
[0010] The first state verification information is processed on the blockchain to obtain the on-chain result corresponding to the first state verification information.
[0011] If the on-chain result indicates that the on-chain is successful, then based on the transaction hash and resource transfer request corresponding to the first state verification information, the first resource transfer information is generated and sent to the state verification object indicated by the resource transfer request.
[0012] The first resource transfer information is used to instruct the state verification object to verify the validity of the digital signature carried by the first state verification information that matches the transaction hash on the blockchain, based on the public key corresponding to the trusted execution component. When the signature verification result corresponding to the first state verification information indicates that the verification is successful, the resource state verification result in the first state verification information is used as the verification result of the digital resource indicated by the first resource transfer information.
[0013] One embodiment of this application provides a blockchain-based data processing device, which includes:
[0014] The first verification information acquisition module is used to acquire the transaction hash carried by the first resource transfer information if it receives the first resource transfer information initiated by the state submission object, and acquire the first state verification information that matches the transaction hash on the blockchain; the first state verification information includes the resource state verification result obtained by the trusted execution component in verifying the resource state of multiple state transition information contained in the state transition trajectory; the state transition trajectory is used to characterize the pre-transfer process of the digital resource indicated by the first resource transfer information.
[0015] The digital signature verification module is used to verify the validity of the digital signature carried in the first state verification information based on the public key corresponding to the trusted execution component, and to obtain the signature verification result corresponding to the first state verification information.
[0016] The resource verification result determination module is used to determine the resource status verification result in the first status verification information as the verification result of the digital resource indicated by the first resource transfer information if the signature verification result indicates that the verification is successful.
[0017] Specifically, the first verification information acquisition module is used for:
[0018] The transaction hash is input into a Bloom filter deployed on the blockchain. The Bloom filter calls a hash function to perform a hash operation on the transaction hash, and the array element identifier of the transaction hash in the Bloom filter is obtained.
[0019] If a transaction exists at the storage location associated with the array element identifier, then the transaction at the storage location is identified as the resource transfer transaction corresponding to the transaction hash, and the first state verification information is obtained from the resource transfer transaction.
[0020] Specifically, the digital signature verification module is used for:
[0021] Obtain the digital signature carried in the first state verification information, and obtain the public key corresponding to the trusted execution component;
[0022] The digital signature carried by the first state verification information is decrypted using the public key corresponding to the trusted execution component to obtain the first digest information corresponding to the digital signature carried by the first state verification information. The first state verification information is then hashed using a hash function to obtain the second digest information corresponding to the first state verification information.
[0023] If the first digest information is the same as the second digest information, then the signature verification result corresponding to the first state verification information indicates that the verification is successful;
[0024] If the first digest information is different from the second digest information, then the signature verification result corresponding to the first state verification information indicates that the verification failed.
[0025] The blockchain-based data processing device also includes a resource status verification module, which is used for:
[0026] If the signature verification result indicates that the verification failed, then obtain the resource transfer transaction that matches the transaction hash on the blockchain, and obtain the preceding transfer transaction associated with the resource transfer transaction on the blockchain;
[0027] Based on the state transition information carried by the resource transfer transaction and the state transition information carried by the preceding transfer transaction, a first transition trajectory of the digital resource indicated by the first resource transfer information is generated.
[0028] The resource status is verified by analyzing the state transition information contained in the first transition trajectory, and the verification result of the digital resource indicated by the first resource transfer information is obtained.
[0029] The first transition trajectory includes N state transition information, where N is an integer greater than 1; the resource status verification module is specifically used for:
[0030] Obtain the i-th state input data of the resource status verification function; when i is 1, the i-th state input data includes the first state transition information among N state transition information; when i is not 1, the i-th state input data includes the (i-1)-th state output data of the resource status verification function and the i-th state transition information among N state transition information; i is a positive integer less than or equal to N;
[0031] The resource status is verified by the resource status verification function for the i-th state input data, and the i-th state output data corresponding to the resource status verification function is obtained. The N-th state output data corresponding to the resource status verification function is determined as the verification result of the digital resource indicated by the first resource transfer information.
[0032] The blockchain-based data processing device further includes: a second verification information acquisition module, which is used for:
[0033] Obtain the second resource transfer information initiated by the status verification object, and determine the resource receiving object to receive the transferred-out resource indicated by the second resource transfer information based on the second resource transfer information; the transferred-out resource indicated by the second resource transfer information belongs to the digital resource indicated by the first resource transfer information.
[0034] If the set of trusted components associated with the resource receiving object includes a trusted execution component, then the state transition information and resource state verification result corresponding to the second resource transfer information are input to the trusted execution component, and the resource state verification function is called through the trusted execution component to obtain the second state verification information;
[0035] The second state verification information is stored in the blockchain; the second state verification information stored on the blockchain is used to determine the validity of the transferred resources received by the resource receiving object.
[0036] The blockchain-based data processing device also includes a conversion trajectory acquisition module, which is used for:
[0037] If the set of trusted components associated with the resource transfer object does not contain a trusted execution component, then obtain the state transition trajectory corresponding to the digital resource indicated by the first resource transfer information;
[0038] Add the state transition information corresponding to the second resource transfer information to the state transition trajectory to obtain the second transition trajectory;
[0039] The second conversion trace is stored on the blockchain; the second conversion trace stored on the blockchain is used to determine the validity of the transferred resources received by the resource receiving object.
[0040] One embodiment of this application provides a blockchain-based data processing device, which includes:
[0041] The status verification information generation module is used to obtain the resource transfer request initiated by the status submission object, determine the multiple status transition information associated with the resource transfer request, generate a status transition trajectory containing multiple status transition information, and obtain the first status verification information corresponding to the status transition trajectory through the trusted execution component; the status transition trajectory is used to characterize the pre-transfer process of the digital resource indicated by the resource transfer request; the first status verification information includes the resource status verification result obtained by the trusted execution component in verifying the status transition trajectory.
[0042] The information uplink processing module is used to process the first state verification information uplink to the blockchain and obtain the uplink result corresponding to the first state verification information.
[0043] The transfer information sending module is used to generate first resource transfer information based on the transaction hash and resource transfer request corresponding to the first state verification information if the on-chain result indicates that the on-chain is successful, and send the first resource transfer information to the state verification object indicated by the resource transfer request.
[0044] The first resource transfer information is used to instruct the state verification object to verify the validity of the digital signature carried by the first state verification information that matches the transaction hash on the blockchain, based on the public key corresponding to the trusted execution component. When the signature verification result corresponding to the first state verification information indicates that the verification is successful, the resource state verification result in the first state verification information is used as the verification result of the digital resource indicated by the first resource transfer information.
[0045] Specifically, the status verification information generation module is used for:
[0046] The digital resource, status submission object, and status verification object indicated by the resource transfer request are combined into candidate conversion information corresponding to the resource transfer request;
[0047] The candidate transition information is signed using the private key corresponding to the status submission object to obtain the digital signature corresponding to the candidate transition information. The candidate transition information and the digital signature corresponding to the candidate transition information are combined to form the status transition information corresponding to the resource transfer request.
[0048] Obtain the preceding transfer transaction of the digital resource indicated by the resource transfer request, and combine the state transition information carried by the preceding transfer transaction and the state transition information corresponding to the resource transfer request into a state transition trajectory.
[0049] The state transition trajectory contains N state transition information entries, where N is an integer greater than 1; the state verification information generation module is specifically used for:
[0050] By calling the resource status verification function through the trusted execution component, the resource status of the state transition trajectory is verified, and the resource status verification result corresponding to the state transition trajectory is obtained.
[0051] The resource status verification result and the transaction identifier of the resource transfer transaction corresponding to the (N-1)th state transition information in the state transition trajectory are combined into resource status combination data;
[0052] The resource state combination data is signed using the private key corresponding to the trusted execution component to obtain the digital signature corresponding to the resource state combination data. The resource state combination data and the combination corresponding to the resource state combination data are used as the first state verification information.
[0053] Specifically, the status verification information generation module is used for:
[0054] The trusted execution component is invoked to populate the resource state combination data, resulting in resource state populated data. The resource state populated data is then split into P segments, where P is an integer greater than 1.
[0055] Obtain the j-th input data of the compression function; when j is 1, the j-th input data includes the initial compressed data and the first segmented padding data in P segmented padding data; when j is not 1, the j-th input data includes the (j-1)-th output data of the compression function and the j-th segmented padding data in P segmented padding data; j is a positive integer less than or equal to P;
[0056] The j-th input data is compressed according to the compression function to obtain the j-th output data corresponding to the compression function. The P-th output data corresponding to the compression function is determined as the compressed information.
[0057] The compressed information is encrypted using the private key corresponding to the trusted execution component to obtain a digital signature for the resource status combination data.
[0058] One aspect of this application provides a computer device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method in one aspect of this application.
[0059] One aspect of this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, perform the steps of the method as described in one aspect of this application.
[0060] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various alternative embodiments of the above-described aspect.
[0061] In this embodiment, if the second device receives first resource transfer information initiated by a state submission object, it obtains the transaction hash carried by the first resource transfer information and acquires first state verification information matching the transaction hash on the blockchain. The first state verification information includes a resource state verification result obtained by a trusted execution component performing resource state verification on multiple state transition information contained in the state transition trajectory. The state transition trajectory is used to characterize the pre-transfer process of the digital resource indicated by the first resource transfer information. Further, the validity of the digital signature carried by the first state verification information can be verified based on the public key corresponding to the trusted execution component, resulting in a signature verification result corresponding to the first state verification information. If the signature verification result indicates successful verification, the resource state verification result in the first state verification information is determined as the verification result of the digital resource indicated by the first resource transfer information. It can be seen that, in verifying the validity of the digital resource indicated by the first resource transfer information, this embodiment only needs to verify the validity of the digital signature carried by the first state verification information, without needing to verify all pre-transfer processes corresponding to the digital resource, thereby improving the verification efficiency of the digital resource. Attached Figure Description
[0062] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0063] Figure 1 This is a network architecture diagram provided in an embodiment of this application;
[0064] Figure 2 This is a timing diagram of a blockchain-based data processing method provided in an embodiment of this application;
[0065] Figure 3 This is an illustration of a method for submitting status verification information for digital resources, provided in an embodiment of this application. Figure 1 ;
[0066] Figure 4This is a schematic diagram illustrating the generation of status verification information provided in an embodiment of this application;
[0067] Figure 5 This is a schematic diagram illustrating the generation of a digital signature according to an embodiment of this application;
[0068] Figure 6 This is a schematic diagram illustrating the verification of digital resources provided in an embodiment of this application;
[0069] Figure 7 This is an illustration of a method for submitting status verification information for digital resources, provided in an embodiment of this application. Figure 2 ;
[0070] Figure 8 This is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of this application. Figure 1 ;
[0071] Figure 9 This is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of this application. Figure 2 ;
[0072] Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0073] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0074] This application mainly relates to blockchain technology. To facilitate understanding of the technical solutions proposed in this application, the technical terms involved in this application are explained below.
[0075] 1. Blockchain: In a narrow sense, blockchain is a chain-like data structure with blocks as the basic unit. Blocks use digital digests to verify previously acquired transaction history, making it suitable for the tamper-proof and scalable requirements of distributed ledger scenarios. In a broader sense, blockchain also refers to the distributed ledger technology implemented using the blockchain structure, including distributed consensus, privacy and security protection, peer-to-peer communication technology, network protocols, and smart contracts. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include the underlying blockchain platform, platform product service layer, and application service layer. The basic structure of a blockchain is a linear linked list. The linked list consists of a series of "blocks," with each subsequent block recording the hash value of the previous block. The validity of each block (and the transactions within it) can be quickly verified by calculating the hash value. If a node in the network proposes to add a new block, the block must be confirmed through a consensus mechanism.
[0076] 2. Blockchain Nodes: Blockchain networks divide nodes into consensus nodes (also known as core nodes) and synchronization nodes (which can include data nodes and light nodes). Consensus nodes are responsible for the consensus process across the entire blockchain network; synchronization nodes are responsible for synchronizing the ledger information of the consensus nodes, i.e., synchronizing the latest block data. Both consensus and synchronization nodes include network communication components in their internal structure, because a blockchain network is essentially a peer-to-peer network, requiring communication with other nodes in the blockchain network through peer-to-peer components. Resources and services in the blockchain network are distributed across various nodes, and information transmission and service implementation occur directly between nodes without the need for intermediaries or centralized servers (third parties).
[0077] 3. Public Key and Private Key: A public key and a private key are a key pair (one public key and one private key) obtained through an algorithm. The public key is the publicly known part of the key pair, while the private key is the private key. Public keys are typically used for encrypting data, verifying digital signatures, etc. This algorithm ensures that the resulting key pair is unique. When using this key pair, if data is encrypted with one key, it must be decrypted with the other key. For example, data encrypted with the public key must be decrypted with the private key, and vice versa; otherwise, decryption will fail.
[0078] 4. Transaction Hash: Also known as information feature or characteristic value, a transaction hash is generated by converting a transaction into cryptography using a hash function and producing a fixed output. The original input data cannot be retrieved by decrypting the transaction hash; it is a one-way cryptographic function. In a blockchain, each block (except the initial block) contains the transaction hash of its predecessor block, which is called the parent block of the current block. Transaction hashes are a core and crucial aspect of blockchain technology, preserving the authenticity of recorded and viewed data, as well as the integrity of the blockchain as a whole.
[0079] 5. Unspent Transaction Output (UTXO): This is a transaction model in blockchain technology used to trace digital resources and prevent double-spending. During resource transfer, each transaction involves inputs and outputs. Inputs represent the source of the digital resource, while outputs represent its destination. When a transaction is made, once a UTXO is used as input, that UTXO is consumed, and a new UTXO is generated as the output.
[0080] 6. One-time encapsulation: also known as "one-time sealing", refers to attaching a change in the state of a resource to a UTXO. When the UTXO is consumed, the corresponding change in the state of the resource also changes.
[0081] Please see Figure 1 , Figure 1 This is a schematic diagram of a system architecture provided in an embodiment of this application. For example... Figure 1 As shown, the system may include a blockchain network 100a, a resource client 100b, and a trusted execution component 100c. The blockchain network 100a may include one or more blockchain nodes; this embodiment does not limit the number of blockchain nodes. Figure 1 As shown, blockchain network 100a includes blockchain nodes 10a, 10b, 10c, and 10d. Each blockchain node in blockchain network 100a (e.g., blockchain nodes 10a, 10b, 10c, and 10d) can be used to maintain the same blockchain (e.g., ...). Figure 1The blockchain 10e shown in the diagram allows any two blockchain nodes in the blockchain network 100a to form a peer-to-peer network. This peer-to-peer network can employ a peer-to-peer network protocol, which is an application layer protocol running on top of the Transmission Control Protocol (TCP). In a distributed system, any electronic device, such as a server or terminal device, can join and become a blockchain node. In this embodiment, each blockchain node in the blockchain network 100a can be referred to as a computer device. This computer device can be a terminal device, a server, or a system composed of terminal devices and servers; this embodiment does not limit the scope of the application.
[0082] The terminal device may include, but is not limited to, personal computers, smartphones, tablets, laptops, handheld computers, mobile internet devices (MIDs), wearable devices (such as smartwatches, smart bracelets, etc.), smart voice interaction devices, smart home appliances (such as smart TVs, etc.), in-vehicle devices, aircraft, and other electronic devices. This application does not limit the type of terminal device.
[0083] A server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0084] It is understood that when each blockchain node is working normally, it can receive transaction data sent by electronic devices other than blockchain network 100a (e.g., the terminal device where the resource client 100b is located or the server corresponding to the terminal device in this embodiment of the application), generate blocks based on the received transaction data, and then process the blocks on the chain.
[0085] To ensure data interoperability between blockchain nodes, data connections can exist between each blockchain node. For example, there is a data connection between blockchain node 10a and blockchain node 10c, between blockchain node 10a and blockchain node 10d, between blockchain node 10b and blockchain node 10c, and so on. It is understood that blockchain nodes can transmit data or blocks through these data connections. Each blockchain node in the blockchain network has a unique node identifier, and each blockchain node can store the node identifiers of other blockchain nodes that are connected to it. This allows it to broadcast acquired data or generated blocks to other blockchain nodes based on their node identifiers. For example, blockchain node 10a can maintain a list of node identifiers, which stores the node names and node identifiers of other blockchain nodes, as shown in Table 1.
[0086] Table 1
[0087] Node Name Node identifier Blockchain node 10b AAAAA Blockchain node 10c BBBBB … … Blockchain node 10d CCCCC
[0088] The node identifier can be an Internet Protocol (IP) address used to interconnect networks, or any other information that can be used to identify a node in a blockchain network. Table 1 uses IP addresses as an example for illustration only.
[0089] Assuming the node identifier of blockchain node 10a is FFFFF, then blockchain node 10a can send transaction data to blockchain node 10d through the node identifier CCCCC, and blockchain node 10d can determine that the transaction data was sent by blockchain node 10a through the node identifier FFFFF. Similarly, blockchain node 10d can send a block awaiting consensus to blockchain node 10c through the node identifier BBBBB, and blockchain node 10c can determine that the block awaiting consensus was sent by blockchain node 10d through the node identifier CCCCC. Data transmission between other nodes is also in the same way, so it will not be elaborated further.
[0090] It is understood that the above data connection is not limited to the connection method. It can be connected directly or indirectly through wired communication, or directly or indirectly through wireless communication, or through other connection methods. This application does not impose any restrictions on this.
[0091] Figure 1The resource client 100b shown is a tool for managing and storing digital resources. Business entities can transfer digital resources to other addresses through resource client 100b, or they can receive digital resources transferred from other addresses through resource client 100b. It can be understood that resource client 100b belongs to the category of Decentralized Applications (DAPPs). DAPPs are applications built on blockchain technology that do not rely on traditional centralized servers or institutions to run, but instead use a decentralized blockchain network to achieve functions such as data storage, computation, and transactions. Specifically, DAPPs combine smart contracts and a front-end interface. When a DAPP's smart contract is successfully deployed on the blockchain, the DAPP can provide services to business entities that wish to interact with the smart contract; that is, the DAPP can act as a business application to provide corresponding services to business entities. When business entities interact with the smart contracts deployed on the blockchain within the DAPP, all operations they perform can be stored on the blockchain in the form of transaction data to improve data security and reliability.
[0092] Figure 1 The Trusted Execution Component 100c shown is a component deployed with a Trusted Execution Environment (TEE). The Trusted Hardware Execution Environment deployed by the Trusted Execution Component 100c has a memory barrier between it and the external environment (including the operating system). This means the external environment does not have access to the data storage space within the Trusted Execution Environment, preventing the external environment from accessing data, programs, and logic code within the Trusted Execution Environment unless actively output. This ensures the reliability of data processing tasks within the Trusted Execution Environment.
[0093] In this embodiment, the resource client 100b and the trusted execution component 100c can run on the same terminal device or on different terminal devices; this embodiment does not limit this. The resource client 100b can interact with the trusted execution component 100c. The terminal devices where the resource client 100b and the trusted execution component 100c reside can be electronic devices outside of the blockchain network 100a, or they can be blockchain nodes within the blockchain network 100a; this embodiment does not limit this. The resource client 100b and the trusted execution component 100c can be independent clients or embedded sub-clients integrated into a client. For example, the trusted execution component 100c can be an embedded sub-client integrated into the resource client 100b; this embodiment does not limit this.
[0094] In resource transfer scenarios, resource transfers typically involve different objects. For example, object A (a status submission object) can initiate a resource transfer request to object B (a status verification object) through a resource client. When object B receives digital resources sent by object A, it needs to determine whether object A holds those digital resources. Currently, as the receiving object, object B needs to trace back to the resource issuing object of the received digital resources and verify each resource transfer process of the digital resources one by one, starting from that resource issuing object, to determine whether the digital resources received by object B are valid. It is evident that in each resource transfer process, the receiving object needs to verify all preceding transfer processes of the current resource transfer, resulting in low verification efficiency for digital resources.
[0095] To address the aforementioned issues, in this embodiment, after the state submission object initiates a resource transfer request to the state verification object, the state submission object can obtain the state transition trajectory associated with the digital resource indicated by the resource transfer request. The trusted execution component then verifies the resource status of this transition trajectory to obtain a resource status verification result. The state verification information containing this result is stored on the blockchain. The state verification object can then obtain this resource status verification result on the blockchain and verify the validity of the digital signature carried by the result using the public key corresponding to the trusted execution component. If the signature verification result indicates successful verification, the resource status verification result in the state verification information is determined as the verification result of the digital resource indicated by the resource transfer request, without needing to verify all preceding transfer processes corresponding to the digital resource, thereby improving the verification efficiency of the digital resource.
[0096] The digital resource verification method involved in the embodiments of this application will be described in detail below. Specifically, please refer to... Figure 2 , Figure 2 This is a timing interaction diagram of a blockchain-based data processing method provided in this application embodiment. This blockchain-based data processing method can be interactively executed by a first device, a second device, and blockchain nodes in a blockchain network. The first device is the computer device logged into by the status submission object, and the second device is the computer device logged into by the status verification object. The first device can be a terminal device, a server, or a cluster of terminal devices and servers; the second device can also be a terminal device, a server, or a cluster of terminal devices and servers. Both the first and second devices can integrate a resource client. The status submission object in the first device and the status verification object in the second device are both registered objects in the resource client. The resource client can be... Figure 1 The resource client 100b shown is shown. Figure 2 The blockchain shown can be Figure 1The blockchain in the blockchain network 100a shown (e.g., blockchain 10e). Figure 2 As shown, the blockchain-based data processing method may include steps S101 to S109, wherein:
[0097] Step S101: Obtain the resource transfer request initiated by the state submission object, determine the multiple state transition information associated with the resource transfer request, generate a state transition trajectory containing multiple state transition information, and obtain the first state verification information corresponding to the state transition trajectory through the trusted execution component.
[0098] In this context, both the status submission object and the status verification object (mentioned below) are registered objects in the resource client. These objects can be identified by an account identifier or a resource address within the resource client. Specifically, the status submission object can be the object that initiates a resource transfer request, and the status verification object can be the object that receives the digital resource indicated by the resource transfer request. The resource transfer request can be used to instruct the status submission object to transfer digital resources to the status verification object. The resource transfer request may include, but is not limited to, the status submission object, the status verification object, the digital resource transferred from the status submission object to the status verification object, the timestamp of the request, and the digital signature corresponding to the status submission object.
[0099] A state transition trajectory can be used to characterize all preceding transfer processes of the digital resource indicated by a resource transfer request. The state transition trajectory includes multiple state transition pieces of information. One state transition piece of information can refer to the state transition attached to the unspent output of the resource transfer transaction in the current resource transfer process using one-time encapsulation technology. The process of obtaining the state transition trajectory may include: a first device combining the digital resource indicated by the resource transfer request, the state submission object, and the state verification object into candidate transition information corresponding to the resource transfer request; signing the candidate transition information using the private key corresponding to the state submission object to obtain a digital signature; combining the candidate transition information and the digital signature corresponding to the candidate transition information into the state transition information corresponding to the resource transfer request; and then obtaining the preceding transfer transactions of the digital resource indicated by the resource transfer request, combining the state transition information carried by the preceding transfer transactions and the state transition information corresponding to the resource transfer request into a state transition trajectory.
[0100] In this embodiment, the resource client can be associated with one or more trusted execution components. The status submission object and status verification object can each be configured with a trusted execution component in the resource client for resource status verification. For ease of understanding, the resource status verification process will be described using the example of the status submission object and status verification object being associated with the same trusted execution component.
[0101] Since the state submission object and the state verification object trust the same trusted execution component, after obtaining the state transition trajectory, the first device can obtain the first state verification information corresponding to the state transition trajectory through the trusted execution component. This first state verification information can be used to determine the validity of the digital resources received by the state verification object. The first state verification information can include the resource state verification result obtained by the trusted execution component performing resource state verification on the state transition trajectory.
[0102] Specifically, please see Figure 3 , Figure 3 This is an illustration of a method for submitting status verification information for digital resources, provided in an embodiment of this application. Figure 1 .like Figure 3 As shown, when a resource issuing object (marked as "-") transfers 100 digital resources to a state commit object (marked as "A"), it can submit a resource transfer transaction (marked as resource transfer transaction 1) to the blockchain that includes the state transition during this resource transfer process. This resource transfer transaction 1 contains the following unspent output UTXO1: UTXO1 =<TX1,NULL> In this context, the state transition information TX1 (TX1<-,A,100>) represents the state transition information in resource transfer transaction 1. Specifically, TX1 indicates that the resource issuing object transfers 100 digital resources to the state submitting object. Alternatively, TX1 can also be a state transition that changes the state of the smart contract. NULL represents the state verification information output by the trusted execution component. Since the trustworthiness of the resource issuing object is guaranteed, the state verification information in resource transfer transaction 1 is NULL.
[0103] like Figure 3 As shown, the status submission object can initiate a resource transfer request to the status verification object (marked "B") through the resource client. This resource transfer request can be used to instruct the status submission object to transfer part or all of the 100 digital resources it holds to the status verification object. After receiving the resource transfer request initiated by the status submission object, the first device can combine the digital resources (e.g., 100 in quantity) indicated by the resource transfer request, the status submission object, and the status verification object into candidate conversion information.<A,B,100> Furthermore, the candidate transformation information can be signed using the private key corresponding to the state submission object to obtain a digital signature (SigA) corresponding to the candidate transformation information. The candidate transformation information and its corresponding digital signature can then be combined into a formula as follows: Figure 3The state transition information shown is TX2(TX2)<A,B,100> The state transition information TX2 (SigA) corresponds to the resource transfer information initiated by the state submitting object to the state verifying object; alternatively, TX2 can also be the hash value corresponding to the digital resource indicated in the resource transfer request, the state submitting object, the state verifying object, and other information such as the state submitting object. For example, TX2 indicates that the state submitting object transfers 100 units of digital resource to the state verifying object, and this is confirmed by the state submitting object's signature. Alternatively, TX2 can also be a state transition that changes the state of the smart contract, which needs to be executed after the preceding state transition of the digital resource indicated in the resource transfer request.
[0104] After obtaining the state transition information corresponding to the resource transfer request, the first device needs to acquire the state transition information in each preceding resource transfer transaction of the digital resource, until it needs to trace back to the state transition information TX1 in the resource transfer transaction initiated by the resource issuer of the digital resource. The state transition information in each preceding resource transfer transaction of the digital resource and the state transition information corresponding to the resource transfer request are then concatenated to form a state transition trajectory (TX1, TX2, ..., TXN). It can be understood that the last state transition information (TXN) in the state transition trajectory is the state transition information corresponding to the resource transfer request; the resource sending object indicated by state transition information TXN is the same as the resource receiving object indicated by state transition information TXN-1, and state transition information TXN-1 is the state transition information adjacent to state transition information TXN in the state transition trajectory; the first state transition information (TX1) in the state transition trajectory is the state transition information in the resource transfer transaction initiated by the resource issuer. The first device can obtain the preceding transfer transaction corresponding to the resource transfer request from the local database of the resource client, or it can obtain the preceding transfer transaction corresponding to the resource transfer request from the blockchain. The number of preceding transfer transactions is determined according to the actual transfer situation of the digital resources. It can be one or multiple. This application embodiment does not limit this.
[0105] like Figure 3 As shown, the preceding transfer transaction corresponding to the resource transfer request initiated by the state submission object is the resource transfer transaction initiated by the resource issuing object (resource transfer transaction 1). Therefore, after obtaining the state transition information TX2 corresponding to the resource transfer request, the first device can obtain resource transfer transaction 1, obtain the state transition information TX1 from resource transfer transaction 1, and concatenate the state transition information TX1 and TX2 to obtain the state transition trajectory (TX1, TX2). Then, the state transition trajectory (TX1, TX2) is input to the trusted execution component deployed with TEE for resource state verification.
[0106] For ease of understanding, this embodiment of the application takes an example where the number of state transition information in the state transition trajectory is N, and describes the generation process of the first state verification information in detail. Here, N is an integer greater than 1, and the specific value of N can be 2, 3, 5, or 10, etc. The N state transition information in the state transition trajectory are state transition information TX1, state transition information TX2, ..., state transition information TXN. The generation process of the first state verification information may include: the first device can call the resource state verification function through the trusted execution component to perform resource state verification on the state transition trajectory, obtaining the resource state verification result corresponding to the state transition trajectory; combining the resource state verification result and the transaction identifier of the resource transfer transaction corresponding to the (N-1)th state transition information in the state transition trajectory into resource state combination data; signing the resource state combination data with the private key corresponding to the trusted execution component to obtain the digital signature corresponding to the resource state combination data; and combining the resource state combination data and the digital signature into the first state verification information. Here, the resource state verification function (EXEC) refers to the execution function of the smart contract virtual machine or other resource state execution environment, used to verify the validity of the transfer state of digital resources. The resource status verification function generates new status output data based on the previous status output data and the current status transition information. In other words, the current status output data of the resource status verification function depends on the previous status output data. The current status transition information can only be executed after the previous status transition information has been executed.
[0107] Please see Figure 4 , Figure 4 This is a schematic diagram illustrating the generation of status verification information provided in an embodiment of this application. For example... Figure 4 As shown, the first device can input a state transition trajectory containing N state transition information into the trusted execution component. The trusted execution component then calls a resource state verification function to verify the resource state of the state transition trajectory, obtaining the corresponding resource state verification result. Before verifying the resource state transition trajectory, an initial state information accessible only to the trusted execution component can be initialized in the TEE deployed by the trusted execution component. This initial state information can be marked as TEE.State0 and assigned the value NULL, i.e., TEE.State0 = Null. Further, the first device can call the trusted execution component to substitute the N state transition information into the resource state verification function, perform N iterative calculations, and obtain the resource state verification result (KVs1) of the digital resource indicated by the resource transfer request initiated by the state submission object.
[0108] like Figure 4As shown, in the first iteration, the state input data corresponding to the resource state verification function includes the first state transition information (state transition information TX1) in the state transition trajectory. The first device can use the trusted execution component to call the resource state verification function to verify the resource state of the state transition information TX1, and obtain the first state output data corresponding to the resource state verification function (TEE.State1 = EXEC(TX1)). This state output data TEE.State1 = EXEC(TX1) is used to indicate the resource receiving object (e.g., Figure 3 The state verification object (shown) is used to determine whether it holds the digital resources transferred from the resource issuing object. In subsequent iterative calculations, the state input data corresponding to the resource state verification function includes the state output data of the previous resource state verification function and the state transition information corresponding to the current iterative calculation. Then, the resource state is verified based on the state input data corresponding to the current iterative calculation using the resource state verification function to obtain the state output data corresponding to the current iterative calculation. For example, in the i-th iterative calculation (i is a positive integer greater than 1 and less than or equal to N), the i-th state input data corresponding to the resource state verification function includes: the (i-1)-th state output data of the resource state verification function and the i-th state transition information (state transition information TXI) among the N state transition information. The i-th state output data corresponding to the resource state verification function can be represented as TEE.State. i =EXEC(TEE.State i-1 ,TXi).
[0109] like Figure 4 As shown, after performing the Nth iteration operation on the resource state verification function, the Nth state output data (TEE.State) corresponding to the resource state verification function can be obtained. N =EXEC(TEE.State N-1 ,TXN)), the Nth state output data TEE.State N This is used to indicate whether the state verification object holds the digital resource transferred by the state submission object. Therefore, in this embodiment, the Nth state output data (TEE.State) corresponding to the resource state verification function can be used. N This determines the resource status verification result (KVs1) of the digital resource indicated by the resource transfer information initiated by the status submission object. It is understandable that when the Nth state output data TEE.State... N The state verification object indicates that it has received 100 digital resources (TEE.State). NWhen `BalanceOf[B]` equals 100, it indicates that the state verification object did indeed receive 100 digital resources during the current resource transfer process, and the verification result of this digital resource is a valid result. When the Nth state outputs data `TEE.State`... N The state verification object (TEE.State) has not received a digital resource of quantity 100. N When =BalanceOf[B]≠100), it indicates that the state verification object did not receive a digital resource of quantity 100 during the current resource transfer process, and the verification result of the digital resource is invalid.
[0110] Since the resource status verification result (KVs1) of this digital resource is related to the preceding resource transfer transaction of this digital resource, the resource transfer transaction (UTXO) corresponding to the (N-1)th state transition information (state transition information TXN-1) in the state transition trajectory can be used. N-1 Transaction identifier (UTXO) N-1 The .id value is added to the first state verification information so that the state verification object can be traced. Specifically, after obtaining the resource state verification result (KVs1) of the digital resource, the first device can obtain the resource transfer transaction UTXO. N-1 Transaction identifier (UTXO) N-1 The .id identifier is used to identify resource transfer transactions (UTXOs). N-1 Specifically, this could be a resource transfer transaction (UTXO). N-1 The transaction hash. The first device can verify the resource status (KVs1) and the resource transfer transaction UTXO. N-1 Transaction identifier (UTXO) N-1 .id), combined into resource status composite data (Raw= <UTXO N-1 .id,KVs>). Further, the resource state composite data (Raw) can be signed using the private key (TEE.Prikey) corresponding to the trusted execution component, resulting in a digital signature (TEESig = Crypto(Raw, TEE.Prikey), where Crypto is the function in the TEE that calls the private key TEE.Prikey for encryption and signing). This digital signature can be used to indicate that the trusted execution component has committed to the authenticity of the resource state verification result (KVs1), thus ensuring the credibility of the resource state verification result (KVs1). Subsequently, the resource state composite data and the corresponding digital signature (TEESig) can be combined to form the first state verification information (UTXO). N-1(.id,KVs,TEESig). In this embodiment, the first state verification information carries the digital signature of the trusted execution component, thereby improving the credibility of the resource state verification result in the first state verification information.
[0111] Specifically, the generation process of the digital signature (TEESig) carried by the first state verification information may include: the first device may call the trusted execution component to fill the resource state combination data to obtain resource state filling data; the resource state filling data may be split to obtain P segmented filling data; P is an integer greater than 1, for example, the specific value of P may be 2, 3 or 10, etc.; the j-th input data of the compression function may be obtained; when j is 1, the j-th input data includes the initial compressed data and the first segmented filling data in the P segmented filling data; when j is not 1, the j-th input data includes the (j-1)-th output data of the compression function and the j-th segmented filling data in the P segmented filling data; j is a positive integer less than or equal to P, for example, the specific value of j may be 1, 2, 3...P; the j-th input data may be compressed according to the compression function to obtain the j-th output data corresponding to the compression function; the P-th output data corresponding to the compression function may be determined as the compressed information; and then the compressed information may be encrypted according to the private key corresponding to the trusted execution component to obtain the digital signature corresponding to the resource state combination data.
[0112] A compression function is used to compress input data into a fixed-length dataset. The initial compressed data is the initial state or starting value of the compression function, and its specific value can be determined based on the actual situation. Compression functions can include, but are not limited to: circular left shift functions, modular addition functions, XOR operations, Boolean functions, and permutation functions.
[0113] Please see Figure 5 , Figure 5 This is a schematic diagram illustrating the generation of a digital signature according to an embodiment of this application. For example... Figure 5 As shown, after obtaining the resource status combination data, the first device can call the trusted execution component to randomly fill the resource status combination data (Raw) to obtain resource status filled data. Optionally, to ensure data consistency, the resource status combination data can be formatted first, for example, converted to binary or hexadecimal, etc. For example, in this embodiment, the number "1" can be added to the end of the resource status combination data, and then k numbers "0" can be added, where k is the smallest non-negative integer satisfying I+1+k≡448mod512, I represents the length of the resource status combination data, ≡ represents congruence, and mod represents modulo operation; then a 64-bit bit string of filling data can be added (this 64-bit bit string of filling data can be a binary representation of length I), thus obtaining the resource status filled data as shown. Figure 5 The resource status population data shown is as follows. It can be understood that the resource status population data is a positive integer multiple of 512, meaning the number of bits in the resource status population data is 512 × P.
[0114] like Figure 5 As shown, the first device can invoke a trusted execution component to split the 512×P-bit resource status filling data into 512-bit segments, resulting in P segments: segment filling data 1, segment filling data 2, ..., segment filling data P, each segment being 512 bits. Further, the first device can invoke the trusted execution component to substitute the initial compressed data and the P segments into a compression function, performing P iterations. In the first iteration, the input data for the compression function includes the initial compressed data and segment filling data 1. The first device can invoke the compression function through the trusted execution component. The compression function compresses the initial compressed data and segment filling data 1, obtaining the first output data. In subsequent iterations, the input data includes the output data of the previous compression function and the segment filling data for the current iteration. The compression function then compresses the input data for the current iteration, obtaining the output data for the current iteration, until the Pth iteration is executed, at which point the Pth output data is determined as the compressed information. After obtaining the compressed information, it can be encrypted using the private key (TEE.Prikey) corresponding to the trusted execution component to obtain the digital signature (TEESig) corresponding to the resource state combination data, thereby improving the security of the digital signature.
[0115] Step S102: Send the first status verification information.
[0116] Step S103: Send the on-chain result corresponding to the first state verification information.
[0117] like Figure 3 As shown, after generating the first state verification information, the first device can perform on-chain processing on the first state verification information to obtain the on-chain result corresponding to the first state verification information. Specifically, the first device can send the first state verification information to the blockchain network so that the blockchain nodes in the blockchain network can store the first state verification information on the blockchain.
[0118] For ease of understanding, this application embodiment uses the example of a first device belonging to a blockchain node in a blockchain network to describe the process of uploading the first state verification information to the blockchain. Specifically, the first device can generate a resource transfer transaction (UTXON) containing the first state verification information. <TXN,[UTXO N-1The resource transfer transaction is encapsulated into a transaction block (.id,KVs1,TEESig]>), which is a newly generated block. The first device can broadcast this transaction block in the blockchain network. All consensus nodes in the blockchain network can receive the transaction block and process it using the consensus algorithm. If the consensus result corresponding to the transaction block is a consensus failure, the on-chain result corresponding to the resource transfer transaction is determined to be an on-chain failure result. At this time, the first device can generate an on-chain failure result to indicate that the first state verification information of the status submission object failed to be uploaded to the chain.
[0119] When the consensus result corresponding to a transaction block containing a resource transfer transaction is a consensus pass result, the first device can store the transaction block in the blockchain. Specifically, the first device can update the block height of the transaction block according to the maximum block height in the blockchain, and store the updated transaction block in the first device's local database. At this time, the process of putting the resource transfer transaction containing the first state verification information on the blockchain is completed. The first device can generate a successful on-chain result for the first state verification information. This successful on-chain result can include the transaction hash corresponding to the first state verification information, so that the transaction hash can be used as a query identifier to query the first state verification information on the blockchain. The consensus algorithm can include, but is not limited to, Proof of Work (PoW) algorithm, Proof of Stake (PoS) algorithm, DPoS algorithm, Practical Byzantine Fault Tolerance (PBFt) algorithm, etc. The embodiments of this application do not limit this.
[0120] Step S104: If the on-chain result indicates that the on-chain process was successful, then generate the first resource transfer information based on the transaction hash and resource transfer request corresponding to the first state verification information.
[0121] When the on-chain result corresponding to the first state verification information indicates successful on-chain processing, the first device can obtain the transaction hash corresponding to the first state verification information, and then add the transaction hash corresponding to the first state verification information to the resource transfer request initiated by the state submission object to obtain the first resource transfer information. The first resource transfer information includes, but is not limited to: the transaction hash corresponding to the first state verification information, the state submission object, the state verification object, the digital resources transferred from the state submission object to the state verification object, the timestamp of the request, and the digital signature corresponding to the state submission object.
[0122] Step S105: Send the first resource transfer information.
[0123] After generating the first resource transfer information, the first device can send the first resource transfer information carrying the transaction hash corresponding to the first state verification information to the state verification object indicated by the resource transfer request, so that the state verification object can verify the validity of the digital signature carried by the first state verification information that matches the transaction hash on the blockchain according to the public key corresponding to the trusted execution component, and then determine the validity of the digital resource indicated by the first resource transfer information based on the signature verification result corresponding to the first state verification information.
[0124] Step S106: Obtain the transaction hash carried by the first resource transfer information.
[0125] Step S107: Obtain the first state verification information that matches the transaction hash.
[0126] Please see Figure 6 , Figure 6 This is an illustration of a method for verifying digital resources provided in an embodiment of this application. Figure 1 .like Figure 6 As shown, when the second device receives the first resource transfer information, it can parse the first resource transfer information to obtain the transaction hash carried by the first resource transfer information, and then obtain the first state verification information that matches the transaction hash on the blockchain. Optionally, after obtaining the first state verification information, it can also obtain the state transition trajectory corresponding to the first state verification information and store the state transition trajectory in a local database for later use.
[0127] In one possible implementation, the process of obtaining the first state verification information may include: the second device can obtain the transaction blocks contained in the blockchain, and then use the transaction hash carried by the first resource transfer information as a query identifier to traverse the transactions contained in the transaction blocks, determine the transaction that matches the transaction hash as the resource transfer transaction corresponding to the first resource transfer information, and then obtain the first state verification information in the resource transfer transaction.
[0128] In one possible implementation, the process of obtaining the first state verification information may include: the second device inputs the transaction hash into a Bloom filter deployed on the blockchain, calls a hash function through the Bloom filter to perform a hash operation on the transaction hash, and obtains the array element identifier of the transaction hash in the Bloom filter; if there is a transaction at the storage location associated with the array element identifier, the transaction at the storage location is determined as the resource transfer transaction corresponding to the transaction hash, and the first state verification information is obtained in the resource transfer transaction.
[0129] A Bloom filter consists of a long binary vector (which can be understood as a long array of 0s and 1s) and a series of random mapping functions (e.g., hash functions). A Bloom filter can quickly retrieve whether an element is in the set without iterating through each piece of data, thus improving the efficiency of data retrieval. Therefore, in this embodiment, a Bloom filter can be used to quickly retrieve first-state verification information that matches the transaction hash on the blockchain.
[0130] After querying data on the blockchain using a Bloom filter, the Bloom filter needs to be deployed on the blockchain. Specifically, the second device can define the parameters of the Bloom filter, which may include, but are not limited to, the array size of the Bloom filter, the number of hash functions, and the error rate. Further, a smart contract can be invoked to insert each transaction stored in the blockchain into the binary array of the Bloom filter, with each storage location in the binary array initialized to 0. The second device can select one or more hash functions to perform hash operations on the transaction hashes corresponding to each transaction stored in the blockchain, obtaining the mapping value of each transaction hash in the Bloom filter. Each transaction is then mapped to the storage location identified by the element array that matches its mapping value in the Bloom filter, updating the value in the corresponding storage location from 0 to 1, thus indicating that a transaction exists at that storage location. The second device can then store the data structure of the Bloom filter, after data insertion, into the blockchain, thereby completing the deployment of the Bloom filter on the blockchain. The hash function may include, but is not limited to, one or more of the hash functions corresponding to hash algorithms such as SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512.
[0131] For ease of description, the embodiments of this application use a hash function y = x. 2 Taking &(len-1) as an example, the data insertion process through the Bloom filter is described. Here, y represents the array element identifier stored in the Bloom filter's data structure (binary array), x represents the transaction hash corresponding to the exchange in the blockchain, and len represents the array length of the Bloom filter. Assuming the Bloom filter array length is 100, and the transaction hash corresponding to a certain transaction in the blockchain (e.g., transaction x) is 5, after hashing using the hash function, the array element identifier of the transaction hash corresponding to transaction x in the Bloom filter is 25. At this point, the value in the storage location corresponding to array element identifier 25 can be updated from 0 to 1, indicating that transaction x is stored in the storage location corresponding to array element identifier 25. When a second device needs to query transaction x on the blockchain, it can input the transaction hash corresponding to transaction x into the Bloom filter, and call the hash function y = x through the Bloom filter. 2The transaction hash is hashed using `&(len-1)` to obtain the array element identifier of the transaction hash in the Bloom filter. This determines whether a transaction exists at the storage location associated with that array element identifier. For example, a value of 1 indicates a transaction exists at that storage location; a value of 0 indicates no transaction exists. If a transaction exists at the storage location associated with that array element identifier, the transaction at that location is identified as the transaction the second device needs to query. Similarly, the resource transfer transaction corresponding to the transaction hash carried by the first resource transfer information can be quickly retrieved using the Bloom filter in the same way, and then the first status verification information can be obtained from the resource transfer transaction.
[0132] Step S108: Verify the validity of the digital signature carried in the first state verification information based on the public key corresponding to the trusted execution component, and obtain the signature verification result corresponding to the first state verification information.
[0133] like Figure 6 As shown, the second device acquires the first state verification information (UTXO). N-1 After obtaining the digital signature (TEESig) carried by the first state verification information, you can obtain the public key (TEE.Pubkey) corresponding to the trusted execution component. Then, you can use the signature verification function (Verify) and the public key (TEE.Pubkey) corresponding to the trusted execution component to verify the validity of the digital signature (TEESig), thereby obtaining the signature verification result corresponding to the first state verification information (Valid = Verify(Raw, TEE.Pubkey, TEESig)).
[0134] Specifically, the second device can decrypt the digital signature using the public key corresponding to the trusted execution component to obtain the first digest information corresponding to the digital signature. Then, it performs a hash operation on the first state verification information using a hash function (the same hash function used when the digital signature was carried in the first state verification information) to obtain the second digest information corresponding to the first state verification information. Further, the second device can compare the first digest information with the second digest information to determine the signature verification result corresponding to the first state verification information based on the comparison result. For example, when the first digest information and the second digest information are the same, it indicates that the digital signature carried by the first state verification information is valid, meaning that the first state verification information has not been tampered with during transmission, thus determining that the signature verification result (Valid) indicates successful verification. When the first digest information and the second digest information are different, it indicates that the digital signature carried by the first state verification information is invalid, meaning that the first state verification information may have been tampered with during transmission, thus determining that the signature verification result indicates unsuccessful verification.
[0135] Step S109: If the signature verification result indicates that the verification is successful, then the resource status verification result in the first status verification information is determined as the verification result of the digital resource indicated by the first resource transfer information.
[0136] like Figure 6 As shown, when the signature verification result corresponding to the first state verification information indicates that the verification is successful, it means that the first state verification information has not been tampered with during transmission. Therefore, the second device can determine the resource state verification result (KVs1) in the first state verification information as the verification result of the digital resource indicated by the first resource transfer information.
[0137] For example, the first resource transfer information indicates that the status submission object transfers 100 digital resources to the status verification object. After the second device determines that the signature verification result corresponding to the first status verification information has passed, it can read the resource status verification result in the first status verification information. When the resource status verification result (KVs1) in the first status verification information indicates that the status verification object has received 100 digital resources (KVs1 == ...<BalanceOf[B]=100> When the resource status verification result (KVs1) in the first status verification information indicates that the status verification object has indeed received 100 digital resources during the current resource transfer process, the verification result of this digital resource indicates that the verification has passed. When the resource status verification result (KVs1) in the first status verification information indicates that the status verification object has not received 100 digital resources (KVs1 == 100), the verification result of this digital resource indicates that the verification has passed.<BalanceOf[B]≠100> When the status verification object does not receive 100 digital resources during the current resource transfer process, the verification result of the digital resource indicates that the verification failed.
[0138] like Figure 6 As shown, when the signature verification result indicates that the verification failed, it means that the first state verification information may have been tampered with during transmission, and the resource state verification result in the first state verification information is unreliable. At this time, the second device can obtain the resource transfer transaction that matches the transaction hash on the blockchain, and obtain the preceding transfer transaction associated with the resource transfer transaction on the blockchain; based on the state transition information carried by the resource transfer transaction and the state transition information carried by the preceding transfer transaction, a first transition trajectory of the digital resource indicated by the first resource transfer information is generated; the resource state is verified by the state transition information contained in the first transition trajectory to obtain the verification result of the digital resource indicated by the first resource transfer information.
[0139] In this embodiment, when the signature verification result indicates that the verification failed, the second device can search the blockchain for a resource transfer transaction that matches the transaction hash, as well as the preceding transfer transaction associated with that resource transfer transaction. The second device then downloads the resource transfer transaction and the preceding transfer transaction associated with it to its local machine. The state transition information carried by the resource transfer transaction and the preceding transfer transaction are then combined to form a first transition trajectory. The first transition trajectory is used for all preceding transfer processes of the digital resource indicated by the first resource transfer information, and the first transition trajectory may include N state transition information entries.
[0140] The resource status verification process for the state transition information contained in the first transition trajectory may include: obtaining the i-th state input data of the resource status verification function; when i is 1, the i-th state input data includes the first state transition information among N state transition information; when i is not 1, the i-th state input data includes the (i-1)-th state output data of the resource status verification function and the i-th state transition information among N state transition information; i is a positive integer less than or equal to N; performing resource status verification on the i-th state input data according to the resource status verification function to obtain the i-th state output data corresponding to the resource status verification function, and determining the N-th state output data corresponding to the resource status verification function as the verification result of the digital resource indicated by the first resource transfer information.
[0141] Specifically, the second device can substitute the first transition trajectory into the resource status verification function and perform N iterative calculations. In the first iterative calculation, the state input data corresponding to the resource status verification function includes the first state transition information (state transition information TX1) in the first transition trajectory. The second device can call the resource status verification function to verify the state transition information TX1 and obtain the first state output data (State1 = EXEC(TX1)) corresponding to the resource status verification function. In subsequent iterative calculations, the state input data corresponding to the resource status verification function includes the state output data of the previous resource status verification function and the state transition information corresponding to the current iterative calculation. Then, the resource status is verified according to the state input data corresponding to the current iterative calculation using the resource status verification function to obtain the state output data corresponding to the current iterative calculation, until the Nth iterative calculation is performed, and the Nth state output data (State1 = EXEC(TX1)) corresponding to the resource status verification function is obtained. N =EXEC(State N-1 ,TXN)), which is the verification result of the digital resource indicated by the first resource transfer information.
[0142] When the Nth state output data State corresponding to the resource state verification function N This indicates that the state verification object has received 100 digital resources (State). N ==<BalanceOf[B]=100> When the state verification object actually receives 100 digital resources during the current resource transfer process, the verification result of this digital resource indicates that the verification is successful. When the resource state verification result in the first state verification information is State... N This indicates that the state verification object has not received a digital resource (State) of quantity 100. N==<BalanceOf[B]≠100> When the status verification object does not receive 100 digital resources during the current resource transfer process, the verification result of the digital resource indicates that the verification failed.
[0143] Optionally, after verifying the validity of the digital resources transferred by the status submission object, the second device obtains the second resource transfer information initiated by the status verification object, and determines the resource receiving object to receive the transferred-out resource indicated by the second resource transfer information based on the second resource transfer information; the transferred-out resource indicated by the second resource transfer information belongs to the digital resource indicated by the first resource transfer information; if the trusted component set associated with the resource receiving object includes a trusted execution component, the status transition information corresponding to the second resource transfer information and the resource status verification result are input to the trusted execution component, and the resource status verification function is called through the trusted execution component to obtain the second status verification information; the second status verification information is stored in the blockchain; the second status verification information stored on the blockchain is used to determine the validity of the transferred-out resource received by the resource receiving object.
[0144] Specifically, please see Figure 7 , Figure 7 This is an illustration of a method for verifying digital resources provided in an embodiment of this application. Figure 2 .like Figure 7 As shown, after verifying the validity of the digital resources transferred by the status submission object, the status verification object can initiate a resource transfer request to the resource receiving object (marked as "C") through the resource client. This resource transfer request can be used to instruct the status verification object to transfer part or all of the digital resources transferred by the status submission object to the resource receiving object. After receiving the resource transfer request initiated by the status verification object, the second device can generate second resource transfer information initiated by the status verification object based on the resource transfer request. The second resource transfer information is used to instruct the status verification object to transfer digital resources to the resource receiving object. The second resource transfer information may include, but is not limited to: the resource receiving object, the status verification object, the digital resources transferred by the status verification object to the resource receiving object (transferring out resources), the timestamp of the request, the digital signature corresponding to the status verification object, etc. The transferring out resources indicated by the second resource transfer information belong to the digital resources indicated by the first resource transfer information.
[0145] Furthermore, the second device can combine the outgoing resources (e.g., 100 in number) indicated by the second resource transfer information initiated by the status verification object, the status verification object, and the resource receiving object into candidate transfer information.<B,C,100> Then, the candidate transformation information can be signed using the private key corresponding to the state verification object to obtain the digital signature (SigB) corresponding to the candidate transformation information. The candidate transformation information and the digital signature corresponding to the candidate transformation information are then combined into a formula as follows: Figure 7 The state transition information shown is TX3 (TX3<B,C,100> The state transition information TX3 is the state transition information corresponding to the second resource transfer information. State transition information TX3 indicates that the state verification object transfers a digital resource of quantity 100 to the resource receiving object, and the state verification object confirms the transfer with its signature.
[0146] The second device can obtain the set of trusted components associated with the resource receiving object and determine whether the set of trusted components associated with the resource receiving object includes a trusted execution component that is jointly trusted by the state verification object and the state submission object. For example... Figure 7 As shown, if the set of trusted components associated with the resource receiving object includes the trusted execution component, the second device can input the state transition information TX3 corresponding to the second resource transfer information and the resource state verification result (KVs1) in the first state verification information to the trusted execution component. The trusted execution component then calls the resource state verification function to perform resource state verification on the state transition information TX3 and the resource state verification result (KVs1). The state output data corresponding to the resource state verification function (TEE.State3 = EXEC(KVs1,TX3)) is determined as the resource state verification result (KVs2) corresponding to the transferred resource indicated by the second resource transfer information. Then, based on the resource... The state verification result KVs2, the transaction identifier (UTXO2.id) of the resource transfer transaction corresponding to the first resource transfer information, and the digital signature (TEESig) corresponding to the trusted execution component are used to generate second state verification information (UTXO2.id, KVs2, TEESig). This second state verification information is stored in the blockchain so that the computer device logged into by the resource recipient can determine the validity of the transferred resources received by the resource recipient based on the second state verification information stored on the blockchain. The specific determination process can refer to the process of determining the validity of the digital resources received by the state verification object based on the first state verification information above, and will not be repeated here.
[0147] As can be seen, in this embodiment, since the state verification object and the resource receiving object trust the same trusted execution component, the reliability of the resource state verification result (KVs1) in the first state verification information generated by the trusted execution component can be guaranteed. Therefore, the resource state verification function can be called by the trusted execution component to perform resource state verification on the state transition information corresponding to the second resource transfer information and the resource state verification result (KVs1) in the first state verification information, so as to obtain the resource state verification result (KVs2) of the transferred resource indicated by the second resource transfer information. There is no need to input the pre-transition information of the state transition information corresponding to the second resource transfer information into the trusted execution component for state calculation, thereby saving resource state verification time and improving resource state verification efficiency.
[0148] Optionally, when the set of trusted components associated with the resource transfer object does not contain a trusted execution component, the second device can obtain the state transition trajectory corresponding to the digital resource indicated by the first resource transfer information; add the state transition information corresponding to the second resource transfer information to the state transition trajectory to obtain the second transition trajectory; and store the second transition trajectory on the blockchain. The second transition trajectory stored on the blockchain is used to determine the validity of the transferred-out resource received by the resource receiving object.
[0149] In this embodiment, when the resource transfer recipient does not trust the trusted execution component, the second device can obtain the state transition trajectory (e.g., TX1, TX2) corresponding to the digital resource indicated by the first resource transfer information, and append the state transition information (e.g., TX3) corresponding to the second resource transfer information to the end of the state transition trajectory to obtain the second transition trajectory (TX1, TX2, TX3). The second transition trajectory is then stored in the blockchain so that the computer device logged into by the resource receiving recipient can determine the validity of the transferred resource received by the resource receiving recipient based on the second transition trajectory stored in the blockchain. The specific determination process can refer to the process described above for determining the validity of the digital resource received by the state verification object based on the first transition trajectory, and will not be repeated here.
[0150] Optionally, when the set of trusted components associated with the resource transfer object does not contain a trusted execution component, the second device can also store the resource transfer transaction containing the state transition information corresponding to the second resource transfer information to the blockchain. The computer device logged into by the resource receiving object can download the resource transfer transaction corresponding to the second resource transfer information, as well as all the preceding transfer transactions associated with the resource transfer transaction of the second resource transfer information, to its local machine. The state transition information in the resource transfer transaction of the second resource transfer information and all the preceding transfer transactions associated with it is combined to obtain the second transition trajectory. Then, the validity of the transferred resources received by the resource receiving object is determined according to the second transition trajectory.
[0151] In this embodiment, if the second device receives first resource transfer information initiated by a state submission object, it obtains the transaction hash carried by the first resource transfer information and acquires first state verification information matching the transaction hash on the blockchain. The first state verification information includes a resource state verification result obtained by a trusted execution component performing resource state verification on multiple state transition information contained in the state transition trajectory. The state transition trajectory is used to characterize the pre-transfer process of the digital resource indicated by the first resource transfer information. Further, the validity of the digital signature carried by the first state verification information can be verified based on the public key corresponding to the trusted execution component, resulting in a signature verification result corresponding to the first state verification information. If the signature verification result indicates successful verification, the resource state verification result in the first state verification information is determined as the verification result of the digital resource indicated by the first resource transfer information. It can be seen that, in verifying the validity of the digital resource indicated by the first resource transfer information, this embodiment only needs to verify the validity of the digital signature carried by the first state verification information, without needing to verify all pre-transfer processes corresponding to the digital resource, thereby improving the verification efficiency of the digital resource.
[0152] It is understood that in the specific implementation of this application, user-related information (e.g., user resource transfer information) may be involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant regions.
[0153] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of this application. Figure 1 The aforementioned blockchain-based data processing device can be a computer program (including program code) running on a computer device (e.g., a terminal device or a server), such as an application software; the blockchain-based data processing device can be used to execute the corresponding steps in the methods provided in the embodiments of this application. Figure 8 As shown, the blockchain-based data processing device 1 may include: a first verification information acquisition module 11, a digital signature verification module 12, and a resource verification result determination module 13, wherein:
[0154] The first verification information acquisition module 11 is used to, if it receives first resource transfer information initiated by a state submission object, acquire the transaction hash carried by the first resource transfer information, and acquire first state verification information matching the transaction hash on the blockchain; the first state verification information includes resource state verification results obtained by a trusted execution component performing resource state verification on multiple state transition information contained in the state transition trajectory; the state transition trajectory is used to characterize the pre-transfer process of the digital resource indicated by the first resource transfer information.
[0155] Digital signature verification module 12 is used to verify the validity of the digital signature carried in the first state verification information based on the public key corresponding to the trusted execution component, and obtain the signature verification result corresponding to the first state verification information.
[0156] The resource verification result determination module 13 is used to determine the resource status verification result in the first status verification information as the verification result of the digital resource indicated by the first resource transfer information if the signature verification result indicates that the verification is successful.
[0157] In one possible implementation, the first verification information acquisition module 11 is specifically used for:
[0158] The transaction hash is input into a Bloom filter deployed on the blockchain. The Bloom filter calls a hash function to perform a hash operation on the transaction hash, and the array element identifier of the transaction hash in the Bloom filter is obtained.
[0159] If a transaction exists at the storage location associated with the array element identifier, then the transaction at the storage location is identified as the resource transfer transaction corresponding to the transaction hash, and the first state verification information is obtained from the resource transfer transaction.
[0160] In one possible implementation, the digital signature verification module 12 is specifically used for:
[0161] Obtain the digital signature carried in the first state verification information, and obtain the public key corresponding to the trusted execution component;
[0162] The digital signature carried by the first state verification information is decrypted using the public key corresponding to the trusted execution component to obtain the first digest information corresponding to the digital signature carried by the first state verification information. The first state verification information is then hashed using a hash function to obtain the second digest information corresponding to the first state verification information.
[0163] If the first digest information is the same as the second digest information, then the signature verification result corresponding to the first state verification information indicates that the verification is successful;
[0164] If the first digest information is different from the second digest information, then the signature verification result corresponding to the first state verification information indicates that the verification failed.
[0165] In one possible implementation, the blockchain-based data processing device 1 further includes: a resource status verification module 14, which is used for:
[0166] If the signature verification result indicates that the verification failed, then obtain the resource transfer transaction that matches the transaction hash on the blockchain, and obtain the preceding transfer transaction associated with the resource transfer transaction on the blockchain;
[0167] Based on the state transition information carried by the resource transfer transaction and the state transition information carried by the preceding transfer transaction, a first transition trajectory of the digital resource indicated by the first resource transfer information is generated.
[0168] The resource status is verified by analyzing the state transition information contained in the first transition trajectory, and the verification result of the digital resource indicated by the first resource transfer information is obtained.
[0169] In one possible implementation, the first transition trajectory includes N state transition information, where N is an integer greater than 1; the resource state verification module 14 is specifically used for:
[0170] Obtain the i-th state input data of the resource status verification function; when i is 1, the i-th state input data includes the first state transition information among N state transition information; when i is not 1, the i-th state input data includes the (i-1)-th state output data of the resource status verification function and the i-th state transition information among N state transition information; i is a positive integer less than or equal to N;
[0171] The resource status is verified by the resource status verification function for the i-th state input data, and the i-th state output data corresponding to the resource status verification function is obtained. The N-th state output data corresponding to the resource status verification function is determined as the verification result of the digital resource indicated by the first resource transfer information.
[0172] In one possible implementation, the blockchain-based data processing device 1 further includes: a second verification information acquisition module 15, the second verification information acquisition module 15 being used for:
[0173] Obtain the second resource transfer information initiated by the status verification object, and determine the resource receiving object to receive the transferred-out resource indicated by the second resource transfer information based on the second resource transfer information; the transferred-out resource indicated by the second resource transfer information belongs to the digital resource indicated by the first resource transfer information.
[0174] If the set of trusted components associated with the resource receiving object includes a trusted execution component, then the state transition information and resource state verification result corresponding to the second resource transfer information are input to the trusted execution component, and the resource state verification function is called through the trusted execution component to obtain the second state verification information;
[0175] The second state verification information is stored in the blockchain; the second state verification information stored on the blockchain is used to determine the validity of the transferred resources received by the resource receiving object.
[0176] In one possible implementation, the blockchain-based data processing device 1 further includes: a conversion trajectory acquisition module 16, which is used for:
[0177] If the set of trusted components associated with the resource transfer object does not contain a trusted execution component, then obtain the state transition trajectory corresponding to the digital resource indicated by the first resource transfer information;
[0178] Add the state transition information corresponding to the second resource transfer information to the state transition trajectory to obtain the second transition trajectory;
[0179] The second conversion trace is stored on the blockchain, and the second conversion trace stored on the blockchain is used to determine the validity of the transferred resources received by the resource receiving object.
[0180] According to one embodiment of this application, the steps involved in the blockchain-based data processing method described above can be performed by... Figure 8 The various modules in the blockchain-based data processing device 1 shown are used to execute this process. For example, Figure 2 Steps S106 and S107 shown can be derived from... Figure 8 The first verification information acquisition module 11 shown is used to execute this. Figure 2 The step S108 shown can be performed by Figure 8 The digital signature verification module 12 shown is used to perform this. Figure 2 The step S109 shown can be performed by Figure 8 The resource verification result determination module 13 is used to perform the process, etc.
[0181] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of this application. Figure 2 The aforementioned blockchain-based data processing device can be a computer program (including program code) running on a computer device (e.g., a terminal device or a server), such as an application software; the blockchain-based data processing device can be used to execute the corresponding steps in the methods provided in the embodiments of this application. Figure 9As shown, the blockchain-based data processing device 2 may include: a status verification information generation module 21, an information on-chain processing module 22, and a transfer information sending module 23, wherein:
[0182] The status verification information generation module 21 is used to obtain the resource transfer request initiated by the status submission object, determine the multiple status transition information associated with the resource transfer request, generate a status transition trajectory containing multiple status transition information, and obtain the first status verification information corresponding to the status transition trajectory through the trusted execution component; the status transition trajectory is used to characterize the pre-transfer process of the digital resource indicated by the resource transfer request; the first status verification information includes the resource status verification result obtained by the trusted execution component in verifying the resource status of the status transition trajectory;
[0183] The information uplink processing module 22 is used to process the first state verification information uplink to obtain the uplink result corresponding to the first state verification information.
[0184] The transfer information sending module 23 is used to generate first resource transfer information based on the transaction hash and resource transfer request corresponding to the first state verification information if the on-chain result indicates that the on-chain is successful, and send the first resource transfer information to the state verification object indicated by the resource transfer request.
[0185] The first resource transfer information is used to instruct the state verification object to verify the validity of the digital signature carried by the first state verification information that matches the transaction hash on the blockchain, based on the public key corresponding to the trusted execution component. When the signature verification result corresponding to the first state verification information indicates that the verification is successful, the resource state verification result in the first state verification information is used as the verification result of the digital resource indicated by the first resource transfer information.
[0186] In one possible implementation, the status verification information generation module 21 is specifically used for:
[0187] The digital resource, status submission object, and status verification object indicated by the resource transfer request are combined into candidate conversion information corresponding to the resource transfer request;
[0188] The candidate transition information is signed using the private key corresponding to the status submission object to obtain the digital signature corresponding to the candidate transition information. The candidate transition information and the digital signature corresponding to the candidate transition information are combined to form the status transition information corresponding to the resource transfer request.
[0189] Obtain the preceding transfer transaction of the digital resource indicated by the resource transfer request, and combine the state transition information carried by the preceding transfer transaction and the state transition information corresponding to the resource transfer request into a state transition trajectory.
[0190] In one possible implementation, the number of state transition information items contained in the state transition trajectory is N, where N is an integer greater than 1; the state verification information generation module 21 is specifically used for:
[0191] By calling the resource status verification function through the trusted execution component, the resource status of the state transition trajectory is verified, and the resource status verification result corresponding to the state transition trajectory is obtained.
[0192] The resource status verification result and the transaction identifier of the resource transfer transaction corresponding to the (N-1)th state transition information in the state transition trajectory are combined into resource status combination data;
[0193] The resource state combination data is signed using the private key corresponding to the trusted execution component to obtain the digital signature corresponding to the resource state combination data. The resource state combination data and the digital signature corresponding to the resource state combination data are combined to form the first state verification information.
[0194] In one possible implementation, the status verification information generation module 21 is specifically used for:
[0195] Data is populated into the resource status combination data to obtain resource status populated data. The resource status populated data is then split to obtain P segments of populated data; P is an integer greater than 1.
[0196] Obtain the j-th input data of the compression function; when j is 1, the j-th input data includes the initial compressed data and the first segmented padding data in P segmented padding data; when j is not 1, the j-th input data includes the (j-1)-th output data of the compression function and the j-th segmented padding data in P segmented padding data; j is a positive integer less than or equal to P;
[0197] The j-th input data is compressed according to the compression function to obtain the j-th output data corresponding to the compression function. The P-th output data corresponding to the compression function is determined as the compressed information.
[0198] The compressed information is encrypted using the private key corresponding to the trusted execution component to obtain a digital signature for the resource status combination data.
[0199] According to one embodiment of this application, the steps involved in the blockchain-based data processing method described above can be performed by... Figure 9 The various modules in the blockchain-based data processing device 2 shown are used to execute this process. For example, Figure 2 The step S101 shown can be performed by Figure 9 The status verification information generation module 21 shown is used to execute this. Figure 2 Steps S102 and S103 shown can be derived from... Figure 9 The information uplink processing module 22 shown is used to execute this. Figure 2 Steps S104 and S105 shown can be derived from... Figure 9 The transfer information sending module 23 shown is used to perform the above.
[0200] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0201] According to one embodiment of this application, Figure 8 The blockchain-based data processing device 1 and Figure 9 The modules in the blockchain-based data processing device 2 shown can be individually or entirely merged into one or more units, or some of these units can be further divided into at least two functionally smaller sub-units to achieve the same operation without affecting the technical effects of the embodiments of this application. The above modules are based on logical functional division. In practical applications, the function of one module can also be implemented by at least two units, or the function of at least two modules can be implemented by one unit. In other embodiments of this application, the blockchain-based data processing device 1 and the blockchain-based data processing device 2 may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by at least two units.
[0202] In this embodiment, if the second device receives first resource transfer information initiated by a state submission object, it obtains the transaction hash carried by the first resource transfer information and acquires first state verification information matching the transaction hash on the blockchain. The first state verification information includes a resource state verification result obtained by a trusted execution component performing resource state verification on multiple state transition information contained in the state transition trajectory. The state transition trajectory is used to characterize the pre-transfer process of the digital resource indicated by the first resource transfer information. Further, the validity of the digital signature carried by the first state verification information can be verified based on the public key corresponding to the trusted execution component, resulting in a signature verification result corresponding to the first state verification information. If the signature verification result indicates successful verification, the resource state verification result in the first state verification information is determined as the verification result of the digital resource indicated by the first resource transfer information. It can be seen that, in verifying the validity of the digital resource indicated by the first resource transfer information, this embodiment only needs to verify the validity of the digital signature carried by the first state verification information, without needing to verify all pre-transfer processes corresponding to the digital resource, thereby improving the verification efficiency of the digital resource.
[0203] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 10 As shown, the computer device 1000 can be a terminal device or a server; this is not a limitation. For ease of understanding, this application uses a computer device as a terminal device as an example. The computer device 1000 may include: a processor 1001, a network interface 1004, and a memory 1005. Furthermore, the computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to implement communication between these components. The user interface 1003 may include a display screen and a keyboard. Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as at least one disk storage device. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. Figure 10 As shown, the memory 1005, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application.
[0204] Among them, Figure 10In the computer device 1000 shown, the network interface 1004 provides network communication functionality; 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 device control application stored in the memory 1005 to achieve:
[0205] If a first resource transfer message initiated by a state submission object is received, the transaction hash carried by the first resource transfer message is obtained, and the first state verification message matching the transaction hash is obtained on the blockchain. The first state verification message includes the resource state verification result obtained by the trusted execution component in verifying the resource state of multiple state transition messages contained in the state transition trajectory. The state transition trajectory is used to characterize the pre-transfer process of the digital resource indicated by the first resource transfer message.
[0206] The validity of the digital signature carried in the first state verification information is verified based on the public key corresponding to the trusted execution component, and the signature verification result corresponding to the first state verification information is obtained.
[0207] If the signature verification result indicates that the verification is successful, then the resource status verification result in the first status verification information is determined as the verification result of the digital resource indicated by the first resource transfer information.
[0208] Alternatively, processor 1001 can also be used to call device control applications stored in memory 1005 to achieve:
[0209] The system obtains a resource transfer request initiated by a state submission object, determines multiple state transition information associated with the resource transfer request, generates a state transition trajectory containing multiple state transition information, and obtains the first state verification information corresponding to the state transition trajectory through a trusted execution component. The state transition trajectory is used to characterize the pre-transfer process of the digital resource indicated by the resource transfer request. The first state verification information includes the resource state verification result obtained by the trusted execution component in verifying the resource state of the state transition trajectory.
[0210] The first state verification information is processed on the blockchain to obtain the on-chain result corresponding to the first state verification information.
[0211] If the on-chain result indicates that the on-chain is successful, then based on the transaction hash and resource transfer request corresponding to the first state verification information, the first resource transfer information is generated and sent to the state verification object indicated by the resource transfer request.
[0212] The first resource transfer information is used to instruct the state verification object to verify the validity of the digital signature carried by the first state verification information that matches the transaction hash on the blockchain, based on the public key corresponding to the trusted execution component. When the signature verification result corresponding to the first state verification information indicates that the verification is successful, the resource state verification result in the first state verification information is used as the verification result of the digital resource indicated by the first resource transfer information.
[0213] It should be understood that the computer device 1000 described in the embodiments of this application can execute the foregoing text. Figure 2 The description of the blockchain-based data processing method in the corresponding embodiments can also be performed as described above. Figure 8 and Figure 9 The description of the blockchain-based data processing device in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated.
[0214] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium, which stores a computer program executed by the aforementioned blockchain-based data processing device 1 and blockchain-based data processing device 2. The computer program includes program instructions, and when the processor executes the program instructions, it can execute the aforementioned... Figure 2 The description of the blockchain-based data processing method in the corresponding embodiments will not be repeated here. Similarly, the beneficial effects of using the same method will not be repeated here either. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. For technical details not disclosed in the embodiments of the computer-readable storage medium involved in this application, please refer to the description of the method embodiments of this application. As an example, program instructions can be deployed and executed on a single computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed across multiple locations and interconnected via a communication network. These multiple computer devices distributed across multiple locations and interconnected via a communication network can constitute a blockchain system.
[0215] Furthermore, it should be noted that this application also provides a computer program product or computer program, which may include computer instructions, which may be stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor may execute the computer instructions, causing the computer device to perform the aforementioned actions. Figure 2The description of the blockchain-based data processing method in the corresponding embodiments is already provided and will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer program products or computer program embodiments related to this application, please refer to the description of the method embodiments of this application.
[0216] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0217] The steps in the method of this application embodiment can be adjusted, combined, or deleted according to actual needs.
[0218] The modules in the device of this application embodiment can be merged, divided, and deleted according to actual needs.
[0219] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0220] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A data processing method based on blockchain, characterized in that, The method includes: If a first resource transfer message initiated by a state submission object is received, the transaction hash carried by the first resource transfer message is obtained, and the first state verification message matching the transaction hash is obtained on the blockchain; the first state verification message includes the resource state verification result obtained by the trusted execution component performing resource state verification on multiple state transition messages contained in the state transition trajectory; the state transition trajectory is used to characterize the pre-transfer process of the digital resource indicated by the first resource transfer message; The validity of the digital signature carried by the first state verification information is verified based on the public key corresponding to the trusted execution component, and the signature verification result corresponding to the first state verification information is obtained. If the signature verification result indicates that the verification is successful, then the resource status verification result in the first status verification information is determined as the verification result of the digital resource indicated by the first resource transfer information.
2. The method according to claim 1, characterized in that, The step of obtaining the first state verification information that matches the transaction hash on the blockchain includes: The transaction hash is input into a Bloom filter deployed on the blockchain. The Bloom filter calls a hash function to perform a hash operation on the transaction hash, and the array element identifier of the transaction hash in the Bloom filter is obtained. If a transaction exists at the storage location associated with the array element identifier, the transaction at the storage location is identified as the resource transfer transaction corresponding to the transaction hash, and the first status verification information is obtained from the resource transfer transaction.
3. The method according to claim 1, characterized in that, The step of validating the digital signature carried in the first state verification information based on the public key corresponding to the trusted execution component, and obtaining the signature verification result corresponding to the first state verification information, includes: Obtain the digital signature carried by the first state verification information, and obtain the public key corresponding to the trusted execution component; The digital signature carried by the first state verification information is decrypted using the public key corresponding to the trusted execution component to obtain the first digest information corresponding to the digital signature carried by the first state verification information. The first state verification information is then hashed using a hash function to obtain the second digest information corresponding to the first state verification information. If the first digest information is the same as the second digest information, then the signature verification result corresponding to the first status verification information indicates that the verification is successful; If the first digest information is different from the second digest information, then it is determined that the signature verification result corresponding to the first status verification information indicates that the verification failed.
4. The method according to claim 1, characterized in that, The method further includes: If the signature verification result indicates that the verification failed, a resource transfer transaction matching the transaction hash is obtained on the blockchain, and a preceding transfer transaction associated with the resource transfer transaction is obtained on the blockchain. Based on the state transition information carried by the resource transfer transaction and the state transition information carried by the preceding transfer transaction, a first transition trajectory of the digital resource indicated by the first resource transfer information is generated. The resource status is verified by analyzing the state transition information contained in the first transition trajectory to obtain the verification result of the digital resource indicated by the first resource transfer information.
5. The method according to claim 4, characterized in that, The first transition trajectory includes N state transition information, where N is an integer greater than 1; The step of verifying the resource status of the state transition information contained in the first transition trajectory to obtain the verification result of the digital resource indicated by the first resource transfer information includes: Obtain the i-th state input data of the resource status verification function; when i is 1, the i-th state input data includes the first state transition information among the N state transition information; when i is not 1, the i-th state input data includes the (i-1)-th state output data of the resource status verification function and the i-th state transition information among the N state transition information; i is a positive integer less than or equal to N; The resource status is verified by the resource status verification function to obtain the resource status output data corresponding to the resource status verification function. The Nth state output data corresponding to the resource status verification function is determined as the verification result of the digital resource indicated by the first resource transfer information.
6. The method according to claim 1, characterized in that, The method further includes: Obtain the second resource transfer information initiated by the status verification object, and determine the resource receiving object for receiving the transferred-out resource indicated by the second resource transfer information based on the second resource transfer information; the transferred-out resource indicated by the second resource transfer information belongs to the digital resource indicated by the first resource transfer information. If the trusted component set associated with the resource receiving object includes the trusted execution component, then the state transition information corresponding to the second resource transfer information and the resource state verification result are input to the trusted execution component, and the trusted execution component calls the resource state verification function to obtain the second state verification information. The second status verification information is stored in the blockchain; the second status verification information stored on the blockchain is used to determine the validity of the transferred resources received by the resource receiving object.
7. The method according to claim 6, characterized in that, The method further includes: If the set of trusted components associated with the resource transfer object does not contain the trusted execution component, then obtain the state transition trajectory corresponding to the digital resource indicated by the first resource transfer information; Add the state transition information corresponding to the second resource transfer information to the state transition trajectory to obtain the second transition trajectory; The second conversion trajectory is stored in the blockchain, and the second conversion trajectory stored on the blockchain is used to determine the validity of the transferred resources received by the resource receiving object.
8. A data processing method based on blockchain, characterized in that, The method includes: The system obtains a resource transfer request initiated by a status submission object, determines multiple status transition information associated with the resource transfer request, generates a status transition trajectory containing multiple status transition information, and obtains first status verification information corresponding to the status transition trajectory through a trusted execution component. The status transition trajectory is used to characterize the pre-transfer process of the digital resource indicated by the resource transfer request. The first status verification information includes the resource status verification result obtained by the trusted execution component in verifying the status transition trajectory. The first state verification information is processed on the blockchain to obtain the on-chain result corresponding to the first state verification information. If the on-chain result indicates that the on-chain was successful, then based on the transaction hash corresponding to the first state verification information and the resource transfer request, the first resource transfer information is generated and sent to the state verification object indicated by the resource transfer request. Wherein, the first resource transfer information is used to instruct the state verification object to perform validity verification on the digital signature carried by the first state verification information that matches the transaction hash on the blockchain according to the public key corresponding to the trusted execution component; when the signature verification result corresponding to the first state verification information indicates that the verification is successful, the resource state verification result in the first state verification information is used as the verification result of the digital resource indicated by the first resource transfer information.
9. The method according to claim 8, characterized in that, The step of determining multiple state transition information associated with the resource transfer request and generating a state transition trajectory containing multiple state transition information includes: The digital resource, status submission object, and status verification object indicated by the resource transfer request are combined into candidate conversion information corresponding to the resource transfer request; The candidate transition information is signed using the private key corresponding to the status submission object to obtain a digital signature corresponding to the candidate transition information. The candidate transition information and the digital signature corresponding to the candidate transition information are combined to form the status transition information corresponding to the resource transfer request. Obtain the preceding transfer transaction of the digital resource indicated by the resource transfer request, and combine the state transition information carried by the preceding transfer transaction and the state transition information corresponding to the resource transfer request into the state transition trajectory.
10. The method according to claim 8, characterized in that, The number of state transition information contained in the state transition trajectory is N, where N is an integer greater than 1; The step of obtaining the first state verification information corresponding to the state transition trajectory through the trusted execution component includes: The trusted execution component calls the resource status verification function to perform resource status verification on the state transition trajectory, and obtains the resource status verification result corresponding to the state transition trajectory. The resource status verification result and the transaction identifier of the resource transfer transaction corresponding to the (N-1)th state transition information in the state transition trajectory are combined into resource status combination data; The resource status combination data is signed using the private key corresponding to the trusted execution component to obtain a digital signature corresponding to the resource status combination data. The resource status combination data and the digital signature corresponding to the resource status combination data are combined to form the first status verification information.
11. The method according to claim 10, characterized in that, The step of signing the resource state combination data using the private key corresponding to the trusted execution component to obtain the digital signature corresponding to the resource state combination data includes: The trusted execution component is invoked to populate the resource status combination data to obtain resource status populated data. The resource status populated data is then split to obtain P segmented populated data; where P is an integer greater than 1. Obtain the j-th input data of the compression function; when j is 1, the j-th input data includes the initial compressed data and the first segmented fill data among the P segmented fill data; when j is not 1, the j-th input data includes the (j-1)-th output data of the compression function and the j-th segmented fill data among the P segmented fill data; j is a positive integer less than or equal to P; The j-th input data is compressed according to the compression function to obtain the j-th output data corresponding to the compression function, and the P-th output data corresponding to the compression function is determined as compressed information; The compressed information is encrypted using the private key corresponding to the trusted execution component to obtain a digital signature corresponding to the resource status combination data.
12. A data processing device based on blockchain, characterized in that, The device includes: The first verification information acquisition module is used to, if it receives first resource transfer information initiated by a state submission object, acquire the transaction hash carried by the first resource transfer information, and acquire first state verification information matching the transaction hash on the blockchain; the first state verification information includes resource state verification results obtained by a trusted execution component performing resource state verification on multiple state transition information contained in the state transition trajectory; the state transition trajectory is used to characterize the pre-transfer process of the digital resource indicated by the first resource transfer information. The digital signature verification module is used to verify the validity of the digital signature carried in the first state verification information based on the public key corresponding to the trusted execution component, and to obtain the signature verification result corresponding to the first state verification information. The resource verification result determination module is used to determine the resource status verification result in the first status verification information as the verification result of the digital resource indicated by the first resource transfer information if the signature verification result indicates that the verification is successful.
13. A data processing device based on blockchain, characterized in that, The device includes: The status verification information generation module is used to obtain a resource transfer request initiated by a status submission object, determine multiple status transition information associated with the resource transfer request, generate a status transition trajectory containing multiple status transition information, and obtain first status verification information corresponding to the status transition trajectory through a trusted execution component; the status transition trajectory is used to characterize the pre-transfer process of the digital resource indicated by the resource transfer request; the first status verification information includes the resource status verification result obtained by the trusted execution component in verifying the status transition trajectory. The information uplink processing module is used to process the first state verification information uplink to obtain the uplink result corresponding to the first state verification information. The transfer information sending module is used to generate first resource transfer information based on the transaction hash corresponding to the first status verification information and the resource transfer request if the on-chain result indicates that the on-chain is successful, and send the first resource transfer information to the status verification object indicated by the resource transfer request. Wherein, the first resource transfer information is used to instruct the state verification object to perform validity verification on the digital signature carried by the first state verification information that matches the transaction hash on the blockchain according to the public key corresponding to the trusted execution component; when the signature verification result corresponding to the first state verification information indicates that the verification is successful, the resource state verification result in the first state verification information is used as the verification result of the digital resource indicated by the first resource transfer information.
14. A computer device, characterized in that, Including memory and processor; The memory is connected to the processor, the memory is used to store a computer program, and the processor is used to invoke the computer program so that the computer device performs the method according to any one of claims 1 to 7, or performs the method according to any one of claims 8 to 11.
15. 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 to 7, or the method of any one of claims 8 to 11.
16. A computer program product, characterized in that, Includes computer instructions that, when executed by a processor, implement the method of any one of claims 1 to 7, or the method of any one of claims 8 to 11.