Zero-knowledge proof generation method, proof system, computing service and storage medium
By setting the first system and the second system in the zero-knowledge proof generation each process instructions and generating partial proofs, and aggregating the generation of complete proofs, the problem of inefficient generation of zero-knowledge proofs in the prior art is solved, and more efficient proof generation is achieved.
Patent Information
- Application Number
- CN202411381262.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-03-04
AI Technical Summary
When the existing zero-knowledge proof generation method processes algorithms with high computational cost, the process of generating proofs takes a long time, resulting in inefficiency and affecting user experience and system efficiency.
By setting up the first system and the second system, each obtain and process instructions in the target execution object, generate partial proofs using the respective proof circuits, and aggregate them to generate a complete zero-knowledge proof.
This method can reduce the time required for proof generation, improve the efficiency of zero-knowledge proof generation, and is suitable for scenarios where rapid response is required.
Smart Images

Figure CN119561692A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a zero-knowledge proof generation method, proof system, computing service and storage medium. Background Art
[0002] With the continuous advancement of blockchain technology, the application of zero-knowledge proof (ZKP) in blockchain has become more and more common. The zero-knowledge proof virtual machine (zkVM) is an execution environment used to generate and verify zero-knowledge proof in blockchain systems.
[0003] However, the current zkVM takes a long time to generate proofs. Especially when dealing with algorithms with large computational workloads (such as hash algorithms), the proof generation process is very time-consuming and the proof generation efficiency is low. For scenarios that require rapid response, it will seriously affect user experience and system efficiency. Therefore, improving the proof generation efficiency is of great significance. Summary of the invention
[0004] The main technical problem solved by this application is to provide a zero-knowledge proof generation method, proof system, computing service and storage medium, which can improve the efficiency of proof generation.
[0005] To solve the above technical problems, a technical solution adopted in the present application is: to provide a zero-knowledge proof generation method, the method comprising: a first system obtains a first instruction and a second instruction in a target execution object; a first proof circuit in the first system is used to generate a first proof based on a first execution trajectory of the first instruction, and a second proof circuit in the second system is used to generate a second proof based on a second execution trajectory of the second instruction; the first proof and the second proof are aggregated to obtain a zero-knowledge proof about the target execution object; the zero-knowledge proof is used to prove that the execution process of the target execution object is correct.
[0006] Among them, the first system is used to send the acquired second instruction to the second system, and receive the second proof sent by the second system; the first proof circuit is a proof circuit associated with the first instruction, and the second proof circuit is a proof circuit associated with the second instruction.
[0007] Among them, the first execution trajectory is obtained when the first system executes the first instruction, and the second execution trajectory is obtained when the second system executes the second instruction; using the first proof circuit in the first system to generate a first proof based on the first execution trajectory of the first instruction, including: using the first proof circuit to verify based on the first execution trajectory to determine whether the first execution trajectory satisfies the first constraint condition; in response to satisfying the first constraint condition, generating a first proof based on the first execution trajectory; the first proof is used to prove that the execution process of the first instruction is correct; using the second proof circuit in the second system to generate a second proof based on the second execution trajectory of the second instruction, including: using the second proof circuit to verify based on the second execution trajectory to determine whether the second execution trajectory satisfies the second constraint condition; in response to satisfying the second constraint condition, generating a second proof based on the second execution trajectory; the second proof is used to prove that the execution process of the second instruction is correct.
[0008] Among them, the first instruction includes several first sub-instructions, the second instruction includes several second sub-instructions, the first execution trajectory includes a trajectory formed by combining the execution results corresponding to each first sub-instruction in the execution order of the several first sub-instructions, and the second execution trajectory includes a trajectory formed by combining the execution results corresponding to each second sub-instruction in the execution order of the several second sub-instructions; and / or, the target execution object includes a target execution program.
[0009] The second proof circuit is a user-defined proof circuit loaded from the first system to the second system; and / or the second proof circuit is customized using a domain-specific language.
[0010] Among them, the first system is a system obtained by separating the pre-compiled computing components in the zero-knowledge proof virtual machine, the second system is a system including the pre-compiled computing components, the first system and the second system are different systems independent of each other, and the first system and the second system are communicatively connected; and / or, aggregating the first proof and the second proof to obtain a zero-knowledge proof about the target execution object, including: using a preset recursive proof technology to aggregate the first proof and the second proof to obtain a zero-knowledge proof about the target execution object.
[0011] To solve the above technical problems, another technical solution adopted in the present application is: providing a zero-knowledge proof system, including: a first system and a second system, the first system and the second system are communicatively connected; the first system is used to obtain the first instruction and the second instruction in the target execution object, and use the first proof circuit in the first system to generate a first proof based on the first execution trajectory of the first instruction, and receive the second proof generated by the second system, and aggregate the first proof and the second proof to obtain a zero-knowledge proof about the target execution object, and the zero-knowledge proof is used to prove that the execution process of the target execution object is correct; the second system is used to generate a second proof based on the second execution trajectory of the second instruction using the second proof circuit in the second system after receiving the second instruction sent by the first system.
[0012] Among them, the first system is a system obtained by separating the pre-compiled computing components in the zero-knowledge proof virtual machine, the second system is a system including the pre-compiled computing components, and the first system and the second system are different systems independent of each other; and / or, the first proof circuit is used to verify based on the first execution trajectory to determine whether the first execution trajectory satisfies the first constraint condition, and generate a first proof based on the first execution trajectory when the first execution trajectory satisfies the first constraint condition; the first proof is used to prove that the execution process of the first instruction is correct; the second proof circuit includes a user-defined proof circuit, which is used to verify based on the second execution trajectory to determine whether the second execution trajectory satisfies the second constraint condition, and generate a second proof based on the second execution trajectory when the second execution trajectory satisfies the second constraint condition; the second proof is used to prove that the execution process of the second instruction is correct.
[0013] To solve the above technical problems, another technical solution adopted in the present application is: to provide a computing service, including a dynamic loading module and a configuration file manager coupled to each other, the configuration file manager is used to read and parse the circuit configuration file, and the dynamic loading module is used to dynamically load the second proof circuit in the circuit configuration file to implement the above method.
[0014] In order to solve the above technical problem, another technical solution adopted by the present application is: providing a computer-readable storage medium for storing program instructions, which can be executed to implement the above method.
[0015] In the above scheme, the first system obtains the first instruction and the second instruction in the target execution object; the first proof circuit in the first system is used to generate the first proof based on the first execution track of the first instruction, and the second proof circuit in the second system is used to generate the second proof based on the second execution track of the second instruction; the first proof and the second proof are aggregated to obtain a zero-knowledge proof about the target execution object; the zero-knowledge proof is used to prove that the execution process of the target execution object is correct. It can be seen that the present application sets up the first system and the second system, each system is used to generate the proof of its corresponding part, and finally the proof of each part is integrated to obtain the complete proof of the target execution object. Compared with the method of generating all proofs by only using a single system, the present application uses different systems to generate the proof of the corresponding part, which can reduce the time required for proof generation, and thus improve the efficiency of proof generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flowchart of an embodiment of a method for generating a zero-knowledge proof provided by the present application;
[0017] Figure 2 It is a schematic diagram of the framework of an embodiment of a zero-knowledge proof system provided by the present application;
[0018] Figure 3 It is a schematic diagram of a framework of an embodiment of an electronic device provided by the present application;
[0019] Figure 4 It is a schematic diagram of a framework of an embodiment of a computing service provided by the present application;
[0020] Figure 5 It is a schematic diagram of the framework of the computer-readable storage medium provided by this application. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and effect of the present application clearer and more specific, the present application is further described in detail below with reference to the accompanying drawings and examples.
[0022] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0023] See also Figure 1 , Figure 1 is a flowchart of an embodiment of a method for generating zero-knowledge proof provided by the present application. It should be noted that if there are substantially the same results, this embodiment does not Figure 1 The process sequence shown is limited. Figure 1 As shown, this embodiment includes:
[0024] S11: The first system obtains the first instruction and the second instruction in the target execution object.
[0025] This embodiment is used to combine two systems to generate a complete zero-knowledge proof of the target execution object, wherein each system is responsible for generating the corresponding partial proof, and then the first system aggregates the partial proofs to generate a complete zero-knowledge proof of the target execution object. The complete zero-knowledge proof of the target execution object is used to prove that the execution process of the target execution object is correct. In the case of proving that the execution process of the target execution object is correct, it means that the execution result obtained by the target execution object for processing the input data is credible.
[0026] That is, the generated zero-knowledge proof is a proof of the authenticity and integrity of the execution result of the target execution object. This proof can enable the verifier to be sure that the execution result of the target execution object is authentic without leaking sensitive information during the execution process of the target execution object.
[0027] The execution subject of this embodiment is the first system, and the first system and the second system are different systems independent of each other, and the first system and the second system are in communication connection. Among them, the first system can send the acquired second instruction to the second system, and receive the second certificate sent by the second system.
[0028] In this embodiment, it is considered that in the case of a traditional zero-knowledge proof virtual machine with only a single proof system, all proof generation tasks are completed by the single proof system, and the time required for corresponding proof generation is relatively long, and the proof generation efficiency is low. To solve this problem, this embodiment distributes the proof generation tasks to different systems, and multiple different systems can process tasks in parallel, each generating proofs for the corresponding proof tasks. Compared with the method of using only a single system to generate all proofs, this embodiment uses different systems to generate proofs corresponding to their respective proof tasks, which can reduce the time required for proof generation and thus improve the proof generation efficiency.
[0029] In some embodiments, based on the above-mentioned zero-knowledge proof virtual machine, the pre-compiled computing components therein can be separated from the single proof system as the second system, and the system after the pre-compiled computing components are separated from the zero-knowledge proof virtual machine is used as the first system. Of course, the first system and the second system can also be rebuilt separately as needed, and the first system and the second system are used to execute different types of instructions. Among them, the number of the second system is at least one, and the number of the second system can be set according to needs, and is not specifically limited here.
[0030] In this embodiment, the target execution object can be but is not limited to a target execution program, and can also be a computing task, etc., wherein an instruction is an operation command that can be directly recognized and executed by a computer, which is used to tell the computer what operation to perform. The target execution object can be composed of multiple instructions.
[0031] In this embodiment, the multiple instructions in the target execution object include a first instruction and a second instruction, wherein the first instruction is an instruction that needs to be executed by the first system, and the second instruction is an instruction that needs to be executed by the second system. After obtaining the first instruction and the second instruction in the target execution object, during the process of executing the target execution object, if the first instruction is the first instruction, the first system executes the first instruction and records the execution trajectory of the first instruction during the execution process; if the second instruction is the second instruction, the first system sends the second instruction to the second system, and the second system executes the second instruction and records the execution trajectory of the second instruction during the execution process; wherein, in order to distinguish the execution trajectories corresponding to the first instruction and the second instruction respectively, the execution trajectory of the first instruction is called the first execution trajectory, and the execution trajectory corresponding to the second instruction is called the second execution trajectory.
[0032] In summary, the first execution trajectory is obtained when the first system executes the first instruction, and the second execution trajectory is obtained when the second system executes the second instruction. The first instruction includes a plurality of first sub-instructions, the second instruction includes a plurality of second sub-instructions, and the first execution trajectory includes a trajectory formed by combining the execution results corresponding to the first sub-instructions in the execution order of the plurality of first sub-instructions. The second execution trajectory includes a trajectory formed by combining the execution results corresponding to the second sub-instructions in the execution order of the plurality of second sub-instructions.
[0033] S12: Generate a first proof based on a first execution trace of the first instruction using a first proof circuit in the first system, and generate a second proof based on a second execution trace of the second instruction using a second proof circuit in the second system.
[0034] It should be noted that in order to prove the correctness of the execution process of the target execution object, it is necessary to prove the correctness of the execution of each instruction in the target execution object. Among them, in order to prove the correctness of the execution of each instruction, it is necessary to generate a corresponding proof circuit for each instruction or instruction sequence in the target execution object, and use the proof circuit corresponding to each instruction to prove the correctness of the execution of each instruction.
[0035] The proof circuit is the core component used to describe and execute computing tasks in zero-knowledge proof. It consists of a series of logic gates or constraints, which are responsible for processing input data and generating corresponding proofs. In zkVM, each computing task or algorithm can be mapped to one or more proof circuits, and different types of proof circuits can handle different types of computing tasks, such as hash operations, encryption operations, etc. These circuits run inside the zero-knowledge proof virtual machine and ultimately generate verifiable mathematical proofs.
[0036] Therefore, in this embodiment, the first proof circuit in the first system can be used to generate the first proof based on the first execution trace of the first instruction; the second proof circuit in the second system can be used to generate the second proof based on the second execution trace of the second instruction. The first proof circuit is a proof circuit associated with the first instruction, and the second proof circuit is a proof circuit associated with the second instruction.
[0037] It should be noted that each proof circuit is pre-defined with three parts: events, execution traces, and constraints. Each proof circuit corresponds to an independent set of events. Each event in the event set records the detailed information of the corresponding operation performed by the target execution object at a specific step. The detailed record of the event helps to accurately track each step of the execution of the target execution object, providing basic data for generating accurate proofs. The execution trace is filled in the trace table generated by the event, which describes the order and results of the instruction execution and all the steps and state changes experienced during the execution process. This trace shows how to reach the final state through a series of operations from the initial state, which is the key basis for generating proofs. Constraints are conditions that define the legality of operations or calculations. These constraints can be mathematical expressions or logical conditions, defining the relationship between input and output. Each instruction or operation has specific constraints, which ensure the legality of the operation and the correctness of the calculation. In addition, the main function of the constraint is to verify whether all operations in the execution trace meet the predetermined rules and conditions. In the process of generating zero-knowledge proofs, all operations must meet these constraints to generate valid proofs.
[0038] Therefore, in one embodiment, generating a first proof based on a first execution trace of a first instruction using a first proof circuit in a first system includes the following steps:
[0039] First, verifying based on the first execution trace using the first proof circuit to determine whether the first execution trace satisfies the first constraint condition.
[0040] Second, in response to satisfying the first constraint condition, generating a first proof based on the first execution trace; the first proof is used to prove that the execution process of the first instruction is correct.
[0041] The first constraint condition is a constraint condition predefined when generating the first proof circuit corresponding to the first instruction, and is used to verify whether all operations in the first execution trace of the first instruction meet the predefined first constraint condition. If the first execution trace satisfies the first constraint condition, it means that all operations in the first execution trace meet the preset constraint, and on this basis, a first proof is generated based on the first execution trace.
[0042] Similarly, generating a second proof based on a second execution trace of a second instruction using a second proof circuit in a second system includes the following steps:
[0043] First, verifying based on the second execution trace using the second proof circuit to determine whether the second execution trace satisfies the second constraint condition.
[0044] Second, in response to satisfying the second constraint condition, generating a second proof based on the second execution trace; the second proof is used to prove that the execution process of the second instruction is correct.
[0045] The second constraint condition is a constraint condition predefined when generating a second proof circuit corresponding to the second instruction, and is used to verify whether all operations in the second execution trace of the second instruction meet the predefined second constraint condition.
[0046] In some embodiments, considering that the design and optimization of the proof circuit directly affects the efficiency and performance of zero-knowledge proof, in some scenarios, the proof circuit can be customized based on actual scenarios and actual needs.
[0047] In some embodiments, considering that there are many types of blockchain underlying platforms, and zero-knowledge virtual machines (zkVM) have become an important basis for realizing cross-chain interactions, if there is only a single system of zero-knowledge virtual machines, if a new optimization circuit needs to be added when the single system is running, it is necessary to stop the operation of the single system, and then change the code therein, and restart the virtual single system after changing the code to perform the next operation. The whole process is time-consuming. In order to solve this problem, the first system can be set to have a dynamic loading function, so that when a new optimization circuit (second proof circuit) needs to be added, the first system loads the second proof circuit into the second system, which means that the user can load the optimization circuit of a specific algorithm or logic into the second system instantly without modifying or restarting the first system, thereby significantly improving the efficiency of proof generation. This design ensures that the proof system can continue to operate efficiently in a constantly changing demand environment.
[0048] Among them, the new optimized circuit (second proof circuit) is a proof circuit customized by the user according to actual needs, and after the user defines the second proof circuit, the first system loads the second proof circuit to the second system.
[0049] In some embodiments, in order to simplify the implementation of the customized second proof circuit, the second proof circuit may be customized using a domain-specific language (DSL).
[0050] Among them, DSL is a programming language designed specifically for a specific application field, which can express complex logic and constraints in a more concise and intuitive way. In this embodiment, DSL is used to describe the structure and logic of the zero-knowledge proof circuit. Users can use DSL to easily define specific operation rules, constraints, and interaction logic with the first system. By encapsulating the dynamic loading process under DSL, the deployment and update process of the entire customized second proof circuit is automated. Specifically, after the user defines the logic of the second proof circuit in DSL, the system will automatically generate the corresponding proof circuit and deploy it to the second system through the dynamic loading mechanism. This automated process not only lowers the user's technical threshold, but also reduces the risk of manual configuration errors. In addition, the introduction of DSL also enhances the security of the system. Due to the high specialization and simplicity of DSL, users can more clearly understand and control the behavior of the circuit, reducing potential security vulnerabilities. In addition, DSL makes the development and expansion of zero-knowledge proof circuits more modular, and users can easily define, test and update new circuit components to meet the increasingly diverse blockchain application needs.
[0051] S13: Aggregate the first proof and the second proof to obtain a zero-knowledge proof about the target execution object; the zero-knowledge proof is used to prove that the execution process of the target execution object is correct.
[0052] In this embodiment, the first proof and the second proof may be aggregated in an existing manner to obtain a zero-knowledge proof about the target execution object. Exemplarily, the first proof and the second proof may be aggregated using a preset recursive proof technology to obtain a zero-knowledge proof about the target execution object.
[0053] In the above scheme, the first system obtains the first instruction and the second instruction in the target execution object; the first proof circuit in the first system is used to generate the first proof based on the first execution track of the first instruction, and the second proof circuit in the second system is used to generate the second proof based on the second execution track of the second instruction; the first proof and the second proof are aggregated to obtain a zero-knowledge proof about the target execution object; the zero-knowledge proof is used to prove that the execution process of the target execution object is correct. It can be seen that the present application sets up the first system and the second system, each system is used to generate the proof of its corresponding part, and finally the proof of each part is integrated to obtain the complete proof of the target execution object. Compared with the method of generating all proofs by only using a single system, the present application uses different systems to generate the proof of the corresponding part, which can reduce the time required for proof generation, and thus improve the efficiency of proof generation.
[0054] See also Figure 2 , Figure 2 It is a framework diagram of an embodiment of a zero-knowledge proof system provided by the present application. In this embodiment, the proof system 20 includes a first system 21 and a second system 22, and the first system 21 and the second system 22 are connected in communication. Among them, the first system 21 is used to obtain the first instruction and the second instruction in the target execution object, generate a first proof based on the first execution trajectory of the first instruction using the first proof circuit in the first system, and receive the second proof generated by the second system 22, and aggregate the first proof and the second proof to obtain a zero-knowledge proof about the target execution object, and the zero-knowledge proof is used to prove that the execution process of the target execution object is correct; the second system 22 is used to generate a second proof based on the second execution trajectory of the second instruction using the second proof circuit in the second system after receiving the second instruction sent by the first system 21.
[0055] In some embodiments, the first system 21 is a system obtained by separating the precompiled computing components in the zero-knowledge proof virtual machine, and the second system 22 is a system including the precompiled computing components. The first system 21 and the second system 22 are different systems independent of each other.
[0056] In some embodiments, the first proof circuit is used to perform verification based on the first execution trace to determine whether the first execution trace satisfies the first constraint condition, and if the first execution trace satisfies the first constraint condition, generate a first proof based on the first execution trace; the first proof is used to prove that the execution process of the first instruction is correct;
[0057] The second proof circuit includes a user-defined proof circuit, which is used to perform verification based on the second execution trajectory to determine whether the second execution trajectory satisfies the second constraint condition, and generate a second proof based on the second execution trajectory when the second execution trajectory satisfies the second constraint condition; the second proof is used to prove that the execution process of the second instruction is correct.
[0058] See also Figure 3 , Figure 3 1 is a schematic diagram of a framework of an electronic device according to an embodiment of the present application. In this embodiment, the electronic device 30 includes a memory 31 and a processor 32 coupled to each other.
[0059] The memory 31 stores program instructions, and the processor 32 is used to execute the program instructions stored in the memory 31 to implement the steps of any of the above method implementations. In a specific implementation scenario, the electronic device 30 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 30 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.
[0060] Specifically, the processor 32 is used to control itself and the memory 31 to implement the steps of any of the above-mentioned embodiments. The processor 32 can also be called a CPU (Central Processing Unit). The processor 32 may be an integrated circuit chip with signal processing capabilities. The processor 32 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 32 can be implemented by an integrated circuit chip.
[0061] See also Figure 4 , Figure 44 is a schematic diagram of a framework of an embodiment of a computing service provided by the present application. In this embodiment, the computing service 40 includes a dynamic loading module 41 and a configuration file manager 42 coupled to each other. The configuration file manager 42 is used to read and parse the circuit configuration file, and the dynamic loading module 41 is used to dynamically load the proof circuit in the circuit configuration file to implement the steps of any of the above method implementations.
[0062] In some embodiments, the second certification circuit is a certification circuit loaded into a circuit configuration file by the first system using the dynamic loading module 41 .
[0063] See also Figure 5 , Figure 5 It is a schematic diagram of the framework of the computer-readable storage medium provided by the present application. The computer-readable storage medium 50 of the embodiment of the present application stores a program instruction 51, and when the program instruction 51 is executed, the method provided by any embodiment of the above method and any non-conflicting combination is implemented. Among them, the program instruction 51 can form a program file and be stored in the above-mentioned computer-readable storage medium 50 in the form of a software product, so that a computer device (which can be a personal computer, a server, or a network device, etc.) executes all or part of the steps of each implementation method of the present application. The aforementioned computer-readable storage medium 50 includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, or a terminal device such as a computer, a server, a mobile phone, and a tablet.
[0064] In the above scheme, the first system obtains the first instruction and the second instruction in the target execution object; the first proof circuit in the first system is used to generate the first proof based on the first execution track of the first instruction, and the second proof circuit in the second system is used to generate the second proof based on the second execution track of the second instruction; the first proof and the second proof are aggregated to obtain a zero-knowledge proof about the target execution object; the zero-knowledge proof is used to prove that the execution process of the target execution object is correct. It can be seen that the present application sets up the first system and the second system, each system is used to generate the proof of its corresponding part, and finally the proof of each part is integrated to obtain the complete proof of the target execution object. Compared with the method of generating all proofs by only using a single system, the present application uses different systems to generate the proof of the corresponding part, which can reduce the time required for proof generation, and thus improve the efficiency of proof generation.
[0065] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0066] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for generating a zero-knowledge proof, characterized in that: The method comprises: The first system obtains the first instruction and the second instruction in the target execution object; Generate a first proof based on a first execution trace of the first instruction using a first proof circuit in the first system, and generate a second proof based on a second execution trace of the second instruction using a second proof circuit in the second system; Aggregating the first proof and the second proof to obtain a zero-knowledge proof about the target execution object; the zero-knowledge proof is used to prove that the execution process of the target execution object is correct.
2. The method according to claim 1, characterized in that The first system is used to send the acquired second instruction to the second system, and receive the second certificate sent by the second system; The first certification circuit is a certification circuit associated with the first instruction, and the second certification circuit is a certification circuit associated with the second instruction.
3. The method according to claim 1, characterized in that The first execution trace is obtained when the first system executes the first instruction, and the second execution trace is obtained when the second system executes the second instruction; The generating a first proof based on a first execution trace of the first instruction by using a first proof circuit in the first system includes: Performing verification based on the first execution trace using the first proof circuit to determine whether the first execution trace satisfies a first constraint condition; In response to satisfying the first constraint condition, generating the first proof based on the first execution trace; the first proof is used to prove that the execution process of the first instruction is correct; The generating a second proof based on a second execution trace of the second instruction by using a second proof circuit in the second system comprises: Using the second proof circuit to perform verification based on the second execution trace to determine whether the second execution trace satisfies a second constraint condition; In response to satisfying the second constraint condition, generating the second proof based on the second execution trace; the second proof is used to prove that the execution process of the second instruction is correct.
4. The method according to claim 1, characterized in that: The first instruction includes a plurality of first sub-instructions, the second instruction includes a plurality of second sub-instructions, the first execution trajectory includes a trajectory formed by combining execution results corresponding to the first sub-instructions in an execution order of the plurality of first sub-instructions, and the second execution trajectory includes a trajectory formed by combining execution results corresponding to the second sub-instructions in an execution order of the plurality of second sub-instructions; And / or, the target execution object includes a target execution program.
5. The method according to claim 1, characterized in that The second certification circuit is a user-defined certification circuit loaded from the first system to the second system; And / or, the second proof circuit is customized using a domain specific language.
6. The method according to claim 1, characterized in that The first system is a system obtained by separating a precompiled computing component from a zero-knowledge proof virtual machine, the second system is a system including the precompiled computing component, the first system and the second system are different systems independent of each other, and the first system and the second system are in communication connection; And / or, the aggregating the first proof and the second proof to obtain a zero-knowledge proof about the target execution object includes: The first proof and the second proof are aggregated by using a preset recursive proof technology to obtain a zero-knowledge proof about the target execution object.
7. A zero-knowledge proof system, characterized in that: The certification system includes a first system and a second system, wherein the first system and the second system are in communication connection; The first system is used to obtain a first instruction and a second instruction in a target execution object, generate a first proof based on a first execution trace of the first instruction using a first proof circuit in the first system, receive a second proof generated by the second system, and aggregate the first proof and the second proof to obtain a zero-knowledge proof about the target execution object, wherein the zero-knowledge proof is used to prove that the execution process of the target execution object is correct; The second system is used to generate the second proof based on the second execution trace of the second instruction by using the second proof circuit in the second system after receiving the second instruction sent by the first system.
8. The system according to claim 7, characterized in that The first system is a system obtained by separating the precompiled computing components in the zero-knowledge proof virtual machine, the second system is a system including the precompiled computing components, and the first system and the second system are different systems independent of each other; and / or, the first proof circuit is used to perform verification based on the first execution trace to determine whether the first execution trace satisfies a first constraint condition, and generate the first proof based on the first execution trace if the first execution trace satisfies the first constraint condition; The first proof is used to prove that the execution process of the first instruction is correct; The second proof circuit includes a user-defined proof circuit, and the second proof circuit is used to perform verification based on the second execution trajectory to determine whether the second execution trajectory satisfies the second constraint condition, and generate the second proof based on the second execution trajectory when the second execution trajectory satisfies the second constraint condition; the second proof is used to prove that the execution process of the second instruction is correct.
9. A computing service, characterized in that: It comprises a mutually coupled dynamic loading module and a configuration file manager, wherein the configuration file manager is used to read and parse the circuit configuration file, and the dynamic loading module is used to dynamically load the proof circuit in the circuit configuration file; thereby realizing the method described in any one of claims 1-6.
10. A computer-readable software medium, characterized in that: The computer-readable software medium stores program instructions, and the program instructions can be executed to implement the method according to any one of claims 1 to 6.