Transaction data processing method and device based on block chain
By deconstructing the blockchain transaction code into functional modules and building privacy vectors, combined with zero-knowledge proof technology, the problem that sensitive information cannot be hidden in blockchain transactions is solved, and efficient privacy protection and data verification are achieved.
Patent Information
- Application Number
- CN202510266338.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2045-03-07
AI Technical Summary
In blockchain transactions, due to the public and tampered transaction records, the sensitive information of both parties to the transaction cannot be hidden or deleted, and there is a risk of privacy leakage.
By deconstructing the transaction code into multiple functional modules, a privacy vector is constructed according to the module's privacy protection needs, and a zero-knowledge proof coprocessor is used to generate circuit modules and verification modules, reconstruct and generate smart contract modules, and deploy them on the blockchain for privacy protection processing.
It realizes privacy protection of sensitive data in blockchain transactions, so that the correctness of data processing results is ensured without exposing specific content, and the efficiency of privacy protection is improved.
Smart Images

Figure CN119760785A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of blockchain technology, and in particular, to a transaction data processing method and device based on blockchain. Background Art
[0002] Blockchain technology is decentralized, transparent, and tamper-proof, making it an ideal technical framework in the fields of finance, supply chain management, digital identity, etc. However, precisely because the transaction records on the blockchain are public and permanently stored, it exposes many potential privacy issues. For example, in commercial transactions, certain sensitive information involving both parties to the transaction (such as transaction amount, business content, identities of both parties, etc.) will be known to external third parties. Once a transaction data is recorded on the blockchain, even the parties involved cannot withdraw or modify this information, which means that transactions involving personal or corporate sensitive data cannot be hidden or deleted after they occur.
[0003] In order to deal with the problem of privacy exposure in blockchain transactions, encryption technology is usually used to protect transaction data, such as symmetric encryption, asymmetric encryption and zero-knowledge proof. This method requires encryption of data in transactions one by one, which slows down transaction processing speed. In addition, encryption is usually for the protection of the data itself, while encryption technology cannot provide sufficient privacy protection for other aspects of the transaction (such as transaction process, transaction links and roles of each party). Summary of the invention
[0004] The embodiments described herein provide a blockchain-based transaction data processing method, device, and computer-readable storage medium storing a computer program.
[0005] According to a first aspect of the present disclosure, a transaction data processing method based on blockchain is provided, comprising: deconstructing a transaction code into multiple functional modules, and constructing a privacy vector of the transaction according to the privacy protection requirements of the functional modules; inputting the functional modules and the corresponding privacy vectors into a zero-knowledge proof coprocessor to generate a circuit module for privacy protection data and its corresponding verification module; reconstructing the functional modules to generate a smart contract module according to the privacy vectors, wherein the smart contract module includes a verification module; and deploying the smart contract module on the blockchain, deploying the circuit module in an off-chain system, sending the transaction to each full node of the blockchain network, and each full node calling the locally stored smart contract module to execute and verify the transaction.
[0006] In some embodiments of the present disclosure, each element value in the privacy vector corresponds to the privacy processing requirement of the functional module. If the functional module requires privacy protection, the corresponding element value is 1; if the functional module does not require privacy protection, the corresponding element value is 0.
[0007] In some embodiments of the present disclosure, a privacy vector and a functional module are input into a zero-knowledge proof coprocessor to obtain a circuit module and its corresponding verification module, including: if the element value of the privacy vector corresponding to the functional module is 1, the functional module is generated into a circuit module and a corresponding verification module; if the element value of the privacy vector corresponding to the functional module is 0, the functional module is not processed and is directly output.
[0008] In some embodiments of the present disclosure, the off-chain system interacts with the blockchain through an oracle, the input end of the oracle runs on the blockchain, and the output end of the oracle is connected to the calling interface of the off-chain system so as to call the zero-knowledge proof generated by a specific circuit module through the calling interface.
[0009] In some embodiments of the present disclosure, the functional module is reconstructed to generate a smart contract module according to the privacy vector. The smart contract module includes a verification module including: if the element value of the privacy vector corresponding to the functional module is 1, the oracle is called to execute the circuit module of the off-chain system, the zero-knowledge proof returned by the circuit module is obtained, and the zero-knowledge proof is used as the input of the verification module to obtain the verification result; if the element value of the privacy vector corresponding to the functional module is 0, the direct execution functional module is executed.
[0010] In some embodiments of the present disclosure, a smart contract module is deployed on a blockchain, a circuit module is deployed in an off-chain system, and a transaction is sent to each full node of the blockchain network. Each full node calls the locally stored smart contract module to execute and verify the transaction, including: if the current transaction function does not require privacy processing, the execution result is obtained through the function module processing; if the current transaction function requires privacy processing, the circuit module of the off-chain system is called by the oracle to obtain a zero-knowledge proof, the verification module is called to verify the zero-knowledge proof, and the execution result is returned; each full node packages the execution result into a new block and broadcasts it to other nodes of the blockchain network; when any node receives a new block, the current operation is stopped and the new block is verified. If the verification passes, the block is added to the end of the local blockchain; if more than 50% of the full nodes in the blockchain network verify that the new block is valid and add the block to the end of the local blockchain, other functions of the transaction continue to be executed and verified, otherwise the system reports an error and the transaction is terminated.
[0011] In some embodiments of the present disclosure, if the current transaction function requires privacy processing, the oracle calls the circuit module of the off-chain system to obtain a zero-knowledge proof, calls the verification module to verify the zero-knowledge proof, and returns the execution result, including: inputting the output of the transaction into the circuit module to generate a zero-knowledge proof; inputting the zero-knowledge proof into the verification module. If the result is True, it proves that the transaction is executed correctly and the results have not been tampered with during and after the execution. If the result is False, it proves that there is a problem with the transaction.
[0012] In some embodiments of the present disclosure, after the transaction execution and verification are completed, the processes or data that require privacy protection or do not contain sensitive data are not disclosed on the blockchain, and other processes or data that do not require privacy protection or do not contain sensitive data are disclosed on the blockchain.
[0013] According to the second aspect of the present disclosure, a transaction data processing device based on blockchain is provided. The device includes at least one processor; and at least one memory storing a computer program. When the computer program is executed by at least one processor, the device: deconstructs the transaction code into multiple functional modules, and constructs the privacy vector of the transaction according to the privacy protection requirements of the functional modules; inputs the functional modules and the corresponding privacy vectors into the zero-knowledge proof coprocessor, generates a circuit module for privacy protection data and its corresponding verification module; according to the privacy vector, reconstructs the functional module to generate a smart contract module, and the smart contract module includes a verification module; and deploys the smart contract module on the blockchain, deploys the circuit module in the off-chain system, sends the transaction to each full node of the blockchain network, and each full node calls the locally stored smart contract module to execute and verify the transaction.
[0014] In some embodiments of the present disclosure, when the computer program is executed by at least one processor, the device inputs the privacy vector and the function module into the zero-knowledge proof coprocessor to obtain the circuit module and its corresponding verification module by performing the following operations: If the element value of the privacy vector corresponding to the functional module is 1, the functional module is generated into a circuit module and a corresponding verification module; if the element value of the privacy vector corresponding to the functional module is 0, the functional module is not processed and is directly output.
[0015] In some embodiments of the present disclosure, the computer program, when executed by at least one processor, causes the apparatus to perform and verify a transaction by: If the current transaction function does not require privacy processing, the execution result is obtained through the functional module processing. If the current transaction function requires privacy processing, the oracle calls the circuit module of the off-chain system to obtain zero-knowledge proof, calls the verification module to verify the zero-knowledge proof, and returns the execution result; each full node packs the execution result into a new block and broadcasts it to other nodes in the blockchain network; when any node receives a new block, it stops the current operation and verifies the new block. If the verification passes, the block is added to the end of the local blockchain; if more than 50% of the full nodes in the blockchain network verify that the new block is valid and add the block to the end of the local blockchain, continue to execute and verify other functions of the transaction, otherwise the system reports an error and the transaction terminates.
[0016] According to a third aspect of the present disclosure, a computer-readable storage medium storing a computer program is provided, wherein the computer program, when executed by a processor, implements the steps of the blockchain-based transaction data processing method according to the first aspect of the present disclosure.
[0017] According to the blockchain-based transaction data processing method and device of the embodiment of the present disclosure, by defining the information that needs to be protected by privacy in a modular vector manner, the part that needs to be protected by privacy in any transaction (including but not limited to data, processes, steps, etc.) can be processed for privacy, so that in the same transaction, the privacy of sensitive data can be protected while keeping non-sensitive data open and transparent. Using zero-knowledge proof to process and verify data, the specific content of sensitive data is not exposed during processing and transmission, and the correctness of the data processing results can be guaranteed. Compared with the traditional method of encrypting transaction data one by one, the efficiency of privacy protection can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly described below. It should be noted that the drawings described below only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure, wherein: Figure 1 An exemplary flow chart of a transaction data processing method 100 based on blockchain according to an embodiment of the present disclosure is shown; Figure 2 is a schematic diagram of a transaction privacy protection processing logic architecture according to an embodiment of the present disclosure; Figure 3 It is a schematic block diagram of a blockchain-based transaction data processing device 300 according to an embodiment of the present disclosure.
[0019] It should be noted that the elements in the drawings are schematic and not drawn to scale. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work also fall within the scope of protection of the present disclosure.
[0021] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art to which the subject matter of the present disclosure belongs. It will be further understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the specification and the relevant art, and will not be interpreted in an idealized or overly formal form unless otherwise explicitly defined herein.
[0022] In the privacy protection application of blockchain, zero-knowledge proof (ZKP) can ensure the privacy of sensitive transaction data, while ensuring that other parties can verify the validity and authenticity of the transaction without knowing the specific transaction content. By combining ZKP and modular vector methods, privacy protection can be achieved in blockchain transactions, which can maintain the transparency and credibility of transactions without exposing sensitive information. Modular vectors allow blockchain networks to flexibly process data based on the sensitivity of the data, only protecting the data that needs to be private in a transaction, and not doing anything with the information that can be made public. For example, the transaction amount or the identity information of the buyer and seller can be hidden through ZKP encryption, while other content that does not involve privacy can still be open and transparent on the blockchain.
[0023] Figure 1 An exemplary flow chart of a transaction data processing method 100 based on blockchain according to an embodiment of the present disclosure is shown. Figure 1 As shown, in Figure 1 In block S102 , the transaction code is deconstructed into multiple functional modules, and a privacy vector of the transaction is constructed according to the privacy protection requirements of the functional modules.
[0024] According to the privacy protection requirements of transaction data, a privacy vector is constructed. The privacy vector is used to distinguish whether a sub-process or data in a transaction process needs privacy protection. In some embodiments of the present disclosure, a privacy vector with a dimension of n is constructed. , each element value a in vector A iCorresponding to the privacy processing requirements of transaction processes or data, if the transaction process or data requires privacy protection, the corresponding element value is 1; if it does not require protection, the corresponding element value is 0. For example, privacy-sensitive data includes transaction amounts, participant identities, business secrets, etc., which need to be protected through encryption and ZKP. Public data includes blockchain transaction time, block hash, transaction hash, etc. These data do not involve privacy and can be stored openly and transparently on the blockchain.
[0025] Code Modulizer can divide a complex code into several independent and clear functional modules according to their functions, so that each module can focus on specific functions, such as data verification, asset transfer, user identity authentication, transaction log recording, etc., thereby improving the maintainability, scalability and flexibility of the code. Assume that it is decomposed into n functional modules: , the input interface corresponding to each functional module is , the output interface is Each module performs different functions, such as data verification, asset transfer, etc. By breaking down transactions into independent modules, each module can be processed more flexibly.
[0026] According to some embodiments of the present disclosure, , The transaction processing code. is the privacy vector of the transaction, Input to CodeModulizer to get the function module .
[0027] Then in block S104 , the functional module and the corresponding privacy vector are input into the zero-knowledge proof coprocessor to generate a circuit module of privacy protection data and its corresponding verification module.
[0028] The zero-knowledge proof coprocessor (ZKP-Coprocessor) is designed to convert transaction logic into a zero-knowledge proof circuit and generate corresponding proofs to ensure that private data is not directly exposed. This circuit describes each step of the transaction and how to verify its correctness. It consists of a series of Boolean gates (such as AND gates, OR gates, NOT gates, etc.) to ensure that the sender's balance is sufficient to pay the transfer amount and that the transaction complies with the rules of the system, such as the sender does have the amount, the transaction signature is valid, and the recipient's address is legal. Zero-knowledge proof allows one party (the prover) to prove to another party (the verifier) that a statement is correct without revealing any information other than correctness. Suppose there is a transaction code that includes: the sender and receiver of the transaction, the transfer amount, verification of whether the balance is sufficient, and confirmation of whether the transaction is legal. The logic of the transaction is as follows: pythonCopy Code if sender_balance>= transfer_amount: sender_balance -= transfer_amount receiver_balance += transfer_amount transaction_valid = True else: transaction_valid = False The above transaction logic can be compiled into a circuit using a ZKP-Coprocessor tool such as Circom or SnarkyJS. The input layer of the circuit is sender_balance, receiver_balance, and transfer_amount. The intermediate computing layer determines if sender_balance>= transfer_amount, which can be implemented using a comparison circuit. If the balance is sufficient, deduction and transfer operations are performed. Subtraction and addition operations need to be represented by addition and subtraction circuits. The output layer outputs transaction_valid, which indicates whether the transaction is successful. The compiled circuit can be used as part of a zero-knowledge proof to generate a proof that the transaction is valid. This proof only proves whether the transaction is legal, without revealing the specific content of the transaction (such as the amount and account information).
[0029] Assume that among the n functional modules, m modules perform operations that require privacy protection or contain sensitive data that require privacy protection, that is, the number of elements with a value of 1 in the original vector is m. Inputting these m modules into the ZKP-Coprocessor will generate corresponding m circuit modules and corresponding verification modules. The input interface corresponding to each circuit module is ,Output interface The input interface corresponding to each verification module is , the output interface is The circuit module is used to execute the part that requires privacy protection and generate proof, while the verification module is used to verify the proof on the blockchain node. The input of the circuit module is the transaction module that requires privacy protection (for example, a sensitive data module involving amount or identity).
[0030] If the element value of the privacy vector corresponding to the functional module is 1, the functional module is generated into a circuit module and a corresponding verification module; if the element value of the privacy vector corresponding to the functional module is 0, the functional module is not processed and is directly output.
[0031] In some embodiments of the present disclosure, the functional module and privacy vector Input to ZKP-Coprocessor to obtain circuit module and verification module. Circuit module in, hour, is 0; when hour, for . Verification Module ,in, hour, is 0; when hour, for .
[0032] In some embodiments of the present disclosure, the off-chain system interacts with the blockchain through an oracle, the input end of the oracle runs on the blockchain, and the output end of the oracle (Oracle) is connected to the calling interface Interface of the off-chain system, which is responsible for calling a specific circuit module so as to call the zero-knowledge proof generated by the specific circuit module through the calling interface.
[0033] For example, the off-chain system runs the circuit module The calling interface of the whole system is Interface(), whose input value is i and return value is P. This interface is responsible for calling a specific circuit module , and then returns the proof generated by the circuit module If function i does not need privacy protection, use the function module ,and It will be deployed and run on the blockchain (each full node of the network). If privacy protection is required, the circuit module will be used Proof of processing , and then use the authentication module right Among them, the circuit module Deployed in the above-mentioned off-chain system. Verification module It runs on the blockchain (every full node of the network).
[0034] Then in box S106, according to the privacy vector, the functional module is reconstructed to generate a smart contract module, and the smart contract module includes a verification module.
[0035] According to the element value of the privacy vector A, it will be determined which data needs to be hidden and which data can be made public. If the element value of the privacy vector corresponding to the function module is 1, the oracle is called to execute the circuit module of the off-chain system, obtain the zero-knowledge proof returned by the circuit module, and use the zero-knowledge proof as the input of the verification module to obtain the verification result; if the element value of the privacy vector corresponding to the function module is 0, the direct execution function module is executed.
[0036] In some embodiments of the present disclosure, the privacy vector A and As input, the function module Refactored into smart contract module .
[0037] The smart contract module is used to execute transaction processing logic on the blockchain. Its goal is to ensure that the contract not only has the required functions, but also can handle privacy protection, and finally deploy the contract to the blockchain network for interaction and execution. The pseudo code is as follows:
[0038] The execution logic of the smart contract module is: if the element value of the privacy vector corresponding to the function module is 1, the oracle is called to execute the circuit module of the off-chain system, obtain the zero-knowledge proof returned by the circuit module, and use the zero-knowledge proof as the input of the verification module to obtain the verification result; if the element value of the privacy vector corresponding to the function module is 0, the function module is directly executed. In other words, when function i does not need to be processed for privacy ( ), the module that executes the original build ; When function i needs privacy processing ( ), calling the oracle to execute the circuit module of the off-chain system The resulting zero-knowledge proof As a verification module Input and get the verification result .
[0039] Figure 2 Schematic diagram of the transaction privacy protection processing logic architecture according to the embodiment of the present disclosure. Figure 2 As shown, for transactions ,in, The transaction processing code. is the privacy vector of the transaction, Input to the code modular deconstructor to decompose into functional modules .
[0040] Functional modules and privacy vector Input to the zero-knowledge proof coprocessor to obtain the circuit module ( ,in, hour, is 0; when hour, ) and the verification module ( ,in hour, is 0; when hour, ). The function module ( ) and the privacy vector Input to the transaction code synthesizer to get the smart contract module ( ).
[0041] Smart Contract Module ( ) and the verification module ( ) is deployed to the blockchain, the circuit module ( ) is deployed in the off-chain system. The execution process of the smart contract module is as follows: when function j does not need to perform privacy processing ( ), the module that executes the original build ; When function j needs privacy processing ( ), calling the oracle to execute the circuit module off-chain. The transaction privacy protection process described above is performed on each transaction, so that the processes or data that require privacy protection or contain sensitive data will not be disclosed on the chain, while the remaining processes or data that do not require privacy protection or do not contain sensitive data will continue to be publicly and transparently available on the blockchain.
[0042] Finally, in box S108, the smart contract module is deployed on the blockchain, the circuit module is deployed in the off-chain system, the transaction is sent to each full node of the blockchain network, and each full node calls the locally stored smart contract module to execute and verify the transaction.
[0043] First, start the blockchain network and ensure that there are enough nodes participating in the network's consensus mechanism to handle subsequent transactions and block verification.
[0044] In some embodiments of the present disclosure, the transaction Submit to each full node of the blockchain network. Full nodes are nodes in the blockchain network that can fully verify and store blockchain data. These full nodes receive transactions and perform corresponding operations, such as calling smart contracts, verifying transactions, etc. Each full node calls the locally stored smart contract module. When the transaction reaches each full node, the node will check whether there is a local smart contract module to decide how to handle the transaction. Smart contracts are automated programs on the blockchain that are used to execute, verify, and record transactions.
[0045] If the current transaction function does not require privacy processing, the execution result is obtained directly through the function module processing. If the current transaction function requires privacy processing, the circuit module of the off-chain system is called by the oracle to obtain the zero-knowledge proof, and the verification module is called to verify the zero-knowledge proof, and the execution result is returned. This includes: inputting the output of the transaction into the circuit module to generate a zero-knowledge proof; inputting the zero-knowledge proof into the verification module. If the return value is false, the system will report an error and terminate the transaction. This is because the calculations performed in the off-chain system may be wrong or inconsistent, resulting in the data being unable to pass verification. If the return value is true, the transaction will continue, proving that the transaction is executed correctly and the results have not been tampered with during and after the execution.
[0046] Each full node packages the execution results into a new block and broadcasts the block to other nodes in the blockchain network. These new blocks contain verified transactions, transaction results, and other possible metadata, forming part of the blockchain.
[0047] When any node receives a new block, it stops the current operation and verifies the new block. The purpose of the verification is to verify whether the transactions in the block are valid and to ensure that the transaction execution complies with the consensus rules and the requirements of the smart contract. If the block verification passes, the node will add the block to the end of the local blockchain.
[0048] If more than 50% of the nodes in the blockchain network confirm that the block is valid and add it to the end of their respective blockchains, the transaction is considered successful and the transaction process continues. If less than 50% of the nodes pass the verification, the block will be rejected, the transaction will be aborted, and the system will report an error. This ensures the consensus of the majority of nodes in the system to ensure the decentralization and security of the blockchain. The same steps are used to continue to execute and verify other functions of the transaction until all functions of the transaction are executed and verified.
[0049] After the transaction execution and verification are completed, the (m) processes or data that require privacy protection or do not contain sensitive data are not disclosed on the blockchain, and the other (nm) processes or data that do not require privacy protection or do not contain sensitive data are disclosed on the blockchain.
[0050] This process ensures the decentralization, security and privacy protection of the blockchain network. By combining the automatic execution of smart contracts and privacy protection mechanisms such as zero-knowledge proof, the blockchain can ensure the transparency and verifiability of transactions while ensuring data privacy. At the same time, based on the consensus mechanism between nodes, the entire system ensures a decentralized and reliable transaction verification process.
[0051] Figure 3is a schematic block diagram of a transaction data processing device 300 based on blockchain according to an embodiment of the present disclosure. Figure 3 As shown, the device 300 may include a processor 310 and a memory 320 storing a computer program. When the computer program is executed by the processor 310, the device 300 may perform the following operations: Figure 1 The steps of the transaction data processing method 100 based on blockchain are shown. In one example, the apparatus 300 may be a computer device or a cloud computing node.
[0052] The device 300 can deconstruct the transaction code into multiple functional modules, and construct a privacy vector of the transaction according to the privacy protection requirements of the functional modules; input the functional modules and the corresponding privacy vectors into the zero-knowledge proof coprocessor to generate a circuit module for privacy protection data and its corresponding verification module; according to the privacy vector, reconstruct the functional modules to generate a smart contract module, and the smart contract module includes a verification module; and deploy the smart contract module on the blockchain, deploy the circuit module in the off-chain system, send the transaction to each full node of the blockchain network, and each full node calls the locally stored smart contract module to execute and verify the transaction.
[0053] In an embodiment of the present disclosure, the processor 310 may be, for example, a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a processor based on a multi-core processor architecture, etc. The memory 320 may be any type of memory implemented using data storage technology, including but not limited to random access memory, read-only memory, semiconductor-based memory, flash memory, disk storage, etc.
[0054] In addition, in the embodiment of the present disclosure, the apparatus 300 may also include an input device 330, such as a keyboard, a mouse, etc., for inputting transaction information. In addition, the apparatus 300 may also include an output device 340, such as a display, etc., for outputting processes or data that do not require privacy protection or do not contain sensitive data.
[0055] In other embodiments of the present disclosure, a computer-readable storage medium storing a computer program is further provided, wherein the computer program can achieve the following when executed by a processor: Figure 1 The steps of the blockchain-based transaction data processing method 100 are shown.
[0056] In summary, according to the blockchain-based transaction data processing method and device of the embodiment of the present disclosure, by defining the information that needs to be protected by privacy in a modular vector manner, the part that needs to be protected by privacy in any transaction (including but not limited to data, processes, steps, etc.) can be privacy processed, so that in the same transaction, both the privacy of sensitive data can be protected and the openness and transparency of non-sensitive data can be maintained. Using zero-knowledge proof to process and verify data, the specific content of sensitive data is not exposed during the processing and transmission process, and the correctness of the data processing results can be guaranteed. Compared with the traditional method of encrypting transaction data one by one, the efficiency of privacy protection can be improved.
[0057] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the device and method according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, a program segment or an instruction, and a part of the module, a program segment or an instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0058] Unless the context clearly indicates otherwise, the singular form of the words used herein and in the appended claims includes the plural and vice versa. Thus, when referring to the singular, the plural form of the corresponding term is generally included. Similarly, the words "comprise" and "include" are to be interpreted as inclusive rather than exclusive. Likewise, the terms "include" and "or" should be interpreted as inclusive unless such interpretation is expressly prohibited herein. Where the term "example" is used herein, particularly when it is located after a group of terms, the "example" is merely exemplary and illustrative and should not be considered exclusive or comprehensive.
[0059] Further aspects and scopes of adaptability become apparent from the description provided herein. It should be understood that various aspects of the present application can be implemented individually or in combination with one or more other aspects. It should also be understood that the description and specific embodiments herein are intended for purposes of illustration only and are not intended to limit the scope of the present application.
[0060] Several embodiments of the present disclosure are described in detail above, but it is obvious that those skilled in the art can make various modifications and variations to the embodiments of the present disclosure without departing from the spirit and scope of the present disclosure. The protection scope of the present disclosure is defined by the attached claims.
Claims
1. A transaction data processing method based on blockchain, characterized in that: include: Deconstructing the transaction code into multiple functional modules, and constructing a privacy vector of the transaction according to the privacy protection requirements of the functional modules; Input the functional module and the corresponding privacy vector into a zero-knowledge proof coprocessor to generate a circuit module for privacy protection data and its corresponding verification module; According to the privacy vector, reconstructing the functional module to generate a smart contract module, wherein the smart contract module includes the verification module; as well as The smart contract module is deployed on the blockchain, the circuit module is deployed in the off-chain system, the transaction is sent to each full node of the blockchain network, and each full node calls the locally stored smart contract module to execute and verify the transaction.
2. The transaction data processing method based on blockchain according to claim 1 is characterized in that: Each element value in the privacy vector corresponds to the privacy processing requirement of the functional module. If the functional module requires privacy protection, the corresponding element value is 1; if the functional module does not require privacy protection, the corresponding element value is 0.
3. The transaction data processing method based on blockchain according to claim 1 is characterized in that: The circuit module for inputting the functional module and the corresponding privacy vector into the zero-knowledge proof coprocessor to generate privacy protection data and its corresponding verification module include: If the element value of the privacy vector corresponding to the functional module is 1, the functional module is generated into a circuit module and a corresponding verification module; If the element value of the privacy vector corresponding to the function module is 0, the function module is not processed and is directly output.
4. The transaction data processing method based on blockchain according to claim 1 is characterized in that: The off-chain system interacts with the blockchain through an oracle, the input end of the oracle runs on the blockchain, and the output end of the oracle is connected to the calling interface of the off-chain system so as to call the zero-knowledge proof generated by a specific circuit module through the calling interface.
5. The transaction data processing method based on blockchain according to claim 4 is characterized in that: The function module is reconstructed to generate a smart contract module according to the privacy vector, and the smart contract module includes the verification module including: If the element value of the privacy vector corresponding to the functional module is 1, the oracle is called to execute the circuit module of the off-chain system, the zero-knowledge proof returned by the circuit module is obtained, and the zero-knowledge proof is used as the input of the verification module to obtain the verification result; If the element value of the privacy vector corresponding to the function module is 0, the function module is directly executed.
6. The transaction data processing method based on blockchain according to claim 1 is characterized in that: The step of deploying the smart contract module on the blockchain, deploying the circuit module in the off-chain system, sending the transaction to each full node of the blockchain network, and each full node calling the locally stored smart contract module to execute and verify the transaction includes: If the current transaction function does not require privacy processing, the execution result is obtained through the function module processing. If the current transaction function requires privacy processing, the oracle calls the circuit module of the off-chain system to obtain zero-knowledge proof, calls the verification module to verify the zero-knowledge proof, and returns the execution result; Each full node packages the execution result into a new block and broadcasts it to other nodes in the blockchain network; When any node receives the new block, it stops the current operation and verifies the new block. If the verification passes, the block is added to the end of the local blockchain. If more than 50% of the full nodes in the blockchain network verify that the new block is valid and add the block to the end of the local blockchain, other functions of the transaction will continue to be executed and verified. Otherwise, the system will report an error and the transaction will be terminated.
7. The transaction data processing method based on blockchain according to claim 6 is characterized in that: If the current transaction function requires privacy processing, the oracle calls the circuit module of the off-chain system to obtain zero-knowledge proof, calls the verification module to verify the zero-knowledge proof, and returns the execution result including: Inputting the output of the transaction into the circuit module to generate a zero-knowledge proof; The zero-knowledge proof is input into the verification module. If the result is True, it proves that the transaction is executed correctly and the result has not been tampered with during and after the execution. If the result is False, it proves that there is a problem with the transaction.
8. The transaction data processing method based on blockchain according to claim 7 is characterized in that: After the transaction execution and verification are completed, the processes or data that require privacy protection or do not contain sensitive data are not disclosed on the blockchain, and other processes or data that do not require privacy protection or do not contain sensitive data are disclosed on the blockchain.
9. A transaction data processing device based on blockchain, characterized in that: The device comprises: at least one processor; and at least one memory storing a computer program; Wherein, when the computer program is executed by the at least one processor, the device performs the steps of the blockchain-based transaction data processing method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the computer program implements the steps of the blockchain-based transaction data processing method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Smart contract authentication data privacy protection method based on zero knowledge proof
CN109614820A
Joint credit investigation method and system based on block chain and verification calculation
CN115297119A
Privacy protection block chain-oriented transaction supervision method and device
CN115829754A
Accounting block chain-based privacy protection smart contract implementation method capable of asking responsibility
CN117290887A