A Bullet Proof Method and Apparatus Based on Graphics Processor
By parallelizing the inner product verification of the bullet algorithm on the graphics processor and using elliptic curve operations, the problem of large calculation amount of inner product proof in zero-knowledge proof is solved, and the efficiency of confidential transactions in blockchain technology is improved.
Patent Information
- Application Number
- CN202111173635.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-09-29
AI Technical Summary
The inner product proof in the existing zero-knowledge proof bullet algorithm requires a large amount of calculation and has high computational complexity, resulting in application scenario limitations in decentralized systems.
Using the bullet proof method based on the graphics processor, the inner product relationship between the vectors to be judged is verified through the inner product argument method, and the elliptic curve addition and scalar multiplication operations are used to achieve parallel processing of parameter calculation, reduce the communication volume and improve the proof and Verification speed.
The inner product verification of the bullet algorithm is accelerated by the graphics processor, which reduces the communication volume of the inner product verification, increases the speed of proof and verification, and expands the application scenarios in blockchain technology.
Smart Images

Figure CN113901394B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a bullet certification method and device based on a graphics processor. Background Art
[0002] Blockchain technology has attracted much attention in recent years. It transforms the traditional centralized transaction method into a decentralized transaction method, ensuring that transactions can be verified while avoiding the risks brought by centralized nodes. However, traditional blockchain technology requires that all transaction details be disclosed during the transaction process, which results in the lack of confidentiality of transaction information. In order to solve this problem, confidential transactions were proposed by Maxwell et al., and zero-knowledge proof is also the most commonly used method in confidential transactions.
[0003] The most popular algorithms in zero-knowledge proof are zk-SNARK and zk-STARK. The zk-SNARK algorithm converts the proof in the confidential transaction into a quadratic spanning program (QSP) problem, and then verifies that the values of two vectors are equal by proving that multiple sets of equations are true at the same time. The algorithm first needs to establish a trusted initialization process between the prover and the verifier, that is, to generate a public reference string, share the initialization parameters through a trusted third party, and perform verification analysis based on these parameters in the subsequent process. Although this process is simple and efficient, it involves a third party, which violates the decentralized system structure to some extent and imposes certain restrictions on its application scenarios. zk-STARK avoids the trusted initialization process through calculation, but this will bring complex calculations, thereby increasing the size and amount of calculation of the proof. The bullet algorithm proposed in 2018 is optimized on the basis of zk-STARK, converting the interval proof into the inner product proof to reduce the computational complexity and effectively reduce the amount of calculation. However, despite this, the computational complexity of the bullet algorithm is still large. Therefore, in zero-knowledge proof, how to reduce the computational complexity of the proof while avoiding the involvement of a trusted third party and increasing the speed of proof and verification is an issue that needs to be addressed urgently. Summary of the invention
[0004] The technical problem to be solved by the present invention is that the volume and calculation amount of the inner product proof in the existing zero-knowledge proof bullet algorithm are large, and the calculation complexity of the proof is high.
[0005] In order to solve the above technical problems, the present invention provides a bullet proof method based on a graphics processor, comprising:
[0006] The bullet proof method includes verifying that there is an inner product relationship between the vectors to be judged by inner product argumentation; the bullet proof method belongs to a zero-knowledge proof method;
[0007] The inner product argumentation method includes:
[0008] The parameter calculation processes in the prover and the verifier are both performed by a graphics processor, and the graphics processor performs an addition operation between two vectors by an elliptic curve addition operation, and realizes a multiplication operation between a scalar and a vector by an elliptic curve scalar multiplication operation, and the elliptic curve addition operation and the elliptic curve scalar multiplication operation are defined on a finite field Fp;
[0009] Wherein, the elliptic curve addition operation formula is:
[0010]
[0011] Among them, K(x K ,y K ) and Q(x Q ,y Q ) are the two vectors to be added, J(x J ,y J ) is K(x K ,y K ) and Q(x Q ,y Q ) is added to obtain the vector, when K(x K ,y K ) and Q(x Q ,y Q ) are different,
[0012] When K(x K ,y K ) and Q(x Q ,y Q ) are the same,
[0013] P is a prime number;
[0014] The elliptic curve scalar multiplication operation is: converting the multiplication operation between the scalar and the vector into an addition operation expression between multiple vectors, and then calculating the addition operation expression through the elliptic curve addition operation.
[0015] Preferably, the step of verifying the existence of an inner product relationship between the vectors to be determined by inner product argumentation includes:
[0016] Initialize the parameters in the parameter group, wherein the parameters in the parameter group include vector g, vector h, scalar u, scalar M, vector a, vector b, scalar n, a and b are vectors to be judged, and M = g a h b is the preset inner product relationship between a and b, and n represents the vector dimension;
[0017] Use g, h, u, M, a, b as the first operation parameter group, and use g, h, u, M as the second operation parameter group;
[0018] Determine whether the current n is greater than 1, if so, divide n by 2 as the new n, the prover performs parameter calculation based on the current parameter values in the first operation parameter group to obtain vector L and vector R, and transmits L and R to the verifier; the verifier randomly generates x, and transmits it to the prover; the prover performs parameter calculation based on x, L, R and the current parameter values in the first operation parameter group to obtain the updated value of the parameter in the first operation parameter group, and updates the parameter value in the first operation parameter group based on the updated value of the parameter in the first operation parameter group, the verifier performs parameter calculation based on L, R, x and the current parameter values in the second operation parameter group to obtain the updated value of the parameter in the second operation parameter group, and updates the parameter value in the second operation parameter group based on the updated value of the parameter in the second operation parameter group, and re-determines whether the current n is greater than 1;
[0019] If the current n is not greater than 1, then the current n is equal to 1, and the parameters are calculated through the hash function of the Pedersen commitment to obtain the rewrite M, and it is determined whether the rewrite M is the same as the parameter M in the current second parameter group. If they are the same, the verification of the preset inner product relationship between vector a and vector b is successful; if they are different, the verification of the preset inner product relationship between vector a and vector b fails.
[0020] Preferably, the inner product argumentation method is applied to the circuit proof and verification module and the range proof and verification module in the bullet algorithm.
[0021] Preferably, the prover performs parameter calculation based on the parameter values in the current first operation parameter group to obtain the parameter calculation formula in vector L and vector R:
[0022]
[0023]
[0024] Here, n′ represents the new n after n is divided by 2, and c L = [:n′] ,b [n′:] >∈p,c R = [n′:] ,b [:n′] >∈p, is a cyclic group with prime number p.
[0025] Preferably, the prover performs parameter calculation based on x, L, R and the current parameter values in the first operation parameter group to obtain the updated values of the parameters in the first operation parameter group. The parameter calculation formula is:
[0026]
[0027]
[0028]
[0029]
[0030]
[0031] Wherein, a′ represents the updated value of parameter a, b′ represents the updated value of parameter b, g′ represents the updated value of parameter g, h′ represents the updated value of parameter h, M′ represents the updated value of parameter M, and n′ represents the new n after n is divided by 2. express n′-dimensional vector space, express n′-dimensional vector space, is a cyclic group with prime number p.
[0032] Preferably, the parameter calculation formula in which the verifier performs parameter calculation based on L, R, x and the current parameter values in the second operation parameter group to obtain the updated values of the parameters in the second operation parameter group is:
[0033]
[0034]
[0035]
[0036] Among them, g′ represents the updated value of parameter g, h′ represents the updated value of parameter h, M′ represents the updated value of parameter M, and n′ represents the new n after n is divided by 2. express n′-dimensional vector space, express n′-dimensional vector space, is a cyclic group with prime number p.
[0037] Preferably, the parameter calculation formula in M is obtained by performing parameter calculation through the hash function of Pedersen commitment:
[0038] M=H(a [:n′] ,a [n′:] ,b [:n′] ,b [n′:] ,c)
[0039] Here, n′ represents the new n after n is divided by 2, and c =<a,b> .
[0040] Preferably, the graphics processor is a multi-core graphics processor to achieve effective parallelization of the parameter calculation process.
[0041] In order to solve the above technical problems, the present invention provides a bullet proof device based on a graphics processor, comprising a central processing unit and a graphics processor connected to the central processing unit;
[0042] The central processing unit is used to implement the content of the bullet proof method based on the graphics processor except the parameter calculation process;
[0043] The graphics processor is used to implement the content of the parameter calculation process in the bullet proof method based on the graphics processor.
[0044] Preferably, the central processing unit is a multi-core central processing unit.
[0045] Compared with the prior art, one or more embodiments of the above scheme may have the following advantages or beneficial effects:
[0046] The bullet proof method based on a graphics processor provided in an embodiment of the present invention is applied, and the parameter calculation process in the inner product argument is processed by a graphics processor to realize partial parallel processing of the bullet algorithm, so that the communication volume of the inner product verification can be reduced by one third, and the speed of proof and verification is improved. The graphics processor performs addition operations between two vectors through elliptic curve addition operations, and realizes multiplication operations between scalars and vectors through elliptic curve scalar multiplication operations, further accelerating the inner product argument method in the bullet proof method, and realizing the acceleration of the bullet proof method. And the use of confidential transactions based on zero-knowledge proof in blockchain technology can expand its application scenarios.
[0047] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0049] Figure 1 A schematic flow chart of a bullet proof method based on a graphics processor according to a first embodiment of the present invention is shown;
[0050] Figure 2A schematic diagram showing the interaction relationship between the prover and the verifier in the first embodiment of the present invention is shown;
[0051] Figure 3 A schematic diagram showing the comparison of the running time of the proof process and the verification process before and after acceleration in the range proof and verification module when the graphics processor is RTX 2080Ti in the first embodiment of the present invention;
[0052] Figure 4 A schematic diagram showing a comparison of the time taken before and after using a bullet proof method based on a graphics processor when different graphics processors are used in the first embodiment of the present invention;
[0053] Figure 5 A schematic diagram showing the acceleration ratio of the bullet proof method based on a graphics processor when different graphics processors are used in the first embodiment of the present invention is shown;
[0054] Figure 6 A schematic structural diagram of a bullet proof device based on a graphics processor according to a second embodiment of the present invention is shown. DETAILED DESCRIPTION
[0055] The following will describe the implementation methods of the present invention in detail with reference to the accompanying drawings and embodiments, so that the implementation process of how the present invention applies technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly. It should be noted that as long as there is no conflict, the various embodiments of the present invention and the various features in the embodiments can be combined with each other, and the technical solutions formed are all within the protection scope of the present invention.
[0056] The earliest confidential transactions protected account balances from being disclosed by hiding the input and balance of transaction information in Pedersen commitments. In fact, it is to make a zero-knowledge proof for each piece of information that needs to be verified in the transaction to ensure that the information is legal without revealing the content of the information. Zero-knowledge proof is also the most commonly used method in confidential transactions, that is, the prover convinces the verifier that he has certain knowledge and does not disclose any information about this knowledge. For example, in the confidential transaction process of the blockchain, zero-knowledge proof is that the prover can prove to the verifier that the transaction he initiated is legal without revealing the specific details of the transaction, such as account balances. In the confidential transaction process, in order to allow anyone to verify the transaction, each transaction needs to contain a zero-knowledge proof to ensure that the total balance of the input is greater than the total balance of the output, and the balance of each output account is greater than 0. Therefore, all inequality proofs can be converted into proofs that the value to be proved belongs to a certain interval. Moreover, a transaction information may contain multiple input accounts and output accounts, so there will be multiple zero-knowledge proofs in a transaction information.
[0057] The Bullet Algorithm proposed in 2018 is optimized on the basis of zk-STARK, which reduces the computational complexity and effectively reduces the amount of computation by converting interval proof into inner product proof. However, despite this, the amount of computation of the Bullet Algorithm is still large. Therefore, in zero-knowledge proof, how to reduce the computational amount of proof while avoiding the participation of trusted third parties and increasing the speed of proof and verification is an urgent problem to be solved.
[0058] Embodiment 1
[0059] In order to solve the technical problems existing in the prior art, an embodiment of the present invention provides a bullet proof method based on a graphics processor.
[0060] Figure 1 A schematic diagram of a bullet proof method based on a graphics processor according to an embodiment of the present invention is shown; Figure 1 As shown, the bullet proof method based on the graphics processor in the embodiment of the present invention includes verifying the existence of an inner product relationship between the vectors to be judged through an inner product argument.
[0061] The bullet proof method is a type of zero-knowledge proof method. In the bullet proof method (Bulletproofs algorithm), the core part is the inner product argumentation method, because circuit proof and verification and range proof and verification are further implemented based on the inner product argumentation method. The embodiment of the present invention accelerates the bullet proof method by accelerating the inner product argumentation method.
[0062] Furthermore, verifying that there is an inner product relationship between the vectors to be judged by inner product argumentation specifically includes the following steps.
[0063] Step S101, initializing the parameters in the parameter group.
[0064] Specifically, we first introduce the symbolic definitions used in the proof interaction process, where vector g and vector h represent two independent vectors, scalar u and scalar M are both cyclic group elements of prime order p, u and M represent vector commitments with certain constraints, vector a and vector b are vectors to be judged, and M = g a h b is the preset inner product relationship between a and b, and scalar n represents the vector dimension. A parameter set such as vector g, vector h, scalar u, scalar M, vector a, vector b, and scalar n is a parameter group.
[0065] Before the argumentation is performed, the parameters in the parameter group need to be initialized, that is, the parameters in the parameter group need to be assigned initial values.
[0066] Step S102, using g, h, u, M, a, b as the first operation parameter group, and using g, h, u, M as the second operation parameter group.
[0067] Step S103, determine whether the current n is greater than 1, if so, go to step S104, otherwise go to step S105.
[0068] Step S104, divide n by 2 as the new n, the prover performs parameter calculation based on the current parameter values in the first operation parameter group to obtain vector L and vector R, and transmits L and R to the verifier; the verifier randomly generates x, and transmits it to the prover; the prover performs parameter calculation based on x, L, R and the current parameter values in the first operation parameter group to obtain the updated values of the parameters in the first operation parameter group, and updates the parameter values in the first operation parameter group based on the updated values of the parameters in the first operation parameter group, the verifier performs parameter calculation based on L, R, x and the current parameter values in the second operation parameter group to obtain the updated values of the parameters in the second operation parameter group, and updates the parameter values in the second operation parameter group based on the updated values of the parameters in the second operation parameter group, and then goes to step S103.
[0069] Specifically, n is processed to obtain a new vector dimension n value, that is, n is divided by 2 to obtain a new n. In order to distinguish n before and after processing, the n value after processing can be temporarily represented by n′, but when n is re-judged, n′ needs to be replaced by n.
[0070] Figure 2 FIG. 1 shows a schematic diagram of data interaction between a prover and a verifier in Embodiment 1 of the present invention; Figure 2 As shown, the prover performs parameter calculation based on the parameter values in the current first operation parameter group to obtain vector L and vector R, wherein the parameter calculation formula used here is:
[0071]
[0072]
[0073] Here, n′ represents the new n after n is divided by 2, and c L = [:n′] ,b [n′:] >∈p,c R = [n′:] ,b [:n′] >∈p, is a cyclic group with prime number p.
[0074] Then the verifier randomly generates x, that is And among them is a positive integer and transmits x to the prover.
[0075] At this time, the prover performs parameter calculation based on x, L, R and the values of the parameters in the current first operation parameter group to obtain the updated values of the parameters in the first operation parameter group, and updates the values of the parameters in the first operation parameter group based on the updated values of the parameters in the first operation parameter group, that is, the prover obtains the updated values of g, h, u, M, a, and b respectively. The parameter calculation formula used here is:
[0076]
[0077] Wherein, a′ represents the updated value of parameter a, b′ represents the updated value of parameter b, g′ represents the updated value of parameter g, h′ represents the updated value of parameter h, M′ represents the updated value of parameter M, and n′ represents the new n after n is divided by 2. express n′-dimensional vector space, express n′-dimensional vector space, is a cyclic group with prime number p.
[0078] The verifier performs parameter calculation based on L, R, x and the current parameter values in the second operation parameter group to obtain the updated values of the parameters in the second operation parameter group, and updates the parameter values in the second operation parameter group based on the updated values of the parameters in the second operation parameter group, that is, the verifier obtains the updated values of g, h, u, and M respectively. The parameter calculation formula used here is:
[0079]
[0080] Among them, g′ represents the updated value of parameter g, h′ represents the updated value of parameter h, M′ represents the updated value of parameter M, and n′ represents the new n after n is divided by 2. express n′-dimensional vector space, express n′-dimensional vector space, is a cyclic group with prime number p.
[0081] After the parameter values in the first operation parameter group and the parameter values in the second operation parameter group are updated, the process goes to step S103 to determine whether the current n is greater than 1. It should be noted that n at this time is a new n obtained by dividing the previous determination n by 2.
[0082] Step S105, if the current n is not greater than 1, then the current n is equal to 1, and M is rewritten by the hash function calculation of the Pedersen commitment, and it is determined whether the rewritten M is the same as the parameter M in the current second parameter group. If they are the same, the verification of the preset inner product relationship between vector a and vector b is successful; if they are different, the verification of the preset inner product relationship between vector a and vector b fails.
[0083] Specifically, in the inner product argument, if there exist vectors a and b that satisfy M = g a h b , c=<a,b> , where variable c is a scalar. Then we have:
[0084]
[0085] Further restricting M to the Pedersen commitment of the vector (a, b, c), the above formula can be simplified to:
[0086]
[0087] At this time, the parameter calculation formula for calculating M through the hash function of Pedersen commitment is:
[0088] M=H(a [:n′] ,a [n′:] ,b [:n′] ,b [n′:] ,c) (4)
[0089] Among them, n' is used to represent the new n after n is divided by 2, that is, the value of n in the formula is the current value. To distinguish it from M calculated in the first operation parameter group and the second operation parameter group, we call M calculated by the hash function formula of Pedersen commitment rewritten M.
[0090] When it is determined that the current n is not greater than 1, the current n is equal to 1. At this time, the rewrite M needs to be calculated according to the hash function formula of the above Pedersen commitment, and the rewrite M is compared with the parameter M in the current second parameter group to determine whether the rewrite M is the same as the parameter M in the current second parameter group. If they are the same, then the preset inner product relationship between vector a and vector b can be verified successfully (that is, it meets M=g a h b ), if they are different, the verification of the preset inner product relationship between vector a and vector b fails (i.e., it does not meet M = g a h b ).
[0091] In the above process, there is no dependency between formula (2) and formula (3), and they will appear repeatedly in the proof and verification, so formula (1) to formula (4) can be parallelized using a graphics processor. In addition, since the bullet proof method (i.e., the Bulletproofs algorithm) usually requires a large number of inner product proofs, if the inner product proof is effectively accelerated, the performance of the bullet proof method will be greatly improved.
[0092] Based on this, we implement the parameter calculation process in the prover and verifier above through the graphics processor. That is, the calculation process of formula (1) to formula (4) in the above-mentioned inner product proof method to verify the existence of the inner product relationship between the vectors to be judged is placed in the graphics processor for implementation. It should be noted that the graphics processor is a multi-core graphics processor to achieve effective parallelization of the parameter calculation process.
[0093] Furthermore, in the bullet proof method, the inner product proof is implemented based on elliptic curve calculations, that is, algebraic calculations based on elliptic curves over finite fields. In the inner product proof, the basic mathematical object is the point on the elliptic curve, and the point multiplication and addition on the elliptic curve are used to replace the multiplication and addition calculations of numbers over the real number field.
[0094] The elliptic curve is actually composed of y 2 =x 3 +ax+b determines a series of points where a and b satisfy 4a 3 +27b 2 ≠0 (where a and b are scalar parameters different from vector a and vector b), this is to ensure that the curve does not contain singular points. One of the characteristics of elliptic curves is that they are symmetric about the x-axis.
[0095] Assume that the straight line and the elliptic curve intersect at three points (K, Q, R), and define that K+Q+R=0 in the elliptic curve (0 is the unit element, used to represent a point at infinity). These three points form an elliptic curve group. The addition of elliptic curves can be seen as solving the coordinates of the third point R when the straight line and the elliptic curve intersect at two points K and Q.
[0096] First, let {(x i ,y i ),i∈K,Q,R} represent the coordinates of the three points (K,Q,R) respectively. Assuming that it is in the real number domain, when K≠Q, the slope of the straight line is calculated as follows:
[0097]
[0098] When K=Q, it is equivalent to the straight line being tangent to the elliptic curve, and the addition of the elliptic curve becomes the scalar multiplication of the elliptic curve. At this time, the calculation formula of the slope becomes:
[0099]
[0100] After obtaining the slope of the straight line, the coordinates of point R can be calculated:
[0101] x R =λ 2 -x K -x Q
[0102] y R =λ(x K -x R )-y K (7)
[0103] However, elliptic curve calculations in the cryptographic sense are defined on a finite field Fp rather than a real number field. Finite field calculations follow the modular multiplication and modular addition rules, so the process of solving the R coordinate above is expressed using the finite field formula as follows:
[0104]
[0105] Where p is a prime number that determines the range of the finite field. After calculating the coordinates of R according to the above formula, since the points on the elliptic curve are symmetric about the x-axis, the symmetric point -R of R can be found through K+Q=-R, that is, the result of the elliptic curve addition operation is obtained.
[0106] Assume that J(x J ,y J ) is -R, then the elliptic curve addition formula is:
[0107]
[0108] Among them, K(x K ,y K ) and Q(x Q ,y Q ) are the two vectors to be added. When K(x K ,y K ) and Q(x Q ,y Q ) are different, When K(x K ,y K ) and Q(x Q ,y Q ) are the same,
[0109] The elliptic curve scalar multiplication operation is: convert the multiplication operation between the scalar and the vector into an addition operation between multiple vectors, and then calculate the addition operation through the elliptic curve addition operation. That is, the elliptic curve scalar multiplication can be realized by addition, that is, nQ=Q+Q+…+Q. It should be noted that the elliptic curve addition operation and the elliptic curve scalar multiplication operation are defined on the finite field Fp, and Fp represents a finite field of size p.
[0110] The parameter calculation process of the inner product argument of the bullet proof method involves a large number of calculations involving elliptic curve addition and multiplication operations. If these can be reasonably parallelized, the efficiency of the inner product argument will be effectively improved.
[0111] In the bullet proof method, the core that can be accelerated is the inner product argumentation method involved in the circuit proof and verification module (circuit proof) and the range proof and verification module (rangeproof). In the inner product argumentation method, many parameter calculation processes are repeated and parallelizable, and the basic calculation of the parameter calculation process is the elliptic curve addition and multiplication operation. Therefore, we can start with the parallelization of the elliptic curve algorithm and realize parallelization layer by layer to achieve the acceleration effect.
[0112] In order to illustrate the effectiveness of the bullet proof method based on a graphics processor according to an embodiment of the present invention, several practical examples are described below.
[0113] The CPU used in the experimental environment is Xeon Gold 6230CPU, and the GPUs used are NVIDIA GeForce RTX2080Ti and NVIDIA Tesla V100. The entire algorithm implementation is completed in the 20.10.3 version of the docker image environment.
[0114] Figure 3 FIG. 1 shows a schematic diagram of the running time comparison of the proof process and the verification process before and after acceleration in the range proof and verification module when the graphics processor is RTX 2080Ti in the first embodiment of the present invention; Figure 3 As shown in Figure 2, the input data bandwidth of the range proof and verification module increases from 1-bit, 1-commit to 512-bit, 256-commit. Figure 3 We can see that after GPU parallelization, both the proof time and verification time are significantly reduced.
[0115] Figure 4 A schematic diagram showing the comparison of the time taken before and after using the bullet proof method based on a graphics processor when different graphics processors are used in the first embodiment of the present invention: Figure 4As shown in the table, the experiment was also tested on V100 GPU, with input data ranging from Pedersen-3 to Pedersen-3072. From the data in the table, it can be found that the method in this embodiment has a good acceleration effect on different GPUs, with a speedup ratio of 3-4x, and there is no obvious difference in the acceleration effect. The possible reason is that the GPU resources used by the algorithm itself are relatively small compared to these two GPUs, so the better GPU V100 will not have much impact on the proof time when using the same algorithm.
[0116] Figure 5 FIG. 1 is a schematic diagram showing the acceleration ratio of the bullet proof method based on a graphics processor when different graphics processors are used in the first embodiment of the present invention. Figure 5 It can be seen that as the number of input data bits increases, the acceleration ratio of the proof process is slightly improved. This is because as the input data increases, the proportion of the parallelizable module in the entire calculation will increase, so the acceleration ratio will increase.
[0117] In general, through the collaborative parallelization of the graphics processor in the method of the embodiment of the present invention, the proof and verification speed in the bullet proof method is increased by 3-4 times.
[0118] The GPU-based bullet proof method is based on the efficient inner product argument proposed by Bootle et al. It proposes a new zero-knowledge proof to prove that the secretly submitted value is within a given interval and only relies on the discrete logarithm assumption. The GPU-based bullet proof method proves that the proof is valid only when the proof submitted by the prover is computationally bounded and meets certain computationally difficult assumptions. The inner product argument proves that there is an inner product relationship between the submitted vectors.
[0119] The bullet proof method based on a graphics processor provided in an embodiment of the present invention uses a graphics processor to process the parameter calculation process in the inner product argument, thereby realizing partial parallel processing of the bullet proof, so that the communication volume of the inner product verification can be reduced by one third, thereby improving the speed of proof and verification. The graphics processor performs addition operations between two vectors through elliptic curve addition operations, and realizes multiplication operations between scalars and vectors through elliptic curve scalar multiplication operations, further accelerating the inner product argument method in the bullet proof method, thereby realizing the acceleration of the bullet proof method. And the use of confidential transactions based on zero-knowledge proofs in blockchain technology can expand its application scenarios.
[0120] Embodiment 2
[0121] In order to solve the technical problems existing in the prior art, an embodiment of the present invention provides a bullet proof device based on a graphics processor.
[0122] Figure 6 The schematic diagram of the structure of the bullet proof device based on the graphics processor of the second embodiment of the present invention is shown. Figure 6 As shown, the bullet proof device based on the graphics processor in the embodiment of the present invention includes a central processing unit and a graphics processor. The central processing unit is connected to the graphics processor. Among them, the central processing unit and the graphics processor are both multi-core.
[0123] The central processing unit is used to implement the content of the bullet proof method based on the graphics processor in the first embodiment except the parameter calculation process;
[0124] The graphics processor is used to implement the content of the parameter calculation process in the bullet proof method based on the graphics processor in the first embodiment.
[0125] The implementation process of the bullet proof device based on the GPU when it is operating normally is as follows: first, the circuit proof and verification module (circuit proof) and the range proof and verification module (rangeproof) are initialized in the CPU and GPU, including data input, memory allocation, and parameter initialization of the prover and verifier. When the proof and verification process of the bullet algorithm enters the parallelization stage, the CPU copies and transfers parameters and functions to the GPU. After the GPU completes the parallel calculation, the results of each step are temporarily stored in the memory of the GPU. When the results need to be used, they are transferred from the GPU back to the CPU for the next step of calculation. Through the above collaborative parallel process, the communication volume of inner product verification can be reduced by one third.
[0126] The bullet proof device based on a graphics processor provided by an embodiment of the present invention processes the parameter calculation process in the inner product argument through a graphics processor, realizes partial parallel processing of the bullet proof, and reduces the communication volume of the inner product verification by one third, thereby improving the speed of proof and verification. The graphics processor performs addition operations between two vectors through elliptic curve addition operations, and realizes multiplication operations between scalars and vectors through elliptic curve scalar multiplication operations, further accelerating the inner product argument method in the bullet proof method, thereby realizing the acceleration of the bullet proof method. And the use of confidential transactions based on zero-knowledge proof in blockchain technology can expand its application scenarios.
[0127] Although the embodiments disclosed in the present invention are as above, the contents described are only embodiments adopted for facilitating the understanding of the present invention and are not intended to limit the present invention. Any technician in the technical field to which the present invention belongs can make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed in the present invention, but the protection scope of the present invention shall still be subject to the scope defined in the attached claims.
Claims
1. A bullet proof method based on a graphics processor, comprising: The bullet proof method includes verifying that there is an inner product relationship between the vectors to be judged by inner product argumentation; The bullet proof method is a zero-knowledge proof method; The inner product argumentation method includes: The parameter calculation processes in the prover and the verifier are both performed by a graphics processor, and the graphics processor performs an addition operation between two vectors by an elliptic curve addition operation, and realizes a multiplication operation between a scalar and a vector by an elliptic curve scalar multiplication operation, and the elliptic curve addition operation and the elliptic curve scalar multiplication operation are defined on a finite field Fp; Wherein, the elliptic curve addition operation formula is: Among them, K(x K ,y K ) and Q(x Q ,y Q ) are the two vectors to be added, J(x J ,y J ) is K(x K ,y K ) and Q(x Q ,y Q ) is added to obtain the vector, when K(x K ,y K ) and Q(x Q ,y Q ) are different, When K(x K ,y K ) and Q(x Q ,y Q ) are the same, p is a prime number; The elliptic curve scalar multiplication operation is: converting the multiplication operation between the scalar and the vector into an addition operation formula between multiple vectors, and then calculating the addition operation formula through the elliptic curve addition operation; The steps to verify the existence of inner product relationship between the vectors to be judged by inner product argumentation include: Initialize the parameters in the parameter group, wherein the parameters in the parameter group include vector g, vector h, scalar u, scalar M, vector a, vector b, scalar n, a and b are vectors to be judged, and M = g a h b is the preset inner product relationship between a and b, and n represents the vector dimension; Use g, h, u, M, a, b as the first operation parameter group, and use g, h, u, M as the second operation parameter group; Determine whether the current n is greater than 1, if so, divide n by 2 as the new n, the prover performs parameter calculation based on the current parameter values in the first operation parameter group to obtain vector L and vector R, and transmits L and R to the verifier; the verifier randomly generates x, and transmits it to the prover; the prover performs parameter calculation based on x, L, R and the current parameter values in the first operation parameter group to obtain the updated value of the parameter in the first operation parameter group, and updates the parameter value in the first operation parameter group based on the updated value of the parameter in the first operation parameter group, the verifier performs parameter calculation based on L, R, x and the current parameter values in the second operation parameter group to obtain the updated value of the parameter in the second operation parameter group, and updates the parameter value in the second operation parameter group based on the updated value of the parameter in the second operation parameter group, and re-determines whether the current n is greater than 1; If the current n is not greater than 1, the current n is equal to 1, and the rewrite M is obtained by performing parameter calculation through the hash function of the Pedersen commitment, and it is determined whether the rewrite M is the same as the parameter M in the current second operation parameter group. If they are the same, the verification of the preset inner product relationship between vector a and vector b is successful; if they are different, the verification of the preset inner product relationship between vector a and vector b fails; The prover performs parameter calculation based on the parameter values in the current first operation parameter group to obtain the parameter calculation formula in vector L and vector R: Here, n′ represents the new n after n is divided by 2, and c L =<a [:n′] ,b [n′:] >∈p,c R =<a [n′:] ,b [:n′] >∈p, is a cyclic group with prime number p; The prover performs parameter calculation based on x, L, R and the current parameter values in the first operation parameter group to obtain the updated values of the parameters in the first operation parameter group. The parameter calculation formula is: Wherein, a′ represents the updated value of parameter a, b′ represents the updated value of parameter b, g′ represents the updated value of parameter g, h′ represents the updated value of parameter h, M′ represents the updated value of parameter M, and n′ represents the new n after n is divided by 2. express n′-dimensional vector space, express n′-dimensional vector space, is a cyclic group with prime number p; The parameter calculation formula in M is obtained by calculating the parameters through the hash function of Pedersen's commitment: M=H(a [:n′] ,a [n′:] ,b [:n′] ,b [n′:] ,c) Here, n' represents the new n after n is divided by 2, and c =<a,b> ; The graphics processor is a multi-core graphics processor to achieve effective parallelization of the parameter calculation process.
2. The method according to claim 1, characterized in that The inner product argumentation method is applied to the circuit proof and verification module and the range proof and verification module in the bullet algorithm.
3. The method according to claim 2, characterized in that The parameter calculation formula in M is obtained by calculating the parameters through the hash function of Pedersen's commitment: M=H(a [:n′] ,a [n′:] ,b [:n′] ,b [n′:] ,c) Here, n' represents the new n after n is divided by 2, and c =<a,b> .
4. A bullet proof device based on a graphics processor, characterized in that: It includes a central processing unit and a graphics processing unit connected to the central processing unit; The central processing unit is used to implement the content of the bullet proof method based on a graphics processor according to any one of claims 1 to 3 except the parameter calculation process; The graphics processor is used to implement the content of the parameter calculation process in the bullet proof method based on the graphics processor as described in any one of claims 1-3.
5. The device according to claim 4, characterized in that The central processing unit is a multi-core central processing unit.
