Computer-implemented system and method for detrusted zero knowledge or payments

By using public key elliptic curve specification and batch processing technology in zero-knowledge proof system, the high cost and large key size problems of arithmetic circuit satisfactory verification in existing systems are solved, and efficient zero-knowledge proof is achieved. Trust exchange and cross-chain atomic exchange.

CN119094131APending Publication Date: 2024-12-06NCHAIN HLDG LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411127507.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-03-23
Filing Date
2019-03-18
Publication Date
2024-12-06

Smart Images

  • Figure CN119094131A_ABST
    Figure CN119094131A_ABST
Patent Text Reader

Abstract

The present invention relates to a computer-implemented method of implementing zero-knowledge certification or verification of a statement, in which a certifier proves to a verifier that the statement is true while keeping witness of the statement secret. The invention also relates to a peer-to-peer method employed by a verifier verifying an attestation, comprising the verifier sending to the verifier a statement having an arithmetic circuit having m gates and n lines configured to implement a functional circuit and to determine an output and an elliptic curve point for a given functional circuit, a functional circuit input to a line of functional circuits is equal to a corresponding elliptic curve point multiplier. The prover also sends a commitment for a line of the circuit, an input for a line in the arithmetic circuit, and a functional circuit output. The prover receives the challenge value from the verifier and responds in public or additionally sends an attestation key to the verifier. The statements and data enable a verifier to determine that the circuitry is satisfied and calculate elliptic curve points and verify the statements, thereby determining that the verifier has a witness of the statements.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with Chinese application number 2019800207686 (corresponding to PCT international application number PCT / IB2019 / 052185), application date March 18, 2019, and invention name “Computer-implemented system and method for trustless zero-knowledge contingent payment”. Technical Field

[0002] The present specification generally relates to computer-implemented methods and systems suitable for implementation in a computer processor (e.g., a node of a blockchain network) or a group of such processors. An improved method for generating proofs is provided, which enables efficient zero-knowledge verification of statements. The method is suitable for incorporation into an existing discrete logarithm-based zero-knowledge proof protocol for circuit satisfiability that does not require the use of bilinear pairing-friendly elliptic curves. The present invention is particularly suitable for, but not limited to, trustless fair exchange of data. One of the parties can prove knowledge of a key or statement without revealing the statement, so as to produce a secure trustless exchange between the participants. In particular, the exchanged data can be implemented to determine a private key for a specified vanity address on a blockchain network. Background Art

[0003] In this document, the term "blockchain" is used to include all forms of electronic, computer-based, distributed ledgers. These include consensus-based blockchain and transaction chain technologies, permissioned and permissionless ledgers, shared ledgers, and their variations.

[0004] The term "user" in this article may refer to a human-based or processor-based resource. Blockchain is a peer-to-peer electronic ledger implemented as a computer-based decentralized, distributed system composed of blocks, which in turn consist of transactions.

[0005] Each transaction is a data structure that encodes the transfer of control of digital assets between participants in a blockchain system and includes at least one input and at least one output. Each block contains a hash of the previous block so that blocks are chained together to create a permanent, unchangeable record of all transactions that have been written to the blockchain since its inception. Transactions contain small programs called scripts embedded in the transaction's inputs and outputs that specify how and who can access the transaction's outputs.

[0006] Furthermore, in this document, reference is made to the structure of known zero-knowledge proof protocols and systems using arithmetic circuits. Blockchain provides a decentralized and permissionless global mechanism that implements a solution capable of resolving the fair exchange problem between two mutually distrusted parties without the need for third-party arbitration or escrow. The fair exchange of data or information in the exchange of economic rewards or information such as digital goods is embodied in a protocol called zero-knowledge contingent payment (ZKCP). [Maxwell 2016] In ZKCP, the specified data is transferred from the seller to the buyer only if the payment is confirmed, and the payment from the buyer to the seller is completed only if the specified data is valid according to the sales conditions. The details of this protocol are known [Campanelli 2017] , but it is essentially based on a combination of hashed time-locked contracts (HTLCs) and zero-knowledge proofs, which simultaneously verify that certain encrypted information (the "digital good") is valid / correct, and that the "password" to decrypt this information is the data that must be revealed on the blockchain in order to request payment.

[0007] The central component of a ZKCP protocol is a zero-knowledge proof of a series of subordinate statements about the validity or correctness of data / information, the validity of a key, and its corresponding hash value. This complex compound statement requires an efficient zero-knowledge proof system for general computation: essentially, this enables one party to run an arbitrary program with secret inputs, and then prove to another party that the program accepted the inputs as valid and that the program was executed correctly — without revealing any information about the secret inputs or the execution of the program. In known ZKCP examples, the general zero-knowledge proof system employed has been based on the Pinocchio protocol [Parno 2016] and C++ libsnark library [Libsnark 2016] The Succinct Non-Interactive Arguments of Knowledge (SNARKs) framework is implemented in . Zero-knowledge SNARKs (zkSNARKs) provide a way to prove the validity of arbitrary computations that can be expressed as arithmetic circuits with zero knowledge. The two main distinguishing properties of zkSNARKs are that they are non-interactive (the prover sends the proof to the verifier in one go) and succinct (the proof is small and easy to verify). However, they have significant limitations:

[0008] -Proof generation is extremely computationally demanding.

[0009] -The proof key is very large and scales with the circuit size.

[0010] - They depend on strong and untested cryptographic assumptions (i.e., knowledge of the exponential and pairing-based assumptions).

[0011] - For any given program (circuit), they require a Common Reference String (CRS) computed by a third party that must be trusted to remove the setup parameters. Any party that knows the setup parameters has the ability to create a forged proof.

[0012] To date, no attempts have been made to construct a zkSNARK to prove statements involving arbitrary cryptographic elliptic curve key operations, but it is assumed that such a zkSNARK would consist of arithmetic circuits with hundreds of thousands or millions of gates, and therefore proof generation time would take minutes and the size of the proving key would be hundreds of megabytes. Technical Background

[0014] The basic system for interactive zero-knowledge proofs can use a ∑ (Sigma) protocol, which includes many communication steps between the prover and the verifier. In general, the ∑ protocol includes 3 moves: the prover sends an initial commitment (a) to the verifier, then the verifier responds with a random challenge (x), and finally the prover answers with a final response or "opening" (z). The verifier then accepts or rejects the statement based on the transcript (a, x, z).

[0015] The ∑ protocol can be used to prove knowledge of a witness (w) known only to the prover or to prove a statement about a witness (w) known only to the prover. The protocol is zero-knowledge if no information about the witness or the secret is revealed to the verifier other than the fact that the statement about the witness is true. [Bootle 2015] .

[0016] At the heart of many interactive zero-knowledge protocols is a commitment scheme, which is used for arithmetic circuit satisfiability. Commitments enable a prover to commit to a secret value in advance, and later verifiably reveal (disclose) the secret value. A commitment scheme has two main properties. First, it is hidden - the commitment keeps the value secret. Second, it is binding - only the commitment to the original committed value is disclosed. Pedersen commitment [Bootle 2015] The scheme involves two elliptic curve generator points: a set of primes of order p known to all parties G and F in . The field of prime numbers generated by the committer The secure random number r in , and then computes (via elliptic curve addition / multiplication) the commitment to the secret value s:

[0017] Com(s,r)=s×G+r×F

[0018] Here, × represents the elliptic curve point multiplication.

[0019] The promiser can fully disclose the promise (i.e., the promise can be verified) at a later stage by providing the values ​​s and r. The promiser can also disclose the promise in response to a specific challenge value as part of the ∑ protocol, without revealing the secret s or the random number r.

[0020] Pedersen commitments are additively homomorphic, which means that adding two commitments together (on an elliptic curve) results in a commitment to the sum of the values ​​of the commitments, i.e.:

[0021] (s 1 ×G+r 1 ×F)+(s 2 ×G+r 2 × F)=(s 1 +s 2 )×G+(r 1 +r 2 )×F

[0022] The proof of satisfiability of arithmetic circuits can be implemented in "zero knowledge". ) is a virtual construction of arithmetic gates connected by wires (forming a directed acyclic graph) that can perform arbitrarily complex calculations, where the calculations are limited to integer operations and must not have data-dependent loops or mutable states.

[0023] Each gate has two input lines and one output line, and performs a multiplication (×) or addition (+) operation on the inputs. Figure 1a shows a left line input (w L ) and right line input (w R ) and a line output (w O ) is a schematic diagram of the multiplication gate, and Figure 1b shows a schematic diagram of a simple arithmetic circuit having three gates, three input lines ((w 1 、w 2 、w 3 ), an output line (w 6 ) and two internal lines (w 5 、w 6 ).

[0024] In practice, a complete circuit has free input and output wires that define external (circuit) input values ​​and output values. A legal assignment is to restrict the values ​​of the wires to those that satisfy the circuit, i.e., to assign a value to each wire where the output of each gate correctly corresponds to the product or sum of the inputs (i.e., the gates are consistent).

[0025] For a given arithmetic circuit, the prover can prove to the verifier that they know the legal assignment for the circuit without revealing the wire values ​​by first committing to each wire value in the legal assignment (using a Pedersen commitment), and then executing a specific ∑ protocol with the verifier for each gate in the circuit (which can be executed in parallel) using the wire values ​​as witnesses. These ∑ protocols exploit the homomorphic properties of Pedersen commitments, as described below.

[0026] To generate a proof (proof that the circuit is satisfied), initially the prover performs a i Generate commitments (i=1,…,n, where n is the number of threads) and send them to the verifier:

[0027] W i =Com(w i ,r i )

[0028] For each "addition" gate in the circuit ( Figure 1b As shown in Figure 1), execute Σ zero Protocol: This involves proving (with zero knowledge) that w L +w R -w O = 0 (i.e., the addition gate is satisfied: input line w L and w R Equal to the output line w O ). This includes the following steps:

[0029] 1. The prover generates a commitment to zero: B = Com(0, r B ) and sends it to the validator.

[0030] 2. The validator responds with a random challenge value:

[0031] 3. The prover then calculates the opening value: z = x(r L +r R -r O )+r B and send it to the validator.

[0032] 4. As w L +w R -w O = 0, the verifier checks that Com(0,z) = x×(W L +W R -W O )+BB represents a curve point, similar to a public key; B=rx F+0x Gr B Indicates the corresponding paired private key.

[0033] For each "multiplication" gate (such as Figure 1a As shown), execute Σ prod Protocol: This involves proving (with zero knowledge) that for each multiplication gate w L ·w R =w O (i.e., the multiplication gate is satisfied).

[0034] 1. The prover generates 5 random blind values:

[0035] 2. The prover calculates C 1 =Com(t 1 ,t 3 ), C 2 =Com(t 2 ,t 5 ) and C 3 =t 1 ×W R +t 4 ×F, and then send them to the validator.

[0036] 3. The validator responds with a random challenge value:

[0037] 4. The prover calculates the public value:

[0038] e 1 =w L x+t 1

[0039] e 2 =w R x+t 2

[0040] z 1 =r L x+t 3

[0041] z 2 =r R x+t 5

[0042] z 3 =(r O -w L r R )x+t 4

[0043] and send them to the validator.

[0044] 5. Then as w L ·w R =w OThe verifier checks the following equation:

[0045] Com(e 1 ,z 1 )=x×W L +C 1

[0046] Com(e 2 ,z 2 )=x×W R +C 2

[0047] e 1 ×W R +z 3 ×F=x×W O +C 3 .

[0048] Σ zero Protocol and Σ prod The protocol can be run in parallel to verify each gate in the circuit, and the same verifier challenge value (x) can be used for all gates.

[0049] For example, consider Figure 1b Circuit in: To enable the prover to prove to the verifier with zero knowledge that they know a legal assignment (i.e., the wire value satisfies the circuit), the prover initially sends the verifier a wire commitment (W) for each gate. 1 ,…,W 6 ) and ∑ protocol commitments (which are one additional commitment for each addition gate and five for each multiplication gate).

[0050] The validator then responds with a random challenge And the prover computes the public value for each gate (one for each addition and five for each multiplication) and sends it back to the verifier. The verifier then performs a Σ protocol check to verify that:

[0051] w 1 ·w 2 =w 4

[0052] w 4 ·w 5 =w 6

[0053] w 2 +w 3 =w 5

[0054] And therefore, the commitment W 1 ,…,W 6 Corresponding to the line value w that satisfies 1 ,…,w 6 .

[0055] If the prover wants to show that, in addition to satisfying the circuit, a particular wire also has a particular value, they can fully disclose the commitment to the relevant wire. In this example, the prover can additionally send the verifier the value w 6 and r 6 (The verifier can then confirm that W 6 =Com(w 6 ,r 6 )) to demonstrate w 6 is the actual output from a particular legal assignment.

[0056] Figure 1b The examples in are trivial circuits. In reality, useful circuits consist of many more gates. Of particular interest is the arithmetic circuit for the SHA-256 hash function - this circuit enables a prover to demonstrate that they know the pre-image (input) of the SHA-256 function that hashes a particular (output) value, without revealing the pre-image. One of the most efficient implementations of the circuit for the SHA-256 algorithm consists of 27,904 arithmetic gates. [Zcash 2016] To then prove knowledge of the SHA-256 preimage would require sending about 5MB of data from both the initial commitment and the opening round of the protocol described above, and would require about 200,000 elliptic curve operations (taking a few seconds of processor time each) for both the prover and the verifier.

[0057] Several methods have been developed to significantly improve the performance of the parallel Σ protocol method for proving the satisfiability of arithmetic circuits. [Bootle 2016][Groth 2009] Involves batching commitments to circuit line values ​​to significantly reduce the size of the data that must be sent from the prover to the verifier (i.e., reduce communication complexity). These methods achieve communication complexity from Reduce to or The proof system.

[0058] Again, as a comparison to prove the satisfiability of the same SHA circuit, the protocol [Bootle 2016] The proof key is only 5KB in size and the key generation time is 180ms. The proof is 24KB in size and takes about 4 seconds to generate, and the proof also takes about 4 seconds to verify.

[0059] These methods are not fully described here except for explaining the main vector batching protocol used in the following steps. This follows the same properties as the standard Pedersen commitment, but for n elements (m=m1 ,…,m n ) requires only sending a single group element:

[0060] 1. The prover and verifier agree on the group elements

[0061] 2. The prover generates n random numbers

[0062] 3. The prover calculates point K i =x i ×F(fori=1,…,n). These values ​​form the proof key PrK sent to the verifier.

[0063] 4. The prover generates a random value:

[0064] 5. The prover calculates the commitment:

[0065]

[0066] and send it to the validator. Summary of the invention

[0067] In general, the present invention is a computer-implemented method for performing zero-knowledge proof or verification of a statement. A prover can use the method herein to prove to a verifier that a statement is true while keeping the witness for the statement secret.

[0068] In particular, a witness may be access data that, when obtained, enables a verifier to access data protected by the witness. The blockchain network and its functionality may be used to protect the protected data. More particularly, a witness may be access data that enables the determination of a private key of a specified vanity address on the blockchain network.

[0069] These statements are compound statements that involve both arithmetic circuit satisfiability and subordinate statements about the validity of the public key (key statement proofs).

[0070] Our method can be used in known circuit satisfiability protocols, such as existing discrete logarithm-based zero-knowledge proof protocols. This method is particularly suitable for protocols that do not require the use of bilinear pairing-friendly elliptic curves.

[0071] In this method, the prover sends a data set to the verifier that includes a statement that for a given function circuit output and elliptic curve point, the function circuit input is equal to the corresponding elliptic curve point multiplier. The statement can be that the prover knows the private key of a specified vanity address on the blockchain network.

[0072] The data includes individual line commitments and / or batches of commitments, inputs and outputs of the circuit for the statement. The prover may include in the data the specification of the or each elliptic curve used in the statement, or may have shared the specification of the or each elliptic curve used in the statement in advance. The prover then sends a public in response to a challenge from the verifier. Alternatively, the prover additionally includes a proof key.

[0073] Using the data received from the prover, the verifier is able to determine that the circuit is satisfied and verify the statement, thereby determining that the prover holds witness to the statement. Elliptic curve points can also be calculated. Upon receiving the data, the verifier determines by calculation that the data complies with the statement. The present invention is particularly suitable for zero-knowledge proofs of the equivalence of hash preimages and elliptic curve private keys.

[0074] Thus, according to the present invention, there is provided a method and system as defined in the appended claims.

[0075] It is therefore desirable to provide a computer implemented method that is a computer implemented method for implementing a trustless zero-knowledge contingent payment or exchange of reward data from a buyer or verifier in exchange for access data from a seller or prover. The reward data can be data associated with the payment, such as an allocation of unspent transaction outputs (UTXOs). The access data can be a secret key from an EC key pair or provide access to a secret key from an EC key pair. In general, the method enables a verifier to prove that they possess requested data.

[0076] A computer-implemented method may be provided for enabling a trustless zero-knowledge contingent payment or exchange of reward data from a buyer or verifier in exchange for access data from a seller or prover, the method comprising:

[0077] Receive the buyer's public key (pk B ), the buyer's public key (pk B ) is obtained by converting the buyer's secret key (sk B ) is derived by multiplying the elliptic curve generator point (G);

[0078] Generate the seller's public key (pk s ), the seller's public key (pk s ) is determined by multiplying a seller secret key (i) by an elliptic curve generator point (G), wherein the seller secret key is access data or is used to protect access data required by the buyer;

[0079] Preparing and sending a data set to a buyer, the data set comprising a zero-knowledge proof statement that is a given function circuit output and an elliptic curve point for an arithmetic circuit representing the statement, the function circuit input being equal to the seller secret key (i), wherein the statement enables the buyer to determine that the circuit is satisfied and verify the statement, thereby determining that the seller possesses the seller secret key required to unlock access to the data;

[0080] Receive the first transaction Tx from the buyer 1 , the first transaction Tx 1 an output comprising reward data distributed to the buyer, the reward data being accessible using the seller's secret key (i);

[0081] Sign and broadcast the first transaction on the blockchain so that the first transaction is mined into a block and the second transaction Tx is provided 2 To access the first transaction Tx 1 The second transaction supplies the seller's secret key (i) to unlock the reward data, which is then leaked on the blockchain, thereby enabling the buyer to obtain the access data provided by the seller.

[0082] The method includes: receiving a buyer public key from a buyer, the buyer public key being derived from multiplying a buyer secret key with an elliptic curve generator. The buyer public key may be a "seed" for protecting access data or maintaining confidentiality of access data or a secret key. The method also includes: generating a seller public key determined from multiplying a seller secret key with an elliptic curve generator, wherein the seller secret key is access data or access data required to protect the buyer. In addition, the method includes: preparing a data set and sending it to the buyer, the data set including a zero-knowledge proof statement that for a given functional circuit output and an elliptic curve point, the functional circuit input is equal to the seller secret key, wherein the statement enables the buyer to determine that the circuit is satisfied and verify the statement, thereby determining that the seller holds the seller secret key required to unlock the access data; receiving a first transaction Tx from the buyer 1 , the first transaction Tx 1 The method includes: signing and broadcasting the first transaction on the blockchain so that the first transaction is mined into a block and providing the second transaction Tx 2 To access the first transaction Tx 1 The second transaction supplies the seller's secret key (i) to unlock the reward data, which is then leaked on the blockchain, allowing the buyer to obtain the access data provided by the seller. In addition to providing the seller's secret key, the verifier can also provide its signature.

[0083] The method can be used by a prover or seller to implement a zero-knowledge contingent transaction for access data (e.g., encryption keys). The prover can be in contact with the verifier or buyer to confirm the reward data to be provided and the access data to be received, and establish a communication channel with the verifier. The communication channel can be public.

[0084] The prover or seller can receive the elliptic curve public key pk from the verifier or buyer B , the seller has obtained a secure random secret key sk B Generate the public key, where

[0085] pk B =sk B ×G, and G is an elliptic curve, and

[0086] The prover or seller can ensure that a lock value i is provided for accessing the data so that

[0087] Access data = pk B +i×G

[0088] And the seller can use his public key pk S and the output f(i) from the functional circuit is included in the data set sent to the buyer, where pk S =i×G, and the functional circuit input is the locked value i.

[0089] The prover or seller can send a statement(S) proof to the verifier or buyer, which proves to the verifier that the input of the functional circuit is the input corresponding to pk S This enables the verifier to verify the proof and confirm that the corresponding private key pk = pk V +pk P The address of the lock matches the agreed pattern, thus confirming that knowing the lock value i can derive the complete private key (sk B +i), and the locked value i is the functional circuit input to the functional circuit i.

[0090] The seller can receive the transaction Tx from the buyer 1 , the transaction Tx 1 Contains an output containing the reward data to be received, which can be accessed through the signature and function circuit input i from the seller, and the seller can sign and broadcast the transaction on the blockchain where the transaction is mined into blocks, so that by providing the second transaction Tx 2 The seller can get the transaction Tx 1 The output of the second transaction Tx obtains access data. 2Provide its signature and value i to unlock the transaction, which is then revealed on the blockchain, allowing the buyer to identify the locked value i and obtain the access data provided by the seller, where

[0091] sk=sk B +i,

[0092] Among them, pk = sk × G.

[0093] From the buyer or verifier's perspective, it is also desirable to provide a complementary computer-implemented method to extend the method of the present invention to reciprocal actions by the verifier in a plug-socket manner. The present invention extends to full cooperation between the prover and the verifier.

[0094] Therefore, the present invention also lies in a computer-implemented method for implementing a trustless zero-knowledge contingent payment or exchange of reward data from a buyer or verifier in an exchange process of access data from a seller or prover, the method comprising: sending a buyer's public key to the seller, the buyer's public key derived from multiplying the buyer's secret key with an elliptic curve generator; receiving a data set from the seller, the data set comprising a zero-knowledge proof statement, which is that for a given function circuit output and an elliptic curve point, the function circuit input is equal to the seller's secret key, wherein the seller's public key is derived from multiplying the seller's secret key with the elliptic curve generator, wherein the seller's secret key is the access data or is used to protect the access data; verifying the proof; sending a first transaction Tx to the buyer 1 , the first transaction Tx 1 An output comprising assigning reward data to the buyer in exchange for obtaining access data, the reward data being accessible using the seller's secret key; confirming on the blockchain that the seller has signed and broadcasted the first transaction so that the first transaction is mined into a block, thereby enabling the seller to be rewarded by providing the second transaction Tx 2 The seller can access the first transaction Tx 1 The output reward data of the second transaction Tx 2 Provide their signature and the seller's secret key to unlock the reward data; and obtain access data provided by the seller. This method can be used by a buyer or a verifier to conduct zero-knowledge contingent transactions or payments for data (e.g., encryption keys).

[0095] The method may also include: sending the elliptic curve public key pk to the seller B , the seller has obtained a secure random secret key sk B The public key is generated, where

[0096] pk S =sk S×G, and G is an elliptic curve, and

[0097] The seller ensures that a lock value i is provided for accessing the data so that

[0098] Access data = pk S +i×G

[0099] And use the dataset to receive the seller's public key pk S and the output f(i) from the functional circuit, where pk S =i×G, and the functional circuit input is the locked value i.

[0100] The prover or seller can send a statement(S) proof to the verifier or buyer, which proves to the verifier that the input to the functional circuit is the input corresponding to pk S This enables the verifier to verify the proof and confirm that the corresponding private key pk = pk V +pk P The address of the lock matches the agreed pattern, thus determining that knowing the lock value i can derive the complete private key (sk B +i), and the locked value i is the functional circuit input to the functional circuit i.

[0101] The method may also include: sending a transaction Tx containing the output to the buyer 1 , which output contains the access data to be received, which can be accessed through the signature and function circuit input i from the seller, where the seller signs and broadcasts the transaction on the blockchain where the transaction is mined into blocks, so that by providing the second transaction Tx 2 The seller can access the transaction Tx 1 The output data of the second transaction Tx 2 Provide its signature and value i to unlock the transaction, which is then exposed on the blockchain, access the blockchain to identify the locked value i and access the digital content provided by the seller, where

[0102] sk=sk B +i,

[0103] Where pk = sk × G

[0104] The reward data to be received from the seller may be an unspent transaction output or UTXO.

[0105] The access data to be provided by the seller is a secret key to the vanity address, or a secret key that enables the vanity address to be determined. The seller secret key may be a lock value i, which is used to protect the digital content and is required by the buyer. The desired vanity address is specified in advance.

[0106] Therefore, it is also desirable to provide a computer-implemented method, which is a computer-implemented method for implementing zero-knowledge proof or verification of a statement, in which a prover proves to a verifier that the statement is true while keeping a witness (w) of the statement secret. The proof may be an explicit proof.

[0107] The method includes: a prover sends a data set to a verifier. The data set includes a statement having an arithmetic circuit, the arithmetic circuit having m gates and n wires, the arithmetic circuit being configured to implement a functional circuit and determine whether, for a given functional circuit output (h) and an elliptic curve point (P), a functional circuit input (s) to the functional circuit or a wire in the functional circuit is equal to a corresponding elliptic curve point multiplier (s). The functional circuit may be a circuit that implements the function of a hash function. The preimage of the hash function circuit or a wire in the functional circuit may be equal to the corresponding elliptic curve point multiplier.

[0108] The data also includes individual line commitments and / or batches of commitments. The or each commitment may be an encrypted line input and output for a gate of a circuit. The data also includes inputs. The inputs operate as key disclosures for lines [elliptic curve points (P)] of an arithmetic circuit. Either the prover or the verifier may name the line. The input or key disclosure may be for the first line in the circuit. The data also includes functional circuit outputs. The specification of the or each elliptic curve used in the statement may be included in the data.

[0109] After sending the data, the prover receives the challenge value from the verifier and replies with a public statement. The public statement can be a value statement according to the ∑ (sigma) protocol. The public value can be for each gate of the circuit that enables the verifier to determine that the statement is true and calculate the elliptic curve point.

[0110] As an alternative to waiting for a challenge, the prover may additionally send a proof key to the verifier. The proof key may be generated from data that is part of the proof. The proof key may be a hash value of one or more random numbers used in the proof.

[0111] The data sent to the verifier enables the verifier to determine that the circuit is satisfied, compute the elliptic curve point and verify the statement, thereby determining that the prover has a witness to the statement.

[0112] The disclosure of the data set sent and / or the challenge sent to the verifier can act like a key created independently of the verifier. The challenge from the verifier is similar to confirming the prover's identity and the integrity of the key.

[0113] The input or key disclosure may be to the first wire in the arithmetic circuit. However, it is preferred to select a random wire, since proving knowledge of an intermediate wire is more difficult than proving knowledge of the first wire. Furthermore, selecting an arbitrary wire other than the first wire is more robust and prevents a malicious third party from discovering evidence or witnessing.

[0114] It is also desirable to provide a complementary computer-implemented method, which is a computer-implemented method for implementing zero-knowledge proof or verification of a statement, in which the verifier verifies that the statement is true by analyzing data received from the prover without knowing the witness (w) to the statement. Clearly, the method of the present invention extends to peer-to-peer actions taken by the verifier in a plug-and-socket manner. The present invention extends to full cooperation between the prover and the verifier.

[0115] The prover can send a separate line commitment and communicate with the verifier using the ∑ (Sigma) protocol to prove knowledge of the witness. Upon receiving a separate line commitment from the prover, the verifier can communicate with the prover using the ∑ protocol to confirm that the prover has knowledge of the witness.

[0116] In addition to or as an alternative to waiting for a challenge value, the prover may also send a random value to the verifier to enable the verifier to determine that the statement is true and calculate an elliptic curve point. Upon receiving the data from the prover, the verifier may alternatively receive a random value to enable the verifier to determine that the statement is true and calculate an elliptic curve point. The random value may be a function of at least one commitment. The function may be a hash function.

[0117] The random value or challenge may be replaced to improve the convenience and efficiency of the process. There is also a risk associated with the verifier generating a non-random challenge in an attempt to extract information about the witness. Moreover, replacing the challenge value with a random value provided by the prover converts the method from an interactive method to a non-interactive method. The prover can generate a proof that can be independently and publicly verified offline. The random value may be the output from a hash function. Replacing the random value (x) with the output from one or more committed hash values ​​utilizes the Fiat-Shamir principle.

[0118] The random value can be calculated by hashing the concatenation of all commitments generated by the prover and sent to the verifier.

[0119] Commitments can be:

[0120] W i =Com(w i ,r i )

[0121] in

[0122] Com is a commitment to functional circuits,

[0123] w i is the line value,

[0124] r i is a random number that is different for each line commitment, and

[0125] i is the line name,

[0126] so that

[0127] Com(w,r)=w×G+r×F

[0128] in

[0129] F and G are elliptic curve points.

[0130] The input to line l in the arithmetic circuit can be:

[0131] ko=r l x F,

[0132] in

[0133] ko is the public input of the key,

[0134] r l is a random number, and

[0135] F is a point on the elliptic curve.

[0136] The line may be the first line in the circuit.

[0137] The verifier can confirm that the circuit is satisfied and is able to compute the public key for line l via elliptic curve point subtraction:

[0138] pk l =Com(w l ,r l )-ko l

[0139] The prover can send batches of line commitments and generate random numbers to compute the elliptic curve point for each line, thus forming the proving key.

[0140] The batch commitment to the witness can be

[0141]

[0142] in

[0143] r is a random number generated by the prover,

[0144] The prover calculates the line value w iThe commitment of a vector w (for i=1,…,n), where w n will be made public by the key,

[0145] K i is the computed elliptic curve point,

[0146] w i is the line value, where w n The key is made public.

[0147] F is a point on the elliptic curve.

[0148] The input to line n in the arithmetic circuit is:

[0149]

[0150] in

[0151] ko n is the public input of the key,

[0152] r is a random number, and

[0153] F is a point on the elliptic curve.

[0154] The input may be for the first line.

[0155] The verifier can calculate the public key of the key statement line through elliptic curve arithmetic:

[0156] pk n =Com(w)-ko n

[0157] Additionally, the prover may send a fully public commitment to at least one line. The method may use a Pedersen commitment. The statement may use only one arithmetic circuit for the functional circuit. The functional circuit may implement a hash function. The hash function may be a SHA-256 hash function.

[0158] The method can be used by a prover to implement a zero-knowledge contingent transaction (which can be a zero-knowledge contingent transaction) for data (e.g., an encryption key), wherein the prover contacts the verifier to confirm the data to be provided (which can be a vanity address) and the data to be received (the data can be a payment in the form of a UTXO), and establishes a communication channel with the verifier (the channel can be public), and the prover receives the elliptic curve public key pk from the verifier B , the verifier has obtained a secure random secret key sk B Generate the elliptic curve public key pk B ,in

[0159] pk V =sk V×G, and G is an elliptic curve,

[0160] The prover ensures that a lock value i is provided for the data such that

[0161] data = pk V +i×G

[0162] The prover can perform a search for the desired pattern in the Base58 encoded address derived by changing i. The prover sends its public key pk to the verifier. P and the output f(i) from the functional circuit, where pk P =i×G, and the function circuit input (eg, pre-image) is the locked value i.

[0163] The prover can send a statement proof to the verifier, which proves to the verifier that the input to the functional circuit is consistent with pk P The corresponding private key enables the verifier to verify the proof and confirm that pk=pk V +pk P The corresponding addresses match the agreed-upon pattern, thereby determining that knowledge of the lock value i enables the derivation of the complete private key for the data, and determining that the lock value i is a functional circuit input to the functional circuit.

[0164] The prover can receive transactions Tx from the verifier 1 , the transaction Tx 1 Contains an output containing the data to be received, which can be accessed through a signature from the prover and the function circuit input i. This transaction can be a hashed time-locked function. The data to be received can provide access to the UTXO.

[0165] The prover can sign and broadcast the transaction on the blockchain where the transaction is mined into blocks, enabling the prover to 2 To access the transaction Tx 1 The output data of the second transaction Tx 2 Provide its signature and value i to unlock the transaction, which is then revealed on the blockchain, allowing the verifier to identify the locked value I and access the data provided by the prover, where

[0166] sk=sk B +i,

[0167] Where pk = sk × G

[0168] The data to be provided by the prover may include a vanity address. The data to be received from the verifier may include a UTXO.

[0169] Transactions can be completely atomic and trustless: the buyer can only pay if he provides a valid value i that is publicly revealed on the blockchain. Due to the splitting of the private key, the value exposed on the blockchain is useless to anyone else and does not compromise the security of the full private key.

[0170] A computer-implemented method may involve a prover performing a trustless fair exchange of data with a verifier (without a third-party centralized exchange). This may be described as a cross-chain atomic swap or atomic transaction, as in this context refers to the fair exchange property: either both parties complete their transaction or neither completes the transaction. This exchange may be performed between blockchains that support scripting functions that implement hashed and time-locked contracts.

[0171] The prover has access to first data on a first blockchain, and the verifier has access to second data existing on a second blockchain, and the prover and the verifier agree to exchange the data. The method includes: the prover generates a key pair for the second blockchain, sends the public key to the verifier, and retains the private key; the prover receives the verifier's public key for the first blockchain, the verifier has generated a key pair for the first blockchain and retains the private key; the prover sends a statement, one or more commitments, input or key disclosure and function circuit output and elliptic curve specification.

[0172] The prover can create the first blockchain transaction Tx A , the transaction Tx A The first data is sent to a public public key address, and the transaction is broadcasted on the first blockchain network, wherein the address is defined by the sum of the input and the public key of the verifier. After no exchange is made within 24 hours of the exchange, the prover can access the data.

[0173] The prover can verify the second blockchain transaction Tx B , the transaction is to confirm the first blockchain transaction Tx A The transaction is created by the verifier on the second blockchain network after being included in the first blockchain and broadcasted on the second blockchain network, the transaction sends the second data to the prover's public key address, which is accessible to the prover using a valid signature for the prover's public key address and a value that is an input to the functional circuit used to determine the output of the functional circuit. The verifier can access the data after no exchange is performed within 24 hours of the exchange.

[0174] The prover confirms the second blockchain transaction Tx BThe second data is included on the second blockchain and accessed by providing its signature and the value of the function circuit input as the function circuit output, thereby enabling the verifier to observe the value of the function circuit input used to determine the function circuit output and access the first data by providing a signature using the private key (for P C , which is the homomorphic property of elliptic curve point multiplication s B +s).

[0175] As described above, each action of the prover requires a counterpart action of the verifier to verify the proof. The present invention extends to methods or actions performed by the verifier. Thus, there is provided a computer-implemented method for achieving zero-knowledge proof or verification of a statement, in which the prover proves (preferably explicitly) to the verifier that the statement is true, while keeping the witness to the statement secret, the method comprising: the verifier receives from the prover: a statement having an arithmetic circuit, the arithmetic circuit having m gates and n wires configured to implement a function circuit (preferably a hash function), and determining whether, for a given function circuit, and preferably a specified function circuit, output, and elliptic curve point, the function circuit input or preimage of the function is equal to the elliptic curve point multiplier. The verifier also receives: individual wire commitments and / or batches of commitments for the wires of the circuit, which are encrypted wire inputs and outputs; inputs or key disclosures for the wires in the arithmetic circuit (preferably wires other than the first wire); and the function circuit output (h). The verifier may also receive a specification of the elliptic curve or each elliptic curve used in the statement. The verifier may send a challenge value to the prover and then receive the disclosure. The disclosure may be made in accordance with the ∑ protocol and contain the values ​​of each gate of the circuit that enable the verifier to determine that the statement is true and compute the elliptic curve point. Additionally or alternatively, the verifier may receive a proof key from the prover.

[0176] The verifier then determines that the circuit is satisfied and computes the elliptic curve point (P) and verifies the statement, thereby determining that the prover holds a witness to the statement (w).

[0177] This can be achieved by proving with zero knowledge that the prover knows the value of each gate of the statement circuit using the Sigma protocol (if the proof is interactive) or using the proof key (if the Fiat-Shamir heuristic is used). The verifier can receive Σ_zero and Σ_prod commitments for each gate from the prover, reply with a challenge value, receive the public value from the prover, and check the commitment. The verifier can confirm that the circuit is satisfied by computing the public key for line 1 via elliptic curve point subtraction. The verifier can confirm that each public key for each line matches the key(s) specified in the statement. The verifier can determine that the fully public lines match the values ​​that can be specified in the statement to complete the verification.

[0178] It is also desirable to provide a computer-readable storage medium comprising computer-executable instructions that, when executed, configure a processor to perform a method performed by a prover, a verifier, or a cooperating prover and verifier.

[0179] It is also expected to provide an electronic device, the electronic device comprising: an interface device; one or more processors coupled to the interface device; a memory coupled to the one or more processors, the memory having computer executable instructions stored thereon, the computer executable instructions configuring the one or more processors to perform the method claimed herein when executed. It is also expected to provide a node of a blockchain network, the node being configured to perform the method claimed. It is also expected to provide a blockchain network having a node, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0180] The above has been used in the technical background section Figure 1a and Figure 1b A basic system for interactive zero-knowledge proofs is described, where Figure 1a is a schematic diagram of a multiplication gate having left and right line inputs and one line output, and Figure 1b is a schematic diagram of an arithmetic circuit with three gates, three input lines, one output line, and two internal lines.

[0181] Aspects of the invention will become apparent from and elucidated with reference to the embodiments described herein. Embodiments of the invention will now be described by way of example only and with reference to the accompanying drawings, in which:

[0182] Figure 2 is a schematic diagram of a composite circuit for a statement, the composite circuit comprising arithmetic circuits for a hash function and an elliptic curve multiplication;

[0183] Figure 3 is an alternative schematic diagram of an arithmetic circuit for the compound statement of FIG1 , wherein only one arithmetic circuit is required;

[0184] Figure 4 is a schematic diagram of an arithmetic circuit having four gates and five wires, wherein the public key of the wire is revealed or disclosed from the wire commitment having the public value of the key;

[0185] Figure 5 is a schematic representation of data exchanged between a prover and a verifier for proof of a statement S, the statement having a circuit description and a first line having a corresponding public key;

[0186] Figure 6 is an alternative schematic representation of the data exchanged between the prover and the verifier; and

[0187] Figure 7Is verified by the verifier Figure 4 Schematic diagram of the checks that are performed when the circuit is satisfied, where the input line has the required public key and the hash value of the output line has the required value. DETAILED DESCRIPTION

[0188] Overview

[0189] The present invention enables efficient zero-knowledge verification of compound statements involving both arithmetic circuit satisfiability and subordinate statements about the validity of public keys (key statement proofs). Public key elliptic curve specifications are employed in homomorphic commitment functions to prove circuit satisfiability. This enables proving public key statements corresponding to private keys used as circuit inputs and / or outputs in an efficient manner.

[0190] The proof size and computational expense of generating proofs for statements involving both circuit satisfiability and elliptic curve key pairs can be greatly reduced. The method in this paper can be easily incorporated into existing discrete logarithm-based zero-knowledge proof protocols for circuit satisfiability without the need to use bilinear pairing-friendly elliptic curves.

[0191] Two applications of this method are described in relation to fair exchange transactions between two parties on a blockchain. The first application involves zero-knowledge contingent payments for trustless sales of outsourced vanity addresses, which requires a zero-knowledge proof of equality of a SHA256 hash preimage and an elliptic curve secret key. The second application involves improving the security of cross-chain atomic swaps, which requires proving that a SHA256 hash preimage is equal to an unknown private key (using a supplied public key) multiplied by a supplied nonce.

[0192] General solution

[0193] The present invention relates to a method that enables proving a specific class of compound statements involving a relationship with an elliptic curve public / private key pair (based on elliptic curve point multiplication).

[0194] Using zkSNARKs to prove statements involving arbitrary cryptographic elliptic curve key operations is considered impractical, and therefore the method uses information about the elliptic curve public key extracted directly from the 'homomorphic hiding' (or commitment scheme) used in constructing proofs for general circuit satisfiability. The specific type of elliptic curve involved in the method's statements is the same as the elliptic curve used in the circuit commitment scheme.

[0195] However, SNARK methods involve pairing operations and therefore require special bilinear pairing-friendly elliptic curves. Since the elliptic curves used on some blockchains are not compatible with bilinear pairing-friendly elliptic curves, the use of zk-SNARKs is excluded.

[0196] Therefore, the method of the present invention is compatible with alternative protocols for proving satisfiability of arithmetic circuits that do not rely on pairing and have fewer cryptographic assumptions. Overall, the method of the present invention is more efficient than zkSNARKS because less computation is required and the size of proofs for trustless exchange applications is reduced.

[0197] For example, the composite circuit representing the following "Statement 1" Figure 2 The schematic diagram of contains subcircuits for both hash functions and elliptic curve multiplication. Figure 2 , the schematic has three inputs: a secret key "s" with a corresponding paired public key "P" and a value "h" that is a hash value of the secret key "s". The schematic contains two arithmetic circuits, where the first arithmetic circuit performs hashing on the secret key and the second arithmetic circuit performs elliptic curve multiplication on the secret key. The output of the circuit is compared to the input.

[0198] Note that the inner gate is only used for illustration purposes. The circuit checks that the output of the hash is equal to the elliptic curve (EC) public key. Only the input "h", "P" and the output are fully revealed to the verifier. All other values ​​are encrypted.

[0199] Statement 1

[0200] “Given the output h of a hash function (H) and an elliptic curve point P (public key),

[0201] Then the hash preimage s (i.e., h = H(s)) is equal to the elliptic curve point multiplier (the private key, i.e., P = s × G, where G is the elliptic curve generator point)"

[0202] This method enables the prover to prove that particular statement with zero knowledge. Examples of applications that benefit from this method are described below in relation to trustless exchange of data and anonymous and secure cross-chain atomic swaps.

[0203] For example, verification of the truth of statement 1 is deterministic using the following pseudocode function, which takes inputs "h", "P", and "s" and outputs "1" if the statement is true and "0" otherwise:

[0204]

[0205] in accordance with Figure 2 , verifying “Statement 1” with zero-knowledge (i.e., the prover keeps the value of “s” secret from the verifier using a zkSNARK system) would require arithmetic circuits for both hash functions and elliptic curve point multiplication.

[0206] While arithmetic circuits for the SHA-256 hash function are widely used and optimized, and typically contain fewer than 30,000 multiplication gates, there are no known examples in the literature of arithmetic circuits that implement cryptographic elliptic curve point multiplication. Even if such circuits were known, they would be impractical due to their size and complexity and the fact that they contain many more gates.

[0207] like Figure 2 As shown, the method operates using the complete arithmetic circuit for a single hash function. Figure 2 Schematic diagram with arithmetic circuits for compound statement 1 using key statement proof and only one arithmetic circuit for the hash function. The circuit checks if the output of the hash is correct and if the public key is equal to the input of the EC encryption (key statement proof). The values ​​highlighted in blue (i.e., input "h", "P", and output "1") are revealed to the verifier, and all other values ​​are encrypted.

[0208] use Figure 3 The prover can unambiguously prove through circuit satisfiability that the secret key "s" hashes to "h", and the corresponding public key "P" of the key pair is equal to "s×G", where G is the elliptic curve generator point. The secret key "s" is the original graph of the hash, or the input to the function, and is not revealed to the verifier when proving the statement.

[0209] It is worth noting that verifying that “s×G” is equal to “P” can be extracted from the circuit proof at negligible additional computational cost by employing the required elliptic curve in the commitment scheme as part of the proof protocol. Such an operation is called “key statement proof” and uses a commitment disclosure procedure called “key disclosure”.

[0210] Technical Effects

[0211] Known zero-knowledge succinct non-interactive arguments of knowledge (zk-SNARKs) are implementations of a generalized proof system for the satisfiability of arithmetic circuits. In the SNARK framework, a statement encoded as an arithmetic circuit is transformed into a construction called a quadratic arithmetic program (QAP), which consists of a set of polynomial equations. The statement is then proved by demonstrating the validity of this set of equations at a single point. The main advantage of the SNARK approach is that the verifier only needs to perform a few elliptic curve (pairing) operations (taking a few milliseconds), and the proof is very small (288 bytes) and is independent of the circuit size.

[0212] The very small proof and verification times achieved by the SNARK method come at the expense of a trusted setup, nonstandard cryptographic assumptions, and a heavier computational burden on the prover. The SNARK method also requires the use of elliptic curve bilinear pairings. However, the use of computationally feasible bilinear pairings requires the use of special "pairing-friendly" elliptic curves. This precludes the use of many standard cryptographic elliptic curve parameter sets. Statements involving general elliptic curve point multiplications must then use explicit circuits (which can be very large).

[0213] By way of comparison with the ∑ protocol method described in the previous section for proving SHA circuit satisfiability, using the SNARK (Pinocchio) framework, it will take about 10 seconds to generate the proof key and the proof key size will be about 7MB, and the proof will also take about 10 seconds to generate. However, the proof size is 288B and only takes about 5 milliseconds to verify. [Bootle 2016] .

[0214] Additionally, incorporating explicit elliptic curve multiplication (key statements) into the circuit multiplies both the proof key size and proof generation time by at least an order of magnitude.

[0215] The present invention implements zero-knowledge proofs of statements involving both elliptic curve public-private key relationships and general arithmetic circuit satisfiability. In addition to proving the satisfiability of arithmetic circuits, this can be done with negligible computational cost and avoids the need to create explicit arithmetic circuits for elliptic curve point multiplication operations which would greatly increase the computational cost of the proof.

[0216] Implementation

[0217] Implementations of the present invention are described below for batched and un-batched commitment based zero-knowledge proof systems.

[0218] In the example, there are two parties involved in the zero-knowledge proof protocol: the prover (P) and the verifier (V). The goal of the protocol is for the prover to convince the verifier of a given statement while keeping the information about the witness of the statement secret. is true. This statement is represented by an arithmetic circuit with m gates and n wires. and about (one or more) elliptic curve public keys pk l The key statement may be composed of subordinate assertions of, the (one or more) elliptic curve public keys corresponding to one (or more) circuit line values, where the subscript l is the line index of the key statement. In addition, the statement may also include assertions about fully public (public) line values ​​(i.e., public inputs / outputs of the circuit).

[0219] The elliptic curve public key(s) specified in the statement are matched to the target elliptic curve specification (which is defined by the complete set of elliptic curve parameters: Corresponding.

[0220] In one case, these parameters are determined by the specification of secp256k1 [SEC 2010] The specification includes the base generator point G. In addition to specifying the base point, the statement must also specify a second point F (where F = f × G, and f is The value of f must be provably random, or a "nothing up my sleeve" number, such as the first 256 bits of the binary representation of π, because allowing the prover to make free choices for f would allow them to generate forged proofs.

[0221] about Figure 4 describes batched and unbatch commitments, Figure 4 is a representative arithmetic circuit with four gates and five wires. The input wire (w 1 ) to make its public key from the value of 'keypublic' 1 The line promises W 1 Leaked or made public.

[0222] Implementation – Separate Line Promise

[0223] by Figure 4 For example, 'key disclosures' are separate commitments for each wire in the circuit, created by the prover and sent to the verifier. These key disclosures follow a known Σ protocol for satisfiability of arithmetic circuits. Figure 5 The data exchanged between the prover and the verifier is shown.

[0224] Satisfiability is achieved through a number of steps including the following:

[0225] 1. Each line i (i=1,…,n) of the circuit is committed to a Pedersen commitment:

[0226] W i =Com(w i ,r i )

[0227] in,

[0228] Com(w,r)=w×G+r×F

[0229] 2. For circuit line l that requires proof of its corresponding public key (key statement proof), the prover will also send the key public key:

[0230] ko l =r l ×F

[0231] 3. Optionally, if circuit line j needs to be revealed publicly (fully public line), the prover sends a fully public tuple:

[0232] (w k ,r j )

[0233] 4. Then use the ∑ protocol to prove with zero knowledge that each gate of the circuit is satisfied, which involves the prover computing and sending ∑ for each gate zero and Σ prod Commitment (i.e., B or C, respectively 1 , C 2 , C 3 ), and the verifier responds with a challenge value (x), then the prover sends the public values ​​(z value and e value), and then the verifier checks the commitment.

[0234] 5. Once the verifier confirms that the circuit is satisfied, the verifier calculates the public key of line l through elliptic curve point subtraction:

[0235] pk l =Com(w l ,r l )-ko l

[0236] 6. Then, the verifier confirms each pk l The key(s) specified in the statement are matched (and the fully public line matches the specified value) to complete the verification.

[0237] Implementation details – separate line promises

[0238] continue Figure 4 , provides an explicit example of separate commitment and verification of a detailed example, which describes verifying the satisfiability of a simple arithmetic circuit using both a key statement proof in one of the lines and a complete revelation of the other line.

[0239] like Figure 4 The circuit shown With 5 lines w i (i=1,…,5) and 4 gates g j (j=1,...,4). Gates 1 and 3 are addition gates, and gates 2 and 4 are multiplication gates.

[0240] The prover and verifier agree on a statement that includes the circuit, the value of line 5, and the public key of line 1, along with the elliptic curve and commitment specification. The statement that the prover wants to prove to the verifier is true. yes:

[0241] “I know that satisfying circuits The assignment of (i.e., the line value that satisfies all gates Where line 1 has the public key P (ie, P = w 1 ×G), while line 5 has value h (i.e., w n =h)”

[0242] The values ​​of lines 1 to 4 are not revealed. Then, the prover and the verifier Figure 6 , and as follows:

[0243] 1. The prover generates 5 random blind values ​​(r 1 ,…,r 5 ), then calculate the 5 line commitments (W 1 ,…,W 5 ) and sends these to the validator.

[0244] 2. The prover calculates the public key for line 1: ko 1 =r 1 ×F and send it to the verifier.

[0245] 3. The prover will focus on line 5 (w 5 ,r 5 )’s fully public information is sent to the verifier.

[0246] 4. For the addition gate (g 1 and g 3 ), the prover generates a commitment to zero (using a random nonce r B1 and r B3 ): B 1 =Com(0,r B1 ) and B 3 =Com(0,r B3 ) and send them to the validator.

[0247] 5. For the multiplication gate (g 2 and g 4 ), the prover will generate the commitment as follows:

[0248] For Gate 2:

[0249] C 12 =Com(t 12 ,t 32 ),

[0250] C 2 =Com(t 22 ,t 52 ),as well as

[0251] C 3=t 12 ×W 1 +t 42 ×F

[0252] For Gate 4:

[0253] C 14 =Com(t 14 ,t 34 ),

[0254] C 2 =Com(t 24 ,t 54 ),as well as

[0255] C 3 =t 14 ×W 3 +t 44 ×F

[0256] Among them, t xx The value is a random blinding nonce. The prover sends these commitments to the verifier.

[0257] 6. The verifier then generates a random challenge value x and sends it to the prover. Alternatively, the prover can use the Fiat-Shamir heuristic to generate the value x by hashing the concatenation of all commitments.

[0258] 7. For the addition gate (g 1 and g 3 ), the prover computes the following public and sends it to the verifier:

[0259] z 1 =x(r 1 +r 1 -r 2 )+r B1

[0260] z 3 =x(r 2 +r 1 -r 4 )+r B3

[0261] 8. For the multiplication gate (g 2 and g 4 ), the prover computes the following public and sends it to the verifier:

[0262] e 12 =w 1 x+t 12

[0263] e 22 =w 2 x+t 22

[0264] z 12 =r 1 x+t 32

[0265] z 22 =r 2 x+t 52

[0266] z 32 =(r 3 -w 1 r 2 )x+t 42

[0267] e 14 =w 3 x+t 14

[0268] e 24 =w 4 x+t 24

[0269] z 14 =r 3 x+t 34

[0270] z 24 =r 4 x+t 54

[0271] z 34 =(r 5 -w 3 r 4 )x+t 44

[0272] 9.Finally, the verifier checks for equality. If these pass, the proof is verified.

[0273] exist Figure 7 The verification performed by the verifier is outlined in , where the checks in the inner box will verify that the circuit is satisfied and that the first line has the required public key and line 5 has the required value.

[0274] Figure 5 and 6 The challenge “x” in provides an interactive proof where communication goes back and forth between the prover and the verifier.

[0275] This interaction may be convenient when zero-knowledge contingent payments (ZKCP) occur, as the seller and buyer may not be available or online at the same time. In addition, the buyer (verifier) ​​may want the proof to be publicly verifiable, for example it may be part of an advertisement for a digital good.

[0276] Furthermore, proofs are strictly zero-knowledge only in the perfect special-honest verifier model: that is, the verifier is assumed to generate truly random numbers as challenges, rather than choosing challenge values ​​to try and extract information about the witness.

[0277] To address these issues, the Fiat-Shamir heuristic is applied, which replaces the random challenge value "x" with the output of the hash value of the commitment made by the prover. In the random oracle model (where the output of the cryptographic hash function is considered truly random), the prover cannot cheat, and the verifier can check the generated challenge value.

[0278] Therefore, this example can be improved by converting the interactive proof system into a non-interactive proof system using the Fiat-Shamir heuristic, and the prover can generate a proof that can be independently and publicly verified offline.

[0279] More specifically, the challenge value (x) is replaced by all the commitments generated by the prover by hashing (using, for example, SHA-256) (i.e., all line commitments for sum gates and product gates, respectively, and all B and C 1 , C 2 , C 3 The value computed by the concatenation of promises.

[0280] Implementation – Batched Vector Commitments

[0281] Commitment to vector [Bootle 2016,Groth 2009] A batched circuit satisfiability compression proof system uses the method described below, wherein the method is capable of extracting key statement proofs from batches of circuit line commitments.

[0282] To avoid repetition, the entire process is not described, and the following steps focus on the generation of batched line commitments and demonstrate that they contain a specified public key. In the following steps, batched commitments are generated as follows, where line l will be provided with the key public-batch n lines together in a vector commitment.

[0283] 1. The prover generates n-1 random numbers

[0284] 2. The prover calculates the elliptic curve point K i =x i ×G(for i=1,…,n-1).

[0285] These values ​​plus K n =G forms the proof key PrK which is sent to the verifier.

[0286] 3. The prover generates a random value:

[0287] 4. The prover calculates the line value w i The commitment of a vector w (for i=1,…,n), where w n To be public by key:

[0288]

[0289] and send it to the validator.

[0290] 5. The prover also sends the public key for the vector commitment:

[0291]

[0292] 6. The verifier calculates the public key of the key statement line through elliptic curve arithmetic:

[0293] pk n =Com(w)-ko n SUMMARY OF THE INVENTION

[0295] Proofs of equality of hash preimages and elliptic curve private keys can be used in numerous applications. Two applications are described below that outline specific examples of constructing zero-knowledge proofs of key statements for application.

[0296] For the purpose of the example application, the following statement is a more specific version of statement 1 above, where

[0297]

[0298] “Given a SHA-256 hash function (H) with public output h and a public point P on the secp256k1 elliptic curve, then the secret preimage s of the hash (i.e., h = H(s)) is equal to the elliptic curve point multiplier (i.e., the corresponding private key, i.e., P = s × G)”

[0299] In the example provided, the statement is represented by a single arithmetic circuit for the SHA-256 hash function. (with n lines w i (i=1,…,n) and m gates) and input lines (w 1 ) is the private key of the public point P and the output line (w n ) is equal to h, that is:

[0300] Through the line W 1 ×G=PANDw nTo satisfy

[0301] Therefore, to fully verify the statement, the prover must use a commitment scheme based on secp256k1 to demonstrate to the verifier that they know a satisfying assignment for the SHA256 circuit, and then only provide the key public for line 1 (ko 1 ) and full disclosure for line n (w n ,r n ). The verifier will not get the input line (w 1 ) value, and will not be obtained except for the fully public output line w n Any other line value other than .

[0302] Application I

[0303] As described in the implementation section above, examples of the present invention may be applied to a ZKCP that outsources a vanity address representing data to be exchanged for payment or access to a resource.

[0304] The address is encoded in a human-readable alphanumeric format (Base58 encoding) to make it easy to disclose, copy and transcribe. The use of this format has led to the popularity of so-called vanity addresses, where a brute force search of the key space is performed in order to find a private key, the result of which is an address containing the desired string (such as a name), such as the one shown below.

[0305]

[0306] Since deriving vanity addresses with significant patterns can be computationally expensive (e.g., the address shown above requires generating approximately 10 13 different public keys), so the search is often outsourced, and there are several online marketplaces for delegating and selling vanity addresses. This can be done securely using the homomorphic properties of point multiplication over elliptic curves. [JoelKatz 2012] .

[0307] While outsourcing this generation is safe, the sale of vanity addresses is not trustless. Either the buyer gets the required value before the seller gets paid, or the seller gets paid before releasing the required value, or they both have to trust the escrow service. The present invention can be employed to enable trustless sales of vanity addresses via ZKCP. The steps taken between the buyer / verifier and the seller / prover are as follows.

[0308] 1. The buyer and seller reach a consensus on the desired vanity mode (Str) and price, and establish a communication channel that does not need to be protected.

[0309] 2. The buyer generates a secure random secret key sk BAnd the corresponding elliptic curve public key, where the public key pk B =sk B ×G

[0310] 3. The buyer will pk B Send to seller.

[0311] 4. Then, the seller changes i from pk = pk B +i×G performs a search for the desired pattern in the Base58 encoded address derived from

[0312] 5. When an address with the desired pattern is found, the seller saves the value i, signals the buyer, and then sends them pk s =i×G and SHA256 hash H(i).

[0313] 6. The seller also provides the buyer with the original image for H(i) corresponding to pk s , as described in the example above.

[0314] 7. The buyer verifies the certificate and also confirms that pk=pk B +pk s The corresponding address matches the agreed-upon pattern. At this point (by virtue of the proof), the buyer knows that the learned value i will allow them to derive the full private key (sk) for the vanity address. B +i), and the particular value i is hashed to h=H(i).

[0315] 8. The buyer then constructs a hashed time-locked contract (HTLC) transaction Tx 1 , the transaction contains an output that contains the agreed-upon fee (a). This output can be unlocked in two ways:

[0316] i. Unlock at any time using the signature and hash preimage i from the seller.

[0317] ii. Unlocking with a signature from the buyer after a specified time by using, for example, the CHECKLOCKTIMEVERIFY (OP_CLTV) script opcode, which can be used to prevent the output from being spent before a specified time or block height.

[0318] 9. The buyer then signs the transaction and broadcasts it to the blockchain where it is mined as a block.

[0319] 10. Once confirmed, the seller can send the transaction by providing the transaction Tx 2 Come to Tx 1 The output of the transaction Tx 2Its signature and value i are provided to unlock the hash lock, which is then revealed on the blockchain.

[0320] 11. The buyer can calculate the final vanity address private key sk = sk B +i, where pk = sk × G

[0321] 12. If the buyer fails to provide the value i before the specified OP_CLTV time, the seller can provide his signature to reclaim the fee (to prevent losing fees due to an uncooperative buyer).

[0322] The transaction is thus completely atomic and trustless: the buyer can only pay if he provides a valid value i that is publicly disclosed on the blockchain. Due to the splitting of the private key, this value is useless to anyone else and the security of the full private key is not compromised.

[0323] General Applications

[0324] The present invention is applicable to zero-knowledge proof or verification of a statement (S), in which the prover proves the statement to the verifier that it is true while keeping the witness (w) of the statement secret. The secret can be processed by a function such as a hash function, but the secret additionally includes cryptographic elliptic curve key operations, such as the validity of the statement about the public key. In the above example, the method of the present invention has been used to implement a trustless ZKCP for vanity addresses. This can also be applied to, for example: the derivation of passwords; the verification of valid machine-readable documents, such as passports or identity cards; or other such confidential transactions.

[0325] It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design many alternative embodiments without departing from the scope of the invention as defined by the appended claims.

[0326] In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The words "comprises" and "comprising" and the like do not exclude the presence of elements or steps other than those listed in any claim or in the specification as a whole. In this specification, "comprises" means "including or consisting of" and "comprising" means "comprising or consisting of".

[0327] The singular reference of an element does not exclude the plural reference of such elements and vice versa.The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer.

[0328] In a device claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.

[0329] References

[0330] [Campanelli 2017]Campanelli, Matteo, et al. "Zero-knowledge contingent payments revisited: Attacks and payments for services." Commun.ACM(2017).

[0331] [Maxwell 2016] https: / / github.com / zcash-hackworks / pay-to-sudoku

[0332] [Parno 2016]Parno,Bryan,et al."Pinocchio: Nearly practical verifiablecomputation."Security and Privacy(SP),2013IEEE Symposium on.IEEE,2013.

[0333] [Libsnark 2016] https: / / github.com / scipr-lab / libsnark

[0334] [Bootle 2015]Bootle,Jonathan,et al."Efficient zero-knowledge proofsystems."Foundations of Security Analysis and Design VIII.Springer,Cham,2015.1-31.

[0335] [Groth 2009]Groth,Jens."Linear Algebra with Sub-linear Zero-KnowledgeArguments."CRYPTO.Vol.5677.2009.

[0336] [JoelKatz2012]

[0337] https: / / bitcointalk.org / index.php?topic=81865.msg901491#msg901491

[0338] [Bootle 2016]Bootle,Jonathan,et al."Efficient zero-knowledgearguments for arithmetic circuits in the discrete log setting."AnnualInternational Conference on the Theory and Applications of CryptographicTechniques.Springer,Berlin,Heidelberg,2016.

[0339] [SEC 2010]Standards for Efficient Cryptography(SEC)(CerticomResearch,http: / / www.secg.org / sec2-v2.pd

Claims

1. A computer-implemented method for implementing a trustless zero-knowledge contingent payment or exchange of reward data from a buyer or verifier in exchange for access data from a seller or prover, wherein the access data provides access to a secret key, the method being implemented by a processing resource, the method include: Receive the buyer's public key (pk B ), the buyer's public key (pk B ) is obtained by converting the buyer's secret key (sk B ) is multiplied by the elliptic curve generator point (G); Generate the seller's public key (pk s ), the seller's public key (pk s ) is determined from multiplying a seller secret key (i) by an elliptic curve generator point (G), wherein the seller secret key is access data or the seller secret key is used to protect access data required by the buyer; preparing and sending a data set to the buyer, the data set including a zero-knowledge proof statement that, for a given functional circuit output and elliptic curve point of an arithmetic circuit representing the statement, the functional circuit input is equal to the seller secret key (i), wherein the statement enables the buyer to determine that the circuit is satisfied and verify the statement, thereby determining that the seller possesses the seller secret key required to unlock the access data; Receive the first transaction Tx from the buyer 1 , the first transaction Tx 1 An output comprising distributing reward data to the buyer, the reward data being accessible using the seller's secret key (i); Sign and broadcast the first transaction on the blockchain so that it is mined into a block, and provide the second transaction Tx 2 To access the first transaction Tx 1 Output reward data of the second transaction Tx 2 The seller's secret key (i) is provided to unlock the reward data, which is then leaked on the blockchain, thereby enabling the buyer to obtain the access data provided by the seller.

2. The computer-implemented method of claim 1, in, The prover or seller receives the elliptic curve public key pk from the verifier or buyer B , the buyer has obtained a secure random secret key sk B The public key is generated, where pk B =sk B ×G, where G is an elliptic curve point, and The certifier or seller ensures that a lock value i is provided for accessing the data so that Access data = pk B +i×G The seller sends his public key (pk s ) and the output f(i) from the functional circuit are included in the data set sent to the buyer, where pk S =i×G, and the functional circuit input is the locked value i.

3. The computer-implemented method of claim 1, in, The seller receives a transaction Tx containing an output from the buyer 1 , the output contains the reward data to be received, the reward data being accessed via the signature from the seller and the function circuit input i, The seller signs and broadcasts the transaction on the blockchain where the transaction is mined into a block, so that by providing a second transaction Tx 2 The seller can get the transaction Tx 1 The output of the second transaction Tx 2 Providing its signature and value i to unlock the transaction, which is then revealed on the blockchain, enables the buyer to identify the locked value i and obtain the access data provided by the seller.

4. A computer-implemented method for implementing a trustless zero-knowledge contingent payment or exchange of reward data from a buyer or verifier in exchange for access data from a seller or prover, the method include: Send the buyer's public key (pk B ), the buyer's public key (pk B ) is obtained by converting the buyer's secret key (sk B ) is multiplied by the elliptic curve generator point (G); A data set is received from a seller, the data set comprising a zero-knowledge proof statement, the zero-knowledge proof statement being for a given function circuit output and elliptic curve point of an arithmetic circuit representing the statement, the function circuit input being equal to the seller's secret key (i), wherein the seller's public key (pk s ) is obtained by multiplying a vendor secret key (i) and an elliptic curve generator point (G), wherein the vendor secret key is access data or is used to protect access data; Verification of proof; Send the first transaction Tx containing the output to the buyer 1 , the output distributing reward data to the buyer in exchange for obtaining access data, the reward data being accessible using the seller secret key (i); Confirm on the blockchain that the seller has signed and broadcast the first transaction so that the first transaction is mined into a block, thereby making the second transaction Tx 2 The seller can access the first transaction Tx 1 Output reward data of the second transaction Tx 2 Provide its signature and Seller Secret Key (i) to unlock the Reward Data; and Obtain access data provided by the Seller, The method also includes sending an elliptic curve public key pk to the seller B , the buyer has obtained a secure random secret key sk B The public key is generated, where pk B =sk B ×G, where G is an elliptic curve point, and the seller ensures that a lock value i is provided for accessing the data, such that Access data = pk B +i×G And using the dataset, receive the seller's public key pk S and the output f(i) from the functional circuit, where pk S =i×G, and the functional circuit input is the locked value i.

5. The computer-implemented method of claim 4, further comprising sending a transaction Tx containing the output to the buyer 1 , the output contains the access data to be received, the access data being accessed by means of the signature from the seller and the function circuit input i, in, The seller signs and broadcasts the transaction on the blockchain where the transaction is mined into a block, so that by providing a second transaction Tx 2 The seller can access the transaction Tx 1 Output data of the second transaction Tx 2 Provide its signature and value i to unlock the transaction, which is then published on the blockchain, Access the blockchain to identify the locked value i and access the digital content provided by the seller.

6. A computer-implemented method according to any preceding claim, in, The reward data to be received from the seller includes a cryptocurrency payment.

7. A computer-implemented method according to any preceding claim, in, The access data to be provided by the seller is the secret key of the vanity address or a secret key enabling the determination of the vanity address.

8. A computer-implemented method for performing zero-knowledge proof or verification of a statement (S) according to any preceding claim, wherein in, The prover proves to the verifier that the statement is true while keeping a witness (w) of the statement secret, the method comprising: The prover sends the following to the verifier: a statement (S) represented by an arithmetic circuit having m gates and n wires, the arithmetic circuit being configured to implement a functional circuit and determine, for a given functional circuit output (h) and an elliptic curve point (P), whether a functional circuit input (s) of the wire to the functional circuit is equal to a corresponding elliptic curve point multiplier (s); Individual line commitments and / or batch commitments for lines of a circuit; Functional circuit output (h); Proof Key (PrK), This enables the verifier to determine that the circuit is satisfied and compute the elliptic curve point (P) and verify the statement, thereby determining that the prover possesses a witness to the statement (w).

9. The computer-implemented method of claim 7, in, The prover sends a separate line commitment and communicates with the verifier using the ∑ protocol to prove knowledge of the witness (W).

10. The computer-implemented method according to claim 7 or 8, in, The prover receives a challenge value (x) from the verifier and responds with a disclosure.

11. The computer-implemented method of claim 7, in, The prover sends a random value (x) to the verifier so that the verifier can determine that the statement is true and calculate an elliptic curve point (P).

12. The computer-implemented method of claim 11, in, The random value (x) is a function of at least one commitment.

13. A computer-implemented method according to claim 11 or 12, in, The random value (x) is calculated by hashing the concatenation of all commitments generated by the prover and sent to the verifier.

14. A computer-implemented method according to any one of claims 8 to 13, in, The commitment W i yes: W i =Com(w i ,r i ) in Com is a commitment to functional circuits, w i is the line value, r i is a random number that is different for each line commitment, and i is the line name, so that Com(w,r)=w×G+r×F in F and G are elliptic curve points.

15. The computer-implemented method of claim 14, in, The input to line 1 in the arithmetic circuit is: it = r l x F, in ko is the public input of the key, r l is a random number, and F is a point on the elliptic curve.

16. The computer-implemented method of claim 15, in, The verifier confirms that the circuit is satisfied and is able to compute the public key for line l via elliptic curve point subtraction: pk l =Com(w l ,r l )-me l 。 17. The computer-implemented method of claim 8, in, The prover sends batches of line commitments and generates random numbers to compute an elliptic curve point for each line, forming a proof key (PrK).

18. The computer-implemented method of claim 17, in, The promise of witnessing batches is in r is a random number generated by the prover, The prover calculates the line value w i The commitment of the vector w (for i=1,…,n), Among them, w n will be disclosed by the key, K i is the computed elliptic curve point, w i is the line value, where w n The key is made public. F is a point on the elliptic curve.

19. The computer-implemented method of claim 17, in, The input to line n in the arithmetic circuit is: in ko n is the public input of the key, r is a random number, and F is a point on the elliptic curve.

20. The computer-implemented method of claim 19, in, The verifier computes the public key of the key statement line via elliptic curve arithmetic: pk n =Com(w)-ko n 。 21. A computer-implemented method according to any preceding claim, in, The prover additionally sends a fully public commitment to at least one line of the functional circuit.

22. A computer-implemented method according to any preceding claim, in, The method described uses Pedersen commitments.

23. A computer-implemented method according to any preceding claim, in, The statement uses only one arithmetic circuit for the functional circuit.

24. A computer-implemented method according to any preceding claim, in, The functional circuit implements a hash function, and preferably, implements a SHA-256 hash function.

25. A computer-readable storage medium comprising computer-executable instructions which, when executed, configure a processor to perform the method of any one of claims 1 to 24.

26. An electronic device, include: Interface devices; one or more processors coupled to the interface device; A memory coupled to one or more processors, the memory having computer executable instructions stored thereon, the computer executable instructions configuring the one or more processors to perform the method of any one of claims 1 to 24 when executed.

27. A node of a blockchain network, the node being configured to execute the method according to any one of claims 1 to 24.

28. A blockchain network having a node according to claim 27.