SYSTEM FOR RECORDING VERIFICATION KEYS ON A BLOCKCHAIN
20210377041 · 2021-12-02
Inventors
- Alexandra COVACI (Canterbury, GB)
- Simone MADEO (London, GB)
- Patrick MOTYLINSKI (London, GB)
- Stephane VINCENT (Luxembourg, LU)
Cpc classification
G06F16/27
PHYSICS
H04L9/3239
ELECTRICITY
H04L9/085
ELECTRICITY
H04L9/30
ELECTRICITY
H04L2209/34
ELECTRICITY
H04L9/3218
ELECTRICITY
H04L2209/56
ELECTRICITY
H04L9/3066
ELECTRICITY
H04L9/0618
ELECTRICITY
G06F9/44521
PHYSICS
H04L9/0637
ELECTRICITY
International classification
H04L9/32
ELECTRICITY
G06Q20/06
PHYSICS
G06Q20/40
PHYSICS
H04L9/06
ELECTRICITY
Abstract
Systems and methods described herein relate to the execution of locking transactions in a blockchain system. In the context of smart contracts, it may be advantageous to have a public record (e.g., recorded on a blockchain) of a proof of correct execution of a circuit published by a worker and the verification key, thereby allowing anyone (e.g., nodes of the blockchain) to verify validity of the computation and proof. However, there are challenges to recording large blocks of data (e.g., large keys that may comprise multiple elliptic curve points) on the blockchain. For example, in a Bitcoin-based blockchain network, a protocol that utilizes standard transactions may be constrained to locking scripts and unlocking scripts that are collectively no t larger than a first predetermined size limit, and the size of a redeem script (if utilized) may be limited to being no more than a second predetermined size limit
Claims
1. A computer-implemented method, comprising: obtaining a first script associated with a blockchain transaction, the first script comprising: a first set of commands; and one or more cryptographic hash values; generating a second script comprising: a second set of commands; one or more subsets of a plurality of elements, wherein the plurality of elements collectively form a verification key and the one or more subsets collectively include each element of verification key; the first script; and an identifier associated with a computer system generating the second script; and generating an attestation that the computer system has access to the verification key based at least in part on executing the first set of commands and the second set of commands in connection to determine that the one or more cryptographic hash values match the one or more subsets of the verification key.
2. The computer-implemented method according to claim 1, wherein an element of the plurality of elements is a point on an elliptic curve.
3. The computer-implemented method according to claim 1, wherein the first set of commands and the second set of commands collectively comprise instructions to determine whether a first cryptographic hash value of the one or more cryptographic hash values matches a hash output based at least in part on a subset of the one or more subsets of the verification key.
4. The computer-implemented method according to claim 3, wherein the hash output is generated using at least a SHA-256 and a RIPEMD-160 cryptographic hash algorithm.
5. The computer-implemented method according to claim 1, wherein obtaining the first script comprises: identifying the one or more subsets of the verification key; and calculating, for each subset of the one or more subsets of the verification key, a corresponding cryptographic hash value, wherein the one or more cryptographic hash values comprises each corresponding cryptographic hash value.
6. The computer-implemented method according to claim 1, further comprising, contingent upon verifying the generated attestation, transferring control of digital assets encumbered by the blockchain transaction to the computer system.
7. The computer-implemented method according to claim 6, further comprising obtaining the first script from a second computer system, wherein the second computer system contributed at least part of the digital assets.
8. The computer-implemented method according to claim 1, wherein the blockchain transaction is a P2SH transaction.
9. The computer-implemented method according to claim 1, wherein at least one of the one or more subsets of the verification key is greater or equal to 512 bytes in size and less than or equal to 520 bytes in size.
10. The computer-implemented method according to claim 1, wherein: the first script is greater than or equal to 58 bytes in size and less than or equal to 104 bytes in size; and the second script is greater than or equal to 1628 bytes in size and less than or equal to 1650 bytes in size.
11. The computer-implemented method according to claim 1, wherein the blockchain transaction is a standard transaction in accordance with a blockchain protocol.
12. The computer-implemented method according to claim 1, wherein each element of the verification key is in exactly one of the sub sets.
13. The computer-implemented method according to claim 1, wherein the one or more subsets is one subset, the one subset comprising the verification key.
14. The computer-implemented method according to claim 1, wherein: the first script further comprises a public key associated with the computer system; the identifier associated with the computer system is a digital signature generated using a private key corresponding to the public key associated with the computer system; and the attestation that the computer system has access to the verification key is further based at least in part on the digital signature and the public key.
15. A system, comprising: a processor; and memory including executable instructions that, as a result of being executed by the processor, causes the system to perform the computer-implemented method according to claim 1.
16. A non-transitory computer-readable storage medium having stored thereon executable instructions that, as a result of being executed by a processor of a computer system, cause the computer system to at least perform the computer-implemented method according to claim 1.
17. A system, comprising: a processor; and memory including executable instructions that, as a result of being executed by the processor, causes the system to perform the computer-implemented method according to claim 2.
18. A system, comprising: a processor; and memory including executable instructions that, as a result of being executed by the processor, causes the system to perform the computer-implemented method according to claim 3.
19. A non-transitory computer-readable storage medium having stored thereon executable instructions that, as a result of being executed by a processor of a computer system, cause the computer system to at least perform the computer-implemented method according to claim 2.
20. A non-transitory computer-readable storage medium having stored thereon executable instructions that, as a result of being executed by a processor of a computer system, cause the computer system to at least perform the computer-implemented method according to claim 3.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0031] These and other aspects of the present invention will be apparent from and elucidated with reference to, the embodiment described herein. An embodiment of the present invention will now be described, by way of example only, and with reference to the accompany drawings, in which:
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
DETAILED DESCRIPTION
[0040] Reference will first be made to
[0041] In some embodiments, the nodes 102 can be comprised of any suitable computing device (e.g., by a server in a data centre, by a client computing device (e.g., a desktop computer, laptop computer, tablet computer, smartphone, etc.), by multiple computing devices in a distributed system of a computing resource service provider, or by any suitable electronic client device such as the computing device 800 of
[0042] As shown in
[0043] As for which nodes 102 can communicate with which other nodes, it can be sufficient that each of the nodes in the example blockchain network 100 are able to communicate with one or more other of the nodes 102 such that a message that is passed between nodes can propagate throughout the example blockchain network 100 (or some significant portion of it), assuming that the message is one that the blockchain protocol indicates should be forwarded. One such message might be the publication of a proposed transaction by one of the nodes 102, such as node 102A, which would then propagate along a path such as a path 106. Another such message might be the publication of a new block proposed for inclusion onto a blockchain.
[0044] In an embodiment, at least some of the nodes 102 are mining nodes that perform complex calculations, such as solving cryptographic problems. A mining node that solves the cryptographic problem creates a new block for the blockchain and broadcasts the new block to others of the nodes 102. The others of the nodes 102 verify the work of the mining node and, upon verification, accept the block into the blockchain (e.g., by adding it to the distributed ledger of the blockchain). In some examples, a block is a group of transactions, often marked with a timestamp and a “fingerprint” (e.g., a hash) of the previous block. In this manner, each block may become linked to a previous block, thereby creating the “chain” that links the blocks in the blockchain. In embodiments, valid blocks are added to the blockchain by a consensus of the nodes 102. Also in some examples, a blockchain comprises a list of validated blocks.
[0045] In an embodiment, at least some of the nodes 102 operate as validating nodes that validate transactions as described in the present disclosure. In some examples, a transaction includes data that provides proof of ownership of a digital asset (e.g., a number of Bitcoins) and conditions for accepting or transferring ownership/control of the digital asset. In some examples, an “unlocking transaction” refers to a blockchain transaction that reassociates (e.g., transferring ownership or control) at least a portion of a digital asset, indicated by an UTXO of a previous transaction, to an entity associated with a blockchain address. In some examples, a “previous transaction” refers to a blockchain transaction that contains the UTXO being referenced by the unlocking transaction. In some embodiments, the transaction includes a “locking script” that encumbers the transaction with conditions that must be fulfilled before ownership/control can be transferred (“unlocked”).
[0046] In some embodiments, the blockchain address is a string of alphanumeric characters that is associated with an entity to which control of at least a portion of a digital asset is being transferred/reassociated. In some blockchain protocols implemented in some embodiments, there is a one-to-one correspondence between a public key associated with the entity and the blockchain address. In some embodiments, validation of transactions involves validating one or more conditions specified in a locking script and/or unlocking script. Upon successful validation of the transaction 104, the validation node adds the transaction 104 to the blockchain and distributes it to the nodes 102.
[0047] Systems and methods described herein in relation to an illustrative application of the invention relate to the execution of locking transactions in a blockchain system. The locking transaction may refer to a transaction that initialises constraints upon which the unlocking transaction can be validated. The invention can be used, in some illustrative applications, to securely list and exchange transactions. In the context of smart contracts, it may be advantageous to have a public record (e.g., recorded on a blockchain) of a proof of correct execution of a circuit published by a worker and the verification key, thereby allowing anyone (e.g., nodes of the blockchain) to verify validity of the computation and proof. However, there are challenges to recording large blocks of data (e.g., large keys that may comprise multiple elliptic curve points) on the blockchain. For example, in a Bitcoin-based blockchain network, a protocol that utilizes standard transactions may be constrained to locking scripts and unlocking scripts that are collectively no more than 1650 bytes in size, and a redeem script (if utilized) may be limited to no more than 520 bytes in size.
[0048] A verifiable computation is a technique that allows the generation of proofs of computation. In an illustrative embodiment, such a technique can be utilized by a client to outsource, to another computing entity referred to herein as a worker, the evaluation of a function f on an input x. In some cases, the client is computationally limited so that it is infeasible for the client to perform the evaluation of the function (e.g., the expected runtime of the calculation using computing resources available to the client exceeds a maximum acceptable threshold), although such need not be the case, and the client may, generally, speaking, delegate evaluation of the function f on the input x based on any suitable criterion, such as computational runtime, computational cost (e.g., the financial cost of allocating computing resources to perform the evaluation of the function), and more.
[0049] A worker, in an embodiment, is any suitable computing entity such as a blockchain node as described in greater detail elsewhere in the present disclosure, such as those described in connection with
[0050] An efficient variant of a zero-knowledge proof of knowledge is zk-SNARK (Succinct Non-interactive ARgument of Knowledge). In an embodiment, all pairings-based zk-SNARKs include a process where the worker computes a number of group elements using generic group operations and the verifier checks the proof using a number of pairing product equations. in an embodiment, the linear interactive proof works over a finite field and the worker's and verifier's message include, encode, reference, or otherwise include information usable to determine vectors of field elements.
[0051] In an embodiment, systems and methods described herein allow mining nodes of a blockchain to perform a computation (e.g., evaluation of function f on input x) once and generate a proof that can be used to verify correctness of the output wherein evaluating correctness of the proof is computationally less expensive than evaluating the function. In this context, the cost (i.e., how expensive) of operations and tasks may refer to the computational complexity of performing the operation or task. In an embodiment, computational complexity refers to the average computational cost or the worst-case computational cost of performing the sorting algorithm for example, a heapsort algorithm and a quicksort algorithm both have an average computational cost of O(n log n), but quicksort has a worst-case computational cost of O(n.sup.2) whereas heapsort has a worst-case computation cost of O(n log n). In an embodiment, the average computational cost and/or the worst-case computational cost of evaluating the function f on input x is worse than that of evaluating correctness of the proof. Accordingly, the use of systems and methods described herein are highly advantageous and, may, for example, allow for more computationally expensive contracts to be run as such contacts would not increase the time required to validate the blockchain proportionally. Further advantages may include reduction in power consumption of verifier systems, thereby improving the efficiency of verifier computer systems and reducing the energy costs associated with running such verifier computer systems in evaluating correctness of proofs. Currently, smart contracts must be executed and validated on all nodes this constraint limits the complexity of smart contracts. Methods and systems described herein can be utilized to implement a system that improves the efficiency of the blockchain by executing a contract once to generate a proof of correctness and, based on the proof of correctness provided by the worker and the verification key provided by the client, all nodes of the blockchain can verify validity of the contract. In this way, the efficiency of the blockchain is improved by increasing the throughput of smart contracts that can be performed in aggregate by nodes of the blockchain and/or enable the computation of more computationally expensive smart contracts.
[0052] In an embodiment, a verification key V.sub.K or portions thereof can be extracted from public parameters generated in a setup phase of a zero-knowledge protocol and used together with a proof π, and the input/output data to verify the alleged proof of correctness computation provided by a worker. For example, as described in greater detail above and below, systems and methods that allow a locking script secures the verification key V.sub.K from alteration and checks the validity of the proof π, allowing the execution of a zero-knowledge protocol on blockchain during transaction validation. Accordingly, the present disclosure presents systems and methods that are suitable for recording verification keys on the blockchain wherein a worker is able to prove possession of the correct verification key V.sub.K (e.g., issued by the client) in order to redeem digital assets for the execution of a set of operations (e.g., execution of a smart contract).
[0053]
[0054] A setup phase may be performed as part of a process to outsource the performance of computational tasks. A client, as referred to below, may refer to an entity such as a customer or client computer system that delegates performance of a computational task to a worker, which may be a different computer system. Clients may, generally speaking, delegate the performance of computational tasks for a variety of reasons, including but not limited to limited computing resources, lack of computing resources, financial costs associated with utilizing a client computer system to perform the task, energy costs associated with utilizing a client computer system to perform the task (e.g., a mobile device or laptop that relies on a battery for power may utilize a worker to perform computationally intensive tasks, thereby saving power and prolonging the usage of the battery-powered device), and more.
[0055] In an embodiment, the setup phase involves a client, customer, employee of an organization, or any other suitable entity writing contracts in a formal language with precise semantics. The contract may be written in a high-level programming language such as C or Java. Generally speaking, contracts may be expressed in any language or syntax that is or can be converted to a format that can be manipulated by a computer system. In an embodiment, a domain specific language, with a limited purpose, may provide type-safety and restricted expressivity may be utilized. The source code generated may be a precise description of a contract.
[0056] The compiler 202 may be any hardware, software, or a combination thereof that includes executable code that, if executed by one or more processors of a computer system, causes the system to take, as input, the source code 206 and produces a circuit. A compiler 202 may refer to a computer program that executes or performs instructions based on instructions that have been compiled into a machine-readable format such as binary code. It should be noted that while a compiler 202 is illustrated, interpreters, assemblers, and other suitable software and/or hardware components may be utilized to convert the source code to a circuit. In an embodiment, the circuit is an arithmetic circuit that comprises wires that carry values from a field F and connect to logical and/or arithmetic gates. In an embodiment, the circuit is used by the system to generate a quadratic program
208 that comprises a set of polynomials that provide a complete description of the original circuit
.
[0057] In an embodiment, the compiler 202 is able to recognise a substantial subset of a programming language such as C or Java including but not limited to: pre-processor directives, static initializers, global and local functions, block-scoped variables, arrays, data structures, pointers, function calls, function operators (e.g., functors), conditionals and loops, and arithmetic and bitwise Boolean operators. In an embodiment, the compiler 202 does not support the entire set of commands in accordance with standards of the programming language (this may, in some cases, be intended to prevent certain types of algorithms from being executed in a smart contract, such as to prohibit recursive algorithms). In an embodiment, the compiler expands expressions of the source code into an arithmetic gate language to produce an arithmetic circuit. Circuit implementations have been contemplated in the past by Campanelli, M., et al. (2017) in “Zero-Knowledge Contingent Payments Revisited: Attacks and Payments for Services” and by Tillich, S. and Smart, B in “Circuits of Basic Functions Suitable For MPC and FHE.” The arithmetic circuit may be utilized to build a Quadratic Arithmetic Problem (QAP) by the compiler 202 or any other suitable hardware, software, or combination thereof (e.g., a software module not illustrated in
[0058] In an embodiment, the key generator 204 is hardware, software, or a combination thereof that includes executable code which, if executed by one or more processors of a computer system, causes the system to generate an evaluation key and a verification key from a quadratic program. Techniques for encoding computations as quadratic programs are contemplated in “Quadratic Span Programs and Succinct NIZKs without PCPs” by Gennaro, R., et al. (2013). In an embodiment, the quadratic arithmetic problem (QAP) encodes the circuit
over a field F and contains a set of m+1 polynomials:
V={v.sub.k(x)}, W={w.sub.k(x)}, Y={y.sub.k(x)}
with 0≤k≤m. A target polynomial t(x) is also defined. Given a function ƒ that takes n elements of F as input and outputs n′ elements, with N=n+n′, then computes ƒ if {c.sub.1, . . . , c.sub.N}∈F.sup.N is a valid assignment of the group of input and outputs off and if there exists a list of coefficients {c.sub.N+1, . . . , c.sub.m} such that t(x) divides p(x):
Therefore, in an embodiment, there must exist some polynomial h(x) such that h(x).Math.t(x)=p(x). The size of is m, and its degree is the degree of t(x).
[0059] In an embodiment, building a QAP for an arithmetic circuit comprises selecting an arbitrary root r.sub.g∈F for each multiplication gate g in the circuit and defining the target polynomial to be t(x)=Π.sub.g(x−r.sub.g). In an embodiment, an index k∈{1 . . . m} is associated to each input of the circuit and to each output from a multiplication gate. The polynomials in V encode the left input into each gate, the W encode the right input into each gate, and the Y encode the outputs. For instance, v.sub.k(r.sub.g)=1 if the k-th wire is a left input to gate g, and v.sub.k(r.sub.g)=0 otherwise. Therefore, for a particular gate g and its root r.sub.g, the previous Equation can be simplified as follows:
(Σ.sub.k=1.sup.mc.sub.k.Math.v.sub.k(r.sub.g)).Math.(Σ.sub.k=1.sup.mc.sub.k.Math.w.sub.k(r.sub.g))=(Σ.sub.k∈I.sub.
The output value of the gate is equal to the product of its inputs. The divisibility check decomposes into deg(t(x)) separate checks, one for each gate g and root r.sub.g of t(x), such that p(r.sub.g)=0. Addition gates and multiplication-by-constant gates do not contribute to the size or degree of the QAP.
[0060] In an embodiment, the QAP is defined over a field Fp, where p is a large prime. In an embodiment, it is desirable that QAP over Fp efficiently computes any function that can be expressed in terms of addition and multiplication modulo p. An arithmetic split gate may be designed to translate an arithmetic wire a∈Fp, known to be in [0, 2.sup.k−1], into k binary output wires. Accordingly, it follows that, Boolean functions can be expressed using arithmetic gates. For instance, NAND(a,b)=1 ab. Each embedded Boolean gate costs only one multiply operation. Moreover, new gates such as split can be defined as standalone and composed with other gates. Given input a∈F.sub.p known to be in [0, 2.sup.k−1], the split gate outputs k wires holding the binary digits a.sub.1, . . . , a.sub.k of a such Σ.sup.k2.sup.i−1a.sub.i=a and each a.sub.i is either 0 or 1.
[0061] Finally, the public parameters to be used by all provers and verifiers are generated by the system as part of the setup phase. It should be noted that the evaluation key E.sub.K and the verification key V.sub.K are derived using a secret value selected by the client. A key generator 204 may utilize the quadratic arithmetic program (QAP) in connection with the key generation algorithm to generate the evaluation key E.sub.K 210 and the verification key V.sub.K 212.
[0062] In an embodiment, performing a computational task involves the computation of a function on an input 216 (i.e., a process for evaluating f(x)) by a worker. In an embodiment, the worker is any suitable computer system that the client may delegate a computational task to. The input 216, in an embodiment, includes information that attests to the worker's identity, such as a digital signature generated using a private key associated with the worker. In an embodiment, the worker is a computer system that the client transfers digital assets to as a result of successful computation. The client, in an embodiment provides an input x and the evaluation key E.sub.K to a worker, the worker uses the evaluation module 214 to a compute routine to compute the output y (i.e., y=f(x) wherein the input is x and the function is f) and uses the evaluation key E.sub.K 210 to produce a proof-of-correctness 218. The evaluation module, in an embodiment, is hardware and/or software that includes instructions that, if executed by one or more processors of a computer system, cause the computer system to evaluate the values of the internal circuit wires of the QAP 208 and produce an output y of the QAP.
[0063] In an embodiment, each polynomial v.sub.k(x) E F of the quadratic program is mapped to an element g.sup.vk(s) in a bilinear group, where s is a secret value selected by the client, g is a generator of the group, and F is the field of discrete logarithms of g. In an embodiment, for a given input, the worker evaluates the circuit to obtain the output and the values of the internal circuit wires, which correspond to the coefficients c.sub.i of the quadratic program. Accordingly, a worker can evaluate v(s)=Σ.sub.k∈{m}c.sub.k.Math.v.sub.k(s) to get g.sup.v(s); compute w(s) and y(s); compute h(x)=p(x)/t(x)=Σ.sup.dh.sub.i.Math.x.sup.i; and compute g.sup.h(s) using the hi and g.sup.s(i) terms in the evaluation key. In an embodiment, the proof-of-correctness 218 comprises (g.sup.v(s), g.sup.w(s), g.sup.y(s), g.sup.h(s)) and a verifier uses the bilinear map to check that p(s)=h(s).Math.t(s). In an embodiment, the proof π is stored on the blockchain 222 for later use or can be verified by multiple parties without requiring the prover to separately interact with each of these. In an embodiment, the evaluation of the circuit storage of the proof-of-correctness may be performed to unlock resources (e.g., digital assets) encumbered by a locking script of a transaction.
[0064] In an embodiment, the proof π is broadcast to a blockchain network and a verifier 220 is used to verify the proof. In an embodiment, the verifier 220 is a computing entity such as a node of the block chain. It should further be noted that in some cases, the computing entity that verifies the proof is the same computing entity that generates the evaluation key E.sub.K and verification key V.sub.K. In an embodiment, nodes of blockchain can validate a payment transaction using the verification key V.sub.K and the proof π, thus validating the contract if the verification succeeds. One requirement of the protocol is that the worker cannot provide incorrect proofs, even when it knows the verification key V.sub.K. Thus, in this protocol, a common reference string (CRS) is produced by the client or by a trusted third party who publishes at least the evaluation key E.sub.K and verification key V.sub.K. In an embodiment, the published verification key V.sub.K can be used by any computing entity to verify computations. In some embodiments, the verification phase is executed using blockchain scripts (e.g., in a Bitcoin-based network) that store the elements used in the verification of the computation, which may be in accordance with techniques described in U.K. Pat. Application No. 1719998.5.
[0065] Using techniques described herein, a client is able to partially obfuscate transaction data, such as the identity of the recipients of a blockchain transaction. In an embodiment, the unlocking script does not expose the recipient's address and the recipient's public key. However, in some cases, the value of the transaction (e.g., amount of digital assets transferred) may be visible to nodes of the blockchain network. In an embodiment, cryptographic techniques as described above and below are utilized by the client to covert locking scripts into quadratic arithmetic programs and the worker to solve arithmetic programs to generate proofs.
[0066] Generally speaking, a client is able to use standard transactions (e.g., standard transactions as defined in a Bitcoin-based blockchain network) such as P2PK and P2PKH to pay a counterparty or worker. For example, in an embodiment, a client converts a P2PK locking script into an arithmetic circuit and broadcasts a payment transaction that includes a puzzle derived from the circuit. A counterparty or worker receives the circuit, provides an appropriate input (e.g., information that attests to the worker's identity such as a shared secret between the client and the worker or a digital signature generated using the worker's private key) and runs the circuit to generate a proof-of-correctness π. In an embodiment, the proof is used to unlock resources (e.g, digital assets), and furthermore, it may be the case that information identifying the counterparty or worker (e.g., a public key and/or digital signature associated with the counterparty or worker) is not recorded to the blockchain in an unobfuscated format.
[0067] In an embodiment, the verification key and the corresponding proof are generated according to techniques described above and/or below. Accordingly, a verifier is given verification key V.sub.K and proof π:
such that the verifier computes a plurality of elliptic curve multiplications (e.g., one for each public input variable) and five pair checks, one of which includes an additional pairing multiplication.
[0068] Given verification key V.sub.K, proof π, and (a.sub.1, a.sub.2, . . . , a.sub.N), to verify that t(x) divides p(x) and hence (x.sub.N+1, . . . , x.sub.m)=ƒ(x.sub.0, . . . , x.sub.N), the verifier proceeds as follows. First it checks all the three α terms:
e(α.sub.vr.sub.vV.sub.mid(s),
)=e(r.sub.vV.sub.mid(s)
,α.sub.v
)
e(α.sub.wr.sub.iW.sub.mid(s),
)=e(α.sub.w,
,r.sub.wW.sub.mid(s)
)
e(α.sub.yr.sub.yY.sub.mid(s),
)=e(r.sub.yY.sub.mid(s)
,α.sub.y
)
wherein V.sub.mid(s)=Σ.sub.i=N+1.sup.ma.sub.iv.sub.i(s), W.sub.mid(s)=Σ.sub.i=N+1.sup.ma.sub.iw.sub.i(s), and Y.sub.mid(s)=Σ.sub.i=N+1.sup.ma.sub.iy.sub.i(s). Then, the verifier checks the term
e(r.sub.vV.sub.mid(s)+r.sub.yY.sub.mid(s)
,β
).Math.e(β
,r.sub.wW.sub.mid(s)
)=e(Z.sub.mid(s)
,
)
and Z.sub.mid(s)=Σ.sub.i=N+1.sup.ma.sub.i(r.sub.vβv.sub.i(s)+r.sub.wβw.sub.i(s)+r.sub.yβy.sub.i(s)). Finally, the verifier checks the divisibility requirement:
e(r.sub.vV(s),r.sub.wW(s)
)=e(r.sub.yY(s)
,
).Math.e(r.sub.yt(s)
,h(s)
)
wherein r.sub.vV (s)=Σ.sub.i=0.sup.mr.sub.va.sub.iv.sub.i(s)
, r.sub.wW(s)
=Σ.sub.i=0.sup.mr.sub.wa.sub.iw(s)
, r.sub.yY(s)
=Σ.sub.i=0.sup.mr.sub.ya.sub.iy(s)
, and h(s)
=Σ.sub.i=0.sup.mh.sub.i
.
[0069] Thus, upon considering the notation from the sections described above and the examples described in this disclosure, the verification comprises a set of pair checks of the following elements, in accordance with one embodiment:
e(π.sub.2,v.sub.K.sup.2)=e(π.sub.1,V.sub.K.sup.3)
e(π.sub.4,V.sub.K.sup.2)=e(V.sub.K.sup.5,π.sub.3,)
e(π.sub.6,V.sub.K.sup.2)=e(π.sub.5,V.sub.K.sup.6)
e((π.sub.1+π.sub.6),V.sub.K.sup.2)=e(π.sub.7,V.sub.K.sup.2)
e((a.sub.0V.sub.K.sup.10+a.sub.1V.sub.K.sup.11+a.sub.2V.sub.K.sup.12+a.sub.3V.sub.K.sup.13+a.sub.4V.sub.K.sup.14+π.sub.2+a.sub.7V.sub.K.sup.15),(a.sub.0V.sub.K.sup.16+a.sub.1V.sub.K.sup.17+a.sub.2V.sub.K.sup.18+a.sub.3V.sub.K.sup.19+a.sub.4V.sub.K.sup.20+π.sub.4+a.sub.7V.sub.K.sup.21))=e((a.sub.0V.sub.K.sup.22+a.sub.1V.sub.K.sup.23+a.sub.2V.sub.K.sup.24+a.sub.3V.sub.K.sup.25+a.sub.4V.sub.K.sup.26+π.sub.6+a.sub.7V.sub.K.sup.15,V.sub.K.sup.2)*e(V.sub.K.sup.9,π.sub.8)
[0070] and connect to addition and multiplication gates. It should be noted that the arithmetic circuit may refer to a logical circuit that can be implemented by a physical circuit comprising a series of physical gates (e.g., using transistor-transistor logic (TTL) integrated circuits such as 7400-series gates, flip-flops, buffers, decoders, multiplexers, and the like) connected by physical wires.
[0071] In an embodiment, the client 302 provides the worker 304 with an arithmetic circuit 310 and an input 312 to the circuit. The circuit 310 may be used to generate a quadratic program that comprises a set of polynomials that provide a complete description of the original circuit. In either case, the worker 304 may execute the circuit
or the quadratic program
on the input 312 to generate one or more outputs 314. In some embodiments, the worker (i.e., the prover) is expected to obtain, as the output, a valid transcript for {
, x,
} that is an assignment of values to the circuit wires such that the values assigned to the input wires are those of x, the intermediate values correspond to the correct operation of each gate in
, and the values assigned to the output wire(s) is
; if the claimed output is incorrect (i.e.,
≠
(x)), then a valid transcript for {
, x,
} does not exist. In an embodiment, the worker is expected to provide a subset of the values of the circuit wires, wherein the selected subset of the values of the circuit wires are not known to the worker a priori.
[0072] In embodiments, the output , the values of the internal circuit wires (or a subset thereof), and the evaluation key EK are used to produce the proof-of-correctness 316. The proof π can be stored on the blockchain and verified by multiple parties without requiring the worker 304 to separately interact with the multiple parties. In this manner, a verifier 306 can validate the payment transaction using the public verification key VK and the proof π, thereby validating the contract. In some cases, the client 302 may reclaim digital assets encumbered by the payment transaction if the verification fails.
[0073] Systems and methods for recording verification keys on a blockchain network are described herein. In many cases, a blockchain system or network is used for ordinary (standard) transactions such as those described above. It is possible, in accordance with an embodiment of this disclosure, to provision systems for creation and processing of smart contracts by applying an implementation of zero-knowledge succinct non-interactive argument of knowledge (zk-SNARKs).
[0074] In an embodiment, transactions contain small programs known as scripts embedded into their inputs and outputs, which specify how and by whom the outputs of the transactions can be accessed. On the Bitcoin platform, these scripts are written using a stack-based scripting language. A blockchain may, furthermore, impose constraints related to the maximum data threshold for the amount of data that can be stored in a block, and protocols may be selected based on the size of keys (e.g., a verification key V.sub.K that encodes multiple elliptic curve points) in relation to the maximum allowable size. For example, in a Bitcoin-based protocol, the total size of the locking and unlocking scripts may not, in an embodiment, exceed 1650 bytes and the size of a redeem script may not exceed 520 bytes. In an embodiment, the unlocking script and/or redeem script include instructions (e.g., opcodes) in addition to encoding verification keys, and may further include additional instructions and/or data for verifying that the worker is in possession of the verification key (e.g., by verifying a digital signature). Accordingly, it is challenging to generate scripts that provide some or all of the functionality as described above, especially in connection with the use of larger key sizes, which may, in an embodiment, provide greater security and/or cryptographic assurances of security.
[0075] In an embodiment, as part of a locking transaction, a client publishes a common reference string (CRS) comprising evaluation and verification keys. In an embodiment, CRS={E.sub.K, V.sub.K}, although it should be noted that, as stated previously, the common reference string can include any additional suitable information. The size of the evaluation key E.sub.K is based at least in part on the size of the circuit under consideration (e.g., the number of elements making up the evaluation key E.sub.K corresponds to and/or is proportional to the number of internal gates of a circuit). The size of the verification key, in an embodiment, depends on the inputs and outputs only. In many cases, it is useful to have a public record of a proof (e.g., a proof of work or a proof of correct execution, as published by the prover/worker) and a corresponding verification key V.sub.K accordingly, any entity that has access to the proof and the verification key V.sub.K is able to verify validity of the computation and the proof. In an embodiment, the verifier 306 is any suitable entity such as a node of a blockchain. It should further be noted that in some embodiments, the verifier 306 and the client 302 are the same computer system. In other words, in some embodiments, any computer system with access to a blockchain network is able to perform a verification process that determines the validity of a computation and proof provided by an alleged prover/worker.
[0076] In some systems, the identity of the worker is known and the client is able to pay for the execution of the contract directory to the worker. In an embodiment, the client pays the worker directly by obtaining an address associated with the worker and transferring digital assets to the address associated with the worker.
[0077] In accordance with various embodiments,
[0078] In an embodiment, a blockchain system supports various types of transactions. In an embodiment, a supported transaction (e.g., a standard transaction) is a script-hash-based transaction such as a Pay-to-Script-Hash (P2SH) transaction in accordance with a Bitcoin-based system. Generally speaking, a script-hash-based transaction refers to any transaction wherein verifying the validity of an unlocking script includes providing a script that matches a specified cryptographic hash value. For example, in a Bitcoin-based P2SH transaction, an unlocking script comprises a redeem script and a locking script comprises at least one condition that the hash of the redeem script supplied by the unlocking script matches a specified value. For example, in a Bitcoin-based system, a locking script may be described based on the following: [0079] OP_HASH160<20-byte hash of redeem script> OP_EQUAL
[0080] In an embodiment, the diagram 400 illustrate in
[0081] The unlocking script 402 comprises a collection of data parameters which satisfy a set of conditions placed in a corresponding locking script. For a P2SH transaction, the locking script typically includes a hash value and requires that the unlocking script includes a redeem script wherein a hash of the redeem script matches the hash value encoded in the locking script. Accordingly, in an embodiment, the locking script encodes the set of conditions indirectly by encoding a hash value based at least in part on the set of constraints and requiring the redeem script presented in the unlocking script to encode the set of constraints.
[0082] Turning to specifics, the unlocking script 402 illustrated in
[0083] The verification key V.sub.K, in an embodiment, comprises a plurality of elements {V.sub.K.sup.1, V.sub.K.sup.2, V.sub.K.sup.3, . . . , V.sub.K.sup.n} wherein each element is a point on an elliptic curve. Elements of the verification key V.sub.K may be partitioned into one or more subsets. For example in
[0084] It should be noted that in some cases, the verification key V.sub.K is not partitioned into multiple non-overlapping subsets and instead is encoded as a single block (i.e., in its entirety) in the unlocking script 402, and a single hash is encoded in the redeem script 404. The unlocking script would function in a similar manner to the embodiment described above and below in connection with the discussion of
[0085] Continuing with the above referenced discussion of the unlocking script 402, the unlocking script may furthermore comprise a redeem script 410. In an embodiment, the redeem script is a set of parameters that, produces a hash output that matches a value encoded in a corresponding locking script. In an embodiment, the locking script, unlocking script, and redeem script are utilized in a two-step process wherein during the first step, the redeem script is checked against the locking script to determine whether the redeem script satisfies the conditions of the locking script, which may include a condition that a hash of the redeem script matches a predetermined value. In an embodiment, the OP_HASH160 opcode is utilized, which hashes the input first with SHA-256 and then with RIPEMD-160 to produce a hash output. In an embodiment, the hash output of an OP_HASH160 operation is 20 bytes (0x14 bytes) in size.
[0086] As stated above, the unlocking script 402 may further comprise opcodes wherein the unlocking script 402 comprises commands and data that, if executed, provide cryptographically verifiable assurances that the worker is in possession of the verification key V.sub.K. For example, one such unlocking script, for an embodiment wherein the verification key V.sub.K is divided into two subsets, may be described in the following manner, illustrated using instructions and data (in brackets) in accordance with a stack-based scripting language such as those utilized by Bitcoin-based systems: [0087] OP_PUSHDATA1 <length of signature> <signature> OP_PUSHDATA1<byte-length of VK1> VK1 OP_PUSHDATA1<byte-length of VK2> VK2 OP_PUSHDATA1 <length of redeem script> <redeem script>
wherein, as stated above, commands (e.g., “OP_PUSHDATA1”) are described without brackets and data is described with brackets (e.g., “<length of signature>” is a 1-byte integer corresponding to the size, in bytes, of the digital signature 406). The notation VK1 refers to a first subset of the verification key V.sub.K, and VK2 refers to a second subset of the verification key V.sub.K such that verification key V.sub.K=VK1∥VK2 and VK1=V.sub.K.sup.1∥V.sub.K.sup.2 . . . ∥V.sub.K.sup.i and VK2=V.sub.K.sup.i+1∥V.sub.K.sup.i+2 . . . ∥V.sub.K.sup.n. It should be noted that in some cases, the various subsets of verification key V.sub.K have the same size (e.g., all or some subsets include the same number of elements of the verification key V.sub.K) but such need not be the case. Additionally “<redeem script>” refers to the functions and data of the redeem script, such as the example redeem script described below.
[0088] In an embodiment, the redeem script 404 is utilized to satisfy one or more conditions encoded in a locking script. For example, a locking script may include a hash value and a condition that the unlocking script include a routine wherein a hash output over the routine results in an output value that matches the hash value included in the locking script. The routine, in an embodiment, is the redeem script 404. In an embodiment, the redeem script 404 comprises, for each subset of the verification key V.sub.K, a corresponding hash value, a public key 414 associated with the worker, and additional opcodes (also referred to as commands, operations, functions, and instructions throughout this disclosure) that, if executed, provide cryptographically verifiable assurances that the worker is in possession of the verification key V.sub.K. In an embodiment, the redeem script 404 is executed in the context of the unlocking script 402. In an embodiment, the hash values encoded in the redeem script are encoded in the reverse order in which the corresponding subsets of the verification key V.sub.K appear in the unlocking script 402. For example, if the first subset 412 appears first in the unlocking script 402, then the corresponding first hash 414 is the last hash value to appear in the redeem script 404. Likewise, the hash 418 corresponding to the last subset of the verification key appears first in the redeem script, relative to the hashes of other subset of the verification key. It should be noted, in this context, the ordering refers to the relative ordering of the hash values and does not imply or impose any ordering relative to other data and other commands encoded in the redeem script 404. Continuing with the previous example, a suitable redeem script is described in the following manner: [0089] OP_HASH160<HVK1> OP_EQUALVERIFY OP_HASH160<HVK2> OP_EQUALVERIFY <PubKey worker> OP_CHECKSIG
wherein, as stated above, commands (e.g., “OP_HASH160”) are described without brackets and data is described with brackets (e.g., “<HVK1>” is a 20-byte value corresponding to the result of applying the OP_HASH160 operation to VK1). In an embodiment, the redeem script is provided by the client to the worker. It should be noted that the redeem script 404, in an embodiment, does not directly provide any information regarding the values of the verification key V.sub.K that may be usable to facilitate a cryptographic attack to determine the verification key V.sub.K.
[0090] In an embodiment, a blockchain protocol defines a maximum size the unlocking script 402 to be 1650 bytes, inclusive. The blockchain protocol may further define a maximum size of 520 bytes as the largest whole chunk of data that can be pushed on the stack. In an embodiment the elements of the verification key are each 32 bits in size. Accordingly, an unlocking script 402 in accordance with the above constraints may include the following:
TABLE-US-00001 Script Size (bytes) Description 0x4c 1 OP_PUSHDATA1 opcode <length of 1 Length of digital signature signature> <signature> 71-73 Digital signature of worker 0x4d 1 OP_PUSHDATA2 opcode 0x200 2 Byte-length of VK1 <VK1> 512 VK1 = V.sub.K.sup.1||V.sub.K.sup.2 . . . ||V.sub.K.sup.16 0x4d 1 OP_PUSHDATA2 opcode 0x200 2 Byte-length of VK2 <VK2> 512 VK2 = V.sub.K.sup.17||V.sub.K.sup.18 . . . ||V.sub.K.sup.32 0x4d 1 OP_PUSHDATA2 opcode 0x1A0 2 Byte-length of VK3 <VK3> 416 VK3 = V.sub.K.sup.33||V.sub.K.sup.34 . . . ||V.sub.K.sup.45 0x4c 1 OP_PUSHDATA1 opcode 0x68 1 Length of redeem script redeem script 0xA9 1 OP_HASH160 opcode 0x14 1 Next 20 bytes is data to be pushed onto the stack <HVK3> 20 Hash of VK3 0x88 1 OP_EQUALVERIFY opcode 0xA9 1 OP_HASH160 opcode 0x14 1 Next 20 bytes is data to be pushed onto the stack <HVK2> 20 Hash of VK2 0x88 1 OP_EQUALVERIFY opcode 0xA9 1 OP_HASH160 opcode 0x14 1 Next 20 bytes is data to be pushed onto the stack <HVK1> 20 Hash of VK1 0x88 1 OP_EQUALVERIFY opcode 0x21 1 Next 33 bytes is data to be pushed onto the stack <PubKey Worker> 33 Public key of worker 0xAC 1 OP_CHECKSIG opcode Total Size: 1630
accordingly, the unlocking script and redeem script described above may be utilized to encode a verification key V.sub.K having 45 elements, each element being 32 bytes in size.
[0091]
[0092] In an embodiment, the first party creates a locking transaction 506 comprising two inputs (e.g., inputs 508 and 510) and two outputs (e.g., outputs 512 and 514) and signs them with an indication as to how the signature should be verified (e.g., using OP_CHECKSIG). In an embodiment, the indication includes an indication of a mode of operation and a modifier indicating who can pay (e.g., anyone can pay). In an embodiment, the inputs and outputs are signed with SIGHASH_SINGLE and SIGHASH_ANYONECANPAY. In an embodiment, the inputs include a transaction amount of a nominal value (e.g., a few satoshis) and the outputs include a transaction amount that includes digital assets for a worker (the value of which may be selected based on various factors such as the value of the contract) and the value of the contract (e.g., the amount that the second party 504 agrees to pay the first party 502 as per the contact terms).
[0093] Generally speaking, the mode of operation may provide an indication of which and/or how various fields of a locking transaction are signed. For example, a first mode of operation (e.g., SIGHASH_ALL) wherein all signable parameters are signed. In an embodiment, this includes all fields of a transaction except the input scripts. A second example of a mode of operation that may be supported is a mode of operation where the outputs are not signed (e.g., SIGHASH_NONE) accordingly, other entities are able to modify the transaction by changing their input sequence numbers. Yet another example of a mode of operation that may be supported is a mode in which the inputs are signed, but the sequence numbers are blanked (e.g., SIGHASH_SINGLE). In an embodiment, some or all modes of operation are supported. Furthermore, in addition to the modes of operation, a separate indication (e.g., SIGHASH_ANYONECANPAY) may be made as to only a single output (or, more generally, any subset of outputs) being signed and the other outputs being anything.
[0094] Next, the locking transaction 506 is provided to the second party 504. The locking transaction is received by the second party who verifies that the locking transaction is correct. In this context, correctness of the locking transaction refers to the locking transaction accurately reflecting the prior agreement between the parties and the verification of correctness includes, for example, verifying the price encoded in the token is the agreed-upon cost between the parties and the terms of the contract are in the form previously agreed upon. In an embodiment, determining correctness of the locking transaction includes verifying the authenticity of a digital signature.
[0095] Upon determining that the locking transaction is correct, the second party 504 adds a new input 516 which can include digital assets (e.g., payment agreed upon as part of the terms of the agreement between the parties) and digital assets for workers to pay for the execution of the contract. The second party 504 may also add an output 518 that constrains the common reference string and signs with SIGHASH_SINGLE or SIGHASH_ALL and broadcasts it (e.g., to a blockchain network). Once the locking transaction is broadcast, the first party 502 may be considered the owner of the contract. In an embodiment, the keys (e.g., the verification key V.sub.K and evaluation key E.sub.K included as part of the CRS) are generated using a field F where F:.fwdarw.
is a function on a field and a corresponding arithmetic circuit
where
=(t(x),
,
,
) is the corresponding quadratic arithmetic program (e.g., a QAP) of size m and degree d. Additionally, in an embodiment, e:
×
.fwdarw.
.sub.T is a bilinear mapping and g is a generator of
. It should be noted that while the representation described in this context is an additive representation chosen for the sake of clarity, other representations (e.g., exponential representation) may be utilized in the context of embodiments in accordance with this disclosure.
[0096] In an embodiment, the evaluation key E.sub.K and verification key V.sub.K are constructed by choosing random or pseudo-random values r.sub.v, r.sub.w, α.sub.v, α.sub.w, α.sub.y, β, γ∈, and setting r.sub.y=r.sub.y.Math.r.sub.w, r.sub.v.Math.g=
g.sub.v
. In other words: (a)=a g generally. Accordingly, the evaluation key E.sub.K is defined as:
E.sub.K({v.sub.k(s)
}.sub.k∈I.sub.
w.sub.k(s)
}.sub.k∈I.sub.
y.sub.k(s)
}.sub.k∈I.sub.
α.sub.vv.sub.k(s)
}.sub.k∈I.sub.
α.sub.ww.sub.k(s)
}.sub.k∈I.sub.
α.sub.yy.sub.k(s)
}.sub.k∈I.sub.
s.sup.i
}.sub.i∈[d],{
βv.sub.k(s)
βw.sub.k(s)
βy.sub.k(s)
}.sub.k∈I.sub.
and the verification key V.sub.K is defined as:
V.sub.K=(1
,
α.sub.v
,
α.sub.w
,
α.sub.y
,
γ
,
βγ
,
t(s)
,{
v.sub.k(s)
w.sub.k(s)
y.sub.k(s)
}.sub.k∈{0}∪[N])
where N=N.sub.in+N.sub.out, i.e., the number of inputs and outputs. In an embodiment, an asymmetric pairing having a pairing mapping would be defined as: e:.sub.1×
.sub.2.fwdarw.
.sub.T, and g.sub.i a generator of
.sub.i, i=1, 2. In that case, V.sub.K would be defined as:
V.sub.K=(1
.sub.1,
1
.sub.2,
α.sub.v
.sub.2,
α.sub.w
.sub.2,
α.sub.w
.sub.1,
α.sub.y
.sub.2,
β
.sub.1,
β
.sub.2,
r.sub.yt(s)
.sub.1,{
v.sub.k(s)
.sub.1
w.sub.k(s)
.sub.2
y.sub.k(s)
.sub.1}.sub.k∈{0}∪[N])
where r.sub.y=r.sub.v.Math.r.sub.w.
[0097] As described above, the evaluation key E.sub.K and verification key V.sub.K are made up of group elements. It should be noted that any group of sufficiently high cardinality is suitable, although for purposes of clarity, the group discussed herein is an elliptic curve.
[0098] In an embodiment, an elliptic curve-based implementation of a pairing function exists. In an embodiment, the cryptography of a blockchain network is based on an elliptic curve such as a secp256k1 elliptic curve. It is possible, in some embodiments, to determine and/or estimate the amount of space that is needed to allocate keys on the blockchain. As discussed above, a subset of the elements of the verification key V.sub.K do not pertain to the size of the circuit and the space required for such fields does not depend on the size of the circuit.
[0099] In some cases, the maximum size of a standard blockchain transaction corresponds to the maximum size of a block. Various blockchain systems may have various upper limits, such as in a Bitcoin-based system wherein a standard transaction has a defined maximum block size of 1 MB and a maximum standard transaction size of 100 KB. In some blockchain systems such as a Bitcoin-based system a redeem script is 520 bytes or less in size. The maximum size of the redeem script, in an embodiment, is the largest whole chunk of data that can be pushed on the stack while still conforming to the conditions of a standard transaction. The upper bound on the unlocking input script and the locking script (e.g., P2PK, P2PH, and more), in an embodiment, is 1650 bytes. In an embodiment, this is equivalent to the script storing or otherwise encoding 15 public keys. In an embodiment, an unlocking script is referred to as an input script or a signature script (e.g., ScriptSig) and comprises a collection of data parameters which satisfy conditions placed in the previous locking script which may be referred to as an output script or scriptPubKey.
[0100] Accordingly, in an embodiment, the redeem script and the corresponding input script are arranged in such a manner that the largest amount of data possible is attached, the arrangement of the redeem script, the corresponding input script, and/or other data based at least in part on the maximum size. In an embodiment, an unlocking script comprises or otherwise encodes a digital signature. In an embodiment,
[0101] In an embodiment, data is recorded in non-standard transaction either in addition to and/or in place of standard transactions. The hardcoded script length, in an embodiment, is 10 kilobytes (KB) and a set of mining nodes of a blockchain accept transactions for smart transactions that are otherwise deemed non-standard. In other words, some embodiments utilize non-standard transactions that are identifiable as smart transactions, and one or more nodes of a blockchain network accept such transactions.
[0102]
[0103] The system serializes 604 the verification key into a plurality of elements in accordance with an embodiment. Generally speaking, serializing data refers to dividing the data into smaller chunks, such as according to a length that has been set by some standard or protocol. For example, the verification key V.sub.K may be split into 32-bit chunks, i.e., V.sub.K.sup.1∥V.sub.K.sup.2∥ . . . ∥V.sub.K.sup.N=VK. In an embodiment, the chunk size is selected based at least in part on the size of a key such as a compressed key. In an embodiment, the serialize(ARG) function divides the ARG input into smaller data sequences according to a length that is set by a standard or protocol for example, in an embodiment, serialize(ARG) serializes a sequence of data into contiguous 32-byte sub-sequences, although in other embodiments the sub-sequences can be of different fixed/variable length as defined by any suitable protocol.
[0104] Generally speaking, the system selects 606 at least a subset of the elements of the verification key. In an embodiment, the subset is a contiguous subset (e.g., such as those described in examples above) that have a total size that does not exceed a threshold size (e.g., the 520 byte limit on stack objects of a Bitcoin-based system). In an embodiment, the subset is determined by sequentially selecting as many verification key V.sub.K elements that fit within the prescribed size limits.
[0105] In an embodiment, the system, for each locking transaction, allocates a set of keys to be included in corresponding unlocking script following a set of rules. In an embodiment, a protocol has an upper limit to the size of data objects that may be pushed onto the stack for example, in Bitcoin, 520 bytes is the maximum size allowable for a block. Accordingly, if the verification key V.sub.K is less than or equal to 520 bytes in size (i.e., if the system determines that the verification key can be encoded without being split into multiple subsets). In an embodiment, the system calculates 608 a hash over the selected elements, which, as described above, may be the entire verification key V.sub.K. In an embodiment, an opcode such as OP_HASH160 is utilized to hash the subset. In an embodiment, the hashing of the object utilizes multiple cryptographic hash algorithms, such as SHA-256 and RIPEMD-160 to generate a hash output HVK and encoded in a redeem script such as the following redeem script: [0106] OP_HASH160<HVK> OP_EQUALVERIFY <PubKey worker> OP_CHECKSIG
[0107] Of course, other hash algorithms and corresponding hashing opcodes may be utilized in various embodiments. The redeem script, when executed in connection with an unlocking script that provides an attestation that the worker possesses the verification key V.sub.K, is usable to unlock digital assets encumbered by a corresponding locking script. Accordingly, a redeem script is generated 610 with one or more conditions that a corresponding unlocking script include one or more parameters that match based at least in part on the calculated hash. In an embodiment, the redeem script further comprises a condition that the output script include a digital signature generated using a worker's private key that corresponds to a public key encoded in the redeem script.
[0108] In an embodiment, the system determines that the verification key V.sub.K exceeds the maximum allowable size for data blocks on the stack and splits the verification key V.sub.K into two or more subsets. In an embodiment, the system determines the number of chunks to include in each subset, such as by calculating the maximum number of chunks that can be encoded within the size limits of the protocol. In an embodiment, the system encodes each subset with the maximum number of chunks or the number of remaining chunks that have not been encoded. For example, in a Bitcoin-based system wherein each chunk V.sub.K.sup.i is 32 bytes and VK=V.sub.K.sup.1∥V.sub.K.sup.2∥ . . . ∥V.sub.K.sup.N for 16<N≤32, the verification key V.sub.K is partitioned into at least two subsets, such as a first subset VK1=V.sub.K.sup.1∥V.sub.K.sup.2∥ . . . ∥V.sub.K.sup.16 and a second subset VK2=V.sub.K.sup.17∥V.sub.K.sup.18∥ . . . ∥V.sub.K.sup.N. It should be noted that in this example, VK1 includes the maximum number of chunks permissible within a Bitcoin-based system's maximum stack data block size (i.e., 16×32=512 bytes, which is the maximum number of chunks permissible within the maximum size of 520 bytes as the largest whole chunk of data that can be pushed on the stack). In an embodiment, the subsets VK1, VK2, etc. are each provided as an input to a cryptographic hash algorithm to generate a hash output and the hash output is encoded as a condition of the redeem script wherein a valid unlocking script supplies the verification key V.sub.K or a portion thereof. As an example, in the example where VK1=V.sub.K.sup.1∥ . . . ∥V.sub.K.sup.16 and a second subset VK2=V.sub.K.sup.17∥ . . . ∥V.sub.K.sup.N for 16<N≤32, a suitable redeem script may be described as: [0109] OP_HASH160<HVK2> OP_EQUALVERIFY OP_HASH160<HVK1> OP_EQUALVERIFY <PubKey worker> OP_CHECKSIG
wherein <HVK1>=HASH160 (V.sub.K.sup.1∥ . . . ∥V.sub.K.sup.16) and <HVK2>=HASH160 (V.sub.K.sup.17∥ . . . ∥V.sub.K.sup.N). In an embodiment, the system generates a first hash <HVK1> and determines that a second hash <HVK2> is to be generated from the second subset VK2 of verification key elements.
[0110] As a third example, consider an embodiment described in connection with
[0112] Each time a hash is generated, the system may determine whether 512 additional subsets should be identified and hashed. In an embodiment, the system determines that no additional subsets are needed based on making a determination that each element of the verification key V.sub.K has a corresponding condition in the redeem script that is satisfied based on a worker supplying the respective element as part of the unlocking script. In an embodiment, the systems makes available 614 the redeem script, such as to the worker, who is able to use the redeem script to generate the corresponding unlocking script.
[0113] In order to redeem the payment to a worker (e.g., the entity associated with <PubKey worker>), the worker, in an embodiment, demonstrates possession of the correct verification key V.sub.K. In an embodiment, any suitable attestation of possession of the correct verification key V.sub.K is usable by the system wherein a counterparty is able to cryptographically verify the worker's attestation of a purported possession. In an embodiment, a worker will, for each locking script, create an unlocking script which, like in the case of the creation of the redeem script, will differ depending on the length of the serialized verification key V.sub.K.
[0114] If the length of the serialized verification key V.sub.K is of sufficiently small cardinality (e.g., V.sub.K is small enough that the entire verification key can be pushed onto the stack without partitioning), the worker creates the unlocking script: [0115] OP_PUSHDATA1<length of signature> <signature> OP_PUSHDATA1<byte-length of VK> VK OP_PUSHDATA1 <length of redeem script> <redeem script>
[0116] Otherwise, if the length of the serialized verification key exceeds the applicable threshold, then the worker splits V.sub.K into two or more subsets. For example, in the case of a Bitcoin-based protocol where V.sub.K=V.sub.K.sup.1∥ . . . ∥V.sub.K.sup.32 and V.sub.K.sup.i is 32 bytes, VK1=V.sub.K.sup.1∥ . . . ∥V.sub.K.sup.16 and VK2=V.sub.K.sup.17∥ . . . ∥V.sub.K.sup.32, and creates the unlocking script: [0117] OP_PUSHDATA1<length of signature> <signature> OP_PUSHDATA1<byte-length of VK1> VK1 OP_PUSHDATA1<byte-length of VK2> VK2 OP_PUSHDATA1 <length of redeem script> <redeem script>
[0118] As a third example, consider an embodiment described in connection with
[0120] Various extensions to embodiments as described in this disclosure are contemplated in addition to those explicitly discussed. In an embodiment, a protocol such as a Bitcoin-based protocol is used to implement systems and methods described herein in some cases, existing protocols may be extended so as to support additional functionality.
[0121] For example, in an embodiment, the output is separated into a plurality of transfers—for example, the output is split into two parts, one for elements belonging to a first group G1 and the other for a second group G2. Accordingly, in this example, there are two inputs paying (with hexadecimal representation of the group elements from each group included in the script) to the public key of the worker. The steps in this protocol for symmetric pairing are repeated for each of the two inputs. In an embodiment, a protocol would be extended to piece together the verification key accordingly.
[0122] As a second example, the key (e.g., in the order of elements stemming from groups G1 and G2, respectively) is kept as it is and a protocol (e.g., an existing Bitcoin-based protocol) is extended to encode and decode the keys and segregate which 32-byte representation of a group element belongs with which group, for example, through the use of a hash map or any other suitable data structure. In an embodiment, software running on top of an existing protocol (e.g., an extension to the protocol used by at least a subset of the set of nodes of a blockchain network) is used to encode and decode the keys and segregate which 32-byte hexadecimal representation of a group element belongs to which group.
[0123] In an embodiment,
[0124] Additional enhancements are contemplated within the scope of this disclosure. As discussed elsewhere, a protocol such as those described herein can be enhanced with additional support that reads off the hashed values of the verified key (e.g., HASH160(V.sub.K)) and the verification key V.sub.K itself and publishes the two in association with the transaction identifiers of the locking and workers redeeming transactions, respectively. Accordingly, in this way, an entity that later verifies the proof of correctness published by the worker can do so with assurances that the key is the one published by the client initially.
[0125] In an embodiment, a protocol as described herein (e.g., a Bitcoin-based protocol) is extended with an additional opcode, command, or statement that performs a check on the proof of correctness (e.g., in the manner described above). In an embodiment, an OP_CHECKPOC opcode is supported and operates on the proof of correctness, verification key, input (u), and output(y) in a manner similar to how OP_CHECKSIG checks that the signature for a transaction input is valid. In an embodiment, OP_CHECKPOC returns a TRUE or FALSE value, a 1 or 0 value, etc. indicating whether the proof of correctness was verified.
[0126]
[0127] In some embodiments, the bus subsystem 804 provides a mechanism for enabling the various components and subsystems of computing device 800 to communicate with each other as intended. Although the bus subsystem 804 is shown schematically as a single bus, alternative embodiments of the bus subsystem utilize multiple busses. In some embodiments, the network interface subsystem 816 provides an interface to other computing devices and networks. The network interface subsystem 816, in some embodiments, serves as an interface for receiving data from and transmitting data to other systems from the computing device 800. In some embodiments, the bus subsystem 804 is utilised for communicating data such as details, search terms, and so on.
[0128] In some embodiments, the user interface input devices 812 includes one or more user input devices such as a keyboard; pointing devices such as an integrated mouse, trackball, touchpad, or graphics tablet; a scanner; a barcode scanner; a touch screen incorporated into the display; audio input devices such as voice recognition systems, microphones; and other types of input devices. In general, use of the term “input device” is intended to include all possible types of devices and mechanisms for inputting information to the computing device 800. In some embodiments, the one or more user interface output devices 814 include a display subsystem, a printer, or non-visual displays such as audio output devices, etc. In some embodiments, the display subsystem includes a cathode ray tube (CRT), a flat-panel device such as a liquid crystal display (LCD), light emitting diode (LED) display, or a projection or other display device. In general, use of the term “output device” is intended to include all possible types of devices and mechanisms for outputting information from the computing device 800. The one or more user interface output devices 814 can be used, for example, to present user interfaces to facilitate user interaction with applications performing processes described and variations therein, when such interaction may be appropriate.
[0129] In some embodiments, the storage subsystem 806 provides a computer-readable storage medium for storing the basic programming and data constructs that provide the functionality of at least one embodiment of the present disclosure. The applications (programs, code modules, instructions), when executed by one or more processors in some embodiments, provide the functionality of one or more embodiments of the present disclosure and, in embodiments, are stored in the storage subsystem 806. These application modules or instructions can be executed by the one or more processors 802. In various embodiments, the storage subsystem 806 additionally provides a repository for storing data used in accordance with the present disclosure. In some embodiments, the storage subsystem 806 comprises a memory subsystem 808 and a file/disk storage subsystem 810.
[0130] In embodiments, the memory subsystem 808 includes a number of memories, such as a main random access memory (RAM) 818 for storage of instructions and data during program execution and/or a read only memory (ROM) 820, in which fixed instructions can be stored. In some embodiments, the file/disk storage subsystem 810 provides a non-transitory persistent (non-volatile) storage for program and data files and can include a hard disk drive, a floppy disk drive along with associated removable media, a Compact Disk Read Only Memory (CD-ROM) drive, an optical drive, removable media cartridges, or other like storage media.
[0131] In some embodiments, the computing device 800 includes at least one local clock 824. The local clock 824, in some embodiments, is a counter that represents the number of ticks that have transpired from a particular starting date and, in some embodiments, is located integrally within the computing device 800. In various embodiments, the local clock 824 is used to synchronize data transfers in the processors for the computing device 800 and the subsystems included therein at specific clock pulses and can be used to coordinate synchronous operations between the computing device 800 and other systems in a data centre. In another embodiment, the local clock is a programmable interval timer.
[0132] The computing device 800 could be of any of a variety of types, including a portable computer device, tablet computer, a workstation, or any other device described below. Additionally, the computing device 800 can include another device that, in some embodiments, can be connected to the computing device 800 through one or more ports (e.g., USB, a headphone jack, Lightning connector, etc.). In embodiments, such a device includes a port that accepts a fibre-optic connector. Accordingly, in some embodiments, this device is that converts optical signals to electrical signals that are transmitted through the port connecting the device to the computing device 800 for processing. Due to the ever-changing nature of computers and networks, the description of the computing device 800 depicted in
[0133] It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be capable of designing many alternative embodiments without departing from the scope of the invention as defined by the appended claims. In the claims, any reference signs placed in parentheses shall not be construed as limiting the claims. The word “comprising” and “comprises”, and the like, does not exclude the presence of elements or steps other than those listed in any claim or the specification as a whole. In the present specification, “comprises” means “includes or consists of” and “comprising” means “including or consisting of”. The singular reference of an element does not exclude the plural reference of such elements and vice-versa. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. 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.
[0134] All references, including publications, patent applications, and patents, cited herein are hereby incorporated by reference to the same extent as if each reference were individually and specifically indicated to be incorporated by reference and were set forth in its entirety herein.