Privacy computing method and related equipment based on smart contracts in blockchain
By using the intelligent contract system in the blockchain to achieve privacy calculation methods, the calculation program solves the problem of data leakage caused by all raw data, ensuring the security and privacy of the data, and improving the reliability of the calculation results.
Patent Information
- Application Number
- CN202111347858.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-15
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2041-11-15
AI Technical Summary
In the prior art, the calculation program needs to obtain all the original data for calculation, resulting in data leakage and the problem that users cannot obtain calculation results while ensuring data security and privacy.
Through the use of intelligent contract systems in the blockchain to achieve privacy calculation methods. This method includes calling the participants' encryption data and digital certificates, using digital certificates to decrypt the original data, execute the calculation logic and return the result to the encryption.
The data security and privacy in the process of privacy computing are guaranteed, and the accuracy and reliability of the data is ensured through the calculation of non -tampered smart contracts to calculate the data security trust in the calculation process.
Smart Images

Figure CN114358764B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a privacy computing method and related equipment based on smart contracts in blockchain. Background Art
[0002] In the prior art, when a computing program obtains a calculation result, it needs to obtain all the original data, and then obtain the desired final calculation result through a certain calculation method. However, the ownership of data and the calculation are inseparable, that is, in all cases where calculations need to be performed using the original data, the user's sensitive data and private data need to be obtained, which is prone to data leakage. Users cannot obtain the expected calculation results while ensuring data security and privacy. Summary of the invention
[0003] In view of this, the purpose of this application is to propose a privacy computing method and related equipment based on smart contracts in blockchain.
[0004] Based on the above purpose, the present application provides a privacy computing method, which is executed by a smart contract system in a blockchain, and the method includes:
[0005] In response to determining that a computing transaction included in a smart contract in the blockchain satisfies a trigger condition, for each of a plurality of participants involved in the computing transaction, calling the encrypted data and a digital certificate of the participant, and decrypting the encrypted data using the digital certificate to obtain the original data of the participant;
[0006] Based on all the original data, the calculation logic corresponding to the calculation transaction is executed to obtain the calculation result,
[0007] The smart contract is established in advance by the multiple participants for the computing transaction, and is signed with the private key of each of the multiple participants and then stored in the blockchain.
[0008] The original data of each of the multiple participants is encrypted in advance with the private key of the participant, and is stored in the blockchain together with the digital certificate of the participant as the encrypted data of the participant.
[0009] The digital certificate is generated by authenticating the public key of the participant through a certificate center and encrypting the basic information of the participant with the public key of the certificate center.
[0010] Furthermore, it also includes: encrypting the calculation result through the digital certificate of each of the multiple participants and returning it to the business demander.
[0011] Furthermore, when each of the multiple participants pre-registers on the blockchain, the blockchain generates a pair of public and private keys for the participant.
[0012] Furthermore, the decrypting the encrypted data using the digital certificate to obtain the original data of the participant includes:
[0013] The digital certificate is decrypted by the public key of the certificate center to obtain the public key of the participant, and the encrypted data is decrypted by the public key of the participant.
[0014] Furthermore, before being stored in the blockchain, the smart contract includes:
[0015] Each of the multiple participants conducts a code audit on the smart contract respectively, and after the audit is completed, signs the smart contract with their respective private keys, and puts the signed smart contract on the chain for confirmation.
[0016] Furthermore, the smart contract is stored in the blockchain, including:
[0017] The smart contract is broadcasted in the blockchain. After receiving the smart contract, the verification node in the blockchain initiates consensus verification. The multiple smart contracts that have passed the consensus verification are packaged into a contract set and broadcasted in the blockchain in the form of blocks. The nodes that receive the contract set verify each of the smart contracts. After the verification is passed, the smart contract is stored in the blockchain.
[0018] Further, the smart contract system periodically checks the state machine included in the smart contract and the triggering condition of the computing transaction, and in response to determining that the state machine indicates that the smart contract is not completed and the triggering condition is satisfied, pushes the computing transaction to each verification node in the blockchain;
[0019] In response to receiving verification information of the computing transaction being passed by the majority of verification nodes in the blockchain, the smart contract system determines that the computing transaction satisfies the trigger condition and executes the computing transaction.
[0020] Based on the same inventive concept, the present application also provides a smart contract system for privacy computing in a blockchain, including:
[0021] A data acquisition module, configured to: in response to determining that a computing transaction included in a smart contract in the blockchain satisfies a trigger condition, for each of a plurality of participants involved in the computing transaction, call the encrypted data and digital certificate of the participant, and use the digital certificate to decrypt the encrypted data to obtain the original data of the participant;
[0022] A calculation module is used to: execute the calculation logic corresponding to the calculation task based on all the original data to obtain the calculation result,
[0023] The smart contract is established in advance by the multiple participants for the computing transaction, and is signed with the private key of each of the multiple participants and then stored in the blockchain.
[0024] The original data of each of the multiple participants is encrypted in advance with the private key of the participant, and is stored in the blockchain together with the digital certificate of the participant as the encrypted data of the participant.
[0025] The digital certificate is generated by authenticating the public key of the participant through a certificate center and encrypting the basic information of the participant with the public key of the certificate center.
[0026] Based on the same inventive concept, the present application also provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable by the processor. When executing the computer program, the processor implements any of the methods for privacy computing based on smart contracts in blockchain as described above.
[0027] From the above, it can be seen that the privacy computing method and related equipment based on smart contracts in blockchain provided by this application ensure the security and privacy of data in the privacy computing process through the use of smart contract systems in blockchain, and ensure the accuracy and reliability of data by calling tamper-proof smart contract calculations, thereby solving the problem of data security trust of users in the calculation process. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0029] Figure 1 A flowchart of a privacy computing method based on a smart contract in a blockchain according to an embodiment of the present application;
[0030] Figure 2 A schematic diagram of the smart contract generation process of an embodiment of the present application;
[0031] Figure 3 A schematic diagram of the smart contract execution process of an embodiment of the present application;
[0032] Figure 4 A schematic diagram of the smart contract transmission and storage process of an embodiment of the present application;
[0033] Figure 5 This is a schematic diagram of the structure of a smart contract system for privacy computing in a blockchain according to an embodiment of the present application;
[0034] Figure 6 A schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0035] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0036] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0037] As described in the background technology, when the computing program is running, all the original data needs to be called, which is prone to user data leakage. The development of blockchain technology has brought us a decentralized, tamper-proof, and highly reliable system. Smart contracts will be automatically executed when certain conditions are met, but there is no guarantee of trust between the two parties to the contract, such as malicious tampering operations. Deploying smart contracts based on the blockchain system can solve the trust problem between the two parties to the transaction. The immutability of the blockchain ensures that the content of the contract will not be changed, the high reliability ensures that the contract is executed when the conditions are met, and the decentralization and full network backup ensure post-audit. Implementing privacy computing based on smart contracts in the blockchain can well ensure the security and privacy of multi-party user data, and solve the data security trust problem in the computing process.
[0038] All data on the blockchain is transparent, so the data processing of smart contracts is also transparent, and any party can view its code and data during operation. All data on the blockchain itself cannot be tampered with, so the smart contract code deployed on the blockchain and the data output generated by the operation are also tamper-proof. Nodes running smart contracts do not have to worry about other nodes maliciously modifying the code and data. The number of nodes supporting the blockchain network often reaches hundreds or even thousands, and the failure of some nodes will not cause the smart contract to stop. Its reliability is theoretically close to permanent operation, which ensures that the smart contract can be valid at all times like a paper contract.
[0039] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0040] refer to Figure 1 , this application provides a privacy computing method, which is executed by a smart contract system in a blockchain, and includes the following steps:
[0041] Step S101: In response to determining that a computing transaction included in a smart contract in the blockchain satisfies a trigger condition, for each of the multiple participants involved in the computing transaction, the encrypted data and digital certificate of the participant are called, and the encrypted data is decrypted using the digital certificate to obtain the original data of the participant.
[0042] Specifically, the smart contract includes a state machine, a computing transaction, and a trigger condition. When a computing transaction in the smart contract system meets the trigger condition, the smart contract needs to call the original data involved in the computing transaction to perform the calculation. The source of the original data is multiple. According to business needs, each party provides or collects data, and the source of the original data may involve multiple participants. Each participant has obtained a unique digital certificate from the certificate center in advance. Based on the authorization of multiple participants, the smart contract calls the digital certificate of the participant to decrypt the encrypted original data. After decryption, the original data of multiple participants is obtained.
[0043] Step S102: Based on all the original data, the calculation logic corresponding to the calculation transaction is executed to obtain a calculation result.
[0044] The smart contract is established in advance by the multiple participants for the computing transaction, and is signed with the private key of each of the multiple participants and then stored in the blockchain.
[0045] The original data of each of the multiple participants is encrypted in advance with the private key of the participant, and is stored in the blockchain together with the digital certificate of the participant as the encrypted data of the participant.
[0046] The digital certificate is generated by authenticating the public key of the participant through a certificate center and encrypting the basic information of the participant with the public key of the certificate center.
[0047] Specifically, two or more parties involved in a transaction jointly agree on a commitment and a privacy computing function contract based on specific needs. The contract contains the rights and obligations of the two or more parties and the functional logic required for privacy computing data. These rights and obligations are designed and recorded in an electronic way to form a smart contract. Figure 2 , Participant 1 who participates in the calculation registers a node account with the blockchain system, and the blockchain system returns the public key and private key for registering the node to Participant 1. Participant 2 applies to register a node account in the same way. Participants 1 and 2 draft the content of the smart contract based on the specific calculation logic and generate smart contract records. The participant sends the content of the smart contract to the blockchain system, and the blockchain system signs and encrypts the content of the smart contract through the private key of the participant, generates a smart contract and returns it to the participant.
[0048] After the smart contract retrieves the original data required to execute the calculation transaction, it executes the corresponding calculation logic to obtain the calculation result. The original data is encrypted by the private key of each participant and stored in the blockchain together with the digital certificate. At the same time, the blockchain calculates the hash value of each original data through the hash algorithm, and stores the hash value in the database, one-to-one corresponding to the original data. The hash value is the unique identifier for querying the original data, so each original data corresponds to an encrypted data and hash value. The digital certificate is issued to the participant by the third-party certificate center. The certificate center authenticates the public key of the participant to whom the original data belongs, and uses the private key of the certificate center to encrypt the public key of the participant and the identity information and identity of the participant, thereby generating a digital certificate.
[0049] In some embodiments, the calculation result is encrypted by the digital certificate of each of the multiple participants and returned to the business demander.
[0050] Specifically, after executing the calculation transaction and obtaining the calculation result, the smart contract will encrypt the calculation result through the digital certificates of multiple participants and return it to the business demander. Among them, if the calculation result involves returning the other party's user data ID, such as the recommendation system, which needs to return the user ID of the other party's system, then after using the real other party's user data ID + random number to comprehensively calculate the Hash value, the other party's user ID obfuscated with random numbers will be returned to the business demander.
[0051] In some embodiments, when each of the multiple participants pre-registers on the blockchain, the blockchain generates a pair of public and private keys for the participant. Users who participate in smart contracts must first register as users of the blockchain, and the blockchain returns a pair of public and private keys to the user. The public key serves as the user's account address on the blockchain, and the private key serves as the only key to operate the account.
[0052] In some embodiments, decrypting the encrypted data using the digital certificate to obtain the original data of the participant includes:
[0053] The digital certificate is decrypted by the public key of the certificate center to obtain the public key of the participant, and the encrypted data is decrypted by the public key of the participant. When the encrypted data needs to be decrypted, the digital certificate corresponding to the encrypted data is first queried, and then the digital certificate is decrypted using the public key of the certificate center to obtain the public key of the participant to whom the encrypted data belongs. The data encrypted by the participant's private key is decrypted by the participant's public key. This encryption process is also called asymmetric encryption, and the certificate center provides security guarantees for the public and private keys of asymmetric encryption.
[0054] In some embodiments, the smart contract, before being stored in the blockchain, includes:
[0055] Each of the multiple participants conducts a code audit on the smart contract respectively, and after the audit is completed, signs the smart contract with their respective private keys, and puts the signed smart contract on the chain for confirmation.
[0056] Specifically, the two or more parties involved in privacy computing, for the business privacy computing logic that needs to be executed, encapsulate the computing process into executable functions according to the possibilities of different businesses to ensure that the correct computing logic is called when the smart contract is executed. When each participant conducts code audits, to ensure the correctness of the calculation and the integrity of the business, it is necessary to sort out the business process and provide test data, and then encapsulate test cases to test and audit the computing logic code. During the calculation process of each participant, ensure that the data is not transmitted or leaked. After the audit is completed, each participant will confirm the smart contract on the chain. The way to confirm the chain is to trigger the triggering conditions of the smart contract after the chain is completed, execute the computing transaction, obtain the data of the computing result, and compare the correctness of the computing result.
[0057] In some embodiments, the smart contract is stored in the blockchain, including:
[0058] The smart contract is broadcasted in the blockchain. After receiving the smart contract, the verification node in the blockchain initiates consensus verification. The multiple smart contracts that have passed the consensus verification are packaged into a contract set and broadcasted in the blockchain in the form of blocks. The nodes that receive the contract set verify each of the smart contracts. After the verification is passed, the smart contract is stored in the blockchain.
[0059] Specifically, after multiple parties reach a smart contract, the smart contract is broadcasted in the entire blockchain network through P2P, and each node will receive a copy of the smart contract. After receiving the broadcast smart contract, the verification node in the blockchain will save it to memory and wait for the consensus time to arrive.
[0060] After the consensus time arrives, the verification node will package all the smart contracts received within the time interval into a contract set Set, calculate the Hash value of the contract set Set, encapsulate the Hash value of the contract set in a block structure, and then broadcast the block structure.
[0061] After receiving the block structure, other verification nodes will decompose the Hash value of the contract set in the structure. The current node will compare the Hash value obtained after calculating the contract set with the Hash value in the block structure sent by other nodes after decomposing the block. If they are the same, the calculation is correct. Then, a contract set recognized by this verification node will be sent to other nodes. Through multiple rounds of sending and comparison, all verification nodes will eventually reach a consensus on the latest contract set within the specified time.
[0062] The latest contract set will be spread to the entire network in the form of blocks. Each block contains the following information: the hash value of the current block, the hash value of the previous block, the timestamp when consensus was reached, and other descriptive information. Nodes that receive the latest contract set will verify each smart contract in the contract set. Only smart contracts that pass the verification will be finally stored in the blockchain. The verification mainly checks whether the private key signature of the participant matches the account. The signature is decrypted using the public key of the participant to check whether the signature is consistent with the original data.
[0063] refer to Figure 3, Participants 1 and 2 broadcast the smart contract in the blockchain, and Verification Node 1 receives the smart contract and stores it in the node. When the consensus time arrives, Verification Node 1 packages all the contracts stored in the node into a contract set, calculates the Hash value of the contract set, encapsulates the Hash value of the contract set in the block structure, and broadcasts it in the blockchain. When Verification Node 2 receives the block structure, it decomposes the block structure to obtain the Hash value, compares it with the Hash value of this node, and obtains a contract set recognized by this node to the next verification node, until it reaches the Nth verification point, and obtains the latest contract set, and finally broadcasts the latest contract set in the form of a block in the blockchain network.
[0064] In some embodiments, the smart contract system periodically checks the state machine included in the smart contract and the triggering condition of the computing transaction, and in response to determining that the state machine indicates that the smart contract is not completed and the triggering condition is satisfied, pushes the computing transaction to each verification node in the blockchain;
[0065] In response to receiving verification information of the computing transaction being passed by the majority of verification nodes in the blockchain, the smart contract system determines that the computing transaction satisfies the trigger condition and executes the computing transaction.
[0066] Specifically, the smart contract will periodically check the state of the automaton, traverse the state machine, computing transactions and trigger conditions contained in each smart contract one by one, push the computing transactions that meet the trigger conditions to the queue to be verified, and wait for consensus. The computing transactions that do not meet the trigger conditions will continue to be stored on the blockchain.
[0067] The computing transaction that enters the latest round of verification will be spread to each verification node. The verification node will first perform signature verification to ensure the validity of the computing transaction. The computing transaction that passes the verification will enter the consensus set. After most verification nodes reach a consensus, the computing transaction will be successfully executed and the business demander will be notified.
[0068] After the calculation transaction is successfully executed, the state machine of the smart contract will determine the status of the smart contract. When all the calculation transactions included in the smart contract are executed in sequence, the state machine will mark the status of the smart contract as completed and remove the smart contract from the latest block. Otherwise, the status of the smart contract will be marked as in progress and will continue to be saved in the latest block waiting for the next round of processing until it is completed. The entire calculation transaction and status processing are automatically completed by the built-in smart contract system at the bottom of the blockchain, which is fully transparent and cannot be tampered with.
[0069] refer to Figure 4, the smart contract system in the blockchain periodically traverses the trigger conditions of each smart contract, and pushes the computing transactions that meet the trigger conditions to the queue of transactions to be verified. The queue of transactions to be verified includes computing transaction 1, computing transaction 2... computing transaction N. After the computing transactions in the queue of transactions to be verified are sent to the verification node, the verification node first performs signature verification on the computing transactions, and after the verification, the computing transactions are stored in the consensus set. Each verification node verifies the computing transactions separately. When most verification nodes reach a consensus, the smart contract system executes the computing transactions, and returns the calculation results to the business demander after the calculation is completed. When all computing transactions in the contract are completed, the contract is removed from the blocks of each verification node, and the contract status is marked as completed.
[0070] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.
[0071] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0072] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a smart contract system for privacy computing in a blockchain.
[0073] refer to Figure 5 , the smart contract system for privacy computing in the blockchain includes:
[0074] The data acquisition module 501 is used to: in response to determining that the computing transaction included in the smart contract in the blockchain satisfies the triggering condition, for each of the multiple participants involved in the computing transaction, call the encrypted data and digital certificate of the participant, and use the digital certificate to decrypt the encrypted data to obtain the original data of the participant;
[0075] The calculation module 502 is used to: execute the calculation logic corresponding to the calculation task based on all the original data to obtain the calculation result,
[0076] The smart contract is established in advance by the multiple participants for the computing transaction, and is signed with the private key of each of the multiple participants and then stored in the blockchain.
[0077] The original data of each of the multiple participants is encrypted in advance with the private key of the participant, and is stored in the blockchain together with the digital certificate of the participant as the encrypted data of the participant.
[0078] The digital certificate is generated by authenticating the public key of the participant through a certificate center and encrypting the basic information of the participant with the public key of the certificate center.
[0079] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0080] The device of the above embodiment is used to implement the corresponding privacy computing method based on smart contracts in blockchain in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0081] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the privacy computing method based on the smart contract in the blockchain as described in any of the above-mentioned embodiments is implemented.
[0082] Figure 6 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0083] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0084] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0085] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0086] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0087] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0088] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0089] The electronic device of the above-mentioned embodiment is used to implement the corresponding privacy computing method based on the smart contract in the blockchain in any of the above-mentioned embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0090] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the privacy computing method based on the smart contract in the blockchain as described in any of the above embodiments.
[0091] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0092] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the privacy computing method based on the smart contract in the blockchain as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0093] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0094] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.
[0095] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0096] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.
Claims
1. A privacy computing method, executed by a smart contract system in a blockchain, comprising: In response to determining that a computing transaction included in a smart contract in the blockchain satisfies a trigger condition, for each of a plurality of participants involved in the computing transaction, calling the encrypted data and digital certificate of the participant, and decrypting the encrypted data using the digital certificate to obtain the original data of the participant; Based on all the original data, the calculation logic corresponding to the calculation transaction is executed to obtain the calculation result, The smart contract is established in advance by the multiple participants for the computing transaction, and is signed with the private key of each of the multiple participants and then stored in the blockchain. The original data of each of the multiple participants is encrypted in advance with the private key of the participant, and is stored in the blockchain together with the digital certificate of the participant as the encrypted data of the participant. The digital certificate is generated by authenticating the public key of the participant through a certificate center and encrypting the basic information of the participant with the private key of the certificate center; wherein the basic information of the participant includes the public key, identity information and identity identifier of the participant; The decrypting the encrypted data using the digital certificate to obtain the original data of the participant includes: The digital certificate is decrypted by the public key of the certificate center to obtain the public key of the participant, and the encrypted data is decrypted by the public key of the participant.
2. The method according to claim 1, further comprising: The calculation result is encrypted through the digital certificate of each of the multiple participants and returned to the business demander; wherein the business demander is the party that initiates the request to execute the calculation transaction, and the business demander is different from the participant.
3. The method according to claim 1 or 2, wherein: When each of the multiple participants is pre-registered on the blockchain, the blockchain generates a pair of public and private keys for the participant.
4. The method according to claim 1 or 2, wherein: Before being stored in the blockchain, the smart contract includes: Each of the multiple participants conducts a code audit on the smart contract respectively, and after the audit is completed, signs the smart contract with their respective private keys, and puts the signed smart contract on the chain for confirmation.
5. The method according to claim 4, wherein: The smart contract is stored in the blockchain, including: The smart contract is broadcasted in the blockchain. After receiving the smart contract, the verification node in the blockchain waits for consensus. When the consensus time arrives, the multiple smart contracts received before the consensus time are packaged into a contract set, and consensus verification is initiated. The multiple smart contracts that have passed the consensus verification are packaged into a contract set and broadcasted in the blockchain in the form of blocks. The nodes that receive the contract set verify each of the smart contracts, and store the smart contracts in the blockchain after verification.
6. The method according to claim 1 or 2, wherein: The smart contract system periodically checks the state machine included in the smart contract and the triggering condition of the computing transaction, and in response to determining that the state machine indicates that the smart contract is not completed and the triggering condition is satisfied, pushes the computing transaction to each verification node in the blockchain; In response to receiving verification information of the computing transaction being passed by the majority of verification nodes in the blockchain, the smart contract system determines that the computing transaction satisfies the trigger condition and executes the computing transaction.
7. A smart contract system for privacy computing in a blockchain, comprising: A data acquisition module, configured to: in response to determining that a computing transaction included in a smart contract in the blockchain satisfies a trigger condition, for each of a plurality of participants involved in the computing transaction, call the encrypted data and digital certificate of the participant, and decrypt the encrypted data using the digital certificate to obtain the original data of the participant; A calculation module is used to: execute the calculation logic corresponding to the calculation task based on all the original data to obtain the calculation result, The smart contract is established in advance by the multiple participants for the computing transaction, and is signed with the private key of each of the multiple participants and then stored in the blockchain. The original data of each of the multiple participants is encrypted in advance with the private key of the participant, and is stored in the blockchain together with the digital certificate of the participant as the encrypted data of the participant. The digital certificate is generated by authenticating the public key of the participant through a certificate center and encrypting the basic information of the participant with the private key of the certificate center; wherein the basic information includes the public key, identity information and identity identifier of the participant; The decrypting the encrypted data using the digital certificate to obtain the original data of the participant includes: The digital certificate is decrypted by the public key of the certificate center to obtain the public key of the participant, and the encrypted data is decrypted by the public key of the participant.
8. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method according to any one of claims 1 to 6 when executing the computer program.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Methods and devices for protecting sensitive data of transaction activity based on smart contract in blockchain
CA3057385A1
Intelligent contract implementation method based on block chain
CN107103473A