Blockchain-based Transaction Data Processing Method and Device
A modular vector-based approach with zero-knowledge proofs addresses the privacy issues in block chain transactions by protecting sensitive data while maintaining transparency and integrity, improving privacy protection efficiency.
Patent Information
- Application Number
- CN202510266338.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-03-07
AI Technical Summary
The problem of sensitive information exposure in blockchain transactions, existing encryption technology leads to slow transaction processing speed and inability to effectively protect the privacy of transactions.
The transaction code is deconstructed into multiple functional modules, a privacy vector is constructed according to privacy protection needs, a zero-knowledge proof coprocessor is used to generate circuit modules and verification modules, and a system on-chain processing transaction data is combined with the on-chain system to achieve privacy protection through smart contracts and oracles.
Without exposing sensitive information, maintain transaction transparency and credibility, improve privacy protection efficiency, and ensure the correctness of data processing results.
Smart Images

Figure CN119760785B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of blockchain technology. Specifically, it relates to a method and apparatus for processing transaction data based on blockchain. Background Art
[0002] Blockchain technology has the characteristics of decentralization, openness, transparency, and immutability, making it an ideal technical framework in fields such as finance, supply chain management, and digital identity. However, precisely because the transaction records on the blockchain are publicly 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 the buyer and seller, etc.) will be known to external third parties. Once a transaction data is recorded on the blockchain, even the parties involved cannot revoke or modify this information, which means that transactions involving personal or corporate sensitive data cannot be hidden or deleted after they occur.
[0003] To address the privacy exposure problem in blockchain transactions, encryption technologies are usually used to protect transaction data. For example, symmetric encryption, asymmetric encryption, and zero-knowledge proof. This approach requires encrypting the data in the transaction one by one, resulting in a slower transaction processing speed. Moreover, encryption is usually for protecting the data itself, and for other aspects of the transaction (such as transaction processes, links in the transaction, and roles of all parties, etc.), encryption technologies cannot provide sufficient privacy protection. Summary of the Invention
[0004] Embodiments described herein provide a method and apparatus for processing transaction data based on blockchain, and a computer-readable storage medium storing a computer program.
[0005] According to a first aspect of the present disclosure, there is provided a method for processing transaction data based on blockchain, including: deconstructing a transaction code into multiple functional modules, 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-protected data and its corresponding verification module; reconstructing the functional modules into a smart contract module according to the privacy vector, where 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, and sending the transaction to each full node in the blockchain network, and each full node calls the smart contract module stored locally 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, its 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, inputting a privacy vector and a functional module into a zero - knowledge proof coprocessor to obtain a circuit module and its corresponding verification module includes: if the element value of the privacy vector corresponding to the functional module is 1, then generate a circuit module and a corresponding verification module for the functional module; if the element value of the privacy vector corresponding to the functional module is 0, then do not process the functional module and directly output the functional module.
[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 call interface of the off - chain system, so as to call the zero - knowledge proof generated by a specific circuit module through the call interface.
[0009] In some embodiments of the present disclosure, according to the privacy vector, reconstruct the functional module to generate a smart contract module. The smart contract module includes a verification module, which includes: if the element value of the privacy vector corresponding to the functional module is 1, then call the oracle 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 a verification result; if the element value of the privacy vector corresponding to the functional module is 0, then directly execute the functional module.
[0010] In some embodiments of the present disclosure, deploy the smart contract module on the blockchain, deploy the circuit module on the off - chain system, and send a transaction 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, then obtain an execution result through processing by the functional module; if the current transaction function requires privacy processing, then obtain a zero - knowledge proof by calling the circuit module of the off - chain system through the oracle, call the verification module to verify the zero - knowledge proof, and return 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 the new block, then stop the current operation, check the new block. If the check passes, add the block 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, then continue to execute and verify other functions of the transaction, otherwise the system reports an error and the transaction terminates.
[0011] In some embodiments of the present disclosure, if the current transaction function requires privacy processing, an oracle is used to call the circuit module of the off-chain system to obtain a zero-knowledge proof, and a verification module is called to verify the zero-knowledge proof. The returned execution result 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 result is True, it proves that the transaction is executed correctly and the result has not been tampered with during and after the execution process. 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 publicly disclosed on the blockchain, while the processes or data that do not require privacy protection or do not contain sensitive data are publicly disclosed on the blockchain.
[0013] According to a second aspect of the present disclosure, there is provided a transaction data processing device based on a blockchain. The device includes at least one processor; and at least one memory storing a computer program. When the computer program is executed by the at least one processor, the device is caused to: decompose the transaction code into multiple functional modules, 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 a zero-knowledge proof coprocessor to generate a circuit module for privacy protection data and its corresponding verification module; reconstruct the functional modules into a smart contract module according to the privacy vector, the smart contract module including a verification module; and deploy the smart contract module on the blockchain, deploy the circuit module in the off-chain system, and 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.
[0014] In some embodiments of the present disclosure, when the computer program is executed by the at least one processor, the device is caused to input the privacy vector and the functional modules into the zero-knowledge proof coprocessor by the following operations to obtain the circuit module and its corresponding verification module:
[0015] If the element value of the privacy vector corresponding to the functional module is 1, the functional module is used to generate a circuit module and its 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 the functional module is directly output.
[0016] In some embodiments of the present disclosure, when the computer program is executed by the at least one processor, the device is caused to execute and verify the transaction by the following operations:
[0017] If the current transaction function does not require privacy processing, the execution result is obtained through function module processing. If the current transaction function requires privacy processing, a zero-knowledge proof is obtained by the oracle calling the circuit module of the off-chain system, and 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 in the blockchain network; when any node receives the new block, it stops the current operation, 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, the other functions of the transaction continue to be executed and verified, otherwise the system reports an error and the transaction terminates.
[0018] According to a third aspect of the present disclosure, there is provided a computer-readable storage medium storing a computer program, 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.
[0019] According to the blockchain-based transaction data processing method and apparatus of the embodiments of the present disclosure, by defining the information that needs to be protected by privacy in a modular vector manner, privacy processing can be performed on the parts that need to be protected by privacy in any transaction (including but not limited to data, processes, steps, etc.), so that both sensitive data privacy and non-sensitive data transparency can be maintained in the same transaction. Using zero-knowledge proof for data processing and verification makes the specific content of sensitive data not exposed during processing and transmission, and at the same time can ensure the correctness of the data processing result. 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
[0020] 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 understood that the following described drawings only relate to some embodiments of the present disclosure and do not limit the present disclosure, where:
[0021] Figure 1 An exemplary flowchart showing a blockchain-based transaction data processing method 100 according to an embodiment of the present disclosure;
[0022] Figure 2 It is a schematic diagram of the transaction privacy protection processing logic architecture according to an embodiment of the present disclosure;
[0023] Figure 3 It is a schematic block diagram of a blockchain-based transaction data processing apparatus 300 according to an embodiment of the present disclosure.
[0024] It should be noted that the elements in the drawings are schematic and not drawn to scale. Detailed implementation manners
[0025] In order to make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings. Apparently, the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments obtained by those skilled in the art based on the described embodiments of the present disclosure without creative efforts shall also fall within the scope of protection of the present disclosure.
[0026] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the subject matter of the present disclosure belongs. Further, it will be understood that terms such as those defined in commonly used dictionaries shall be interpreted as having a meaning that is 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 manner unless expressly defined herein otherwise.
[0027] In the privacy protection application of the 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 the method of ZKP and modular vectors, privacy protection is achieved in blockchain transactions, and the transparency and credibility of the transaction can be maintained without exposing sensitive information. Modular vectors enable the blockchain network to flexibly process data according to its sensitivity, protecting only the data that requires privacy protection in a transaction and not processing any information that can be made public. For example, the amount of the transaction or the identity information of the buyer and seller can be encrypted and hidden through ZKP, while other content that does not involve privacy can still be publicly transparent on the blockchain.
[0028] Figure 1 An exemplary flowchart of a blockchain-based transaction data processing method 100 according to an embodiment of the present disclosure is shown. Referring to Figure 1 as shown, at block S102 of Figure 1 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.
[0029] A privacy vector is constructed according to the privacy protection requirements of the transaction data. The privacy vector is used to distinguish whether sub-processes or data in the transaction process require privacy protection. In some embodiments of the present disclosure, a privacy vector of dimension n is constructed , and each element value a in vector A iFor the privacy processing requirements corresponding to the trading process or data, if the trading 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, trade secrets, etc., and these data need to be protected through encryption and ZKP. Public data includes the trading time of the blockchain, block hash, transaction hash, etc., and these data do not involve privacy and can be stored on the blockchain in an open and transparent manner.
[0030] The Code Modulizer can divide a piece of complex code into several independent and clearly defined functional modules according to functions, enabling each module to focus on a specific function, such as data verification, asset transfer, user authentication, transaction logging, etc., thereby improving the maintainability, scalability, and flexibility of the code. Suppose it is decomposed into n functional modules: , the input interface corresponding to each functional module is , and the output interface is . Each module performs different functions, such as data verification, asset transfer, etc. By disassembling the transaction into independent modules, each module can be processed more flexibly.
[0031] According to some embodiments of the present disclosure, for the transaction , is the processing code of the transaction, is the privacy vector of the transaction. Input to the Code Modulizer to obtain the functional module .
[0032] Subsequently, in block S104, input the functional module and the corresponding privacy vector into the zero-knowledge proof coprocessor to generate the circuit module of the privacy-protected data and its corresponding verification module.
[0033] The zero-knowledge proof coprocessor (ZKP-Coprocessor) aims to convert the transaction logic into a zero-knowledge proof circuit and generate the corresponding proof to ensure that the privacy data will not be directly exposed. This circuit describes each step of the transaction and how to verify its correctness, and is composed 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 ensure that the transaction complies with the system rules, such as the sender actually owns the amount, the transaction signature is valid, the recipient address is legal, etc. Zero-knowledge proof allows one party (the prover) to prove to another party (the verifier) that a certain statement is correct without revealing any information other than the correctness. Suppose there is a piece of transaction code, including: the sender and recipient of the transaction, the transfer amount, verifying whether the balance is sufficient, and confirming whether the transaction is legal. The logic of the transaction is as follows:
[0034] python Copy Code
[0035] if sender_balance >= transfer_amount:
[0036] sender_balance -= transfer_amount
[0037] receiver_balance += transfer_amount
[0038] transaction_valid = True
[0039] else:
[0040] transaction_valid = False
[0041] The ZKP-Coprocessor tools, such as Circom or SnarkyJS, can be used to compile the above transaction logic into a circuit. The input layer of the circuit takes sender_balance, receiver_balance, and transfer_amount as inputs. The intermediate calculation layer determines whether sender_balance >= transfer_amount, which can be implemented by a comparison circuit. If the balance is sufficient, the deduction and transfer operations are performed. The subtraction and addition operations need to be represented by an addition circuit and a subtraction circuit. The output layer outputs transaction_valid, indicating whether the transaction is successful. The compiled circuit can be used as part of a zero-knowledge proof by generating a proof to show 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).
[0042] Suppose that among n functional modules, m modules perform operations that require privacy protection or contain sensitive data that requires privacy protection, that is, the number of elements with a value of 1 in the original vector is m. . Input these m modules into the ZKP-Coprocessor, which will generate corresponding m circuit modules and corresponding verification modules. The input interface corresponding to each circuit module is , and the output interface . The input interface corresponding to each verification module is , and the output interface is 。The circuit module is used to execute the parts that require privacy protection and generate a 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).
[0043] If the element value of the privacy vector corresponding to the functional module is 1, the circuit module and the corresponding verification module generated by the functional module will be generated; if the element value of the privacy vector corresponding to the functional module is 0, the functional module will not be processed and the functional module will be directly output.
[0044] In some embodiments of the present disclosure, the functional module and the privacy vector are input to the ZKP-Coprocessor to obtain the circuit module and the verification module. The circuit module Among them, when is 0; when when is . The verification module , among which, when is 0; when when is .
[0045] 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 call interface Interface of the off-chain system, which is responsible for calling a specific circuit module to generate a zero-knowledge proof through the call interface.
[0046] For example, the off-chain system runs the circuit module , the call interface of the entire system is Interface(), its input value is i, and the 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 require privacy protection processing, the functional module is used, and will be deployed and run on the blockchain (each full node of the network). For those that require privacy protection processing, the circuit module is used to generate a proof first , and then the verification module is used to verify . Among them, the circuit module is deployed in the above off-chain system. The verification module Then it runs on the blockchain (each full node of the network).
[0047] Subsequently, in block S106, according to the privacy vector, the functional module is reconstructed to generate an intelligent contract module, and the intelligent contract module includes a verification module.
[0048] According to the element values 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 functional module is 1, then 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 functional module is 0, then the functional module is directly executed.
[0049] In some embodiments of the present disclosure, the privacy vector A and are used as inputs, and the functional module is reconstructed into an intelligent contract module .
[0050] The intelligent contract module is used to execute the 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. In some embodiments of the present disclosure, the intelligent contract module has the following pseudocode:
[0051]
[0052] The execution logic of the intelligent contract module is: if the element value of the privacy vector corresponding to the functional module is 1, then 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 functional module is 0, then the functional module is directly executed. That is to say, when function i does not require privacy processing ( ), the originally constructed module is executed ; when function i requires privacy processing ( ), the oracle is called to execute the circuit module of the off-chain system . The generated zero-knowledge proof is used as the input of the verification module to obtain the verification result .
[0053] Figure 2 is a schematic diagram of the transaction privacy protection processing logic architecture according to an embodiment of the present disclosure. Referring to Figure 2 shown, for transaction , where is the processing code of the transaction, is the privacy vector for the transaction, and is input to the code module disassembler to be decomposed into functional modules .
[0054] The functional modules and the privacy vector are input to the zero-knowledge proof coprocessor to obtain a circuit module ( , where when is 0; when when ), and a verification module ( , where when is 0; when when ). The functional module ( ) and the privacy vector are input to the transaction code synthesizer to obtain a smart contract module ( ).
[0055] The smart contract module ( ) and the verification module ( ) are deployed to the blockchain, and 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 require privacy processing ( ), the originally constructed module is executed; when function j requires privacy processing ( ), the oracle is called to execute the off-chain circuit module. Performing the above-described transaction privacy protection processing for each transaction can ensure that processes or data that require privacy protection or contain sensitive data will not be publicly 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 queryable on the blockchain.
[0056] Finally, in block S108, the smart contract module is deployed on the blockchain, the circuit module is deployed in the off-chain system, and the 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.
[0057] First, start the blockchain network to ensure that there are enough nodes participating in the network's consensus mechanism to handle subsequent transactions and block verifications.
[0058] In some embodiments of the present disclosure, the transaction Each full node submitted to the blockchain network. A full node is a node in the blockchain network that can fully verify and store blockchain data. These full nodes receive transactions and perform corresponding operations, such as invoking smart contracts, verifying transactions, etc. Each full node invokes the smart contract module stored locally. When a transaction arrives at each full node, the node checks whether there is a local smart contract module to decide how to process the transaction. A smart contract is an automated program on the blockchain used to execute, verify, and record transactions.
[0059] If the current transaction function does not require privacy processing, the execution result is directly obtained through the function module. If the current transaction function requires privacy processing, a zero-knowledge proof is obtained by the oracle calling the circuit module of the off-chain system, 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 incorrect or inconsistent, resulting in the data not passing the verification. If the return value is true, the transaction will continue, proving that the transaction is executed correctly and the result has not been tampered with during and after the execution process.
[0060] Each full node packs the execution result into a new block and broadcasts the block to other nodes in the blockchain network. These new blocks contain the verified transactions, transaction results, and other possible metadata, forming part of the blockchain.
[0061] 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 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.
[0062] 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, then the transaction is considered successful and the transaction process continues to execute. If less than 50% of the nodes verify and pass, 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 guarantee the decentralization and security of the blockchain. The same steps are used to continue executing and verifying other functions of the transaction until all functions of the transaction are executed and verified.
[0063] After the transaction execution and verification are completed, (m) processes or data that require privacy protection or do not contain sensitive data are not publicly available on the blockchain, and the other (n - m) processes or data that do not require privacy protection or do not contain sensitive data are publicly available on the blockchain.
[0064] 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 proofs, the blockchain can ensure the transparency and verifiability of transactions while guaranteeing data privacy. At the same time, based on the consensus mechanism among nodes, the entire system ensures a decentralized and reliable transaction verification process.
[0065] 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. As Figure 3 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 can execute the steps of the blockchain-based transaction data processing method 100 as Figure 1 shown. In one example, the device 300 can be a computer device or a cloud computing node.
[0066] The device 300 can decompose the transaction code into multiple functional modules, construct a privacy vector for the transaction according to the privacy protection requirements of the functional modules; input 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; reconstruct the functional modules according to the privacy vector 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 an off-chain system, and send the transaction to each full node in the blockchain network. Each full node calls the smart contract module stored locally to execute and verify the transaction.
[0067] In an embodiment of the present disclosure, the processor 310 can 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 can 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 memory, etc.
[0068] In addition, in an embodiment of the present disclosure, the device 300 may also include an input device 330, such as a keyboard, a mouse, etc., for inputting transaction information. Additionally, the device 300 may further 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.
[0069] In other embodiments of the present disclosure, there is also provided a computer-readable storage medium storing a computer program, wherein the computer program can implement the steps of the blockchain-based transaction data processing method 100 as Figure 1 shown when executed by a processor.
[0070] In summary, according to the blockchain-based transaction data processing method and apparatus of the embodiments of the present disclosure, by defining the information that needs to be protected by privacy in the form of modular vectors, privacy processing can be performed on the parts that need to be protected by privacy in any transaction (including but not limited to data, processes, steps, etc.), so that both sensitive data privacy can be protected and non-sensitive data can be kept publicly transparent in the same transaction. Using zero-knowledge proofs for data processing and verification makes the specific content of sensitive data not exposed during processing and transmission, while ensuring the correctness of the data processing results. Compared with the traditional method of encrypting transaction data one by one, the efficiency of privacy protection can be improved.
[0071] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of the apparatus and methods according to multiple embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of an instruction, and the module, the segment of a program, or the part of an instruction contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the blocks may occur in an order different from that marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0072] Unless the context clearly indicates otherwise, the singular forms of the words used in this specification and the appended claims include the plural, and vice versa. Thus, when referring to the singular, the plural of the corresponding term is generally included. Similarly, the terms "comprising" and "including" will be interpreted as inclusive rather than exclusive. Likewise, the term "including" and "or" should be interpreted as inclusive, unless such an interpretation is explicitly prohibited herein. Where the term "example" is used in this specification, especially when it is located after a group of terms, the "example" is merely exemplary and illustrative, and should not be considered exclusive or extensive.
[0073] Further aspects and scopes of adaptability become apparent from the description provided herein. It should be understood that the various aspects of the present application can be implemented alone or in combination with one or more other aspects. It should also be understood that the description and specific embodiments herein are for illustrative purposes only and are not intended to limit the scope of the present application.
[0074] The foregoing has described in detail several embodiments of the present disclosure. Obviously, 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 appended claims.
Claims
1. A transaction data processing method based on blockchain, characterized in that, Including: Decompose the transaction code into multiple functional modules, and construct a privacy vector for the transaction according to the privacy protection requirements of the functional modules; Input the functional modules and the corresponding privacy vectors into a zero-knowledge proof coprocessor to generate a circuit module for privacy-protected data and its corresponding verification module; Reconstruct the functional modules according to the privacy vectors to generate a smart contract module, and the smart contract module includes the verification module; And Deploy the smart contract module on the blockchain, deploy the circuit module in the off-chain system, and send the transaction to each full node in 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, obtain the execution result through the functional module. If the current transaction function requires privacy processing, obtain the zero-knowledge proof by calling the circuit module of the off-chain system through the oracle, call the verification module to verify the zero-knowledge proof, and return 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, stop the current operation, verify the new block. If the verification passes, add the block 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; After the transaction execution and verification are completed, the processes or data that require privacy protection or do not contain sensitive data are not publicly disclosed on the blockchain, and other processes or data that do not require privacy protection or do not contain sensitive data are publicly disclosed on the blockchain.
2. The method for processing transaction data based on blockchain according to claim 1, wherein Each element value in the privacy vector corresponds to the privacy processing requirement of the functional module. If the functional module requires privacy protection, its corresponding element value is 1; if the functional module does not require privacy protection, the corresponding element value is 0.
3. The blockchain-based transaction data processing method according to claim 1, wherein The inputting the functional modules and the corresponding privacy vectors into a zero-knowledge proof coprocessor to generate a circuit module for privacy-protected data and its corresponding verification module includes: If the element value of the privacy vector corresponding to the functional module is 1, generate a circuit module and its corresponding verification module for the functional module; If the element value of the privacy vector corresponding to the functional module is 0, do not process the functional module and directly output the functional module.
4. The blockchain-based transaction data processing method according to claim 1, wherein 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 call interface of the off-chain system, so as to call the zero-knowledge proof generated by a specific circuit module through the call interface.
5. The method for processing transaction data based on blockchain according to claim 4, wherein The reconstructing the functional modules according to the privacy vectors to generate a smart contract module, and the smart contract module includes the verification module includes: If the element value of the privacy vector corresponding to the functional module is 1, call the oracle 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 functional module is 0, then directly execute the functional module.
6. The method for processing transaction data based on blockchain according to claim 1, characterized in that If the current transaction function needs to perform privacy processing, then obtain a zero-knowledge proof by calling the circuit module of the off-chain system through an oracle, and call the verification module to verify the zero-knowledge proof. The returned execution result includes: Input the output of the transaction into the circuit module to generate a zero-knowledge proof; Input the zero-knowledge proof 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 process. If the result is False, it proves that there is a problem with the transaction.
7. A transaction data processing device based on a blockchain, characterized in that, The device includes: 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 is caused to execute the steps of the blockchain-based transaction data processing method according to any one of claims 1 to 6.
8. A computer-readable storage medium storing a computer program, characterized in that, The computer program, when executed by a processor, implements the steps of the blockchain-based transaction data processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Joint credit investigation method and system based on block chain and verification calculation
CN115297119A