Proof of Work

JP7536796B2Active Publication Date: 2024-08-20NCHAIN LICENSING AG
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2021569490
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-05-24
Filing Date
2020-04-22
Publication Date
2024-08-20
Estimated Expiration
2040-04-22

Smart Images

  • Figure 0007536796000018
    Figure 0007536796000018
  • Figure 0007536796000021
    Figure 0007536796000021
  • Figure 0007536796000030
    Figure 0007536796000030
Patent Text Reader

Abstract

A computer-implemented method for node validation in a blockchain network is provided, comprising the steps of: obtaining a first transaction including executable code; receiving a second transaction including information, the information further including at least submitted instances of the r and s portions of a first ECDSA signature and a nonce; and executing the code from the first transaction. The code is H PoW is configured to verify that (f(r,d)) satisfies a predetermined condition defined in the code and return a true result for the condition, where r is the submitted instance of the r part and d is a nonce; and H PoW is a hash function, and f is a function combining r and d.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This disclosure relates to the concept of proof-of-work (PoW) in the context of blockchain. [Background technology]

[0002] Blockchain refers to a form of distributed data structure in which a duplicate copy of the blockchain is maintained at each of multiple nodes in a peer-to-peer (P2P) network. A blockchain contains a chain of blocks of data, with each block containing one or more transactions. Each transaction can point to a previous transaction in the sequence. Transactions can be submitted to the network for inclusion in a new block. New blocks are produced by a process known as “mining”, which involves multiple mining nodes each competing to perform a “proof-of-work”, i.e., solving a cryptographic puzzle based on a pool of pending transactions waiting to be included in a block.

[0003] Traditionally, transactions in a blockchain are used to transfer digital assets, i.e. data that acts as a store of value. However, blockchains can also be used to layer additional functionality on top of the blockchain. For example, blockchain protocols allow for additional user data to be stored in the output of a transaction. Modern blockchains increase the maximum amount of data that can be stored in a single transaction, allowing more complex data to be incorporated. For example, this may be used to store electronic documents in the blockchain, or even audio or video data.

[0004] Each node in the network can have one, two, or all three roles: forwarding, mining, and storage. Forwarding nodes propagate transactions throughout the nodes of the network. Mining nodes mine transactions into blocks. Storage nodes each store a copy of the mined block in the blockchain. To have a transaction recorded in the blockchain, the party sends the transaction to one of the nodes in the network where it is propagated. Mining nodes that receive a transaction may compete to mine the transaction into a new block. Each node is configured to respect the same node protocol. This protocol includes one or more conditions under which a transaction is valid. Invalid transactions are not propagated into or mined into a block. Assuming the transaction is validated and thereby accepted into the blockchain, the transaction (including any user data) remains stored as an immutable public record in each node of the P2P network.

[0005] Miners who successfully solve the proof-of-work puzzle to produce the latest block are typically rewarded with a new transaction, called a “generation transaction,” that generates a new amount of the digital asset. Proof-of-work incentivizes workers not to cheat the system by including double-spending transactions in their blocks, because mining a block requires a large amount of computer resources and blocks containing double-spending are unlikely to be accepted by other nodes.

[0006] In the “output-based” model (also called the UTXO-based model), a transaction data structure consists of one or more inputs and one or more outputs. A usable output consists of an element that specifies an amount of digital assets, sometimes called a UTXO (“unspent transaction output”). The output may further include a locking script that specifies a condition for redeeming the output. Each input includes a pointer to such an output in a prior transaction and may further include an unlocking script to unlock the locking script of the pointed to output. The two transactions are then referred to as the first and second transactions. The first transaction includes at least one output that specifies an amount of digital assets and includes a locking script that defines one or more conditions for unlocking the output. The second transaction includes at least one input that includes a pointer to an output of the first transaction and an unlocking script to unlock the output of the first transaction.

[0007] In such a model, when a second transaction is sent to the P2P network to be propagated and recorded in the blockchain, one of the validity conditions applied at each node is that the unlocking script meets all of one or more conditions defined in the locking script of the first transaction. Another is that the output of the first transaction has not yet been redeemed by another transaction that was previously valid. A node that finds the second transaction to be invalid based on any of these conditions will not propagate it and will not include it for mining in the block that will be recorded in the blockchain.

[0008] An alternative type of transaction model is the account-based model. In this case, each transaction does not define the amount transferred by referencing an absolute account balance, but rather by going back to the UTXO of the previous transaction in the sequence of past transactions. The current state of every account is stored separately in the blockchain and is constantly updated by miners. Transactions in the account-based model can also include smart contracts that are executed at each node upon validation of the transaction.

[0009] Transactions in either model can contain proofs of knowledge. A “knowledge proof” or “proof of knowledge” is a technical term that refers to a test that a party knows some data (e.g., call it d). As an example in the case of the output-based transaction model, the locking script in the output of one transaction, Tx1, can contain a hash puzzle. If the input of a second transaction, Tx2, points to this output of Tx1, then the unlocking script in the input of Tx2 must solve the hash puzzle before it can redeem the output of Tx1. The hash puzzle contains a hash value h, which is the hash of d, i.e., h=H puz (d). This puzzle also works by taking a data value d' that purports to be d from the unlocking script of Tx2 and applying it to a hash function H puz and compares it to the hash value h contained in the unlocking script of Tx1. That is, if and only if the result of the comparison is yes (or, in the jargon of the art, “true”), then h=H puz(d') and only unlocks the output of Tx1. Therefore, the beneficiary of Tx2 can only unlock the output of Tx1 if d is included in the unlocking script of Tx2 for proof of knowledge of d.

[0010] The problem with using the traditional hash puzzle alone is that an unscrupulous miner or other node can observe d in Tx2’s unlocking script and then create its own version of Tx2. * and then mine (or publish) Tx2 on behalf of the intended recipient (e.g., Bob) in Tx2. * The existing way to avoid this is to add a "pay-to-public key hash" (P2PKH) requirement in the locking script of Tx1, which requires that a cryptographic signature of the intended payee be included in the unlocking script of Tx2, in addition to a proof of knowledge for d.

[0011] Hash puzzles and P2PKH can also be implemented using smart contracts in an account-based model, rather than the locking and unlocking scripts of the output-based model.

[0012] As is well known to those skilled in the art, a cryptographic signature may be generated based on a private key V and then verified based on the corresponding public key P of a private-public key pair. Given a signature generated by applying a private key V to a message m, it is possible for another party to use P to verify that the signature was generated using V, without that party knowing V (so verifying the signature itself is another form of proof-of-knowledge, in its own right).

[0013] One form of algorithm for this is the Elliptic Curve Digital Signature Algorithm (ECDSA), which operates on elliptic curve crytography (ECC), where P and V are related by: P=V G where P is a two-element vector (P x ,P y ), V is a scalar, and G is a two-element vector (G x ,G y The operation “·” is scalar elliptic curve multiplication, a well-known form of operation that transforms from one point on an elliptic curve to another.

[0014] An ECDSA signature is a tuple (r,s) consisting of two parts, commonly known in the art as the r-part (r) and the s-part (s), respectively. The signature (r,s) is generated by applying a private key V to a message m. In the case of a record transaction on the blockchain, m becomes part of the transaction, and the signature is explicitly tagged on the transaction in addition to parts of the transaction to allow for the verification of the transaction. For example, in an output-based model, the signature signs a part of Tx2 to unlock the output of Tx1, and is included in the locking script of Tx2. Since the signed parts usually contain the output of the transaction, they cannot be changed without invalidating the signature and therefore the transaction.

[0015] Whatever transaction model is used, the signature (r,s) is computed as follows: r=[R] x , where R=k G s=k -1 (H sig (m)+rV) mod n Here, [R] x is a two-element vector R=(R x,R y ), K is known as the ephemeral key, which is typically chosen randomly from the set [1,n-1], where n is the prime modulus and [1,n-1] is the set of real numbers ranging from 1 to n-1 inclusive. H sig is the hash function, and the hash function H used in the hash puzzle puz It may be the same or a different type of hash function compared to

[0016] Given knowledge of the signature (r, s), the message m, and the public key P, any party who does not know the private key V can verify that the signature was generated using the private key V for message m by the following computation: R'=H sig (m)S -1 ·G+rs -1 P And, [R'] x = r. The signature is valid if and only if this is correct, not otherwise. This can be viewed as verifying that the party associated with the public key P was in fact the signer of the message. Summary of the Invention

[0017] In a blockchain network, the proof-of-work required to mine a transaction into a block is an inherent feature of the node protocol applied by each mining node in the network. However, it is recognized herein that it is desirable to add additional “layer 2” proof-of-work (i.e., layered on top of the base node protocol). In particular, in accordance with the present disclosure, this can be accomplished by setting the challenge in Tx1 to a variant of a type of puzzle, referred to herein as an “r-puzzle,” based on the r-part of the ECDSA signature.

[0018] According to one aspect disclosed herein, a computer-implemented method is provided for node validation in a blockchain network, the method including the steps of obtaining a first transaction including executable code, receiving a second transaction including information, the information further including at least a submitted instance of the r and s portions of a first ECDSA signature and a nonce, and executing the code from the first transaction. The code is H PoW is configured to verify that (f(r,d)) satisfies a predetermined condition defined in the code and to return a true result for the condition, where r is the submitted instance of part r and d is a nonce; and H PoW is a hash function, and f is a function of r and d combined.

[0019] In any embodiment, the r-puzzle set in the code of the first transaction may further include a challenge that requires the second transaction to include a particular value of part r. Thus, similar to a proof of work, the r-puzzle can also be used to implement a proof of knowledge based on the r-part of the signature.

[0020] There is a problem with using hash puzzles as proofs of knowledge when combined with P2PKH to avoid the vulnerability discussed in the background: it allows a node to swap to a new version of a second transaction that would otherwise see d and pays the node operator instead of the prover. So, P2PKH guarantees that payments are only made to the party that originally knew d, but it also means that the output of Tx1 is tied to a specific pre-determined payee or set of payees (it is possible to specify alternative conditions that may include alternative payees, but those payees must still be identified in advance).

[0021] As recognized herein, it is desirable to allow transactions redeemable by unspecified parties that can prove knowledge of a particular secret value, but in a way that avoids revealing that value. For example, suppose Alice wants to set up a first transaction that can be unlocked by anyone who passes her a private key, but does not want to specify the parties in advance. For example, the first transaction could pay someone to accept delivery of some item, such as a letter or parcel, on Alice's behalf, and / or pay a delivery company to deliver the item. The first transaction can be redeemed by a second transaction that proves knowledge of the secret. At the time of ordering the delivery, Alice can set up the first transaction and provide it to the delivery company or publish it on the blockchain (or simply provide the necessary details so that the delivery company can make the first transaction). The delivery company is thus confident that payment will be made once the delivery is completed. However, Alice does not want to decide at this stage who will accept the delivery for her. Instead, she will provide the secret value at a later time to one or more trusted parties (e.g., her housemates Charlie and Bob, who have confirmed that they will be present on the delivery day). This allows anyone to sign on her behalf by providing a second transaction that proves the value of Alice's secret.

[0022] It will be understood that this is only one illustrative example. As another example, a transaction may be used to indicate assent to an agreement. Alice may wish to set up the agreement now, but only after the fact has determined that she will grant signing authority or power of attorney to a subset of one or more trusted parties to sign on her behalf. For example, Alice may have intended to sign for herself at the time of setting up the agreement, but later, when she finds that she has lost mental capacity or will be unable to sign for some reason, she will need to assign power of attorney to someone else (in this case Bob and Charlie may be her family members or business associates).

[0023] More generally, although not essential to the main PoW idea, it would also be desirable to provide an alternative to traditional hash puzzles. In particular, an alternative form of puzzle would allow proof of knowledge of a secret value without revealing that value to a node or publishing it on the blockchain, and that is not tied to a specific identity.

[0024] To address this, according to any embodiment disclosed herein, the method includes obtaining a public key, the first ECDSA signature signing a message based on a private key corresponding to the public key, the message being part of the second transaction, and applying an ECDSA verification function to verify the first ECDSA signature received in the second transaction based on the public key and the message, the code being configured to return a true result for a further condition of the verification of the first ECDSA signature, the code further including a reference value corresponding to the r portion of the first ECDSA signature, the reference value being a reference instance of the r portion or a transform thereof, in which case the code is configured to check that the reference value corresponds to the reference instance of the r portion received in the second transaction and to return a true result for a further condition.

[0025] The indication of the r part in the code of the first transaction may be a reference instance of the r part, or it may be a transformation of it, e.g. a hash of the components that make up the r part (the hashed components may simply be equal to the r part itself, or may be concatenated with another data element d, for example). In any case, the code sets up an “r-puzzle” that proves that the challengee (e.g. Bob) must have known the ephemeral key k (it is impossible that the solution could have been provided without knowledge of k). This puzzle advantageously uses the r part as the basis for this proof of knowledge, and does not require the challenger to submit the ephemeral key k to the node or to disclose it in the second transaction (e.g. Tx2). This means, for example, that a first party (e.g. Alice) can use it to assign signing authority to one or more second parties, such as Bob or Charlie, as ephemeral private or secret keys. Because the r-puzzle proves knowledge of k without revealing k, a malicious miner or other node can generate a valid second transaction Tx2 that would pay itself instead of the intended beneficiary. * In order to form k, the proof cannot be satisfied by anyone other than Alice, who cannot generate her own signature to form k. Furthermore, since the r part of the signature itself is not linked to an identity in the system, this means that anyone who knows k can satisfy the proof. The conditions on the validity of the second transaction do not need to be tied to a specific identity by the first transaction. For example, Alice does not need to decide in advance who to lock the first transaction to. For example, she could provide details to a delivery company to set up the first transaction, and then decide who to authorize to receive packages on her behalf.

[0026] More generally, the scope of this disclosure can be extended to any “layer 2” proof-of-work, whereby code in a transaction is used to layer an additional proof-of-work puzzle on top of the proof-of-work already performed by miners in the blockchain.

[0027] Thus, in accordance with another aspect disclosed herein, a computer-implemented method is provided for node validation in a blockchain network, the method including the steps of obtaining a first transaction including executable code, receiving a second transaction including information having at least a first portion and a nonce, and executing the code from the first transaction. PoW is configured to verify that (f(q,d)) satisfies a predetermined condition defined in the code and to return a true result for the condition, where q is the first part and d is a nonce, and H PoW is a hash function, and f is a function of r and d combined. [Brief description of the drawings]

[0028] To facilitate an understanding of embodiments of the present disclosure and to show how such embodiments may be carried into effect, reference will now be made, by way of example only, to the accompanying drawings, in which: [Figure 1] FIG. 1 is a schematic block diagram of a system for implementing a blockchain. [Diagram 2] Figure 2 shows a schematic of some examples of transactions that may be recorded on a blockchain. [Diagram 3] FIG. 3 is another schematic block diagram of a system for implementing a blockchain. [Figure 4] FIG. 4 is a schematic block diagram of a portion of the node software for processing transactions according to the node protocol of the output-based model. [Diagram 5]FIG. 5 illustrates a schematic diagram of an exemplary set of transactions. [Figure 6A] FIG. 6A illustrates generally some of the principles behind the Elliptic Curve Digital Signature Algorithm (ECDSA). [Figure 6B] FIG. 6B illustrates generally some of the principles behind the Elliptic Curve Digital Signature Algorithm (ECDSA). [Figure 6C] FIG. 6C illustrates generally some of the principles behind the Elliptic Curve Digital Signature Algorithm (ECDSA). [Figure 6D] FIG. 6D illustrates generally some of the principles behind the Elliptic Curve Digital Signature Algorithm (ECDSA). [Figure 7] FIG. 7 is a schematic diagram of one possible embodiment of a type of proof of knowledge referred to herein as an r-puzzle (or equivalently an r-challenge). [Figure 8] FIG. 8 is a schematic diagram of another possible implementation of the r-puzzle. [Figure 9] FIG. 9 is a schematic diagram of another possible implementation of the r-puzzle. [Figure 10] FIG. 10 is a schematic diagram of yet another possible implementation of the r-puzzle. [Figure 11] FIG. 11 is a schematic block diagram of node software for processing transactions according to the node protocol of the account-based model. [Figure 12] FIG. 12 illustrates generally an exemplary format for an ECDSA signature. [Figure 13] Figure 13 is a step-by-step script analysis of a sample implementation of the lock-and-lock script for one form of the r-puzzle. [Figure 14A] Figure 14A illustrates diagrammatically some examples of forms of r-puzzles that impose additional proof-of-work on top of the inherent proof-of-work already performed by miners as part of the underlying blockchain protocol. [Figure 14B]Figure 14B illustrates diagrammatically some examples of forms of r-puzzles that impose additional proof-of-work on top of the inherent proof-of-work already performed by miners as part of the underlying blockchain protocol. [Figure 14C] Figure 14C illustrates diagrammatically some examples of forms of r-puzzles that impose additional proof-of-work on top of the inherent proof-of-work already performed by miners as part of the underlying blockchain protocol. [Figure 14D] Figure 14D illustrates diagrammatically some examples of forms of r-puzzles that impose additional proof-of-work on top of the inherent proof-of-work already performed by miners as part of the underlying blockchain protocol. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0029] In some cryptographic schemes, a verifier may need to convince a person (called the prover or challengee) that he has some information in what is called a knowledge proof. In effect, this can be done by directly providing the verifier with some of the information. Alternatively, the prover may be required to perform a computation that depends on the information. Preferably, it is a computation that does not require the verifier to know the information itself to set the challenge, nor does it require the verifier to disclose the information to the verifier to verify that the prover knows it. For the computation method, the verification computation must be performed on the input data. A simple way to prove knowledge of a secret value is to use a cryptographic hash function for preimage and collision resistance functions. This hashing method can be easily integrated in many blockchain applications since hash functions form a fundamental part of private-key public-key cryptosystems. This kind of knowledge proof is very versatile in blockchain applications, typically called a hash puzzle.

[0030] In UTXO-based blockchains, the solution to a hash puzzle (a pre-image of the hash value) can be set as a condition of payment, and the verification is performed by the miner as part of the transaction validation. However, in this approach, the transaction must also require signing using a specific private key, since otherwise the miner would receive the solution to the hash puzzle before including the transaction in a block. This gives a malicious miner the opportunity to create a spending transaction with an output destined to an address belonging to the miner.

[0031] In this disclosure, a proof of knowledge is provided that avoids this problem while still allowing the miner (or forwarding node) to perform the verification. To do this, the proof of knowledge is connected to an ephemeral key that corresponds to an Elliptic Curve Digital Signature Algorithm (ECDSA) signature. The cryptographic primitives used in this algorithm are native to many blockchains, and therefore can be easily integrated into current infrastructures.

[0032] Example of a system overview FIG. 1 illustrates an exemplary system 100 for implementing a blockchain 150. The system 100 includes a packet-switched network 101, which is typically a wide area internetwork such as the Internet. The packet-switched network 101 includes a number of nodes 104 arranged to form a peer-to-peer (P2P) overlay network 106 within the packet-switched network 101. Each node 104 includes a peer computing device with different nodes 104 belonging to different peers. Each node 104 includes one or more processors, e.g., processing devices including one or more central processing units (CPUs), accelerator processors, application specific processors, and / or field programmable gate arrays (FPGAs). Each node also includes a memory, i.e., a computer-readable storage device in the form of a non-transitory computer-readable medium or medium. The memory may include one or more memory units using one or more memory media, e.g., a magnetic medium such as a hard disk, an electronic medium such as a solid-state drive (SSD), a flash memory, or an EEPROM, and / or an optical medium such as an optical disk drive.

[0033] The blockchain 150 includes a chain of blocks of data 151, each copy of which is maintained at each of multiple nodes in the P2P network 160. Each block 151 in the chain includes one or more transactions 152, where transaction in this context refers to a type of data structure. The nature of the data structure depends on the type of transaction protocol used as part of the transaction model or scheme. A given blockchain typically uses one particular transaction protocol throughout. In one common type of transaction protocol, the data structure of each transaction 152 includes at least one input and at least one output. Each output specifies an amount that represents a quantity of digital assets belonging to a user 103, and the output is cryptographically locked to the user (requiring the user's signature to unlock and thereby redeem or pay out). Each input points to an output of a previous transaction 152, thereby linking the transactions.

[0034] At least some of the nodes 104 take on the role of transfer nodes 104F, which transfer and thereby propagate transactions 152. At least some of the nodes 104 take on the role of miners 104M, which mine mine blocks 151. At least some of the nodes 104 take on the role of storage nodes 104S, with each node storing a respective copy of the same blockchain 150 in its respective memory. Each miner node 104M also maintains a pool 154 of transactions 152 waiting to be mined into blocks 151. A given node 104 can be a transfer node 104, a miner 104M, a storage node 104S, or any combination of two or all of these.

[0035] In a given present transaction 152j, the input (or each input) contains a pointer that references an output of a preceding transaction 152i in the sequence of transactions, specifying that this output is to be redeemed or "spent" in the present transaction 152j. In general, the preceding transaction can be any transaction in the pool 154 or any block 151. The preceding transaction 152i does not necessarily have to exist when the present transaction 152j is created or sent to the network 106, but the preceding transaction 152i must exist and be verified for the present transaction to be valid. Thus, in this context, "preceding" refers to preceding in logical order linked by pointers, not necessarily to the time of creation or sending in chronological order, and therefore does not necessarily preclude transactions 152i, 152j from being created or sent in order (see below on orphan transactions). The antecedent transaction 152i may similarly be referred to as an antecedent transaction or a predecessor transaction.

[0036] The input of the current transaction 152j also includes the signature of the user 103a to which the output of the previous transaction 152i is locked. The output of the current transaction 152j can then be cryptographically locked to the new user 103b. Thus, the current transaction 152j can transfer the amount defined in the input of the previous transaction 152i to the new user 103b defined in the output of the current transaction 152j. In some cases, a transaction 152 may have multiple outputs to split the input amount among multiple users (one of which may be the original user 103a to provide the change). In some cases, a transaction may have multiple inputs and collect amounts together from multiple outputs of one or more previous transactions and then redistribute them into one or more outputs of the current transaction.

[0037] The above is sometimes called an “output-based” transaction protocol, and sometimes also called an Unspent Transaction Output (UTXO) type protocol (where the outputs are called UTXOs). A user’s total balance is not defined by any one number stored in the blockchain 151; instead, a user needs a special “wallet” application 105 to collate the values ​​of all of that user’s UTXOs, which are spread across many different transactions 152 in the blockchain 151.

[0038] An alternative type of transaction protocol may be called an “account-based” protocol, as part of the account-based transaction model. In the account-based case, each transaction does not define the amount transferred by referencing an absolute account balance, but rather by going back to the UTXO of a previous transaction in a sequence of past transactions. The current state of every account is stored by a miner in a separate blockchain and is constantly updated. In such a system, transactions are ordered using the account’s running transaction tally (also called “position”). This value is signed by the sender as part of the cryptographic signature and hashed as part of the transaction reference calculation. Additionally, an optional data field may also be signed in the transaction. This data field may indicate a previous transaction, for example, if a previous transaction ID is included in the data field.

[0039] In both types of transaction protocols, when a user 103 wants to enact a new transaction 152j, he sends the new transaction from his computer terminal 102 to one of the nodes 104 of the P2P network 106 (today this is usually a server or a data center, but in principle it could be another user terminal). This node 104 checks whether the transaction is valid according to a node protocol applied at each node 104. The details of the node protocol form the overall transaction model and correspond to the type of transaction protocol used in the blockchain 150 in question. The node protocol typically requires the node 104 to check that the cryptographic signature in the new transaction 152j matches an expected signature, which depends on the preceding transaction 152i in the ordered sequence of transactions 152. In the output-based case, this may involve checking that the user's cryptographic signature included in the input of the new transaction 152j matches a condition defined in the output of the preceding transaction 152i to which the new transaction pays. Here, the conditions typically include at least checking that a cryptographic signature on the input of the new transaction 152j unlocks the output of the previous transaction 152i to which the input of the new transaction points. In some transaction protocols, the conditions may be defined, at least in part, by custom scripts included in the inputs and / or outputs. Alternatively, they may be fixed solely in the node protocol, or alternatively by a combination of these. In any case, if the new transaction 152j is valid, the current node forwards it to one or more other of the nodes 104 in the P2P network 106. At least some of these nodes 104 also act as forwarding nodes 104F that forward the new transaction 152j to one or more further nodes 104, following the same node protocol and applying the same tests.In this manner, the new transaction is propagated throughout the network of nodes 104.

[0040] In an output-based model, the definition of whether a given output (e.g., UTXO) is paid or not is whether it has yet been validly redeemed by an input of another, onward transaction 152j according to the node protocol. Another condition for a transaction to be valid is that the output of the preceding transaction 152i that it attempts to pay or redeem has not yet been used / paid by another valid transaction. Again, if not valid, the transaction 152j is not propagated or recorded in the blockchain. This prevents double-spending, which is an attempt to spend the output of the same transaction multiple times. On the other hand, an account-based model prevents double-spending by maintaining account balances. Again, because of the defined order of transactions, balances are in a single defined state at a time.

[0041] In addition to validating, at least some of the nodes 104M also compete to be the first to create a block of transactions in a process known as mining, which is underpinned by "proof of work." At the mining nodes 104M, new transactions are added to a pool of valid transactions that have not yet appeared in a block. The miners then compete to assemble a new valid block 151 of transactions 152 from the pool of transactions 154 by attempting to solve a cryptographic puzzle. Typically, this involves searching for a nonce value such that when the "nonce" is concatenated with the pool of transactions 154 and hashed, the output of the hash satisfies a predefined condition. For example, the predefined condition may be that the output of the hash has a predefined number of leading zeros. A property of a hash function is that it has an output that is unpredictable with respect to the input. This search can therefore only be performed by brute force, and therefore consumes a significant amount of processing resources at each node 104M trying to solve the puzzle.

[0042] The first minor node 104M to solve the puzzle announces this to the network 106 and provides its solution as a proof, which can be easily checked by other nodes 104 in the network (when the solution is given a hash, it is easy to check that it matches the output of the hash). The transaction pool 154 in which the winner solved the puzzle is then recorded as a new block 151 in the blockchain 150 by at least some of the nodes 104 acting as storage nodes 104S, based on checking the solution announced by the winner in each such node. A block pointer 155 is also assigned to the new block 151n that points back to the previously generated block 151n-1 in the chain. Proof of work helps to reduce the risk of double spending, since it takes a lot of effort to create new blocks 151, and blocks containing double spending are likely to be rejected by other nodes 104, so that double spending is not included in those blocks. Once created, blocks 151 cannot be modified because they are known and maintained at each storage node 104S in the P2P network 106 according to the same protocol. Block pointers 155 also impose a sequential order on blocks 151. This provides an immutable public ledger of transactions, as transactions 152 are recorded in ordered blocks at each storage node 104S in the P2P network 106.

[0043] Note that different 104M miners can solve the puzzle at any time, depending on when they started searching for a solution, and based on different snapshots of the unmined transaction pool 154. Whoever solves the puzzle first defines which transactions 152 will be included in the next new block 151n, and the current pool of unmined transactions 154 is updated. The miners 104M then continue to compete to generate blocks from the newly defined outstanding pool 154. There is also a protocol to resolve possible "forks", which ensures that two miners 104M solve the puzzle within a very short time of each other, and that conflicting views of the blockchain are propagated. In essence, whichever prong extends the longest will be the final blockchain 150.

[0044] In most blockchains, the winning miner 104M is automatically rewarded by a special type of new transaction that creates a new amount of digital assets that does not exist anywhere (as opposed to a normal transaction that transfers an amount of digital assets from one user to another). Thus, the winning node has “minded” an amount of digital assets. This special type of transaction is sometimes called a “generation” transaction. It automatically forms part of a new block 151n. This reward incentivizes the miner 104M to participate in the proof-of-work competition. A normal (non-generation) transaction 152 often specifies an additional transaction fee in one of its outputs, further rewarding the winning miner 104M that produced the block 151n that contained the transaction.

[0045] Due to the computational resources involved in mining, typically at least each of the miner nodes 104M takes the form of a server, including one or more physical server units, or an entire data center. Each transfer node 104M and / or storage node 104S may also take the form of a server or a data center. However, in principle, any given node 104 may take the form of a user terminal or a group of user terminals networked together.

[0046] The memory of each node 104 stores software 400 configured to run on the processing unit of the node 104 to perform a respective role or roles and process transactions 152 according to the node protocol. It will be understood that any action attributed to a node 104 herein may be performed by the software 400 executing on the processing unit of the respective computing device. The node software 400 may be implemented in one or more applications, at a lower layer such as an application layer, an operating system layer, a protocol layer, or any combination thereof. Additionally, the term “blockchain” as used herein is a general term that refers to a type of technology in general and is not limited to any particular proprietary blockchain, protocol, or service.

[0047] Also connected to the network 101 are computing devices 102 of multiple parties 103 in the role of consuming users. These play the role of payer and payee in the transaction, but do not necessarily participate in mining or propagating transactions for the other parties. They do not necessarily execute the mining protocol. Two parties 103 and their respective devices 102 are shown for illustrative purposes: a first party 103a and its respective computing device 102a, and a second party 103b and its respective computing device 102b. It will be understood that many more such parties 103 and their respective computing devices 102 can exist and participate in the system, but for convenience they are not shown. Each party 103 may be an individual or an organization. Purely by way of example, first party 103a will be referred to herein as Alice (Alice) and second party 103b will be referred to herein as Bob (Bob), although it will be understood that this is not limiting and that references herein to Alice or Bob can be interchangeably referred to as "first party" and "second party," respectively.

[0048] The computing device 102 of each party 103 comprises a respective processing device comprising one or more processors, e.g., one or more CPUs, GPUs, other accelerator processors, application specific processors, and / or FPGAs. The computing device 102 of each party 103 further comprises a memory, i.e., a computer readable storage device in the form of a non-transitory computer readable medium or media. The memory may include one or more memory units using one or more memory media, e.g., a magnetic medium such as a hard disk, an electronic medium such as a SSD, flash memory or EEPROM, and / or an optical medium such as an optical disk drive. The memory on the computing device 102 of each party 103 stores software including a respective instance of at least one client application 105 arranged to operate on the processing device. It will be understood that any action attributed to a party 103 given herein may be performed using software executed on the processing device of the respective computing device 102. The computing device 102 of each party 103 comprises at least one user terminal, e.g., a desktop or laptop computer, a tablet, a smartphone, or a wearable device such as a smart watch. The computing device 102 of a given party 103 may also include one or more other networked resources, such as cloud computing resources accessed via a user terminal.

[0049] The client application 105 may initially be provided to the computing device 102 of any given party 103 on a suitable computer readable storage medium or media downloaded from a server, or may be provided on a removable storage device such as a removable SSD, a flash memory key, a removable EEPROM, a removable magnetic disk drive, a magnetic floppy disk or tape, an optical disk such as a CD or DVD ROM, or a removable optical drive.

[0050] The client application 105 has at least a “wallet” functionality. It has two main functions. One of these is to allow each user party 103 to create, sign and send transactions 152 that are propagated throughout the network of nodes 104 and thereby included in the blockchain 150. The other is to report to each party the amount of digital assets that it currently owns. In an output-based system, this second function involves reconciling the amounts defined in the outputs of the various 152 transactions scattered throughout the blockchain 150 that belong to that party.

[0051] NOTE: Although various client functions may be described as being integrated into a given client application 105, this is not necessarily limiting; instead, any client function described herein may be implemented in a suite of two or more separate applications, for example, interfacing via an API, or one plugging into the other. More generally, client functions may be implemented at the application layer or a lower layer, such as an operating system, or any combination of these. The following is described with respect to client application 105, but it will be understood that this is not limiting.

[0052] An instance of a client application or software 105 on each computing device 102 is operatively coupled to at least one of the transfer nodes 104F of the P2P network 106. This allows the wallet function of the client 105 to transmit the transaction 152 to the network 106. The client 105 can also contact one, some, or all of the storage nodes 104 to query the blockchain 150 for any transactions in which the respective party 103 is a recipient (or, in an embodiment of the blockchain 150, actually inspect the transactions of other parties in the blockchain 150, since the blockchain 150 is a public facility that provides trust of transactions in part through its public visibility). The wallet function on each computing device 102 is configured to form and transmit the transaction 152 according to a transaction protocol. Each node 104 executes software 400 configured to validate the transaction 152 according to the node protocol and, in the case of a transfer node 104F, forward the transaction 152 for propagation throughout the network 106. The transaction protocol and the node protocol correspond to each other, and a given transaction protocol implements a given transaction model together with a given node protocol. The same transaction protocol is used for all transactions 152 in the blockchain 150 (although the transaction protocol may allow different subtypes of transactions). The same node protocol is used by all nodes 104 in the network 106 (although many nodes process different transaction subtypes differently according to rules defined for that subtype, and different nodes may take on different roles and thus implement different corresponding aspects of the protocol).

[0053] As described above, the blockchain 150 includes a chain of blocks 151, each of which includes a set of one or more transactions 152 created by the proof-of-work process, as described above. Each block 151 also includes a block pointer 155 back to a block 151 created earlier in the chain, to define a sequential order to the blocks 151. The blockchain 150 also includes a pool of valid transactions 154 waiting to be included in a new block by the proof-of-work process. Each transaction 152 includes a pointer to a previous transaction to define the order of the transactions (note that the order of transactions 152 is allowed to branch). The chain of blocks 151 goes back to a genesis block (Gb) 153, which was the first block of the chain. Early in the chain 150, one or more original transactions 152 pointed to the genesis block 153, not to a previous transaction.

[0054] When a given party 103, say Alice, wants to submit a new transaction 152j to be included in the blockchain 150, she formulates the new transaction (using a wallet function in her client application 105) according to the relevant transaction protocol. She then sends the transaction 152 from her client application 105 to one of one or more forwarding nodes 104F to which she is connected. For example, this may be the forwarding node 104F that is closest or best connected to Alice's computer 102. When any given node 104 receives the new transaction 152j, it processes it according to the node protocol and its respective role. This includes first checking whether the newly received transaction 152j meets certain conditions to be "valid", examples of which will be explained in detail shortly. In some transaction protocols, the conditions for validation are configurable on a per-transaction basis by a script included in the transaction 152. Alternatively, the conditions may simply be a built-in feature of the node protocol, or may be defined by a combination of script and node protocol.

[0055] Provided that the newly received transaction 152j passes the tests to be considered valid (i.e., is “validated”), any storage node 104S that receives the transaction 152j adds the newly validated transaction 152 to a pool 154 in the copy of the blockchain 150 maintained at that node 104S. Additionally, any forwarding node 104F that receives the transaction 152j propagates the validated transaction 152 to one or more other nodes 104 in the P2P network 106. Because each forwarding node 104F applies the same protocol, assuming the transaction 152j is valid, this means that it will soon be propagated throughout the P2P network 106.

[0056] Once in the pool 154 in the copy of the blockchain 150 maintained on one or more storage nodes 104, the miner nodes 104M start competing to solve the proof-of-work puzzle of the latest version of the pool 154 that contains the new transaction 152 (other miners 104M are still trying to solve the puzzle based on the old view of the pool 154, but whoever gets there first defines where the next new block 151 ends and the new pool 154 begins, and eventually someone solves the puzzle for the part of the pool 154 that contains Alice's transaction 152j). Once the proof-of-work has been done for the pool 154 that contains the new transaction 152j, it becomes part of one of the blocks 151 in the blockchain 150. Since each transaction 152 consists of a pointer to the previous transaction, the order of the transactions is also immutably recorded.

[0057] Different nodes 104 may initially receive different instances of a given transaction and thus have competing views of which instances are "valid" before one instance is mined into block 150, at which point all nodes 104 agree that the mined instance is the only valid instance. If a node 104 accepts one instance as valid and then discovers that two instances have been recorded in the blockchain 150, it must accept this one and discard (i.e., treat as invalid) the unmined instance that it originally accepted.

[0058] UTXO-based model Figure 2 shows an example of a transaction protocol. This is one example of a UTXO-based protocol. A transaction 152 (abbreviated as "Tx") is the basic data structure of a blockchain 150 (each block 151 contains one or more transactions 152). The following is described with reference to an output-based protocol or a "UTXO"-based protocol. However, this is not limited to all possible implementations.

[0059] In a UTXO-based model, each transaction ("Tx") 152 comprises a data structure that includes one or more inputs 202 and one or more outputs 203. Each output 203 may include an unspent transaction output (UTXO), which can be used as a source of input 202 for another new transaction (if the UTXO has not yet been redeemed). The UTXO specifies an amount of a digital asset (a store of value). It may also include, among other information, the transaction ID of the transaction from which it came. The transaction data structure may also include a header 201, which may include indicators of the sizes of the input fields 202 and the output fields 203. The header 201 may also include the ID of the transaction. In an embodiment, the transaction ID is a hash of the transaction data (excluding the transaction ID itself) and is stored in the header 201 of the raw transaction 152 submitted to the miner 104M.

[0060] Suppose Alice 103a wants to create a transaction 152j that transfers the amount of the digital asset in question to Bob 103b. In FIG. 2, Alice's new transaction 152j is labeled "Tx1". It in turn takes the amount of digital asset locked to Alice in the output 203 of the previous transaction 152i and transfers at least a portion of it to Bob. The previous transaction 152i is labeled "Tx0" in FIG. 2, where Tx0 and Tx1 are just arbitrary labels. These do not necessarily mean that Tx0 is the first transaction in the blockchain 151 or that Tx1 is the immediate next transaction in the pool 154. Tx1 could point to any of the previous (i.e., antecedent) transactions that still have unspent outputs 203 locked to Alice.

[0061] The preceding transaction Tx0 may already be validated and included in the blockchain 150 when Alice creates her new transaction Tx1, or at least when she sends it to the network 106. It may already be included in one of the blocks 151 at that point, or alternatively it may still be waiting in the pool 154, in which case it will be included in the new block 151 immediately. Alternatively, if the node protocol allows for buffering of "orphan" transactions, Tx0 and Tx1 may be created and sent to the network 102 together, or Tx0 may be sent after Tx1. The terms "preceding" and "subsequent" as used herein in the context of transaction sequences refer to the order of transactions in a sequence defined by a transaction pointer specified in the transaction (e.g., which other transaction the transaction points to). They may also be interchangeably referred to as "predecessor" and "successor", "antecedent" and "descendant", "parent" and "child", etc. This does not necessarily imply the order in which they are generated, sent to the network 106, or arrive at any given node 104. Nevertheless, a successor transaction (a successor transaction or "child") that points to a predecessor transaction (a predecessor transaction or "parent") is not validated until and unless the parent transaction is validated. A child that arrives at a node 104 before its parent arrives at the node 104 is considered an orphan. Depending on the node protocol and / or minor actions, it may be discarded or buffered for a period of time to wait for its parent to arrive.

[0062] One of the one or more outputs 203 of the prior transaction Tx0 comprises a particular UTXO, here labeled UTXO0. Each UTXO includes a value specifying the amount of the digital asset represented by the UTXO and a locking script that defines the conditions that must be met by an unlocking script in the input 202 of the subsequent transaction for the subsequent transaction to be validated and therefore the UTXO to be successfully redeemed. Typically, the locking script locks an amount to a particular party (the beneficiary of the transaction in which it is included). That is, the locking script defines the unlocking conditions, which typically include a condition that the unlocking script in the input of the subsequent transaction includes a cryptographic signature of the party to whom the prior transaction is locked.

[0063] A locking script (aka scriptPubKey) is a piece of code written in a domain-specific language recognized by the node protocol. A specific example of such a language is called “Script” (capital S). A locking script specifies the information needed to pay the transaction output 203, e.g., the requirements for Alice’s signature. The output of the transaction shows the unlocking script. An unlocking script (aka scriptSig) is a piece of code written in a domain-specific language that provides the information needed to satisfy the criteria of the locking script. For example, it may include Bob’s signature. The unlocking script appears in the input 202 of the transaction.

[0064] In the illustrated example, UTXO0 in output 203 of Tx0 is A ], which requires Alice's signature, Sig PA, for UTXO0 to be redeemed (or more precisely, for any subsequent transaction that attempts to redeem UTXO0 to be valid). A] contains Alice's public key PA from her public / private key pair. Input 202 of Tx1 contains a pointer to Tx1 (e.g., its transaction ID, TxID0, which in an embodiment is a hash of the entire transaction Tx0). Input 202 of Tx1 contains an index that identifies UTXO0 within Tx0 to identify it among any other possible outputs of Tx0. Input 202 of Tx1 further contains an unlocking script that contains Alice's cryptographic signature, created by applying Alice's private key from the key pair to the predetermined portion of the data. <Sig P A > (sometimes called a “message” in cryptography). The data (or “message”) that Alice needs to sign in order to provide a valid signature is defined by the locking script, the node protocol, or a combination of these.

[0065] When a new transaction Tx1 arrives at node 104, the node applies the node protocol, which involves running the locking script and the unlocking script together to check if the unlocking script satisfies the conditions defined in the locking script (which may include one or more criteria). In an embodiment, this involves concatenating the two scripts. <Sig P A > <P A > || [Checksig P A ] Here, "||" denotes concatenation, "<...>" means to put data on a stack, and "[...]" is a function that is composed of the unlocking script (a stack-based language in this example). Similarly, the scripts can run against each other on a common stack rather than concatenating the scripts. Either way, when run together, the scripts authenticate that the locking script on the input of Tx1 contains Alice's signature signing the expected portion of the data, using Alice's public key PA, as included in the locking script on the output of Tx0. In order to perform this authentication, the expected portion of the data itself (the "message") must also be included in the Tx0 sequence. In an embodiment, the signed data includes the entirety of Tx0 (so a separate element must be included to specify in the clear that the signed portion of the data is already essentially present).

[0066] The details of authentication with public-private cryptography will be well known to those skilled in the art. Essentially, if Alice signs a message by encrypting it with her private key, then given Alice's public key and the message in the clear, another entity, such as node 104, can authenticate that the encrypted version of the message must have been signed by Alice. Signatures typically allow the holder of the public key to authenticate the signature by hashing the message, signing the hash, and tagging this as the signature on the clear version of the message. Thus, it should be noted that references herein to signing a particular portion of data or part of a transaction, etc., can, in embodiments, mean signing a hash of that portion of data or part of a transaction.

[0067] If the unlocking script of Tx1 satisfies one or more conditions specified in the locking script of Tx0 (in the example shown, Alice’s signature is provided in Tx1 and authenticated), the node 104 considers Tx1 valid. If it is a storage node 104S, this means adding it to the pool 154 of transactions waiting for proof of work. If it is a forwarding node 104F, it forwards the transaction Tx1 to one or more other nodes 104 in the network 106, so that it is propagated throughout the network. Once Tx1 is validated and included in the blockchain 150, this defines the UTXO0 from Tx0 as having been paid. Note that Tx1 is only valid if it uses unspent transaction outputs 203. If it tries to pay an output that has already been paid by another transaction 152, Tx1 becomes invalid even if all other conditions are met. Therefore, node 104 also needs to check whether the UTXO referenced in prior transaction Tx0 has already been spent (already formed a valid input to another valid transaction). This is one of the reasons why it is important for blockchain 150 to impose a defined order on transactions 152. In practice, a given node 104 may maintain a separate database marking which UTXOs 203 of a transaction 152 have been spent, but ultimately, what defines whether a UTXO has been spent is whether it already forms a valid input to another valid transaction in blockchain 150.

[0068] If the total amount specified in all outputs 203 of a given transaction 152 is greater than the total amount pointed to by all its inputs 202, this is another ground of invalidity in most transaction models, and therefore such a transaction will not be propagated to a block 151 or mined.

[0069] Note that in the UTXO-based transaction model, a given UTXO must be used in its entirety. It is not possible to “leave behind” part of the amount defined in a UTXO as paid while another amount is being paid. However, an amount from a UTXO can be split into multiple outputs of a subsequent transaction. For example, the amount defined in UTXO0 in Tx0 can be split into multiple UTXOs in Tx1. Thus, if Alice does not want to give Bob the entire amount defined in UTXO0, she can use the remaining amount to modify herself or pay another party in the second output of Tx1.

[0070] In practice, Alice also usually needs to include the winning miner's fee, because today the generation transaction's reward alone is typically not enough to incentivize mining. If Alice does not include the reward for the miner, Tx0 will likely be rejected by the miner's node 104M, and thus, although technically valid, it will still not be propagated and included in the blockchain 150 (the miner's protocol does not force the miner 104M to accept the transaction 152 if it does not want to). In some protocols, the mining reward does not need its own separate output 203 (i.e., it does not need a separate UTXO). Instead, the difference between the total amount indicated by the input 202 and the total amount specified in the output 203 of a given transaction 152 is automatically given to the winning miner 104. For example, suppose a pointer to UTXO0 is the only input to Tx1, and Tx1 has only one output UTXO1. If the amount of digital assets specified in UTXO0 is greater than the amount specified in UTXO1, the difference automatically goes to the winning miner 104M. However, nothing in this document precludes that a miner reward could alternatively or additionally be explicitly specified in one of the UTXOs 203 of transaction 152.

[0071] Alice and Bob's digital assets consist of the unspent UTX that is locked to them in any transaction 152 in the blockchain 150. Thus, typically, the assets of a given party 103 are distributed across the UTXOs of various transactions 152 throughout the blockchain 150. Nowhere in the blockchain 150 is a single number stored that defines the total balance of a given party 103. It is the role of the wallet function in the client application 105 to aggregate the value of all the various UTXOs locked to each party and not yet spent in another onward transaction. This can be done by querying the copy of the blockchain 150 stored in one of the storage nodes 104S, e.g., the storage node 104S that is closest to or best connected to each party's computing device 102.

[0072] Note that script code is often expressed diagrammatically (i.e., not in a precise language). A ]=OP_DUP OP_HASH160 <H(P A )> OP_EQUALVERIFY OP_CHECKSIG to mean [Checksig P A]. "OP_..." refers to a specific opcode in a scripting language. OP_CHECKSIG (also called "Checksig") is a scripting opcode that takes in two inputs (a signature and a public key) and verifies the validity of the signature using the Elliptic Curve Digital Signature Algorithm (ECDSA). At runtime, all occurrences of the signature ("sig") are removed from the script, but additional requirements such as a hash puzzle remain for the transaction to be verified by the "sig" input. As another example, OP_RETURN is a scripting language opcode for generating an indeterminate output of a transaction that can store metadata within the transaction, thereby immutably recording the metadata to the blockchain 150. For example, the metadata can include a document that is desirable to store on the blockchain.

[0073] signature P A is a digital signature. In an embodiment, it is based on ECDSA using the elliptic curve secp256k1. A digital signature signs specific data. In an embodiment, for a given transaction, the signature signs some of the transaction inputs and all or some of the transaction outputs. The specific parts of the outputs to sign depend on the SIGHASH flag, which is a 4-byte code included at the end of the signature that selects which outputs are signed (and is therefore fixed at the time of signing).

[0074] A locking script is sometimes referred to as a "scriptPubKey", referring to the fact that each transaction contains the public key of the party being locked. An unlocking script is sometimes referred to as a "scriptSig", referring to the fact that it provides a corresponding signature. However, more generally, in all applications of blockchain 150, it is not required that the conditions for a UTXO to be redeemed include authentication of the signature. More generally, the scripting language may be used to define any one or more conditions. Hence, the more general terms "locking script" and "unlocking script" are preferred.

[0075] Optional Side Channel FIG. 3 illustrates a further system 100 for implementing a blockchain 150. The system 100 is substantially the same as described in connection with FIG. 1, except that an additional communication function is included. The client applications on each of Alice's and Bob's computing devices 102a, 120b are equipped with the additional communication function. That is, it allows Alice 103a to establish a separate side channel 301 with Bob 103b (at the solicitation of either party or a third party). The side channel 301 allows for the exchange of data apart from the P2P network. Such a transmission is sometimes referred to as "off-chain". For example, it can be used to exchange a transaction 152 between Alice and Bob without it being published (even) on the network P2P 106 or proceeding so on the chain 150 until one of the parties chooses to broadcast it to the network 106. Alternatively or additionally, the side channel 301 can be used to exchange other transaction-related data, such as keys, negotiated amounts or terms, data content, etc.

[0076] The side channel 301 may be established over the same packet-switched network 101 as the P2P overlay network 106. Alternatively or additionally, the side channel 301 may be established over a different network, such as a mobile cellular network, or a local area network, such as a local wireless network, or over a direct wired or wireless link between Alice's and Bob's devices 1021, 102b. In general, the side channel 301 referred to anywhere herein may include any one or more links over one or more network technologies or communication media for exchanging data "off-chain," i.e., separately from the P2P overlay network 106. When more than one link is used, the bundle or collection of off-chain links as a whole may be referred to as the side channel 301. Thus, it should be noted that when it is said that Alice and Bob exchange certain information or data, or the like, over the side channel 301, this does not necessarily mean that all of this data must be transmitted over exactly the same links or the same type of network.

[0077] Node Software FIG. 4 illustrates an example of node software 400 running on each node 104 of the P2P network 106 in the example of a UTXO or output-based model. The node software 400 comprises a protocol engine 401, a script engine 402, a stack 403, an application level decision engine 404, and a set of one or more blockchain-related function modules 405. In any given node 104, these may include any one, two, or all three (depending on the role or roles of the node): a mining module 405M, a forwarding module 405F, and a storage module 405S. The protocol engine 401 is configured to recognize different fields of a transaction 152 and process them according to the node protocol. Another prior transaction 152m-1 (Tx m-1Transaction 152m (Tx m When a TxO (e.g., a UTXO) is received, the protocol engine 401 m The protocol engine 401 also identifies the unlocking script in the Tx m Based on the pointer in the input of Tx m-1 It identifies and searches for Tx m-1 If Tx is not already on the blockchain 150, then each node can obtain it from its own pool of pending transactions 154, or m-1 If already on the blockchain 150, Tx m-1 In any case, the script engine 401 searches for Tx m-1 The script engine 402 then identifies the locking script in the pointed to output and passes it to the script engine 402.

[0078] Therefore, the script engine 402 m-1 The locking script and the corresponding Tx m 4. For example, Tx1 and Tx2 are shown in FIG. 4, but the same can be applied to any pair of transactions, such as Tx0 and Tx1, etc. The script engine 402 executes the two scripts together, as described above. It includes putting data on the stack 403 and popping data off the stack according to the stack-based script language used (e.g., Script).

[0079] By executing the scripts together, the script engine 402 determines whether the unlocking script meets one or more criteria defined in the locking script, i.e., whether the unlocking script "unlocks" the output it is contained in. The script engine 402 returns the result of this determination to the protocol engine 401. If the script engine 402 determines that the unlocking script meets one or more criteria specified in the corresponding locking script, it returns a result "true"; otherwise, it returns a result "false."

[0080] In an output-based model, a "true" result from the script engine 402 is one of the conditions for the validity of a transaction. Typically, one or more further protocol-level conditions evaluated by the protocol engine 401 must be satisfied as well. For example, Tx m The total amount of digital assets designated for the output of Tx does not exceed the total amount designated for the input. m-1 The protocol engine 401 evaluates the results from the script engine 402 together with one or more protocol-level conditions, and accepts the transaction Tx only if they are all true. m The protocol engine 401 outputs an indication of whether the transaction is valid to the application level decision engine 404. m is actually verified, the decision engine 404 m 151. The node may select to control one or both of the mining module 405M and the transfer module 405F to perform respective blockchain-related functions related to Tx m and / or a mining module 405M that adds Txm It is noted, however, that in an embodiment, the decision engine 404 does not choose to forward or mine an invalid transaction, but this does not necessarily mean that it will conversely trigger the mining or forwarding of a valid transaction simply because it is valid. Optionally, in an embodiment, the decision engine 404 may apply one or more additional conditions before triggering either or both of these functions. For example, if the node is a mining node 104M, the decision engine may choose to mine a transaction only on the condition that the transaction is valid and has sufficient mining fees remaining.

[0081] It should also be noted that the terms "true" and "false" herein are not necessarily limited to returning a result expressed solely in the form of a single binary digit (bit), although this is certainly one possible implementation. More generally, "true" refers to any state that indicates a success or positive outcome, and "false" refers to any state that indicates a failure or negative outcome. For example, in an account-based model (not shown in FIG. 4), a "true" outcome may be indicated by a combination of an implicit, protocol-level validation of a signature by node 104 and an additional positive output of the smart contract (if both individual outcomes are true, the overall outcome is considered true).

[0082] Example transaction set FIG. 5 illustrates a set of transactions 152 for use in accordance with embodiments disclosed herein. The set includes a zeroth transaction Tx0, a first transaction Tx1, and a second transaction Tx2. Note that “zeroth”, “first”, and “second” are merely convenient labels. They do not necessarily mean that these transactions are placed immediately one after the other in block 151 or blockchain 150, or that the zeroth transaction is the first transaction in block 151 or blockchain 150. Also, these labels do not necessarily mean anything about the order in which the transactions are sent to the network 106. They refer only to the logical procedure in which the output of one transaction is pointed to by the input of the next transaction. Keep in mind that in some systems, it is possible for a parent to be sent to the network 106 after its children (in which case the “orphaned” children are buffered for a period of time at one or more nodes 104 while waiting for their parents to arrive).

[0083] The zeroth transaction Tx0 is also referred to as a source transaction for this purpose in that it acts as a source of the amount of digital assets locked to Alice 103a. The first transaction Tx1 may also be referred to as a challenge or puzzle transaction for this purpose. It conditionally transfers the amount of digital assets from the source transaction Tx0 depending on the second transaction Tx2, and acts as an intermediary that provides the solution to the r-puzzle. The second transaction Tx2 is also referred to as a proof transaction or a payment transaction because it is the transaction that provides the solution to the r-puzzle set in the first transaction Tx1 and locks the resulting payment to the prover (or a potential beneficiary on behalf of which the prover is acting). Although the embodiment may be described as an example where the prover (second party) happens to be Bob, as will be understood based on the discussion below, the r-puzzle allows for practically any second party to be a prover, regardless of identity, as long as they provide a valid signature that solves the r-puzzle.

[0084] As shown in FIG. 5, the source transaction Tx0 includes at least one output 2030 (e.g., output 0 of Tx0) that specifies an amount of digital assets, and further includes a locking script that locks this output to Alice 103a. This means that the locking script of the source transaction Tx0 must satisfy at least one condition: that the input of a transaction that attempts to unlock the output (and thus redeem the amount of digital assets) must include Alice's cryptographic signature (i.e., using Alice's public key) in its unlocking script. In this sense, the amount defined by the output of Tx0 is said to be owned by Alice. The output may be referred to as a UTXO. For present purposes, it is not particularly important where the inputs of Tx0 point back to (as long as they are sufficient to cover the total outputs of Tx0).

[0085] In this case, the transaction that unlocks the output of source transaction Tx0 is the first transaction Tx1 (the challenge transaction). Thus, Tx1 has at least one input 2021 (e.g., input 0 of Tx1), where input 1 includes a pointer to the relevant output of Tx0 (output 0 of Tx0 in the illustrated example), and further includes an unlocking script configured to unlock the pointed-to output of Tx0 according to a condition defined in the locking script of that output, which requires at least Alice's signature. The signature required from Alice by the locking script of Tx0 is required to sign a portion of Tx1. In some protocols, the portion of Tx1 that requires a signature may be a setting defined in the unlocking script of Tx1. For example, this may be set by a SIGHASH flag, which is a byte appended to the signature, so that in terms of data, the unlocking script: <Sig P A > <sighashflag><P A > Alternatively, the portion that needs to be signed may simply be a fixed or default portion of Tx1. In any case, the portion that is signed will typically exclude the unlocking script itself, and may exclude some or all of Tx1's inputs. However, the signed portion of Tx1 includes at least the output 2031, which contains the r-puzzle (see output 0 of Tx1 in this example, below).

[0086] The first transaction Tx1 has at least one output 2031 (e.g., output 0 of Tx1, which may also be referred to as a UTXO). The output of the first transaction Tx1 is not locked to one side or the other. Like Tx0, it has at least one output (e.g., output 0 of Tx1), which specifies the amount of digital assets to be transferred and further includes a locking script that defines what is needed to unlock that output and thus redeem that amount. However, the locking script allows any party that provides a solution to the r-puzzle to unlock that output.

[0087] The second transaction (payment transaction) Tx2 has at least one input 2022 (e.g., input 0 of Tx2), which includes a pointer to the aforementioned output of Tx1 (in the illustrated example, output 0 of Tx1), and also includes an unlocking script configured to unlock said output of Tx1 based on satisfying one or more requirements of an unlocking condition defined in the unlocking script of Tx1. According to embodiments disclosed herein, the unlocking condition includes at least one requirement that the corresponding unlocking script includes a solution to an r-puzzle. The r-puzzle includes a challenge defined in the locking script of Tx1 based on the r-part of an Elliptic Curve Cryptography (ECC) signature, which can be satisfied by any party (which happens to be Bob in this case) that includes their signature (or at least the s-part thereof) in the unlocking script of Tx2. Note that unlike the locking script of Tx0, any party's signature can be used to unlock the locked state of Tx1, as long as it is a valid signature that satisfies the r-challenge (i.e., r-puzzle). We briefly explain this example in more detail. Although Bob is chosen here simply as an example of a prover or second party, in practice, the r-puzzle allows a second party to be the prover, e.g., Charlie, Dora, Ezekiel, etc. In some embodiments, the unlocking condition in Tx1 can also be made conditional on one or more further conditions, e.g., requiring that the unlocking script of Tx2 also includes Alice's signature.

[0088] The second transaction, Tx2, has at least one output 2022 (e.g., output 0 of Tx2) that specifies the amount of digital assets to transfer to Bob, and a locking script that locks it to Bob (i.e., it requires a further forward transaction that includes Bob's signature in the unlocking script). In this sense, the output of the target transaction, Tx2, is said to be owned by Bob. This output is again called a UTXO.

[0089] The part of Tx2 that is signed by the prover's signature (e.g., Sig P in Bob's case) B ) will contain at least this output 2032, i.e., the output that locks the payment to the prover (in this example, output 0 of Tx2).

[0090] In an embodiment, the locking script at the output 2031 of Tx1 may define multiple alternative conditions for unlocking the output, such as multiple alternative r-puzzles, in which case the unlocking script at the input 2022 of Tx2 will unlock the output of Tx1 if any of the alternative unlocking conditions are met.

[0091] The zeroth (i.e., source) transaction Tx0 may be generated by Alice, a prover r (e.g., Bob), or a third party. It typically requires the signature of a preceding party from whom Alice obtained a quantity defined in the input of Tx0. It may be sent to the network 106 by Alice, Bob, the aforementioned party, or another third party.

[0092] The first transaction (i.e., challenge transaction) Tx1 may be generated by Alice, a prover (e.g., Bob), or a third party. In an embodiment, it may be generated by Alice, since it requires Alice's signature. Alternatively, it may be generated by Bob or a third party as a template and sent to Alice to sign, such as sent via side channel 301. Alice then needs to send the signed transactions to the network 106 herself, to Bob or a third party to forward them to the network 106, or simply send her signature for Bob or a third party to assemble into signed Tx1 and forward to the network 106. Any off-chain exchanges prior to sending Tx1 to the network 106 can occur via side channel 301.

[0093] The second transaction (i.e., a proof of transaction or payment) Tx2 may be generated by Alice, a prover (e.g., Bob), or a third party. The first version may be generated by Bob, since it requires the prover's signature and / or data. Alternatively, it may be generated by Alice or a third party as a template and sent to Bob for signing, such as by being sent to Bob via a side channel 301. Bob can then send the signed transactions to the network 106 himself, or send them to Alice or a third party for forwarding to the network 106, or simply send his signature for Alice or a third party to assemble into a signed Tx2 and forward to the network.

[0094] It will be appreciated that there are a variety of locations where the different elements of a transaction may be generated and assembled, and a variety of ways for direct or proxy transmission to an ultimate destination on the P2P network 106. The scope of practice of the disclosed technology is not limited in any of these respects.

[0095] It will also be understood that phrases such as "by Alice," "by Bob," and "by a third party" may be used herein as short-hand for "by Alice's 103a's computing device 102a," "by Bob's 103b's computing device 102b," and "by a third party's computing device," respectively. Note again that the equipment of a particular party may consist of one or more user devices used by that party, or server resources, such as cloud resources, used by that party, or a combination thereof. This is not necessarily limited to actions performed on a single user device.

[0096] Elliptic Curve Digital Signature Algorithm (ECDSA) Public key cryptography is used as the basis for securing transactions in many different blockchain architectures. Uses of public key cryptography include public key encryption and digital signature schemes. Public key cryptography is based on the principle that certain functions are easy to compute but difficult to reverse without special knowledge. Such functions are called trapdoor functions, and the special knowledge required to reverse them is called the trapdoor of the function. Easy to compute means that it is computationally feasible to compute the trapdoor function in a reasonable time frame for a given input (or set of inputs), and difficult to reverse means that it is computationally infeasible to infer the input (or inputs) from the result without knowing the trapdoor.

[0097] In the context of public key cryptography, a key pair means a public key (which can be made freely available to anyone) and a corresponding private key (which is assumed to be secret in the sense that it is known only to a specific entity or group). The public key defines a trapdoor function, and the corresponding private key is the trapdoor needed to reverse that function.

[0098] In the context of public key cryptography, encryption is based on a trapdoor function (i.e., encryption is performed in the "forward direction"), while decryption is based on the reversal of the trapdoor function (i.e., decryption is performed in the "reverse direction"). This is only possible if the trapdoor is known.

[0099] In the context of digital signatures, signature verification is performed in the forward direction using the public key, and signature generation is performed in the reverse direction and can only be performed using the private key.

[0100] In the context of blockchain, digital signatures based on public key cryptography are used as the basis for cryptographically signing transactions and verifying transaction signatures.

[0101] ECC is a form of public key cryptography that takes advantage of the mathematical properties of elliptic curves, and has various advantages over other cryptographic schemes such as DSA (Digital Secure Algorithm).

[0102] "Elliptic Curve Digital Signature Algorithm" (ECDSA) refers to a class of digital signature schemes that use ECC as the basis for digital signature generation and verification. Some principles of ECDSA are outlined below:

[0103] In mathematical terms, ECC exploits the algebraic structure of elliptic curves of prime order over a finite field, meaning a finite set of elements and a set of related operations of multiplication, addition, subtraction, and division that satisfy the usual rules of arithmetic operations (associativeness, commutativity, etc.) when applied to elements in the set -- that is, operations that are not addition or multiplication in the "normal" sense, but that behave essentially the same way.

[0104] Elliptic Curve Arithmetic: In the context of ECC, the addition, subtraction, and multiplication operations are respectively elliptic curve point addition, denoted here as "+", elliptic curve point subtraction, denoted here as "-", and elliptic curve scalar multiplication, denoted here as "·". The addition and subtraction operations are each applied to two points on an elliptic curve and return a third point on the elliptic curve. However, the multiplication operation is applied to a scalar and a single point on an elliptic curve and returns a second point on the elliptic curve. In contrast, division is defined in terms of scalars.

[0105] For illustration purposes, FIG. 2 denotes the elliptic curve ε in R 2 is the set of all real-valued two-dimensional coordinates, and (x,y)∈R 2 is R 2 The elliptic curve ε is a set of points that satisfy the following equation: ε:y 2 =x 3 +ax+b

[0106] Addition: Given any two points A, B on an elliptic curve ε, the line where A and B intersect will cross ε again, denoting only one additional point C. The elliptic curve addition of A and B, i.e. A+B, is defined as the "reflection" of C. Take a horizontal line that crosses C, and the reflection of C is the other point on the elliptic curve that crosses that line. This definition also applies to the case A=B. The modification is that C is the point where the tangent to ε at A crosses ε again. This definition also applies to the case where the two intersecting points are perpendicular by defining a point at infinity, denoted as ∞, since it is a point on the elliptic curve and any perpendicular line will cross the elliptic curve there (e.g. the points labeled D and E are aligned horizontally vertically, so D+E=∞).

[0107] Subtraction / additive inverse: The above definition of reflection can be applied to any point, providing the definition of elliptic curve point subtraction: AB is the sum of A and the reflection of B. The reflection of B is more formally called the "additive inverse" of B, denoted by -B inverse. Using this notation, elliptic curve subtraction can be defined in mathematical notation as follows: AB=A+(-B)

[0108] Thus, in Figure 6B, C = -(A + B) and (A + B) = -C. Also, under this definition, D = -E, and note the general law of algebraic construction, namely, that the addition of any point on an elliptic curve to its additive inverse elliptic point is a point at infinity, i.e.: A+(―A)=∞ ∇A∈ε Please do.

[0109] The point at infinity ∞ is more formally called the "identity element" (note both the parallel to and deviation from normal arithmetic: in normal arithmetic, the sum of any number a and its additive inverse -a is 0, and 0 is the identity element in normal arithmetic). Another property of the identity element ∞ is that, reflecting normal arithmetic, for any point A in ε, including ∞ itself, A+∞=A (similar to the statement that for any real number a, a+0=0).

[0110] Multiplication: From the definition of elliptic curve point addition, the definition of elliptic curve scalar multiplication follows: Multiplication of an elliptic curve point A and an integer ν is defined as follows: ν A=A+...+A (ν additions)

[0111] That is, for ν, the elliptic curve point A is added to itself.

[0112] Note: Elliptic curve scalar multiplication is also known in the art as elliptic curve point multiplication. These two terms have the same meaning in this disclosure.

[0113] Division / multiplicative inverse: The division operation is defined in terms of scalars. Given a scalar ν, its "inverse multiplication" is the scalar ν -1 is defined as follows: ν -1 =1

[0114] FIG. 6A provides an intuitive visualization of the above operations, where ε is defined over an infinite domain that contains all real numbers R.

[0115] FIG. 6B shows in more detail how the above operations are actually applied in the context of ECC, with ε defined by Eq. n Shows. ε n :y 2 =x 3 +ax+b mod p

[0116] where p is a prime number (prime modulus) and mod denotes modulo operation. The set of points that satisfy the above formula is finite, and all but one of these points is shown in Figure 6B as a white circle, with the remaining points being the identity ∞. The prime number p forms part of the definition of an elliptic curve and can be chosen freely. For an elliptic curve to have good cryptographic properties, p should be sufficiently large. For example, a p of 256 bits is specified in a given blockchain model.

[0117] In contrast, the subscript "n" is referred to herein as the ordering of the groups formed by the elliptic curve points under point addition as defined above (for brevity, this is the ordering of the elliptic curve ε n (can be called the order of) - see below.

[0118] In other words, n is the order of the groups, and p is the order of the regions. In total there are n elliptic curve points. Each point on the elliptic curve is represented by two numbers / coordinates (x,y), where x and y are all in the range -(p-1),...0,...,(p-1).

[0119] ε in Figure 6B n It can be seen that ε exhibits a horizontal symmetry similar to that of FIG. 6A. This is a general property of elliptic curves for prime files, and thus ε n We can see that the above definition of the additive inverse of a point still holds: some points do not have a horizontally aligned counterpoint (e.g., (0,0)), and such points are their own additive inverse.

[0120] ε n A "line" l that intersects two points A and B on A,B becomes an infinite set of points, represented by smaller black circles, that satisfy similar geometric requirements and the definition of elliptic curve scalar multiplication still holds. Similar to Figure 6A, Figure 6B shows the point A+B=-C, which is the intersection of the line l A,B is ε n The point where A and B intersect again is C=-(A+B), which is the inverse of the addition.

[0121] ε n The elliptic curve addition of any two points above, A+B=-C, can be defined algebraically by the following formula. A=(x A ,y A ), B=(x B ,y B ), C=(x C ,y C )=-(A+B), x C =(λ 2 -x A -x B ) mod p, y C =((λ(x C -x A )+y A ) mod p, =((λ(x C -x B )+y B ) mod p, Here, if A ≠ B, λ=(y A -y B )(x A -x B ) -1 mod p And if A=B, then λ = (2y A ) -1 (3x A 2 +a) mod p

[0122] For the above purposes, the inverse of the multiplication of an integer ν is -1 The definition is amended as follows: ν -1 ≡1(mod p)

[0123] That is, the inverse of multiplication of an integer v is the modular inverse of v mod p.

[0124] The case B=-A is a special case, which is solved by the introduction of the identity ∞, as shown above. - As shown, in this case, A+B=A+(-A)=∞. The case B=∞ is also a special case, which is solved as A+∞=A, as shown above.

[0125] The definition of elliptic curve scalar multiplication adopts this definition of elliptic curve addition and otherwise remains the same.

[0126] In other contexts, the inverse of the multiplication of the scalar ν -1 The definition is as follows: ν -1 ≡1(mod n)

[0127] In the context, it will be clear whether the mod n or mod p multiplicative inverse is being defined.

[0128] In practice, the following checks are applied to identify whether a number should be treated as mod n or mod p. 1.Does the number represent the coordinates of an EC point? a. If yes, then mod p. 2. Is that number used to multiply EC points? a. If yes, then mod n.

[0129] However, it is possible that both checks give a positive answer, in which case the number must be mod n and mod p.

[0130] Elliptic Curve Cryptography (ECC) Elliptic curve arithmetic offers the unique ability to obfuscate secret values ​​and forms the basis of many modern cryptosystems. In particular, inverse scalar multiplication of elliptic curve points over finite domains is a hard problem (computationally infeasible).

[0131] The private key V takes the form of an integer, and the corresponding public key P is a function of the elliptic curve ε n It is also possible to find the elliptic curve ε n The above point. P=V G=G+...+G (V additions)

[0132] where "·" is the elliptic curve ε defined by a, b, and n (elliptic curve parameters). n This shows scalar multiplication in

[0133] For a sufficiently large V, it is difficult, i.e., computationally infeasible, to actually perform elliptic curve addition on V to derive P. However, if V is known, P can be computed more efficiently by exploiting the algebraic properties of elliptic curve arithmetic. An example of an efficient algorithm that can be used to compute P is the "double and add" algorithm - which can only be implemented if V is known.

[0134] Conversely, if V is unknown, then there is no computationally feasible way to derive it (i.e., reversing the scalar multiplication), even if both G and P are known (this is the so-called "discrete-logarithm problem"). An attacker can try to "brute force" P by starting from G and repeatedly performing elliptic curve point additions up to P, at which point he will find that V is the number of elliptic curve point additions he would have had to perform, but that turns out to be computationally infeasible. Thus V satisfies the requirements for a trapdoor in the above sense.

[0135] In ECC, a public key P, a generator key G, and an elliptic curve ε n is assumed to be public and known, while the private key V is secret.

[0136] Elliptic Curve Digital Signature Verification Algorithm (ECDSA) In a blockchain system, a user or other entity typically holds a private key V that is used to prove their identity, and a corresponding public key P, calculated as follows: P=V G

[0137] A private key V can sign a piece of data m (a “message”) using ECDSA.

[0138] Further details on ECDSA are described, for example, in "RFC 6979 - Deterministic Usage of the Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)" Tools.ietf.org, which is incorporated herein by reference in its entirety.

[0139] 6C shows a schematic functional block diagram of the signature generation function (Signature Generator_600 generates an ECDSA signature (r,s) for a public / private key pair (V,P). An EDSA signature is a pair of values, referred to herein as the r-part (r) and the s-part (s), respectively.

[0140] The signature generation is performed on the same elliptic curve ε n and the generation point G, and thus the elliptic curve parameters a, b, and n, as well as the generation point G, are shown as inputs to the signature generator 600.

[0141] An ephemeral key generator 602 of signature generator 600 generates an “ephemeral” key k ∈ [1, n-1], i.e., in the range from 1 to n-1, inclusive.

[0142] The r-part generator 604 computes the corresponding public ephemeral key k as follows: R = k G Next, take the x-coordinate of the calculated point ([] x shows the process of taking the x-coordinate of an elliptic curve point). r=[R] This is the r part of the signature.

[0143] The s-part generator 606 generates the modular inverse k of k mod n. -1 (i.e., as a result, k -1 1(mod n)—see above), and use the hash of the message m, denoted H(m) (truncated if necessary), to compute the s part of the signature as follows: s=k -1 (H(m)+rV)mod n

[0144] In this example, message m contains the data to be included in transaction 608 (in this example, one or more transaction outputs). This may be referred to as the process of signing message m, and message m may be referred to as the signature portion of the transaction.

[0145] The message m and the signature (r, s), in turn, form part of the transaction 608. In this example, the signature (r, s) is included at the input of the transaction 608 as part of the unlocking script.

[0146] 6D shows a schematic functional block diagram of a signature verification function (signature verifier) ​​620 for verifying transaction 608. The computations performed by signature verifier 620 are performed over the same publicly available elliptic curve ε n and based on the generating point G.

[0147] A signature requires the private key V as input; that is, knowledge of the signature is required to generate a valid signature, but only the signature pair (r,s), the message m, and the public key P are needed to verify the signature (r,s). To verify a signature, the signature verifier 620 hashes the signature portion of the transaction m (applying the same hash function H used to generate the signature (r,s)). It then performs the verification process using the following calculation: R' = H(m)s ―1 ·G+rs ―1 P

[0148] The signature is [R'] x = r, otherwise it is invalid (i.e., signature verification fails). In this example, r denotes the r portion of the signature included in transaction 608.

[0149] The public key P used in the signature verification process can be specified, for example, in the locking script of the prior transaction. In this case, the signature verification is performed using the public key specified in the locking script of the prior transaction and the signature (r,s) of the (later) transaction 608 - and fails if the signature (r,s) was not generated based on the private key P corresponding to the public key specified in the prior transaction and the signature part m of the later transaction 608. Thus, only the holder of the private key V can claim the output of the prior transaction (typically by including his or her public key in the output of the later transaction 608), and the signature part m of the later transaction 608 cannot be changed without invalidating the signature (r,s).

[0150] R-PUZZLE The following describes a new form of proof of knowledge based on ECDSA. As an example, the challenger is Alice, a first party who sets up r-puzzles in a first transaction Tx1, either by creating and publishing them themselves on the P2P blockchain network 106, or by providing the necessary details for a third party to assemble them into Tx1. The verifier (the party that actually performs the proof) is an operator of a node 104 of the network, e.g., a miner. A solution to the r-puzzle is provided by publishing Tx2 on the network 106. Since r-puzzles are not inherently tied to identity, the prover can be any second party, but as an example, the following can be written for a scenario where the prover happens to be Bob. The prover can either create and publish Tx2 himself, or provide the necessary details for a third party to assemble and publish Tx2.

[0151] Cryptographic hash functions provide a means to deterministically obfuscate an input, where small changes in the input lead to unpredictable changes in the output. Classic hash functions include MD5, RIPEMD-160, SHA-1, and SHA-256[5], each of which provides collision resistance (the probability of finding two inputs that produce the same output is very small) and preimage resistance (given a hash value h=H(d), it is very hard to find an input d).

[0152] A traditional hash puzzle can be set up as follows: The idea is to set up a first transaction, Tx1, whose output can be redeemed by a second transaction, Tx2, provided that the second transaction, Tx2, contains one particular piece of data in its input.

[0153] In a blockchain transaction, the first party (Alice) can simply create a non-standard transaction Tx2 using the hash value h in the locking script as follows: OP_HASH160 <h>OP_EQUALVERIFY

[0154] Here, h=H puz (d) and H puz is the hash function used in the puzzle (in the above example, according to the locking script, this hash function must be HASH160, but other implementations may use other forms of hash functions). Redeeming a UTXO containing this locking script requires the hash puzzle solution in the unlocking script of the subsequent transaction. Thus, a payment transaction Tx2 for a second party with address Addr_Bob will be constructed with an unlocking script that must only contain d. [Table 1]

[0155] Where TxID i Tx i The locking script is written as follows: take the data value d from the unlocking script at the input of Tx2, hash it, and check whether it is equal to the hash value h contained in the locking script at the output of Tx1. Thus, by providing d to the unlocking script of Tx2, the output is unlocked.

[0156] In this simple example, after seeing a user's transaction with the hash puzzle solution in Tx2, the miner who originally received this transaction could maliciously reject the transaction and create a new malleated version of Tx2 with the same solution to the hash puzzle. * and change the output to its own address, Addr_Miner. The malicious miner can then send the Tx2 * and if successful before Tx2 is mined, the miner will receive a payment on Bob's behalf. [Table 2]

[0157] Digital signatures are commonly used in blockchain transactions to prove ownership and redeem unspent transaction outputs (UTXOs). This allows transaction outputs like Tx1 to be locked to a specific party. The most common example is a pay-to-public-key-hash (P2PKH) transaction, where the transaction output is locked to a specific hash of a public key (which also serves as the address of that party). The locking script for public key P is: OP_DUP OP_HASH160 <h p > OP_EQUALVERIFY OP_CHECKSIG

[0158] Here, h p =H sig (P) and H sig P is the hash function used in the signature (in the above example, the locking script requires this hash function to be HASH160, but other implementations may use other forms of hash functions). To be able to use this UTXO as input to another transaction, you need to provide an unlocking script with a valid ECDSA signature over P. <sig>

[0159] The entire string (unlocking + locking script) is evaluated by the miner, which verifies that the correct public key has been provided and that the signature is valid and corresponds to P. The locking script basically takes the public key P from the unlocking script at the input of Tx2, hashes it, and then returns the hash value h p Then, also given knowledge of the signature part of Tx2, verify the signature sig using the public key P from the unlocking script of Tx2 based on the ECDSA verify function. The ECDSA verify function is called by the OP_CHECKSIG opcode.

[0160] Therefore, the output can only be unlocked by providing a valid signature sig, signed under the private key V corresponding to P, in the unlocking script.

[0161] Combining this with hash puzzles, the vulnerability described above can be fixed by requiring a digital signature from the intended recipient along with the hash puzzle solution. The locking script is constructed as follows: OP_HASH160 <h>OP_EQUALVERIFY OP_DUP OP_HASH160 <h p > OP_EQUALVERIFY OP_CHECKSIG And the corresponding unlocking script would need to: <sig>< / sig> < / h> <d>

[0162] However, this limits who can redeem it to the owner of the public key P. It is recognized that in some applications this may not be desirable, for example if Alice wants to retain the ability to specify signing authority only after she has set up the puzzle.

[0163] It is recognized here that the hash puzzle function can be emulated by utilizing the r part in an ECDSA signature, which can be a temporary random value. An ECDSA signature is composed of two main parts, r and s. As stated above, r = [k G] x Instead of the traditional hash puzzle h = H(d), the intractability of inversion of elliptic curve addition allows us to form a similar puzzle, referred to herein as the r-puzzle. To solve this puzzle, we need to obtain a solution value k, where k is an ephemeral key corresponding to r.

[0164] In a traditional hash puzzle, the risk is that d will be revealed on the blockchain when solving the puzzle. However, in an r-puzzle, k is never revealed. Instead, r is revealed, and knowledge of k can be proven from r along with a signature.

[0165] To emulate the hash puzzle function, the creator of an r-puzzle can first hash some other preimage data to obtain a value k, since k must be a fixed size, while the preimage data of a hash puzzle can be of any length (and one property of a hash function is that it outputs a fixed-length value regardless of the length of the input data). For example, if a 256-bit long secret / ephemeral key is used, the preimage data for the r-puzzle should be hashed to obtain k. Alternatively, however, some appropriately long value of k can be chosen and used directly as a secret value in its own right (i.e., without having to be derived from some other, preceding preimage).

[0166] This method can be used in any blockchain system that uses ECDSA signatures for payments. As an illustration, we describe below an example implementation in the UTXO-based model. In the scripting language, the OP_CHECKSIG opcode requires a signature and a public key on the stack (the public key on the top of the stack, and the signature just below it). In the case of an r-puzzle, the script is configured to check that the value in the provided signature is the same as the r value used for the r-puzzle challenge. In other words, the script not only checks that the signature is valid for the public key (through OP_CHECKSIG), but also verifies that the signature is generated using the r value of the r-puzzle that is published on the blockchain beforehand.

[0167] We now describe some example implementations of r-puzzles with reference to Figs. 7-10. In each case, a prover, say Bob, creates a signature (r,s) by signing a portion of the signature of Tx2. Signatures of this form are sometimes called "sig". In the context of cryptographic signatures, the signed portion is also called the "message" (m). The signed portion (message) m includes at least the output 2032 of Tx2, which locks the payment to Bob as a result. If there is more than one output, m can constitute some or all of the outputs. m can also include other parts, such as a lock time. However, it typically excludes the unlocking script itself (which of course must exclude at least the signature itself). The portion of Tx2 that is signed as the "message m" can be set by Sighash, or be a default, or be a fixed feature of the protocol.

[0168] Perhaps the simplest implementation of the r-puzzle is shown in FIG. 7. The locking script in Tx1 contains a reference instance or part r, here labeled r'. In this way, the locking script in Tx2 only needs to contain at least the s part of Bob's signature. It can also be seen to contain the public key P that corresponds to the private key V that Bob used to sign m. The locking script in Tx1, when executed by the script engine 402 on node 104, is configured to retrieve s and P from the unlocking script in Tx2 and then perform the following operations: I) R'=H sig (m)s ―1 ·G+r's ―1 P, and II) check[R'] x =r'

[0169] where r' is taken from the locking script of Tx1, and s and m are taken from the unlocking script of Tx2. Bob's public key P can be taken from the unlocking script of Tx2 or can be known by other means. H sig is the hash function used to hash m in generating the initial ECDSA signature. It can be any type of hash function. Whatever the type, the type of hash function can be assumed to be predetermined and known at both ends. G is a fixed, known vector value.

[0170] The locking script is configured to return a “true” result provided that the above checks are true, but a “false” result otherwise. In the case of UTXOs, a true (i.e., successful) result of locking together with the unlocking script is a requirement for the validity of the transaction. Thus, the validity of Tx2 can be used as a proxy for the outcome of the r-puzzle. Or, stated differently, the validity of Tx2 is conditional on giving a solution to the r-puzzle. That is, if Bob does not pass the r-puzzle, his transaction Tx2 will not be propagated through the network 106 and will not be recorded in the blockchain 150 (and any payments defined in the output of Tx1 will not be redeemed).

[0171] The example in Figure 7 is the simplest in a mathematical sense, but this does not necessarily mean that it is the simplest to integrate with any given node protocol or scripting language.<r,s> and< / d> In contrast to the unlocking script, <s> and< / s> <s>If only a signature is provided, the script must account for this. Operations I)-II) are not standard Checksig type op-code operations. The OP_CHECKSIG op-code expects the signature to be in DER format, so <s>If only values ​​are provided in the unlocking script, additional opcodes are needed in the locking script to generate a valid signature in DER format (such as concatenating OP_CAT). Figure 8 shows an alternative example that is simpler to write and involves an extra step mathematically, but in practice integrates more easily with scripting languages ​​such as Script, and already has dedicated opcodes to invoke ECDSA signature verification based on both r and s taken from the inputs of Tx2.

[0172] Note: It is not mandatory to include P in Tx2 in all possible embodiments. Indeed, from knowledge of the message m and (r,s), or in this case (r',s), it is possible to compute two possible values ​​P and -P of the public key (but not know which is which). The two verifications are then used to identify which is the correct one, or alternatively, a one-bit flag can be used in Tx2 to signal which of the two possible solutions to use. This latter approach is currently used in some account-based protocols. However, it tends not to be used in current UTXO-based protocols, whose scripting language (e.g., Script) does not have opcodes for the operations to post P and -P and m from (r,s). Nevertheless, it should not be excluded that one could be introduced, or that the operation could simply be explicitly coded in the locking script. Another possibility is that Alice already knows or has access to P, or has received it via a side channel 301. However, this would require another lookup to map P to Tx2.

[0173] Another example implementation is shown in FIG. 8. Here, the r-puzzle requires that Tx2's unlocking script explicitly includes an r-part submitted instance r. Tx1's locking script includes a test on the r-part, which includes an r-part reference instance r' that is compared against the submitted instance r. In this manner, Tx2's unlocking script must include at least the r-part (r) and s-part (s) of Bob's signature. It may also include a public key P that corresponds to the private key V that Bob used to sign m. Tx1's locking script, when executed by the script engine 402 on node 104, is configured to retrieve r, s, and P from Tx2's unlocking script and perform the following operations: I) check r'=r II) compute R'=H sig (m)s ―1 ·G+rs ―1 P, and III) check[R'] x =r

[0174] where r' is taken from the locking script of Tx1, and s, r, and m are taken from the unlocking script of Tx2. Bob's public key P can be taken from the unlocking script of Tx2, or it can be known by other means, such as by deriving (r,s) and m, or (r,s) and m, as described above.

[0175] The locking script is configured to return a result of "true" on the condition that both checks in step I) and step III) are true, but a result of "false" otherwise. Again, in the UTXO-based case, this allows the validity of the transaction to be determined depending on the outcome of the proof-of-knowledge r-puzzle. Note that the numbers I-III do not necessarily imply an order: check I) can be performed after II)-III), but III) requires that it be performed after II).

[0176] In the method of Fig. 8, only steps II) and III) are conventional operations performed by the ECDSA verification function. Therefore, in most protocols, they can be called by a dedicated opcode, such as the existing Checksig opcode (OP_CHECKSIG) in the script. Step I) can be coded separately into the locking script using a generic opcode (an example will be given shortly). It is also not excluded that steps II) and III) could in principle be explicitly encoded using generic opcodes, instead of using a dedicated opcode like Checksig.

[0177] In one example of a transaction protocol, the transaction ECDSA signature uses the ASN.1 (Abstract Syntax Notation One) DER (Distinguished Encoding Rules) encoding format, as shown in Figure 12. The first byte field contains a flag 0x30, which indicates an ASN.1 sequence number. The next byte field contains the length of the sequence in hexadecimal. The third byte field contains a flag 0x02, which indicates an ASN.1 integer. The r value of the ECDSA signature is then contained in the next 32 or 33 bytes. The field is 32 bytes, but if the first byte of r is greater than 0x7f (first bit is 1), an extra byte of zero is added before the r value, making it 33 bytes long. This is done as a result of the DER format encoding interpreting the first bit of the integer as a sign. The extra byte of zero is added to the beginning of the value to prevent it from being interpreted as a negative value. The same is done for the s value of the ECDSA signature. Finally, a one-byte field, hash type (ht), is added to the DER encoding corresponding to the type of Bitcoin signature for the transaction (SIGHASH_ALL, SIGHASH_NONE, etc.).

[0178] Consider the case where Alice (A) wants to create an r-puzzle transaction that can be spent by anyone who has the solution to the puzzle. To achieve this, she creates a new transaction Tx1 as follows. The input section contains the unlocking script of the previous transaction Tx0 that is to be spent. For simplicity, we assume it is a standard P2PKH where spending is done using Alice's signature and public key. The output section contains the locking script (script pub key), or in other words, the r-puzzle challenge. As the signature may use a DER encoded format in some protocols, as shown in Figure 12, the script extracts the value of r from the encoded signature and then converts it to <r>Then the script needs to check that the signature is valid on the public key. The details of how the script works are shown in Figure 5. The opcode in bold is basically how we extract r from the signature. [Table 3]

[0179] The corresponding unlocking script is shown below, where signature sig r uses r, and the payer Bob (B) can compute the signature using any private / public key pair. r Note that, is (r,s). <P B > <sig r >

[0180] Figure 13 shows the step-by-step analysis of the script.

[0181] The ephemeral key k may be generated by Alice and given to Bob (and, optionally, one or more other potential provers). Alternatively, k may be generated by Bob and given to Alice to set up an r-puzzle that only Bob (or anyone Bob chooses to share k with) can solve. In either case, the prover Bob must trust that the sender Alice will not spend the transaction herself because Alice knows the solution (k) to the r-puzzle. To prevent this, the prover Bob may create the puzzle and then send the r-value to Alice to use when creating the R-puzzle transaction. Bob can then redeem the output at a later date using his private / public key pair, so long as he keeps the value k. This is the solution to the r-puzzle, and can be considered a form of key. On the other hand, in some cases, the fact that Alice knows k may be an advantageous feature. For example, this can be used to create private key puzzles and, through them, generalized atomic swaps.

[0182] FIG. 9 illustrates another exemplary r-puzzle, which may be referred to herein as “pay to r-puzzle hash” (P2RPH), similar to pay to public hash (P2PKH). To improve security and privacy, the r value may be hashed before being placed in Tx1 (propagated through nodes 104 of network 106 and placed in blockchain 150). Similar to P2PKH, the same can be done with R-puzzle, where only the hash of the public key is on the blockchain instead of the public key itself.

[0183] Here, the r-puzzle again requires that Tx2's unlocking script contains the submitted instance r of part r. Again, Tx1's locking script contains a test of part r, but this time in the form of a compressed instance of part r in the form of a hash of r', i.e., h=H(r'). This is again compared to the submitted instance r. In this manner, Tx2's unlocking script must also contain at least the r part (r) and the s part (s) of Bob's signature. It may also contain the public key P that corresponds to the private key V that Bob used to sign m. Tx1's locking script, when executed by the script engine 402 on node 104, is configured to take r, s, and P from Tx2's unlocking script and perform the following operations: I)check h=H puz (r) and II) compute R'=H sig (m)s ―1 ·G+rs ―1 P, and III) check[R'] x =r

[0184] where h is taken from the locking script of Tx1, and s, r, and m are taken from the unlocking script of Tx2. The hash value h=H puz (r), where H puz is the hash function used in hashing the r-puzzle. It can be any form of hash function. This is sig Whatever form it takes, H puz The form of m may be assumed to be predetermined and known at both ends. Bob's public key P may also be taken from the unlocking script Tx2, or may be known by other means, such as by deriving (r,s) and m, or (r,s) and m, as described above.

[0185] The locking script is configured to return a result of "true" provided that both checks in step I) and step III) are true, otherwise it returns a result of "false." Check I) can be performed before or after II)-III), but III) must be performed after II).

[0186] Also, as in Figure 8, only steps II) and III) are conventional operations performed by the ECDSA verification function, and therefore in most protocols can be invoked by a dedicated opcode, such as the existing Checksig opcode (OP_CHECKSIG) in the script. Step I) can be coded separately into the locking script using a generic opcode.

[0187] An example of a locking script for transaction challenge Tx1 is shown below. [Table 4]

[0188] Any type of hash function can be used, as long as it is consistent between both parties, sender and receiver. However, to stay consistent with the P2PKH standard, we use OP_HASH160, a double hash of SHA-256, and then RIPEMD-160.

[0189] The corresponding unlocking script is shown below (same as in the previous section), where the signature sig r uses r, and the payer Bob (B) can compute the signature using any private / public key pair. <P B > <sig r >

[0190] The example of Figure 9 is therefore exactly the same as Figure 8, except that instead of the untransformed instance r, we use a hash of part r as the basis for the r challenge.

[0191] Note that in any of these cases it is not excluded that the unlocking script of Tx1 may impose additional criteria for the "true" result, for example a lock time or requiring an additional signature would be one example.

[0192] An example use case for any of the above techniques is as a general knowledge challenge. Consider any challenge that has some solution k, or some solution that can be hashed to k. Alice can then create R puzzles that are combined into a puzzle. That is, she can create r = [k G] x can be defined.

[0193] As an example, Alice is a mathematics professor. She can construct an r-puzzle transaction Tx1, where the underlying k value is the solution to a mathematical question that students are motivated to solve. Whoever creates a solution can use it to create a signature (r,s), where r matches a value in the locking script, and claim a reward. The signature not only provides authenticity, but also a proof of knowledge of the solution without revealing the solution to anyone else. Thus, the R-puzzle provides a secure mechanism to prove knowledge of a solution, or information in general, without the risk of exposing it. It elegantly reuses the signature required in unlocking the script, and whoever finds the solution can claim the reward with privacy, since any public key P can be used.

[0194] This scheme can also be used as a form of token or digital ticket. For example, an event organizer can issue attendees digital tickets of different values ​​k. If an attendee wants to join the event, they can prove knowledge of the secret token through the use of the r puzzle.

[0195] As another exemplary use case, r-puzzles can be used as a signatory authorisation scheme, where one party can delegate the right to sign to another party. Consider an r-puzzle transaction Tx1 that can be unlocked only if a signature with a matching r value is provided in the locking script. This is because only one person knows the value k, and r = [k G]. x This means that if a person can generate such a signature, then k can be used to generate a signature for that person. However, if that person communicates knowledge of k to someone else, this effectively gives them the authority to sign on his or her behalf.

[0196] For example, suppose Alice wants to receive a delivery. She is concerned that she may not be there to accept the delivery. She gives copies of k to both Bob and Charlie so that they can receive the delivery on her behalf. When Dave wants to deliver the package, she needs to get a signature along with the expected r value to release the package to Bob.

[0197] In such a scenario, k can be thought of as acting as an ephemeral private key and r as an ephemeral public key, similar to V and P, respectively, except that k and r are not linked to any particular identity.

[0198] Joint value R puzzle As an extension of the hash-R puzzle (P2RPH) in Figure 9, it is possible to include an additional value d concatenated with r before hashing (h=H puz (to obtain r||d). In that case, the prover (e.g., Bob) must not only solve the r puzzle, but also know r. An example implementation of this is shown in Figure 10.

[0199] The locking script of Tx1, when executed by the script engine 402 on the node 104, is configured to take r, s, P, and d from the unlocking script of Tx2 and perform the following operations: I)check h joint =H puz (r||d), and II) compute R'=H sig (m)s ―1 ·G+rs ―1 P, and III) check[R'] x =r

[0200] Here, r||d represents the concatenation of r and d in either order (r first or d first). An example of a locking script for a challenge transaction Tx1 is shown below. [Table 5]

[0201] The corresponding unlocking script is below (same as in the previous section except for the inclusion of d). Signature sig r P B uses r, and the prover Bob (B) can compute the signature using any private / public key pair. <sig'><P B > <d><sig r >

[0202] The extra signature sig' is an added feature for security (see the section on optional security features below), however, this need not be required in all possible implementations.

[0203] An example use case is the CLTV linked R-puzzle. In this case, a data value d can be a time value t that is linked to a CLTV (Check Lock Time Verify) transaction output. The motivation behind this is to hide the time t before the output cannot be paid in the P2RPH hash and link it to the R-puzzle. In that case, the prover (e.g. Bob) must not only solve the r-puzzle, but also know the time t and wait until a specific time to pay it. An example of a locking script in a transaction is shown below: [Table 6]

[0204] The corresponding unlocking script is shown below, where signature sig r P B uses r, and the payer Bob (B) can compute the signature using any private / public key pair. <sig'><P B > <t><sig r >

[0205] The extra signature sig' is an added feature for security (see the section on optional security features below), however, this need not be required in all possible implementations.

[0206] The above has been explained in terms of concatenation. However, it is possible to generalize this to any function f(r,d). For example, <r> <d>As implemented as OP_ADD, f may be the addition of r and d.

[0207] Proof-of-Work for R Puzzles As a variation of the combined value puzzle above, the value d received in the proof transaction Tx2 can be used as a nonce value in the form of a proof-of-work puzzle. The payer must not only solve the r puzzle, but also do the work to find a nonce value that results in a hash of a target that is of a given difficulty. In other words, a check in the script for the following equation, or a value with more leading zeros than the target: H puz (r||d) <target

[0208] Note: In general, a given hash function may be a single base hash function or a composition of two or more constituent hash functions. For example, in an embodiment, H puz =H[H(...)]. In typical blockchain mining protocols, transaction headers are hashed twice in the proof-of-work. Thus, to mimic this, in the r-puzzle PoW embodiment disclosed herein, r||d may also be hashed twice. However, this is optional, and in other embodiments, H puz can be just a single hash.

[0209] Preferably, this check is combined with at least a regular ECDSA signature verification performed on the signature tuple (r,s) received at Tx2 to verify that the r value used in the proof-of-work corresponds to the signature. The locking and unlocking scripts, when executed together, will only output a "true" result if both checks are satisfied, i.e. the nonce together with r satisfies the target and the signature is verified.

[0210] In this case, the locking script of Tx1, when executed by the script engine 402 on the node 104, is configured to retrieve r, s, P, and the nonce from the unlocking script of Tx2, and then perform the following operations: check H PoW (r||d)≦target, and compute R'=H sig (m)s ―1 ·G+rs ―1 P, and check[R'] x =r

[0211] where r||d represents the concatenation of r and d in either order (r first or d first), and d is a nonce. This is shown in Figure 14A. In general, H PoW is the same as the hash function, or H sig and / or H PoW It may be a different form of hash function for

[0212] The corresponding locking script for transaction Tx1 is shown below. [Table 7]

[0213] The corresponding unlocking script is shown below (same as in the previous section except for the nonce and data value d), where the signature sig r P B uses r, and the payer Bob (B) can compute the signature using any private / public key pair. <sig'><P B > <nonce><sig r >

[0214] The extra signature sig' is an added feature for security (see the section on optional security features below), however, this need not be required in all possible implementations.

[0215] Note that the nonce here is different from the unique, underlying proof-of-work used by mining nodes on a pool of transactions 154 to mine transactions into blocks 151 according to the base node protocol followed by all nodes 104. Thus, the disclosed technology layers an additional proof-of-work performed by a prover (e.g., Bob) on top of the base blockchain protocol. In order for Bob to redeem the output, he not only needs to know the value of k, but he also needs to do some proof-of-work to obtain a valid nonce value.

[0216] An example use case would be when a challenger, Alice, wants to ensure that after a predefined time has elapsed (because proof-of-work takes time), only the prover (Bob) can receive the amount of digital assets defined in the output of Tx1. This could be used as an alternative to a lock time.

[0217] Another example is Proof of Computational Power. Alice would like to identify who has the most computational power available. She creates a PoW r puzzle. Whoever solves it will be the first to pay the output and show that they have the most hash power. In this context, it would also be useful if they could link their identity to the solution using a public key P or another P2 (see next section). Alice could then choose to use some further service of the winner that requires this computational power.

[0218] In general, the value of k needed to generate part r of the solution may be given to the prover by Alice or a third party, or given to Alice by the prover (or one of the potential provers). For example, in the proof of computational ability example, Alice or a third party may distribute k to potential provers to allow them to participate in the challenge.

[0219] Note that in the example locking script above, the locking script does not include a check of what r value is used - this is not required to verify the proof of work itself.

[0220] Optionally, however, in an embodiment, the unlocking script includes some extra code (not shown) to check which r value is used. This can be done, for example, by combining the PoW r-puzzle described above with any of the checks described in connection with Figures 7-9. Figure 14B shows a combination of the verification of Figure 7 and the r-puzzle proof-of-work. Figure 14C shows a combination of the verification of Figure 8 and the r-puzzle proof-of-work. Figure 14C shows a combination of the verification of Figure 9 and the r-puzzle proof-of-work. In these cases, the locking script and the unlocking script, when run together, will output a "true" result only if all checks are satisfied. Note that numbers I), III), and IV) do not imply that a particular order in which he checks are required, and in general, the checks may be performed in any order with respect to each other.

[0221] In other embodiments, there may be an advantage to not having a reference value for the r part in the locking script. This allows anyone to provide a solution without others being able to steal it. The idea is that the prover can choose a value of k and compute r. The prover then runs through all possible values ​​of d. If none work, the prover can try different k. After finding a pair of r and d, the prover can construct a signature using r as the r part.

[0222] On the other hand, a fixed r' (or a hash of r') in the locking script requires the prover to first solve the r puzzle or be given the k value, which is undesirable in this case.

[0223] The above has been described in terms of concatenation. However, it is also possible to generalize this to some function f(r,d) in any version of the r-puzzle proof-of-work. For example, <r> <d>f can be the addition of r and d, as implemented as OP_ADD. Also, the conditions to be satisfied by f(r,d) are not limited to the hash being less than the target value or having at least a pre-determined number of leading zeros. In general, any condition can be used for the proof of work, e.g., the hash being greater than the target, or e.g., within a pre-determined range. Furthermore, similar comments apply for the prover's public key P, as mentioned above. That is, P can be received in Tx2, or derived from the r and s parts, or received via some other means.

[0224] Optional Security Feature #1 If a signature based on k is published, then anyone who knows its value can derive the value of the private key V used to create the signature by solving for V in the signing equation: s=k -1 (H(m))+rV)mod n Solving for V, we get: V=r -1 (sk-H(m)mod n

[0225] In many cases, this does not pose a significant risk, since the recipient of the transaction is the only person who knows k. In other cases, the payer must be careful not to reuse the private key V that was used to sign the solution to the R puzzle. Good security practice dictates that payers should never reuse a public / private key pair (P,V), and should always use a new public / private key pair when receiving new funds.

[0226] In principle, a public-private key pair (P,V) is "permanent", i.e., it can be used many times. The use of a random ephemeral key k should ensure this. However, there have been incidents of poorly implemented random number generators. If one signs two different messages using the same ephemeral key k and the same private key, one can derive the private key V from the two signatures. That is, given (r,s) and k, one can calculate V, where r=[k·G] x and V is the private key for the public key P used in signing. If the random number generator fails during the signing process, it may generate the same random numbers as the last time, thereby leaking the private key to the public. To address this problem, people avoid reusing public keys rather than fixing the random number generator.

[0227] In this case, even though Alice knows k, she does not know the private key for V, Bob's public key. If Alice hands over k to Bob, Bob will be able to solve the r-puzzle by providing (r,s) using his private key. When Alice looks at the signature, she will be able to derive V since she knows k. This is undesirable for Bob. Therefore, Bob should preferably avoid reusing (P,V).

[0228] The problem with this, however, is that Bob's public key P cannot be used as a permanent means of identifying Bob.

[0229] To address this, according to the embodiments disclosed herein, Bob can include his additional signature sig2 in Tx2 using a separate private key V2 with corresponding public key P2. He also includes P2 with the additional signature. Thus, there are two types of public and private key pairs. The first type is generated on the fly for one-time use. The other type is generated according to some additional protocol, e.g. HD wallet. Bob can use the first type of key pair for r-puzzle signatures and the second type for second signatures.

[0230] Alice can then use this further public key to look up Bob's identity, e.g., unique name, username, or network address, based on a mapping between the public key and the identity. The mapping can be available, for example, in a public database that maps public keys to identities, or the mapping can simply be one pre-agreed upon between Alice and Bob (e.g., stored privately on Alice's computing device 102a).

[0231] Consider again the authorized signer use case. For example, Alice wants to accept a delivery, but may not be able to receive the delivery herself. She gives copies of k to both Bob and Charlie so that they can accept the delivery on her behalf. Dave is carrying the package. He must sign with an expected r value. Now imagine that for Dave's records or regulatory compliance, Dave also needs to verify the identity of the recipient.

[0232] Assume Bob then accepts delivery. If Bob creates a signature based on his public key and k, then both Alice and Charlie can create Bob's private key V. This is not a problem if the public key is designed for one-time use; however, it is not ideal if Bob needs this public key to prove his identity in the future.

[0233] To address this issue, embodiments can include one or more r-puzzle-independent signatures from Bob in Tx2 that can be used to identify Bob. For example, an extra signature and corresponding public key P2 can be added to the OP_RETURN output (an unspendable output) in the same transaction that Dave accepts. An alternative is to include an extra OP_CHECKSIG in the locking script of the r-puzzle transaction. By viewing the transaction and the public key used for the extra signature, Alice can see who signed for her.

[0234] In other cases, there may be a concern that the value k may be leaked before it is used. To address this, Alice can add a P2PKH to the r-puzzle transaction to make it more secure. Suppose Alice wants to delegate her signing rights to Bob. Alice obtains a one-time public key k from Bob and creates an r-puzzle transaction that not only specifies the r value, but also specifies an extra public key P2.

[0235] Optionally, Alice can create one of two MultiSigs so that she can sign it herself as well. An example locking script is shown below. [Table 8]

[0236] Note that r-puzzle offers more flexibility because Alice can choose when to pass on the r-puzzle solution to Bob. She can decide to pass on or not even after the transaction has been mined.

[0237] If k is leaked, people can discover the private key used to sign the signature with the leaked k. However, there exists another private key V2, i.e., a private key linked to the public key that can be used to identify Bob. For the output to be compromised, an attacker would need to obtain two independent secrets, which is much more unlikely than compromising only one of them.

[0238] Note that in the above example, Tx2's locking script is locked to Bob's extra public key P2 by a traditional P2PKH (not the one used in r-puzzle, but unlocked by an extra signature). The r-puzzle technique allows additional choices for the user. In some applications, it may be desirable to use r-puzzles so that the prover meets the challenge regardless of identity. Meanwhile, in other applications, the combination of hash puzzles and P2PKH may still be desirable, and r-puzzles may optionally be used alongside it. This is explained in more detail below.

[0239] However, if a corresponding extra signature P2 is needed for identity lookup and / or security, and the locking script of Tx1 is not pre-bound to a specific prover's identity, as in a P2PKH, then the above locking script can be adapted accordingly.

[0240] That is, the extra signature can simply include a Checksig, but the corresponding public key P2 cannot include OP_EQUALVERIFY.

[0241] Optional Security Feature #2 Another potential security vulnerability in the above method is the forgeability of the signature, which may be exploited (similar to a hash puzzle) by a miner who wants to claim the funds. A miner who receives a transaction (from a payer) can modify the transaction to send funds to himself, using the same signature that the payer used in the original transaction. This is done as follows:

[0242] Let P = V G be the public / private key pair used to sign the original transaction, denoted by m, to obtain the signature (r,s), as follows: r = [k G] x ,and, s=k -1 (H(m))+rV)mod n

[0243] To use this transaction, the payer uses the following unlocking script: < / d> < / r> < / nonce> < / d> < / r> < / t> < / d> < / r> < / s> < / s> <s> <s><r,s>

[0244] A miner who receives this transaction can modify it into a new one, denoted by m', that sends the funds to itself using the new unlocking script: <P'><r,s> where P'=V'·G is a public / private key pair such that: V'=V+r -1 [H(m)-H(m')], and P'=P+r -1 [H(m)-H(m')]·G

[0245] Note that the miners do not need to know V' (because they do not know V). The verification process is performed using the following calculation: R' = H(m)s -1 ·G+rs -1 P

[0246] The signature is (R') x =r, otherwise it is invalid.

[0247] Using the new transaction m' and the new unlocking script, the verification process is as follows: R' = H(m')s -1 ·G+rs -1 P' =H(m')s -1 ·G+rs -1 ·{P+r -1 [H(m)-H(m')]·G} =rs -1 P+H(m)s -1 G =r (Note that primed notation has a different meaning here than it did before. Primed notation in this context does not refer to a reference instance).

[0248] To address this potential vulnerability, embodiments provide a separate message m that the miner cannot provide without knowing the private key V. sighash The unlocking script in can contain another extra signature sig'. In that case, the unlocking script looks like this: <sig'>< / s> < / s> <s> <s><sig r >

[0249] sig' is a different message m sighash Since the signature in ' may be a sighhash flag, modifying the message simply uses a different sighhash flag from the original (e.g. SIGHASH_NONE instead of the default flag SIGHASH_ALL). sig' must also use a different value of r to avoid leaking the private key (because the private key can be derived from two signatures that use the same ephemeral key). Finally, the transaction must include another OP_CHECKSIG at the end, as shown below: [Table 9]

[0250] This means that only someone who knows the private key V for public key P can create another signature using the same public key P as in the r-puzzle, and the above attack is not possible.

[0251] The attacker tries to replace the public key with another public key, whose private key the attacker does not have knowledge of. To prevent this attack, the challenge also requires knowledge of the private key. In this case, one signature is not enough; two signatures are therefore needed. Both signatures are considered as a proof of knowledge of the same private key. This is secure, since the challenge asserts that you have a different temporary key.

[0252] P2PKH+P2PRPH Just as the R-puzzle is used as a knowledge proof, the P2PKH output is also a knowledge proof of the knowledge of the private key that corresponds to the public key in the P2PKH output. This essentially converts the puzzle k to the public key P puzzle =V puzzle A private key V that maps to G puzzle In an r-puzzle embodiment, the proof of knowledge is accompanied by a public key that the prover can choose and that can be used to link to an identity. In P2PKH, the regular payment signature and public key (which proves knowledge of the secret puzzle) must be accompanied by another signature and public key to link to a specific identity. In simple terms, as shown below, the prover can add another signature and public key for the P2PKH unlock, which corresponds to another OP_CHECKSIG for the locking script. [Table 10]

[0253] The corresponding unlocking script is shown below: <sigP ID > <P ID > <sigP puzzle > <P puzzle >

[0254] <sigP ID > <P ID Note that there is no cryptographic link between the signatures and the puzzles or transactions. The miner and anyone can replace them with a different signature on a different public key, somewhat similar to how a miner can intercept an open hash puzzle. Miners and interceptors cannot modify the message to send funds to themselves (as in an open hash puzzle). However, they can modify the message in a way that makes it appear linked to their own identity. <sigP ID > <P ID > with your own identity.

[0255] On the other hand, based on the techniques disclosed herein, it is possible to use both P2PKH and P2RPH together in the same script, and similarly to the above case, the cryptographic link in the second signature can be enforced so that it cannot be intercepted and replaced. [Table 11]

[0256] In the locking script, P puzzle =V puzzle ·G, while r=[R] x =[V puzzle G] x and so they are basically equivalent. The public key may be compressed or uncompressed, and since prefixes are added either way, they are not actually equivalent. As shown below, <H(P puzzle )>= <H(r puzzle It is also possible to explicitly add a prefix to the script when extracting the r value from the signature to create the . However, this is not very useful in practice. [Table 12] (Note that here H(...) refers to the angle brackets <> in the schematic representation of a locking script, which is actually intended to refer to the value of the hash, not the hash function. The angle brackets <> mean to put this value on the stack.)

[0257] The corresponding unlocking scripts for both transactions are: <P ID > <r puzzle ,s> <sigP puzzle > <P puzzle >

[0258] Alternative implementations in the account-based model The above has been described primarily in terms of implementation in an output-based model (e.g., a UTXO-based model). However, it will be understood that this is not limiting. Figure 11 shows a possible alternative implementation using an account-based model.

[0259] In essence, in an account-based model, the r-puzzle function can be included in a smart contract function that is called by a user: one party can set the r-puzzle value (or the hashed r-puzzle value) in the smart contract, and then the other party will subsequently provide a signature to the smart contract.

[0260] In the UTXO blockchain architecture, the requirements embodied in the unlocking script of a first transaction must be met by the unlocking script of a second transaction in order for it to be accepted as valid and recorded in the blockchain. In the current context, this is beneficial because it leverages the work already done by miners as part of the transaction validation process. As a concrete example in the current context, the fact that a transaction has been added to the blockchain means that it has been validated by nodes throughout the blockchain network, which in turn means that its locking script satisfies some specific useful requirements. Interested parties do not need to check for themselves whether these requirements are met or not - i.e., they can simply assume that they are met by the fact that the transaction was successfully recorded in the blockchain. This follows from the fact that for a transaction to be valid, the script must return a "true" result upon completion (there may be other requirements for a transaction to be valid), and that if the script returns a "false" result (which includes cases where the script fails, e.g., because the OP_VERIFY opcode terminates the script), the transaction is invalid, according to the terminology used here.

[0261] However, in other blockchain models (e.g., certain account-based architectures), this interdependence between transaction validity and the outcome of the executing transaction code is not necessarily reflected. For example, in a given smart contract blockchain, a transaction is valid and therefore may be accepted for recording on the blockchain if it satisfies a set of "basic" validity requirements imposed by the blockchain protocol. Thus, a second transaction may still be accepted as valid and recorded on the blockchain even if it does not meet some requirements embodied in the code of the first transaction. The code of the first transaction may be, for example, smart contract code.

[0262] Assuming that the second transaction is destined for the smart contract account created by the first transaction, it is the smart contract code that decides how to respond to that transaction - i.e., it can ignore it if some requirements are not met (or return a false result otherwise); on the other hand, it can reward the prover with an amount of digital assets deducted from the balance of the smart contract account if the requirements are correct (or return a true result otherwise). In a sense, this abstracts "agent-level" processing by smart contracts (agents), i.e., explicitly coded in the smart contract code, from "protocol-level" processing performed "implicitly" by nodes. That is, the processing performed on a transaction determines whether it meets the validity requirements imposed by the blockchain protocol on which the blockchain network operates. Thus, in such a blockchain architecture, the “valid / invalid” decision by a node at the protocol level for each transaction may be decoupled from the “true / false” result returned for that transaction at the agent level by a smart contract, where a transaction is determined to be valid at the protocol level but nevertheless returns a false result at the agent level.

[0263] This is in contrast to the UTXO architecture, where a script is required to return a "true" result for a transaction to be valid: a transaction becomes invalid if the script exits or completes leaving anything other than true on the stack (either of these results constitutes a "false" result as that term is used here).

[0264] One of the fundamental requirements for a transaction's validity is that it contains a valid signature. Thus, while in the UTXO example above the signature is verified by the code of the challenge transaction itself (e.g. using an OP_CHECKSIG opcode that verifies the signature and returns true / false for signature verification, or an OP_CHECKSIGVERIFY opcode that checks the signature in the same way and additionally verifies that the result is true, and the script exits if not), in alternative blockchain architectures the signature may be verified implicitly by the processing node in the above sense. This may avoid the need to code the signature check in the transaction code itself.

[0265] As a concrete example in the present context, a transaction may be considered valid at the protocol level, e.g. because it contains a valid signature, but may still return a false result at the application level, e.g. because some other requirements are not met.

[0266] FIG. 11 illustrates an alternative node software 400 for processing transactions according to an account-based model, the node software here labeled 400acc. An instance of this node software 400acc may be implemented in each of the account-based version nodes 104 of the network 106. The account-based node software 400acc comprises an account-based protocol engine 401acc, a contract engine 402acc (somewhat similar to the script engine 402), an application-level decision engine 404, and a set of one or more blockchain-related function modules 405. In any given node 104, these may include any one, two, or all three (depending on the role or roles of the node): a mining module 405M, a forwarding module 405F, and a storage module 405S. The protocol engine 401acc is configured to recognize different fields of transactions and process them according to the node protocol. The node software 400acc also maintains an account state 406 for each of multiple accounts in the memory of each node 104. These include, for example, accounts of Alice, a prover (e.g., Bob), and / or another party that are debited or credited depending on a contract established between Alice and the prover. The contract engine 402acc is configured to modify the account state depending on the outcome of a smart contract received in a transaction. A smart contract is also referred to as an "agent."

[0267] FIG. 11 also shows transaction Tx1 acc and Tx2 acc 11 shows a pair of r-puzzle transactions Tx1 and Tx2, which may implement the same or similar r-puzzle functionality as described above in connection with FIGS. 7-10. Each includes a source account address 1102 (source address field) and a destination account address 1103 (destination address field). acc The second transaction Tx2 includes a source account address 1102a and a destination account address 1103a. acc The first transaction Tx1 includes a source account address 1102b and a destination account address 1103b. acc The second transaction Tx2 also includes a smart contract 1101. The smart contract 1101 may include a challenge (puzzle) by Alice, which may be created by Alice or a third party on her behalf using details provided by Alice. acc may optionally include one or more free data fields 1104 for carrying user-specified payload data, which may include at least a portion of the solution to the puzzle provided by the prover, e.g., Bob. acc and Tx2 acc is signed by Alice and the prover, respectively. Each transaction also includes the signatures 1105a, 1105b of each party.

[0268] The transactions are broadcasted over the network 106. Upon receiving each transaction, the protocol engine 401acc implicitly verifies whether the signature 1105 is valid or not. That is, this is an inherent function of the protocol engine 401acc and does not need to be specified in the smart contract 1101. Thus, the protocol engine 401acc validates each transaction for forwarding and / or mining, at least under the condition that the respective signature is valid. Also, one or more additional conditions may be required to satisfy the validity. If valid, the application-level decision engine 404 can control the mining module 405M and / or the forwarding module 405F to select whether to mine and / or forward the transaction, respectively.

[0269] In such an account-based model, Alice, Bob, and the smart contract itself are assigned separate accounts, with different account addresses. A transaction is said to be sent "to" the address in its destination address field and "from" the address in its source address field. To create a smart contract account, a transaction containing the smart contract's bytecode is uploaded to the blockchain in a transaction. For such an account creation transaction, the destination address 1103 in the destination field should be an address not used before in the blockchain, and once the transaction is accepted, that address becomes the address of the newly created smart contract account. Further transactions can then be sent to that address to "call" the smart contract, i.e., to have the smart contract's bytecode executed depending on further transactions. The "destination" address 1103 acts as an intermediary address to enact the contract - i.e., Alice sends Tx1 to create a smart contract specifying one or more requirements. acc to that address, and Bob sends Tx2 to the same address to invoke the smart contract. acc It then sends Tx2 to the smart contract. acc The “source” address 1102 specifies the account of the user who is a party to the contract. acc If the smart contract determines that Tx2 satisfies the specified requirements, the smart contract may be configured to deduct an amount of the digital asset from its own account balance. acc The balance of the account with source address 1102b in Tx2 (i.e., Bob's account) is credited up to that amount (intuitively, acc By sending a ,Bob effectively requests that the smart contract (identified in the destination address field) credit its account (identified in the source address field).

[0270] Protocol Engine 401acc Tx2 acc If it is received, and it is valid, Tx2 acc Search for an account that matches destination address 1103b in Tx1. acc Assuming that is processed and valid, the account will receive a Tx1 acc , and is associated with the smart contract code provided in Tx1. In response, the protocol engine 401acc controls the contract engine 402acc to acc Tx1 executes a smart contract 1101 from the smart contract 1102 and populates it with data from one or more fields of the smart contract as operand data according to criteria defined in the contract. The operand data may include, for example, data from one or more of the free data fields 1104 and / or a signature from the signature field 1105b. acc One or more criteria defined in the smart contract 1101 of Tx2 acc If the operand data from Tx1 satisfies the condition, the contract engine 402 acc modifies the account state 406 of one or more parties (Alice, the prover, and / or one or more third parties) according to the changes defined in the smart contract 1101. Otherwise, this modification to the account state 406 is not made. Note, however, that in some account-based systems, the outcome of a smart contract is not a condition for the validity of the transaction. Thus, Tx1 acc The standard set in smart contract 1101 will be Tx2 acc Even if Tx2 is not satisfied, acc is still propagated as a record of the failed transaction and mined into a block, and it can still levy mining fees (so the protocol engine 401 can still modify the account state 406 of either party and the winning miner).

[0271] To implement the r-puzzle, at least part of the r-puzzle function must be acc The solution can be coded into the smart contract 1101 of Tx2. acc 7. For example, this may be used to implement the variant of FIG. 7. Optionally, some of the implicit signature verification functionality of the protocol engine 401acc may be utilized to implement, for example, one of the variants of FIG. 8-10. In the case of FIG. 8-10, steps II) and III) are performed by Tx2 acc (Recall that signature verification is itself an inherent function of the node protocol implemented by the protocol engine 401acc). Thus, step I) can be performed by acc It is only required to layer on top of this in the smart contract 1101 of Tx2. The smart contract determines whether the result of I) is true and whether the protocol engine 401ac acc indicates that the r-puzzle is valid. If both are "yes", declare an overall result of "true" for the verification, i.e., Bob has successfully satisfied the challenge set by the r-puzzle. Note that for the implementation of Figures 8-10, only the data value d in the cases of Figures 9 and 10 needs to be included in the free data field 1104. The signature information is included in the signature field 1105b.

[0272] A smart contract account also indexes into "data registers" (not shown), which are (logical) data storage elements associated with the account. In the UTXO model outlined above, values ​​are embedded in the locking script itself, and the same can be true for certain parts of the smart contract code 1101. However, the smart contract bytecode of a smart contract may alternatively or additionally be executed on data stored in one or more of its account registers. Furthermore, it is generally possible to store values ​​in a smart contract account register after a smart contract account has been created. So, for example, a smart contract account may contain a Tx 1,α acc Then, a separate "intermediate" transaction Tx 1,β acc is sent to a (now existing) smart contract account, which has the effect of storing a particular value ν in the smart contract account's register $R. The smart contract may be configured to accept such data only from (for example) a specified source account address, e.g. the same party that created the smart contract in the first place (Alice). Tx2 acc When received, the operation to be performed by the contract engine 402acc (e.g., “access register $R and set the value to Tx2 acc The challenge transaction Tx 1,α acc While the value stored in $R is defined by the smart contract bytecode provided by 1,β acc In accordance with the terminology used herein, Tx 1,α acc is still said to be a challenge transaction that sets one or more requirements, only now these requirements are required to be met by one or more intermediate transactions (e.g., Tx 1,β acc ) may be defined with reference to the data provided in

[0273] Thus, in some implementations, the challenge transaction Tx 1,α acc may define the operation of r-puzzles (e.g., proof transaction Tx2 acc (The r part of the signature of Tx2 is compared to the value in register $R to see if it matches.) The value in $R is the attestation transaction Tx2 acc The value in the r part of the intermediate transaction Tx 1,β acc may be set by

[0274] Note: Some account-based models do not need to include the public key P in the signature 1105. Instead, they simply include a one-bit flag. As already mentioned, two possible keys P and -P can be derived from (r, s) and the message. The flag flg indicates which of these two possible solutions the prover actually chooses. acc The protocol engine 401acc uses (r,s) and flg to signal that the public key corresponds to the private key V used to sign the message in Tx2. acc Instead of explicitly receiving it in , the prover's public key P is derived. This implementation method is also possible in output-based models and is not specific to account-based models, however, in the scripting languages ​​used in many current output-based models, there is no dedicated opcode for deriving P from r and s, so it would be complicated to explicitly code this functionality into the unlocking script using existing generic opcodes in stack-based languages. Furthermore, note that certain account-based models derive the source address of a transaction from the public key used to sign that transaction. Thus, the source address does not need to be encoded separately in the transaction, and if the public key is derived from the signature, this means that the source address can also be indirectly derived from the signature.

[0275] conclusion It will be understood that the above-described embodiments have been described by way of example only.

[0276] More generally, in accordance with a first instantiation of the teachings disclosed herein, a computer-implemented method is provided for node validation in a blockchain network, the method including the steps of obtaining a first transaction including executable code, receiving a second transaction including information, the information further including at least a submitted instance of the r and s portions of a first ECDSA signature and a nonce, and executing the code from the first transaction. The code is H PoW is configured to verify that (f(r,d)) satisfies a predetermined condition defined in the code and to return a true result for the condition, where r is the submitted instance of part r and d is a nonce; and H PoW is a hash function, and f is a function of r and d combined.

[0277] In an embodiment, a second, optional instantiation of the presently disclosed teachings may provide a method according to the first instantiation, where r∥d is concatenation.

[0278] A third, optional instantiation of this disclosure may provide a method according to the second instantiation, where the predetermined condition is H puz (r||d) is less than a predetermined target value, or has at least a predetermined minimum number of leading zeros.

[0279] A fourth, optional instantiation of the present disclosure may provide a method according to the first, second, and third instantiations, including obtaining a public key, the first ECDSA signature signing a message based on a private key corresponding to the public key, the message being part of the second transaction, and applying an ECDSA verification function to verify the first ECDSA signature received in the second transaction based on the public key and the message, where the code is configured to return a true result for a further condition of the verification of the first ECDSA signature.

[0280] In an output-based model (e.g., a UTXO-based model), the ECDSA validation function may be invoked by an opcode in the locking script of the output (e.g., a UTXO) of the first transaction. The opcode may invoke an instance of an ECDSA validation function pre-stored in the validating node. Alternatively, as in an account-based model, the ECDSA validation function may be an implicit function of the node, executed automatically as part of the node protocol and does not need to be explicitly invoked by the code of the first transaction (or smart contract, in the case of account-based). As another alternative, it is not excluded that ECDSA validation may be explicitly coded into the code.

[0281] A fifth, optional instantiation may provide a method according to the fourth instantiation, where the code further includes a reference value corresponding to the r portion of the first ECDSA signature, the reference value being a reference instance of the r portion or a transform thereof, and the code configured to check that the reference value corresponds to the reference instance of the r portion received in the second transaction and to return a true result in a further condition.

[0282] A sixth, optional instantiation may provide a method according to the fifth instantiation, where the reference value is a reference instance of the r portion of the ECDSA signature.

[0283] A seventh, optional instantiation may provide a method according to the sixth instantiation, the code comprising: The above H PoW Check that (f(r,d)) satisfies the predetermined condition, and The ECDSA verification function is R'=H sig (m)s -1 ·G+r's -1 Calculate P, [R'] x =r'. where r′ is the reference instance of the r portion of the first ECDSA signature, s is the s portion of the first ECDSA signature, P is a first public key, m is the portion of the second transaction signed by the first ECDSA signature, and H sig is the hash function used to hash m in generating the first ECDSA signature, G is the elliptic curve generator, and [R'] x represents the X coordinate of R' and "·" represents elliptic curve scalar multiplication. In this case, the code is configured to return a true result if both of the tests are true, but otherwise is configured to return a false result.

[0284] H PoW is the hash function used in the hash puzzle. H sig is the hash function used in ECDSA signing and verification. PoW and H sig may or may not be the same form of hash function.

[0285] An eighth, optional instantiation may provide a method according to the sixth instantiation, the code comprising: The above H PoW Check that (f(r,d)) satisfies the predetermined condition and that r'=r; and The ECDSA verification function is R'=H sig (m)s -1 ·G+rs -1 Calculate P, [R'] x =r. where r is the submitted instance of portion r of the first ECDSA signature, r' is the reference instance of portion r of the first ECDSA signature, s is the portion s of the first ECDSA signature, P is a first public key, m is the portion of the second transaction signed by the first ECDSA signature, and H sig is the hash function used to hash m in generating the first ECDSA signature, G is the elliptic curve generator, and [R'] x represents the X coordinate of R' and "·" represents elliptic curve scalar multiplication. In this case, the code is configured to return a true result if all three of the tests are true, but otherwise is configured to return a false result.

[0286] A ninth, optional instantiation may provide a method according to the fifth instantiation, where the reference value is a transformation of a reference instance of part r of the first ECDSA signature, and the code is configured to verify that the submitted instance corresponds to the reference value by performing the same transformation on the submitted instance and comparing with the reference value.

[0287] A tenth, optional instantiation may provide a method according to the ninth instantiation, where the reference value is a hash value that is a hash of the reference instance of part r of the first ECDSA signature.

[0288] An eleventh, optional instantiation may provide a method according to the tenth instantiation, wherein the code comprises: The above H PoW (f(r,d)) satisfies the predetermined condition, and h=H puz (r) and The ECDSA verification function is R'=H sig (m)s -1 ·G+rs -1 Calculate P, [R'] x =r. where r' is the reference instance of portion r of the first ECDSA signature, r is the submitted instance of portion r of the first ECDSA signature, s is the s portion of the first ECDSA signature, h is a hash value, and H puz is the hash function used to hash r' to produce h, P is the first public key, m is the portion of the second transaction signed by the first ECDSA signature, and H sig is the hash function used to hash m in generating the first ECDSA signature, G is the elliptic curve generator, and [R'] x represents the x-coordinate of R' and "·" represents elliptic curve scalar multiplication. In this case, the code is configured to return a true result if all three of the tests are true, and otherwise to return a false result.

[0289] H puz is the hash function used in the hash puzzle. H puz is H sig and / or H PoW It may or may not be the same form of hash function as

[0290] A twelfth, optional instantiation may provide a method according to any one of the first through eleventh instantiations, where obtaining the first public key includes receiving the first public key as part of information in the second transaction.

[0291] Alternatively, the information of the second transaction includes both the s portion and the submitted instance of the r portion of the first ECDSA signature, and said obtaining includes deriving the first public key from a combination of the s portion of the r portion of the first ECDSA signature and the submitted instance.

[0292] As another alternative, it is not excluded that obtaining may include, for example, receiving the first public key via a side channel in connection with the second transaction, or receiving an index of the first public key or an identity of the owner of the first public key and private key via the second transaction or side channel and using this to look up the first public key.

[0293] A thirteenth, optional instantiation may provide a method according to any one of the first through twelfth instantiations, where the submitted instance of parts r and s of the first ECDA was generated by the second party using a first private key that is an ephemeral key given by a first party to a second party, or vice versa, and that is a private key of the second party, and where the nonce was also generated by the second party performing a proof-of-work on a computing device of the second party.

[0294] A fourteenth, optional instantiation may provide a method according to the thirteenth instantiation, where P=V G, k∈[1,n-1], R=k G, r=[R] x , and s=k -1 (H sig (m) + rV) mod n. where P is the first public key, V is the first private key, k is the ephemeral key, n is a prime modulus, G is an elliptic curve generator, m is the portion of the second transaction signed by the first ECDSA signature, and H sig is the hash function used to hash m in generating the first ECDSA signature, and [R] x represents the x-coordinate of R, and "·" represents elliptic curve scalar multiplication.

[0295] A fifteenth, optional instantiation may provide a method according to the thirteenth or fourteenth instantiations, where receiving the second transaction includes receiving the second transaction from the second party.

[0296] A sixteenth, optional instantiation may provide a method according to any one of the thirteenth to fifteenth instantiations, the method including triggering a service for the first party conditional on a result returned by the code being true;

[0297] For example, the service may be commissioned by, performed on behalf of, or for the benefit of a first party. The service may be a computerized service and the triggering may include automatically triggering the service.

[0298] By giving the ephemeral key to a second party ("Bob"), this allows a first party ("Alice") to have Bob sign for services on her behalf, without requiring Bob to disclose the ephemeral key k to any node or publish it on the blockchain. Furthermore, because the process is not tied to a specific private key (or the corresponding public key), this means that Alice can hand over a copy of the ephemeral key to a third party ("Charlie"), and either Bob or Charlie can successfully sign for services. This is possible because the r part is used as the basis for the challenge, and the r part is not mapped to a specific identity.

[0299] A seventeenth, optional instantiation may provide a method according to any one of the thirteenth to sixteenth instantiations, where the information received in the second transaction includes a further cryptographic signature of the second party signing a portion of the second transaction using a further private key of the second party, the further private key corresponding to a further public key.

[0300] The further signature may be an ECC signature, or another type, for example an RSA signature.

[0301] An eighteenth, optional instantiation may provide a method according to the seventeenth instantiation, where a mapping is available that enables the first party and / or a third party to look up an identity of the second party based on the further public key.

[0302] For example, the identity may be the second party's personal name, company name, username, or network address. The third party may be, for example, a provider of the aforementioned services.

[0303] A nineteenth, optional instantiation may provide a method according to the seventeenth or eighteenth instantiations, where the code is configured to verify a further cryptographic signature using the further public key, and, conditional on the further cryptographic signature being verified, return a result of true.

[0304] A twentieth, optional instantiation may provide a method according to any one of instantiations seventeen to nineteen, where the information received in the second transaction further includes a cryptographic signature of the first party using a private key of the first party to sign a portion of the second transaction.

[0305] In an embodiment, the method may include obtaining a public key corresponding to a private key of a first party, where the code is configured to verify a cryptographic signature of a second party and return a result that the cryptographic signature of the first party is true under a further condition.

[0306] In an embodiment, the mapping may be available to enable a second party and / or a third party to look up the identity of the first party based on the first party's public key. For example, the identity of the first party may be the first party's personal name, company name, username, or network address.

[0307] A twenty-first, optional instantiation may provide a method according to any one of the thirteenth to twentieth instantiations, where the information received in the second transaction includes an additional ECDSA signature having a different value of r portion than the first ECDSA signature, but using the same first private key as the first ECDSA signature; The code is configured to verify the additional ECDSA signature using the first public key, and, conditional on the additional ECDSA signature verifying, return a result of true.

[0308] In an embodiment, the additional ECDSA signature may sign a different portion of the second transaction than the first ECDSA signature.

[0309] A twenty-second, optional instantiation may provide a method according to any one of the first to twenty-first instantiations, where each of the transactions comprises a data structure including one or more inputs and one or more outputs, each output including a locking script, and each input including an unlocking script and a pointer to an output of another transaction, the code being configured by the locking script of the first transaction, the information received in the second transaction being configured by the unlocking script in an input of the second transaction, and the pointer in the input of the second transaction pointing to the output of the first transaction, the method including, at least conditional on the code returning a true result, validating the transaction, and in response to the validation, including at least one of the following steps: including the second transaction in a pool of transactions for mining into one or more blocks by a validating node, and / or forwarding the second transaction to at least one other node in a blockchain network.

[0310] For each of the plurality of transactions, including the first and second transactions, at least some of the nodes of the network are configured to propagate each transaction under a condition that the transaction is valid, and at least some of the nodes of the network are configured to record each transaction in at least a partial copy of the blockchain under a condition that the transaction is valid, the validity of the second transaction being conditioned on at least a code returning a true result.

[0311] 23. An optional instantiation may provide a method according to any one of instantiations 1 to 22, where the transaction is configured according to an account-based model and the code is configured by a smart contract included in the first transaction.

[0312] In embodiments, in either model, a validator node may be a mining node, a transfer node, and / or a storage node that stores at least a portion of a blockchain (e.g., a full copy storage node that stores a full copy of a blockchain). In embodiments, the obtaining of the first transaction may include receiving at least a portion of the first transaction from a first party, e.g., the first party. In embodiments, the obtaining of the first transaction may include receiving the first transaction from a first party. Alternatively, in embodiments, the obtaining of the first transaction may include formulating the first transaction at a validator node. In embodiments, the obtaining of the first transaction may include receiving at least a reference instance of r portions from the first party and formulating the first transaction at one of the nodes. In embodiments, the obtaining of the first transaction may include formulating the first transaction at a validator node, including generating r portions.

[0313] In embodiments, the receiving of the second transaction may include receiving the second transaction from a second party, e.g., the second party. In embodiments, the second transaction is at least partially generated by the second party. In embodiments, the second transaction is generated by the second party. In embodiments, the receiving of the second transaction may include receiving the second transaction from the second party directly or via the first party or a third party. In embodiments, the second transaction is generated by a third party based on at least the s portion of the first ECDSA signature (and, in embodiments, the submitted instance of the first ECDSA signature and / or the r portion of the data element) that has been provided to the third party by the second party.

[0314] According to a 24th instantiation of the teachings disclosed herein, there may be provided a computer program embodied in a computer readable storage device and configured to perform a method according to any one of the 1st to 22nd instantiations when executed on a node of a network.

[0315] According to a twenty-fifth instantiation of the teachings disclosed herein, there is provided a node of a network comprising: a memory including one or more memory units; and a processing device including one or more processing units, wherein the memory stores code configured to execute on the processing device, the code being configured to implement on the processing device a method according to any one of the first to twenty-third instantiations.

[0316] According to a twenty-sixth instantiation of the teachings disclosed herein, there is provided a computer-implemented method in a second party's computing device, the method comprising the steps of monitoring a first transaction including executable code, the code comprising: PoW is configured to verify that (f(r,d)) satisfies a predetermined condition defined in the code and to return a true result for the condition, where r is the r part of the EDSCA signature and d is a nonce, and H PoW is a hash function, f is a function of r and d, the r portion being specified by a first party; generating the r portion based on a temporary key; and H PoW searching for a value of the nonce d such that (f(r,d)) satisfies the predetermined condition; formulating a second transaction linked to the first transaction, the second transaction including information including at least the r and s parts of the first ECDSA signature and further the nonce d; and transmitting the second transaction, which is propagated through a blockchain network for recording in the blockchain.

[0317] In embodiments, the method performed on the second party device may further include corresponding instantiations or other features disclosed herein.

[0318] According to a twenty-seventh instantiation of the teachings disclosed herein, there is provided a set of transactions for recording on a blockchain, the set including a first transaction embodied on a computer readable medium or media and including executable code, at least a submitted instance of the r and s portions of a first ECDSA signature, and further including a nonce; and a second transaction. PoW is configured to verify that (f(r,d)) satisfies a predetermined condition defined in the code and to return a true result for the condition, where r is the submitted instance of part r and d is a nonce; and H PoW is a hash function, and f is a function of r and d combined.

[0319] In an embodiment, the first transaction and the second transaction may be further configured according to any instantiation or other features disclosed herein.

[0320] According to a twenty-seventh instantiation of the teachings disclosed herein, a computer-implemented method is provided for node validation in a blockchain network, the method including the steps of obtaining a first transaction including executable code, receiving a second transaction including information having at least a first portion and a nonce, and executing the code from the first transaction. The code is PoW is configured to verify that (f(q,d)) satisfies a predetermined condition defined in the code and to return a true result for the condition, where q is the first part and d is a nonce, and H PoW is a hash function, and f is a function of q and d.

[0321] Any features disclosed herein relating to rPuzzleverse proof-of-work can be generalized to any such “layer-s.”

[0322] The first part q may be any predetermined part of the data. It may be any part of the second transaction except the nonce.

[0323] In an embodiment, any feature disclosed in connection with the r-puzzle PoW puzzle may be applied in connection with this more general PoW puzzle. For example, for an instance in an embodiment, f is a concatenation q||d. In an embodiment, the above preset condition is H puz It may be that (q||d) is less than a preset target value, or that it has at least a preset minimum number of leading zeros.

[0324] In an embodiment, the information received in the second transaction may further include a cryptographic signature. The method may include obtaining a public key for signing a message, where the cryptographic signature is based on a private key corresponding to the public key, where the message is part of the second transaction. The method may include applying a verification function to verify the cryptographic signature received in the second transaction based on the public key and the message, where the code is configured to return a true result based on a further condition of said verification of the cryptographic signature. In an embodiment, the public key may be mapped to an identifier of the verifier. This may be used by the first party to check the identity of the verifier.

[0325] According to a further instantiation, corresponding to a twenty-eighth instantiation, a set of programs, methods, or transactions may be provided that are executed on a second party device.

[0326] Other variations or use cases of the disclosed technology may become apparent to those skilled in the art once disclosed herein. The scope of the present disclosure is not limited by the described embodiments, but only by the appended claims.< / s> < / s> < / sig> < / h> < / sighashflag>

Claims

1. 1. A computer-implemented method for node validation in a blockchain network, comprising: obtaining a first transaction including executable code; receiving a second transaction including information, the information further including at least the submitted instances of the r and s portions of the first ECDSA signature and a nonce; executing code from the first transaction, the code being configured to verify that HPoW(f(r,d)) satisfies a predetermined condition defined in the code and to return a true result for the condition; r is the submitted instance of the r part, d is a nonce, HPoW is a hash function, and f is a function combining r and d; method.

2. f is the connection r∥d, The method of claim 1.

3. The predetermined condition is that Hpuz(r∥d) is less than a predetermined target value or has at least a predetermined minimum number of leading zeros. The method according to claim 1 or 2.

4. The method further comprises: obtaining a public key, the first ECDSA signature signing a message based on a private key corresponding to the public key, the message being part of the second transaction; applying an ECDSA verification function to verify the first ECDSA signature received in the second transaction based on the public key and the message; the code being configured to return a true result for a further condition of the verification of the first ECDSA signature.

4. The method according to claim 1 .

5. the code further includes a reference value corresponding to the r portion of the first ECDSA signature, the reference value being a reference instance of the r portion or a transform thereof; the code is configured to check that the reference value corresponds to the reference instance of the r portion received in the second transaction, and to return a true result in a further condition. The method according to claim 4.

6. the reference value is a reference instance of the r portion of the ECDSA signature; The method according to claim 5.

7. The code is Check that the HPoW(f(r,d)) satisfies the predetermined condition; and The ECDSA verification function: Calculate R' = Hsig(m)s-1·G + r's-1·P; [R'] Check that x = r'; It is structured as follows: wherein r' is the reference instance of the r portion of the first ECDSA signature, s is the s portion of the first ECDSA signature, P is a first public key, m is the portion of the second transaction signed by the first ECDSA signature, Hsig is a hash function used to hash m in generating the first ECDSA signature, G is an elliptic curve generating point, [R']x represents the X coordinate of R', and "." represents elliptic curve scalar multiplication; the code is configured to return a true result if both of the tests are true, but otherwise to return a false result. The method according to claim 6.

8. The code is Check that the HPoW(f(r,d)) satisfies the predetermined condition and that r′=r; and The ECDSA verification function: Calculate R' = Hsig(m)s-1 * G + rs-1 * P; [R'] Check that x = r; It is structured as follows: wherein r is the submitted instance of portion r of the first ECDSA signature, r' is the reference instance of portion r of the first ECDSA signature, s is the s portion of the first ECDSA signature, P is a first public key, m is the portion of the second transaction signed by the first ECDSA signature, Hsig is a hash function used to hash m in generating the first ECDSA signature, G is an elliptic curve generating point, [R']x represents the X coordinate of R', and "." represents elliptic curve scalar multiplication; the code is configured to return a true result if all three of the tests are true, but otherwise to return a false result. The method according to claim 6.

9. the reference value is a transform of a reference instance of part r of the first ECDSA signature; the code is configured to verify that the submitted instance corresponds to the reference value by performing the same transformation on the submitted instance and comparing it to the reference value. The method according to claim 5.

10. the reference value is a hash value that is a hash of the reference instance of part r of the first ECDSA signature; 10. The method of claim 9.

11. The code is Check that the HPoW(f(r,d)) satisfies the predetermined condition and that h=Hpuz(r); and The ECDSA verification function: Calculate R' = Hsig(m)s-1 * G + rs-1 * P; [R'] Check that x = r; It is structured as follows: where r' is the reference instance of portion r of the first ECDSA signature, r is the submitted instance of portion r of the first ECDSA signature, s is the s portion of the first ECDSA signature, h is a hash value, Hpuz is the hash function used to hash r' to generate h, P is a first public key, m is the portion of the second transaction signed by the first ECDSA signature, Hsig is the hash function used to hash m in generating the first ECDSA signature, G is an elliptic curve generating point, [R']x represents the x-coordinate of R', and "." represents elliptic curve scalar multiplication; the code is configured to return a true result if all three of the tests are true, but otherwise to return a false result. The method of claim 10.

12. obtaining the first public key includes receiving the first public key as part of information in the second transaction. The method according to claim 4.

13. the submitted instances of parts r and s of the first ECDA were generated by the second party using a first private key that was given by the first party to the second party, or vice versa, and that is the private key of the second party; and The nonce is also generated by the second party performing a proof-of-work on the second party's computing device.

13. The method according to any one of claims 1 to 12.

14. P = V.G. k∈[1, n-1], R = k G, r = [R]x, and s=k−1(Hsig(m)+rV) mod n, where P is a first public key, V is the first private key, k is an ephemeral key, n is a prime modulus, G is an elliptic curve generator, m is the portion of the second transaction signed with the first ECDSA signature, Hsig is the hash function used to hash m in generating the first ECDSA signature, [R]x represents the x coordinate of R, and "." represents elliptic curve scalar multiplication. The method of claim 13.

15. receiving the second transaction includes receiving the second transaction from the second party; 15. The method according to claim 13 or 14.

16. triggering a service for the first party on the condition that the result returned by the code is true; 16. The method according to any one of claims 13 to 15.

17. the information received in the second transaction includes a further cryptographic signature of the second party using a further private key of the second party to sign a portion of the second transaction; the further private key corresponds to a further public key; 17. The method according to any one of claims 13 to 16.

18. a mapping is available that enables the first party and / or a third party to look up the identity of the second party based on the further public key; 20. The method of claim 17.

19. the code is configured to verify a further cryptographic signature using the further public key, and, conditional on the further cryptographic signature being verified, return a result of true.

19. The method of claim 17 or 18.

20. the information received in the second transaction further includes a cryptographic signature of the first party using a private key of the first party to sign a portion of the second transaction; 20. The method of any one of claims 17 to 19.

21. the information received in the second transaction includes an additional ECDSA signature having a different value of the r portion from the first ECDSA signature but using the same first private key as the first ECDSA signature; the code is configured to verify the additional ECDSA signature using the first public key, and, if the additional ECDSA signature is verified, to return a result of true.

21. The method according to any one of claims 13 to 20.

22. each of said transactions comprises a data structure including one or more inputs and one or more outputs, each output including a locking script, and each input including an unlocking script and a pointer to an output of another transaction; the code is constituted by a locking script of the first transaction, the information received in the second transaction is constituted by the unlocking script at an input of the second transaction, and the pointer at the input of the second transaction points to the output of the first transaction; The method comprises: validating the transaction at least conditional on the code returning a true result; and In response to said verification, including the second transaction in a pool of transactions for mining into one or more blocks by validating nodes; and / or forwarding the second transaction to at least one other node of a blockchain network; Contains at least one of:

22. The method of any one of claims 1 to 21.

23. the transactions are structured according to an account-based model; The code is configured by a smart contract included in the first transaction.

22. The method of any one of claims 1 to 21.

24. A computer program embodied in a computer readable storage device and adapted to carry out the method of any one of claims 1 to 23 when executed on a node of a network.

25. A node of the network, a memory including one or more memory units; a processing device including one or more processing units, the memory storing code configured to execute on the processor; The code is configured to perform, on the processor, a method according to any one of claims 1 to 23. node.

26. 1. A computer-implemented method, on a second party computing device, comprising: monitoring a first transaction including executable code; the code is configured to verify that HPoW(f(r,d)) satisfies a predetermined condition defined in the code and to return a true result for the condition; where r is the r part of the EDSCA signature, d is a nonce, HPoW is a hash function, and f is a function combining r and d, said r part being specified by the first party. Steps and generating the r portion based on a temporary key; searching for a value of the nonce d such that HPoW(f(r,d)) satisfies the predetermined condition; formulating a second transaction linked to the first transaction; the second transaction includes information including at least the r and s parts of the first ECDSA signature and further including the nonce d; Steps and sending the second transaction, which is propagated through a blockchain network for recording in the blockchain; A method comprising:

Citation Information

Patent Citations

  • System and method for creating a multi-branched blockchain with configurable protocol rules

    US20160028552A1

  • Duplicating smart contracts with termination condition

    WO2018215876A1