Contract processing method and related equipment based on blockchain
Through the combination of blockchain technology and TEE nodes, automatic signing, execution and payment of contracts is achieved, inefficiency and privacy security issues in contract management are solved, and the transparency and security of contract processing are improved.
Patent Information
- Application Number
- CN202111567106.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-20
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2041-12-20
AI Technical Summary
The existing contract management model has problems such as inefficiency, difficulty in progress control, unequal information and privacy and security threats, especially in multi-party coordination and long-term projects.
The blockchain-based contract processing method is adopted, and the combination of TEE nodes and non-TEE nodes is used to realize automatic signing, automatic execution and automatic payment of contracts through secure ledgers and smart contracts to ensure the security and transparency of sensitive data.
It improves the security and transparency of contract processing, realizes precise control and tracking of contracts, reduces the coordination costs between participants, enhances the authenticity and accuracy of information, and ensures the privacy protection of sensitive data.
Smart Images

Figure CN114239066B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of blockchain technology, and in particular, to a blockchain-based contract processing method, a blockchain system, a computer device, and a computer-readable storage medium. Background Art
[0002] In today's business world, the signing of standardized paper or electronic contracts is the legal basis. The contract process is generally divided into several stages, such as signing a contract, paying the down payment, progress acceptance, and paying the final payment. Each stage requires a lot of manual process and acceptance work, which is inefficient and the process is not transparent enough. For projects with longer cycles, contracts are often divided into several stages for acceptance, and it is difficult to accurately control and track the progress with traditional methods. Some contracts involve multiple parties, and the coordination costs between the parties are high. In addition, there is a problem of information asymmetry, which raises questions about the authenticity and accuracy of the information.
[0003] Traditional electronic contract management models often rely on centralized servers, and their security mainly relies on the trust endorsement of the third party. Centralized data storage has the risk of centralization. If the third party is dishonest or suffers external attacks, data leakage will pose a great threat to the privacy and security of the participants. Summary of the invention
[0004] The embodiments of the present disclosure provide a blockchain-based contract processing method, a blockchain-based contract processing method, a blockchain system, a computer device, and a computer-readable storage medium, which can improve the security of contract processing.
[0005] The present disclosure provides a blockchain-based contract processing method, which is applied to a blockchain system. The blockchain system includes nodes, and the nodes include a trusted execution environment TEE node and a non-TEE node. The method includes: the TEE node receives a first contract deployment transaction initiated by a contract deployer, and the first contract deployment transaction includes contract information; after the first contract deployment transaction consensus is passed, the TEE node stores the contract information on a security account book of the TEE node; the TEE node desensitizes the contract information to obtain desensitized data; the TEE node initiates a second contract deployment transaction to the non-TEE node, and the second contract deployment transaction includes the desensitized data; after the second contract deployment transaction consensus is passed, the non-TEE node stores the desensitized data in the blockchain of the non-TEE node.
[0006] An embodiment of the present disclosure provides a blockchain system, the blockchain system includes nodes, the nodes include a trusted execution environment TEE node and a non-TEE node, wherein: the TEE node is used to receive a first contract deployment transaction initiated by a contract deployer, the first contract deployment transaction includes contract information; the TEE node is used to store the contract information on a security account book of the TEE node after the first contract deployment transaction consensus is passed; the TEE node is used to desensitize the contract information to obtain desensitized data; the TEE node is used to initiate a second contract deployment transaction to the non-TEE node, the second contract deployment transaction includes the desensitized data; the non-TEE node is used to store the desensitized data in the blockchain of the non-TEE node after the second contract deployment transaction consensus is passed.
[0007] An embodiment of the present disclosure provides a computer device, including a processor, a memory, and an input / output interface; the processor is connected to the memory and the input / output interface, respectively, wherein the input / output interface is used to receive data and output data, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device including the processor executes the blockchain-based contract processing method in the embodiment of the present disclosure.
[0008] On the one hand, an embodiment of the present disclosure provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the blockchain-based contract processing method in the embodiment of the present disclosure.
[0009] In one aspect, the embodiments of the present disclosure provide a computer program product or a computer program, which includes 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 the processor executes the computer instructions, so that the computer device executes the method provided in various optional ways in the embodiments of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 It is a flowchart of a blockchain-based contract processing method provided by an embodiment of the present disclosure.
[0011] Figure 2 The overall view of a blockchain-based contract processing method according to an embodiment of the present disclosure is schematically shown.
[0012] Figure 3 A schematic diagram of a TEE ledger structure according to an embodiment of the present disclosure is shown schematically.
[0013] Figure 4A sensitive data transaction flow chart based on a TEE node according to an embodiment of the present disclosure is schematically shown.
[0014] Figure 5 The flowchart of signing a contract according to an embodiment of the present disclosure is schematically shown.
[0015] Figure 6 The flowchart of contract automation execution according to an embodiment of the present disclosure is schematically shown.
[0016] Figure 7 A schematic diagram of a blockchain platform docking with a DCEP network according to an embodiment of the present disclosure is schematically shown.
[0017] Figure 8 A schematic diagram of contract automation payment according to an embodiment of the present disclosure is schematically shown.
[0018] Fig. 9 It is a structural diagram of a computer device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more comprehensive and complete and will fully convey the concept of the example embodiments to those skilled in the art.
[0020] In the description of the present disclosure, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different.
[0021] like Figure 1As shown, the blockchain-based contract processing method provided by the embodiment of the present disclosure can be applied to a blockchain system (also referred to as a blockchain network or a blockchain platform). The blockchain system may include multiple nodes (also referred to as blockchain nodes). In the embodiment of the present disclosure, two types of blockchain nodes are included. One is a common blockchain node, which is referred to as a non-TEE (Trusted Execution Environment) node in this application, that is, a node without a TEE; the other is a node equipped with a TEE, which is referred to as a TEE node, or a TEE-based blockchain security node or a TEE security node. There can be multiple TEE-based blockchain security nodes and multiple non-TEE nodes in the entire blockchain network.
[0022] The method provided by the embodiment of the present disclosure may include the following steps.
[0023] In step S110 , the TEE node receives a first contract deployment transaction initiated by a contract deployer, where the first contract deployment transaction may include contract information.
[0024] In an exemplary embodiment, the contract information may include at least one of a transaction hash, a contract hash, a contract content, a contract identification (ID), participant information, an upload time, version information, and progress information of the first contract deployment transaction.
[0025] In the embodiments of the present disclosure, the contract deployer may be any party related to the contract, such as the payer, regulator, payee, and other contract participants related to the contract, or the developer and acceptance party of the project related to the contract, etc., and the present disclosure does not limit this. The first contract deployment transaction refers to a request initiated by the contract deployer to any TEE node in the blockchain network to deploy a contract to the blockchain network.
[0026] In the disclosed embodiment, contract information refers to any information related to the contract, such as a contract hash, which is a hash value obtained by processing the contract using any suitable hash algorithm; a transaction hash can be used as the ID of the first contract deployment transaction; contract content refers to the specific information in the contract; a contract ID is a unique number for the contract; party information refers to relevant information of any party related to the contract, for example, if the party is an individual, the party information may include any one or more of the individual's ID number, mobile phone number, address, etc.; if the party is an enterprise or unit, the party information may include any one or more of the business license, legal representative, mailing address, contact person, contact information, etc. of the enterprise or unit, and the party information may be set according to the actual situation of each contract; upload time refers to the time when the contract is uploaded to the blockchain network; version information refers to version-related information of the contract; progress information is used to record information related to the progress of the contract or a project related to the contract.
[0027] The contract information in the embodiments of the present disclosure includes sensitive data, for example, the sensitive data may include any one or more of the contract content, information of the parties involved, etc. Sensitive data refers to data that requires a higher security level than other non-sensitive data in the contract information. If the sensitive data is leaked, it may cause greater information security or cause greater losses to the contract parties.
[0028] In step S120, after the first contract deployment transaction consensus is passed, the TEE node stores the contract information on the security account of the TEE node.
[0029] In the embodiment of the present disclosure, when the contract deployer initiates the first contract deployment transaction to the blockchain network, it will use the private key of the contract deployer to sign it. After any TEE node in the blockchain network receives the first contract deployment transaction, it uses the public key of the contract deployer to verify the signature of the first contract deployment transaction. If the verification fails, the operation is terminated and a prompt message indicating that the contract deployment failed is returned to the contract deployer; if the verification passes, the TEE node can broadcast the first contract deployment transaction to other TEE nodes in the blockchain network. After receiving the first contract deployment transaction, the other TEE nodes use a pre-set consensus algorithm (the present disclosure does not limit the specific consensus algorithm) to reach a consensus on the first contract deployment transaction. If the consensus passes, for example, when the number of confirmation messages received by the accounting node in the TEE node for the first contract deployment transaction exceeds a preset number, it is determined that the consensus of the first contract deployment transaction passes, and the accounting node can package the first contract deployment transaction into a certain account book page (assuming it is called the current account book page) and store it in the security account book in the TEE node. In the embodiment of the present disclosure, in order to ensure the security and reliability of the contract information, all TEE nodes may be required to send a confirmation message to the first contract deployment transaction before the consensus of the first contract deployment transaction is determined to have passed, but the present disclosure is not limited to this.
[0030] In an exemplary embodiment, storing the contract information on the security ledger of the TEE node may include: calculating the hash value of the contract information; obtaining the Merkle root based on the hash value of the contract information; storing the contract information, the hash value of the contract information, the Merkle root, submission time, timestamp, block height, block version number, and the previous ledger page hash and block hash in the current ledger page of the security ledger. The disclosed embodiment proposes a blockchain ledger for securely storing contract information, referred to as a security ledger. The TEE built on the TEE node can ensure the security of the contract information stored in the security ledger. The security ledger is shared between the various TEE nodes in the blockchain network, that is, the same security ledger is stored in each TEE node. In the disclosed embodiment, a storage structure for the security ledger of a TEE node is constructed. For details, please refer to the following Figure 3 shown.
[0031] In an exemplary embodiment, a smart contract for automatic contract signing may be deployed on the TEE node. The contract information may include information about the participating parties.
[0032] In the disclosed embodiment, the automatic contract signing smart contract refers to a code that can realize the automatic online signing of the contract. The contract participants can first formulate the rules for automatic contract signing according to the actual needs of each contract, and then convert them into code to generate the automatic contract signing smart contract. In the disclosed embodiment, the method may also include: the TEE node receives a first contract deployment transaction, and the first contract deployment transaction includes the automatic contract signing smart contract; after the first contract deployment transaction consensus is passed, the TEE node deploys it in each TEE node.
[0033] Specifically, the first contract deployment transaction can be proposed by any party that reaches a consensus on the automatic signing of the smart contract for the contract, such as the regulator, the payee, the payee, other contract participants, the developer, the acceptance party, etc. of the contract. After any TEE node in the blockchain network receives the first contract deployment transaction, it verifies the signature of the first contract deployment transaction. If the verification fails, the operation is terminated; if the verification passes, the TEE node can broadcast the first contract deployment transaction to other TEE nodes in the blockchain network. After receiving the first contract deployment transaction, the other TEE nodes use a pre-set consensus algorithm (the present disclosure does not limit the specific consensus algorithm used) to reach a consensus on the first contract deployment transaction. If the consensus passes, for example, when the number of confirmation messages received by the accounting node in the TEE node for the first contract deployment transaction exceeds a preset number, it is determined that the consensus of the first contract deployment transaction passes, and the accounting node can package the first contract deployment transaction into a certain account book page (assuming it is called the current account book page) and store it in the security account book in the TEE node, so as to realize the automatic signing of the smart contract and deploy it to the TEE node in the blockchain network. In the embodiment of the present disclosure, in order to ensure the security and reliability of the automatic signing of the smart contract, all TEE nodes may be required to send a confirmation message to the first contract deployment transaction before the consensus of the first contract deployment transaction is determined to have passed, but the present disclosure is not limited to this.
[0034] In an exemplary embodiment, after the first contract deployment transaction consensus is passed, the TEE node stores the contract information on the security ledger of the TEE node, which may include: after the first contract deployment transaction consensus is passed, the TEE node calls the contract to automatically sign the smart contract; sends a contract signing request to the contract participant according to the participant information through the contract automatic signing smart contract, the contract signing request includes the contract information, and the contract participant is used to generate a confirmation transaction when agreeing to the contract information; receives the confirmation transaction of the contract participant through the contract automatic signing smart contract, and sets the contract to an effective state according to the confirmation transaction, and stores the contract information on the security ledger of the TEE node. The disclosed embodiment can ensure the security of sensitive data by storing contract information containing sensitive data in the security ledger on the TEE node; at the same time, it can also realize automatic signing of contracts through the contract automatic signing smart contract deployed on the TEE node, thereby improving the efficiency and security of contract signing.
[0035] In step S130, the TEE node desensitizes the contract information to obtain desensitized data.
[0036] In the embodiments of the present disclosure, the TEE node can desensitize the sensitive data in the contract information to generate desensitized data, where the desensitized data refers to the contract information that does not contain sensitive data. The present disclosure does not limit the specific desensitization algorithm used.
[0037] In step S140, the TEE node initiates a second contract deployment transaction to the non-TEE node, where the second contract deployment transaction includes the desensitized data.
[0038] In an exemplary embodiment, the TEE node initiating a second contract deployment transaction to the non-TEE node may include: the TEE node performing a summary calculation on the sensitive data in the contract information to obtain a first summary; using the private key of the TEE node to digitally sign the first summary to obtain a first signature; the TEE node initiating the second contract deployment transaction to the non-TEE node, and the second contract deployment transaction may also include the first signature.
[0039] In step S150, after the second contract deployment transaction consensus is passed, the non-TEE node stores the desensitized data in the blockchain of the non-TEE node.
[0040] In an exemplary embodiment, after the consensus on the second contract deployment transaction is passed, the non-TEE node stores the masked data in the blockchain of the non-TEE node, which may include: the non-TEE node verifies the first signature using the public key of the TEE node; if the first signature verification is passed, the non-TEE node reaches a consensus on the second contract deployment transaction; after the consensus on the second contract deployment transaction is passed, the masked data is stored in the blockchain of the non-TEE node.
[0041] In the disclosed embodiment, after the TEE node desensitizes the sensitive data in the contract information, the desensitized data is stored on the chain in a non-TEE node in the blockchain network, which can ensure the security of the sensitive data in the contract information.
[0042] In an exemplary embodiment, a contract automatic execution smart contract may be deployed on the blockchain system, and the contract automatic execution smart contract may include a progress recording module.
[0043] In the disclosed embodiment, the automatic contract execution smart contract refers to a code that can trigger the automatic execution of the contract. The contract participants can first formulate the rules for automatic contract execution according to the actual needs of each contract, and then convert them into code to generate the automatic contract execution smart contract. In the disclosed embodiment, the method may also include: the node (which may include TEE nodes and / or non-TEE nodes) receives a second contract deployment transaction, and the second contract deployment transaction includes the automatic contract execution smart contract; after the second contract deployment transaction consensus is passed, the node deploys it in the blockchain network.
[0044] Specifically, the second contract deployment transaction can be proposed by any party that reaches a consensus on the automatic execution of the smart contract, such as the regulator, payee, payee, other contract participants, developer, acceptance party, etc. of the contract. After any node in the blockchain network receives the second contract deployment transaction, it verifies the signature of the second contract deployment transaction. If the verification fails, the operation is terminated; if the verification passes, the node can broadcast the second contract deployment transaction to other nodes in the blockchain network. After receiving the second contract deployment transaction, the other nodes use a pre-set consensus algorithm (the present disclosure does not limit the specific consensus algorithm) to reach a consensus on the second contract deployment transaction. If the consensus passes, for example, when the number of confirmation messages received by the accounting node in the node for the second contract deployment transaction exceeds a preset number, it is determined that the second contract deployment transaction consensus passes, and the accounting node can package the second contract deployment transaction into a block (assuming it is called the current block) and store it in the blockchain ledger in the node, so as to realize the deployment of the contract automatic execution smart contract to the blockchain network. In the embodiment of the present disclosure, in order to ensure the security and reliability of the automatic execution of the smart contract by the contract, all nodes may be required to send a confirmation message to the second contract deployment transaction before the consensus of the second contract deployment transaction is determined to have passed, but the present disclosure is not limited to this.
[0045] In an exemplary embodiment, the method may further include: the node receives a progress record transaction sent by a project participant, the progress record transaction including project progress information; the node stores the project progress information in the progress record module after the progress record transaction consensus is passed; the contract automatic execution smart contract automatically triggers a project acceptance operation when it detects that the progress record module has been updated; the contract automatic execution smart contract receives an acceptance result upload transaction sent by the project acceptance party, the acceptance result upload transaction including the project acceptance result; after the acceptance result upload transaction consensus is passed, the contract automatic execution smart contract automatically triggers the agreed payment operation if it is detected that the project acceptance result is accepted.
[0046] In an exemplary embodiment, the project acceptance operation may include an automatic acceptance operation; the contract automatic execution smart contract may also include an automatic acceptance rule code.
[0047] In an exemplary embodiment, the project acceptance operation may include a manual acceptance operation.
[0048] In an exemplary embodiment, the contract automatic execution smart contract automatically triggers the project acceptance operation, which may include: the contract automatic execution smart contract receives a project progress query transaction sent by the project acceptance party, and the project progress query transaction includes the project acceptance party information; the contract automatic execution smart contract responds to the project progress query transaction and sends the project progress information to the project acceptance party, and the project acceptance party checks the project progress according to the project progress information, obtains the project acceptance result, signs the project acceptance result, and generates an acceptance result upload transaction. The method provided by the embodiment of the present disclosure can also realize automatic triggering of the acceptance process and automatic execution of payment operations through the deployed contract automatic execution smart contract.
[0049] The method provided by the disclosed embodiment, on the one hand, utilizes blockchain technology to convert contracts into blockchain electronic contracts. Blockchain electronic contracts can store and operate electronic contracts based on blockchain smart contracts (such as the above-mentioned contract automatic signing smart contracts and contract automatic execution smart contracts) to achieve decentralized electronic contract management. Utilizing the characteristic of blockchain smart contracts of "code is law institutionalized coding", the automated execution and payment of contracts can be well realized. On the other hand, since the trusted execution environment TEE can ensure that the calculation is not interfered by the conventional operating system, the disclosed embodiment also combines TEE with blockchain technology to ensure that the sensitive data in the contract will not be leaked due to the openness and transparency of the blockchain, that is, the blockchain smart contract combined with the trusted hardware execution environment TEE can ensure the privacy and security of sensitive data in the contract.
[0050] Combine the following Figures 2 to 8 The method provided in the embodiment of the present disclosure is illustrated by way of example, but the present disclosure is not limited thereto.
[0051] The method provided by the disclosed embodiment is a contract automation trusted execution and payment solution based on blockchain and TEE. It designs a blockchain security node based on TEE, and designs its security ledger and contract transaction structure. At the same time, the disclosed embodiment also designs the transaction process of sensitive data in the contract. The TEE node is used to process and store sensitive data such as contract content, which ensures the security of sensitive data and improves the reliability and credibility of the blockchain system.
[0052] On the other hand, through blockchain smart contracts, we can realize automated contract signing, automated acceptance, and automated payment, solve efficiency problems, and achieve precise control of each stage of the project. And through the control of blockchain smart contracts, the whole process is transparent and reliable, and the whole process of the contract can be tracked and queried, solving the trust problem of multiple parties. The blockchain system can be connected to DCEP (Digital Currency Electronic Payment, digital currency and electronic payment tools) to realize automated payment, fund tracking, and solve the problem of fund transparency.
[0053] Figure 2 This is an overall view of the solution provided by the embodiment of the present disclosure. Based on the blockchain electronic contract solution, the embodiment of the present disclosure combines TEE technology to design a blockchain TEE security node (i.e., TEE node, or Figure 2 TEE-based blockchain security node in the , which improves security.
[0054] like Figure 2 As shown in the figure, the system can include multiple participants, such as developers, payers, payees, regulators, and other contract participants, and all parties are closely organized together through the blockchain platform. Contract participants, regulators, etc. jointly participate in forming a consortium chain.
[0055] The underlying capabilities of blockchain include smart contracts, payment modules, contract execution and identity authentication.
[0056] Smart contracts (such as contract automatic deployment smart contracts and contract automatic execution smart contracts) are deployed by the contracting parties to the blockchain platform and are the main body of the system implementation. Core operations such as contract signing, progress control, automatic payment, and viewing payment records are all implemented by smart contracts. The contracting party here can be any one of the developer, payer, regulator, and other contract participants, and after reaching a consensus on the contract, any party can deploy it to the blockchain network.
[0057] The payment module is responsible for discovering digital assets or connecting to DECP on the blockchain platform to perform payment operations. For example, the payment module and contract execution can call the contract to automatically execute the smart contract to perform payment operations.
[0058] Sensitive data such as contract content is processed and stored by TEE security nodes (i.e. TEE nodes), and the desensitized data is then saved on the blockchain ledger.
[0059] The disclosed embodiment realizes ledger separation, that is, the security ledger is shared between TEE nodes, and the security ledger is shared between multiple TEE nodes in the blockchain platform, that is, each TEE node has the same security ledger data. Other non-TEE nodes share the blockchain ledger, and the disclosed embodiment also designs the TEE node ledger structure. Based on the design of the disclosed embodiment, the TEE node and other non-TEE nodes realize ledger isolation: the TEE node maintains a TEE security ledger, while other nodes maintain the blockchain ledger.
[0060] The design of TEE node ledger structure and contract transaction structure is as follows Figure 3 As shown. The security ledger is Figure 3 The ledger is stored in a secure ledger, that is, a ledger page is connected to a ledger page in sequence, and each ledger page saves the hash of the previous ledger page. Each request to the TEE node generates a transaction. For example, each request to write any one or more of the contract hash, contract content, contract ID, party information, version information, and progress information will generate a new transaction. Assume that these transactions include the first contract deployment transaction. The accounting node in the TEE node can package multiple transactions into the same current ledger page each time it packages. For example Figure 3 TX 0, TX 1, TX 2, and TX 3 are four transactions initiated to the TEE node. The storage structure of each transaction is as follows: Figure 3 The contract transaction body structure shown on the right is shown. TX 0 is calculated using the hash algorithm to obtain Hash 0, TX 1 is calculated using the hash algorithm to obtain Hash 1, TX 2 is calculated using the hash algorithm to obtain Hash 2, TX 3 is calculated using the hash algorithm to obtain Hash 3, Hash 0 and Hash 1 are calculated using the hash algorithm to obtain Hash 01, Hash 2 and Hash 3 are calculated using the hash algorithm to obtain Hash 23, Hash 01 and Hash 23 are calculated using the hash algorithm to obtain the Merkle root, and Commit Time, TimeStamp, Block Number, Block Version, Pre-block Hash, and Block Hash are also stored.
[0061] In the method provided in the embodiment of the present disclosure, the method for processing sensitive data in the contract information is as follows: Figure 4 shown.
[0062] In step 1, the transaction initiator sends the transaction containing sensitive data such as contract content to the TEE node in the blockchain network through its user terminal.
[0063] The transaction initiator here may be, for example, the contract deployer that initiates the first contract deployment transaction.
[0064] In step 2, after receiving the transaction in step 1, the TEE node verifies the transaction and processes the transaction according to the designed Figure 3 The ledger structure shown in the figure stores data securely.
[0065] In step 3, the TEE node desensitizes the sensitive data to obtain desensitized data, performs summary calculation on the sensitive data to obtain a first summary, and digitally signs the first summary with the private key of the TEE node to obtain a first signature. Here, the sensitive data is processed to obtain a first summary, and the first summary is digitally signed with the first signature, so that after the subsequent non-TEE node verifies the first signature, the sensitive data will not be restored, thereby ensuring the security of the sensitive data.
[0066] In step 4, the TEE node sends the first signature and non-sensitive information (i.e., desensitized data) to the non-TEE node in the blockchain network for on-chain storage.
[0067] In step 5, after the non-TEE node receives the transaction including the first signature and the masked data, it verifies the first signature, that is, the non-TEE node decrypts the first signature using the public key of the TEE node. If the decryption is successful, it is determined that the first signature verification is successful. At this time, the non-TEE node can process the transaction and store the masked data on the chain.
[0068] In step 6, after the non-TEE node successfully stores the desensitized data on the chain, it can send transaction feedback to the TEE node.
[0069] In step 7, after the TEE node receives the transaction feedback sent by the non-TEE node, it can send a prompt message indicating that the transaction is completed to the user end.
[0070] As mentioned above, sensitive data is processed and stored by TEE nodes, and the anonymized data is stored on the blockchain to ensure data security.
[0071] The specific process of signing a contract provided by the embodiment of the present disclosure is as follows: Figure 5 shown.
[0072] First, any party to the contract can upload the electronic contract to the TEE node in the blockchain network, that is, initiate the first contract deployment transaction to the TEE node. The electronic contract can be associated with the contract automatic signing smart contract deployed on the TEE node in the blockchain network, and the contract automatic signing smart contract is responsible for controlling and archiving the contract.
[0073] If each contract participant (such as Party A, Party B, etc.) agrees with the content of the contract, a confirmation transaction is sent to the contract to automatically sign the smart contract. The transaction content is to sign the contract data with a certain encryption algorithm to indicate the signing of the contract.
[0074] The smart contract automatically signs the contract and collects the signatures of all parties involved in the contract and verifies them. When all parties who need to sign the contract have signed, the contract is set to the effective state and archived, that is, stored as Figure 3 The structure shown.
[0075] In the disclosed embodiment, each contract participant can request the contract content from the TEE node's contract automatic signing smart contract. After the authority verification is passed, the TEE node returns the contract content to the contract participant who issued the request, and the contract participant returns to confirm the transaction. Alternatively, the TEE node's contract automatic signing smart contract actively pushes the contract content to the contract participant based on the participant information stored in the security account book to obtain confirmation of the transaction.
[0076] The effective contract will be archived in the storage system of the TEE node of the blockchain network. The contract content cannot be tampered with, and the anonymized data will be synchronously stored in the non-TEE node of the blockchain network.
[0077] Authorized parties can view the contract content and verify the validity of the contract at any time. That is, the party can initiate a query transaction to the TEE node, and the TEE node will perform permission verification on the received query transaction. If it is verified that the party has the permission to view, the contract content will be sent to the corresponding party. When the party receives the contract content returned by the TEE node, it can use the public key of the TEE node to verify the validity of the contract.
[0078] Figure 5 An example of a contract signing process is shown below:
[0079] Step 1. The participants upload the electronic contract (including sensitive data) to the TEE node of the blockchain network;
[0080] Step 2. The TEE node processes the transaction data and stores it; and sends the desensitized data to the non-TEE node in the blockchain network;
[0081] Step 3. The parties involved in the contract have the authority to query the contract content from the TEE node; the unauthorized party cannot see the specific content of the contract.
[0082] Step 4. If the parties agree to the contract, a confirmation transaction is sent to the contract automatic signing smart contract corresponding to the contract. The transaction content is to sign the contract data with a certain encryption algorithm to indicate the signing of the contract;
[0083] Step 5. Automatically sign the contract. The smart contract collects the signatures of all parties involved in the contract and verifies them. When all parties who need to sign the contract have signed, the contract is set to the effective state and the evidence is stored;
[0084] Step 6. After the contract certificate takes effect, the contract progress and other information can be updated by calling the relevant smart contract;
[0085] Step 7. The parties involved in the contract have the authority to query the contract and its execution status on the blockchain platform.
[0086] The specific process of contract automation execution provided by the embodiment of the present disclosure is as follows: Figure 6 shown.
[0087] In the disclosed embodiment, the contract participants, i.e., the smart contract signatories, confirm the contract on behalf of all parties, similar to the signing of a contract by all parties in the real world. The parties jointly formulate the rules for automatic signing and automatic execution of the contract and upload them to the blockchain platform, thereby completing the deployment of the smart contract for automatic signing and the smart contract for automatic execution of the contract.
[0088] The smart contract drives the automated execution of the contract, such as paying a 30% down payment, a 70% balance, etc.
[0089] A participant (such as the construction party, the developer) can upload the project progress and the proof of achievement (as the project progress information) to the blockchain and record it in the progress recording module of the contract automatic execution smart contract (i.e. Figure 6 Contract progress record management in ).
[0090] After the progress record module of the contract automatic execution smart contract updates the progress, the contract automatic execution smart contract automatically triggers the progress acceptance every time it detects that the progress has been updated. The progress acceptance can be divided into automatic acceptance and manual acceptance:
[0091] (1) Automatic acceptance: Automatic acceptance is to embed the acceptance rules into the contract automatic execution smart contract and execute it in the form of code. For software projects, such as test code, test cases, etc.
[0092] (2) Manual acceptance: Manual acceptance requires the project acceptance party to view or download the progress certificate (i.e. the above-mentioned project progress information) from the contract automatic execution smart contract and manually check it. After the check is passed, the project acceptance result is signed and uploaded. After receiving the project acceptance result uploaded by the project acceptance party, the contract automatic execution smart contract automatically triggers the payment operation, such as paying the final payment.
[0093] Project participants can check the project progress at any time to ensure the process is transparent.
[0094] The specific process of digital assets & DCEP provided by the embodiment of this disclosure is as follows Figure 7 shown.
[0095] The blockchain platform can be connected to DCEP and use digital currency for payment activities. DCEP is a legal digital currency with high reliability and stability. Compared with other cryptocurrencies, using DCEP for payment is safer and more acceptable to the public.
[0096] like Figure 7 As shown in the figure, the blockchain platform is connected to the DCEP network. User A pays a project fee to B through the blockchain platform. B can view the payment result through other DCEP clients without going through the blockchain platform.
[0097] Users can also issue specific digital currencies based on the blockchain platform for payment, such as points, membership coins, coupons, etc. The blockchain platform provides corresponding issuance and payment interfaces.
[0098] The method provided by the disclosed embodiment, on the one hand, uses blockchain to store electronic contracts, and on the other hand, also considers the protection of the contract content, and combines TEE technology to solve the security and privacy protection issues of sensitive data in the blockchain electronic contract solution. The TEE node is used to process and store sensitive data such as contract content, ensuring the security of sensitive data. In addition, the method provided by the disclosed embodiment is also combined with smart contracts to achieve automated control of contract progress, further promoting cost reduction and efficiency improvement. That is, blockchain is used to achieve automated execution and payment of contracts, and smart contracts are used to solve the problem of inefficiency in contract execution, reduce the coordination costs between the various parties in the contract, and achieve process transparency; electronic contracts are automatically executed using smart contracts, and automatic progress management is achieved; automatic payment can also be achieved by docking with DECP.
[0099] The specific execution process of the automated payment provided by the embodiment of the present disclosure is as follows: Figure 8 As shown, the following steps may be included:
[0100] Step 1. All parties jointly formulate contract rules, such as the above-mentioned rules for automatic execution of contracts, which may include the logic of automatic triggering of acceptance and automatic payment, and upload them to the blockchain platform, that is, deploy the contract automatic execution smart contract to the blockchain network.
[0101] Step 2. A participant (such as the construction party, the developer) uploads the project progress information such as project progress and proof of results to the blockchain, and records it in the progress recording module of the contract automatic execution smart contract.
[0102] Step 3. After the progress record module updates the progress, it triggers acceptance. The project acceptance party enters the payment process after acceptance.
[0103] Step 4. When the payment module detects that a certain condition (the condition can be set according to the actual situation, such as the project acceptance result is passed), the payment behavior is triggered according to the pre-set settlement rules.
[0104] Step 5. Funds are paid to the account specified in the settlement rules and the payment is recorded.
[0105] Step 6. Participants can view payment records and contract progress on the blockchain platform at any time.
[0106] On the one hand, the disclosed embodiment introduces TEE security nodes in the blockchain electronic contract solution, and designs its TEE ledger structure and transaction body structure; TEE nodes provide high-level security protection for users' privacy data, and design sensitive data transaction processes based on TEE nodes. The disclosed embodiment fully combines TEE and blockchain technology to provide a set of special blockchain service solutions with dual security protection of software + hardware. On the other hand, the disclosed embodiment also designs the process of automated contract signing, automated execution and automated payment based on TEE and smart contracts.
[0107] Fig. 9 It is a structural diagram of a computer device provided by an embodiment of the present disclosure.
[0108] See also Fig. 9 , Fig. 9 Schematic diagram of a computer device provided by an embodiment of the present disclosure. Fig. 9As shown, the computer device in the embodiment of the present disclosure may include: one or more processors 901, a memory 902, and an input-output interface 903. The processor 901, the memory 902, and the input-output interface 903 are connected via a bus 904. The memory 902 is used to store a computer program, which includes program instructions. The input-output interface 903 is used to receive data and output data, such as for data interaction between a host machine and a computer device, or for data interaction between various virtual machines in a host machine; the processor 901 is used to execute the program instructions stored in the memory 902.
[0109] Among them, the processor 901 can execute the operations performed by the TEE node and / or non-TEE node and / or user terminal in the above embodiments.
[0110] In some feasible implementations, the processor 901 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0111] The memory 902 may include a read-only memory and a random access memory, and provide instructions and data to the processor 901 and the input / output interface 903. A portion of the memory 902 may also include a non-volatile random access memory. For example, the memory 902 may also store information about the device type.
[0112] In a specific implementation, the computer device can execute the implementation methods provided in the various steps of the above embodiments through its built-in functional modules, which will not be repeated here.
[0113] The embodiment of the present disclosure provides a computer device, including: a processor, an input and output interface, and a memory. The processor obtains a computer program in the memory, executes each step of the method shown in the above embodiment, and performs data processing operations.
[0114] The embodiments of the present disclosure also provide a computer-readable storage medium, which stores a computer program, and the computer program is suitable for being loaded by the processor and executing the blockchain-based contract processing method provided in each step of the above embodiment. For details, please refer to the implementation methods provided in each step of the above embodiment, which will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in the present disclosure, please refer to the description of the method embodiment of the present disclosure. As an example, the computer program can be deployed to be executed on one computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed in multiple locations and interconnected by a communication network.
[0115] The computer-readable storage medium may be the network traffic prediction device provided by any of the aforementioned embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (smart media card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. equipped on the computer device. Further, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0116] The present disclosure also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional modes in the above embodiments.
[0117] The terms "first", "second", etc. in the specification, claims, and drawings of the embodiments of the present disclosure are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product, or equipment that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules that are not listed, or may optionally include other step units inherent to these processes, methods, devices, products, or equipment.
[0118] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in this description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.
[0119] The method and related apparatus provided by the embodiments of the present disclosure are described with reference to the method flow chart and / or structural diagram provided by the embodiments of the present disclosure. Specifically, each process and / or block in the method flow chart and / or structural diagram, as well as the combination of the processes and / or blocks in the flow chart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the process. Figure 1 Schematic diagram of one or more processes and / or structures Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 Schematic diagram of one or more processes and / or structures Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A flow or multiple flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.
[0120] The above disclosure is only a preferred embodiment of the present disclosure, which certainly cannot be used to limit the scope of rights of the present disclosure. Therefore, equivalent changes made according to the claims of the present disclosure are still within the scope of the present disclosure.
Claims
1. A contract processing method based on blockchain, characterized in that: Applied to a blockchain system, the blockchain system includes nodes, the nodes include trusted execution environment TEE nodes and non-TEE nodes, and the method includes: The TEE node receives a first contract deployment transaction initiated by a contract deployer, where the first contract deployment transaction includes contract information; After the first contract deployment transaction consensus is passed, the TEE node stores the contract information on the security account of the TEE node; The TEE node performs desensitization processing on the contract information to obtain desensitized data; The TEE node initiates a second contract deployment transaction to the non-TEE node, and the second contract deployment transaction includes the desensitized data, which includes: the TEE node performs a summary calculation on the sensitive data in the contract information to obtain a first summary; uses the private key of the TEE node to digitally sign the first summary to obtain a first signature; the TEE node initiates the second contract deployment transaction to the non-TEE node, and the second contract deployment transaction also includes the first signature; After the consensus on the second contract deployment transaction is passed, the non-TEE node stores the desensitized data in the blockchain of the non-TEE node, which includes: the non-TEE node verifies the first signature using the public key of the TEE node; if the first signature verification is passed, the non-TEE node reaches a consensus on the second contract deployment transaction; after the consensus on the second contract deployment transaction is passed, the desensitized data is stored in the blockchain of the non-TEE node.
2. The method according to claim 1, characterized in that Storing the contract information on the secure ledger of the TEE node includes: Calculating a hash value of the contract information; Obtaining a Merkle root based on the hash value of the contract information; The contract information, the hash value of the contract information, the Merkle root, the commit time, the timestamp, the block height, the block version number, and the previous ledger page hash and block hash are stored in the current ledger page of the secure ledger.
3. The method according to claim 2, characterized in that The contract information includes at least one of a transaction hash, a contract hash, a contract content, a contract identifier, participant information, an upload time, version information, and progress information of the first contract deployment transaction.
4. The method according to claim 1, characterized in that: A smart contract for automatic contract signing is deployed on the TEE node; the contract information includes information of the participating parties; Wherein, after the first contract deployment transaction consensus is passed, the TEE node stores the contract information on the security account book of the TEE node, including: After the first contract deployment transaction consensus is passed, the TEE node calls the contract to automatically sign the smart contract; The contract automatically signs the smart contract, sending a contract signing request to the contract participants according to the participant information, wherein the contract signing request includes the contract information, and the contract participants generate a confirmation transaction when they agree with the contract information; The smart contract is automatically signed by the contract to receive the confirmation transaction of the contract participants, and the contract is set to an effective state according to the confirmation transaction, and the contract information is stored in the security account book of the TEE node.
5. The method according to claim 1, characterized in that A smart contract for automatic contract execution is deployed on the blockchain system, and the smart contract for automatic contract execution includes a progress recording module; Wherein, the method further comprises: The node receives a progress record transaction sent by a project participant, wherein the progress record transaction includes project progress information; After the progress record transaction consensus is passed, the node stores the project progress information in the progress record module; The contract automatic execution smart contract automatically triggers the project acceptance operation when it detects that the progress record module has been updated; The contract automatically executes the smart contract to receive the acceptance result upload transaction sent by the project acceptance party, and the acceptance result upload transaction includes the project acceptance result; The contract automatically executes the smart contract after the acceptance result is uploaded and the transaction consensus is passed. If it is detected that the project acceptance result is passed, the agreed payment operation is automatically triggered.
6. The method according to claim 5, characterized in that The project acceptance operation includes an automatic acceptance operation; the contract automatic execution smart contract also includes an automatic acceptance rule code.
7. The method according to claim 5, characterized in that The project acceptance operation includes manual acceptance operation; The contract automatically executes the smart contract to automatically trigger the project acceptance operation, including: The contract automatically executes the smart contract to receive a project progress query transaction sent by the project acceptance party, and the project progress query transaction includes information of the project acceptance party; The contract automatically executes the smart contract to respond to the project progress query transaction, and sends the project progress information to the project acceptance party. The project acceptance party checks the project progress according to the project progress information, obtains the project acceptance result, signs the project acceptance result, and generates an acceptance result upload transaction.
8. A blockchain system, characterized in that: The blockchain system includes nodes, and the nodes include trusted execution environment TEE nodes and non-TEE nodes, wherein: The TEE node is used to receive a first contract deployment transaction initiated by a contract deployment party, where the first contract deployment transaction includes contract information; The TEE node is used to store the contract information on the security account of the TEE node after the first contract deployment transaction consensus is passed; The TEE node is used to perform desensitization processing on the contract information to obtain desensitized data; The TEE node is used to initiate a second contract deployment transaction to the non-TEE node, and the second contract deployment transaction includes the desensitized data, which includes: the TEE node performs a summary calculation on the sensitive data in the contract information to obtain a first summary; uses the private key of the TEE node to digitally sign the first summary to obtain a first signature; the TEE node initiates the second contract deployment transaction to the non-TEE node, and the second contract deployment transaction also includes the first signature; The non-TEE node is used to store the desensitized data in the blockchain of the non-TEE node after the consensus on the second contract deployment transaction is passed, which includes: the non-TEE node verifies the first signature using the public key of the TEE node; if the first signature verification is passed, the non-TEE node reaches a consensus on the second contract deployment transaction; after the consensus on the second contract deployment transaction is passed, the desensitized data is stored in the blockchain of the non-TEE node.
9. A computer device, characterized in that: Includes processor, memory, input and output interfaces; The processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used to receive and output data, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method described in any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Electronic contract block chain structure and electronic contract signing device and method
CN111651521A
Smart contract execution method of block chain, computer equipment and block chain system
CN113379420A
