Generating Blockchain Transactions
By employing Merkle trees and R-puzzles, the method enhances flexibility and confidentiality in blockchain transactions, enabling any user or group to unlock UTXOs securely without modifying previous transactions, addressing the limitations of existing models.
Patent Information
- Application Number
- JP2024515062
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-09-14
- Filing Date
- 2022-08-15
- Publication Date
- 2024-09-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing blockchain transaction models struggle with flexibility and confidentiality when the recipient of a UTXO (Unspent Transaction Output) is unknown at the time of generating the locking script, limiting the ability to unlock transactions by anyone or a threshold of individuals without modifying previous transactions.
A method using Merkle trees and R-puzzles allows any valid public-private key pair to unlock UTXOs by deriving a portion (r) from a secret number (k), enabling transactions to be locked without knowing the recipient upfront, and requiring knowledge of the secret value k and Merkle proof for unlocking, enhancing flexibility and confidentiality.
This approach improves both the flexibility and confidentiality of blockchain transactions by allowing any user or group to unlock transactions, while ensuring secure and efficient unlocking through knowledge proofs, and reduces the need for modifying previous transactions.
Smart Images

Figure 2024533308000001
Abstract
Description
[Technical field]
[0001] The present disclosure relates to methods for generating outputs of blockchain transactions that can be unlocked by any individual or threshold of individuals, and methods for generating blockchain transactions for unlocking such outputs. [Background technology]
[0002] "Blockchain" refers to a form of distributed data structure in which duplicate copies of the blockchain are maintained at each of multiple nodes in a distributed peer-to-peer (P2P) network (hereinafter referred to as the "blockchain network") and made publicly available. A blockchain includes a chain of blocks of data, with each block including one or more transactions. Each transaction, except for so-called "coinbase transactions," points back to the preceding transaction in the sequence, which may span one or more blocks up to one or more coinbase transactions, which are described further below. Transactions submitted to the blockchain network are included in new blocks. New blocks are often produced by a process called “mining”, which involves multiple nodes each competing to perform a “proof of work”, i.e., solving a cryptographic puzzle based on a representation of a defined set of ordered and verified pending transactions waiting to be included in a new block of the blockchain. It should be noted that the blockchain may be deleted at some nodes, and publication of a block is accomplished by simply publishing the block header.
[0003] Transactions in a blockchain can be used for one or more of the following purposes: to transfer digital assets (i.e., numbers of digital tokens), to order a set of entries in a virtualized ledger or registry, to receive and process time-stamp entries, and / or to time-order index pointers. A blockchain can also be used to layer additional functionality on top of the blockchain. For example, the blockchain protocol allows for the storage of additional user data or indexes to data within a transaction. There is no pre-specified limit on the maximum amount of data that can be stored within a single transaction, and therefore increasingly more complex data can be incorporated. For example, this can be used to store electronic documents or audio or video data in the blockchain.
[0004] Nodes in a blockchain network (often referred to as “miners”) perform a distributed transaction registration and validation process, which is described in more detail below. In summary, during this process, nodes validate transactions and insert them into a block template attempting to identify a valid proof-of-work solution. Once a valid solution is found, the new block is propagated to other nodes in the network, so that each node can record a new block in the blockchain. To have a transaction recorded in the blockchain, a user (e.g., a blockchain client application) sends the transaction to one of the nodes in the network, where it is propagated. Nodes receiving the transaction may compete to find a proof-of-work solution that will incorporate the validated transaction into the new block. Each node is configured to implement the same node protocol, which includes one or more conditions for a transaction to be valid. Invalid transactions are not propagated to or incorporated into a block. Assuming a transaction has been verified and thereby accepted into the blockchain, the transaction (including any user data) remains registered and indexed as an immutable public record at each node in the blockchain network.
[0005] Nodes that successfully solve the proof-of-work puzzle to create the latest block are typically rewarded with a new transaction called a “coinbase transaction” that distributes a sum of digital assets, i.e., a number of tokens. Detection and rejection of invalid transactions is performed by the action of competing nodes that act as agents of the network and have an incentive to report and block misconduct. Public publication of information allows users to continuously audit node performance. By simply publishing block headers, participants can guarantee the ongoing integrity of the blockchain.
[0006] In an “output-based” model (sometimes referred to as a UTXO-based model), the data structure of a given transaction contains one or more inputs and one or more outputs. Any spendable output contains an element that specifies the total value of the digital asset that can be derived from the preceding sequence of transactions. A spendable output is sometimes referred to as a UTXO (unspent transaction output). An output may further include a locking script that specifies the conditions for future redemption of the output. A locking script is a predicate that defines the conditions necessary to validate and transfer a digital token or asset. Each input of a transaction (other than a coinbase transaction) contains a pointer (i.e., a reference) to that output in the preceding transaction, and may further include an unlocking script to release the locking script of the pointed-to output. Thus, for a pair of transactions, we refer to the first and second transactions (or “target” transactions). The first transaction includes at least one output specifying a value of the digital asset and a locking script defining one or more conditions for unlocking the output. The second, target transaction includes at least one input including a pointer to the output of the first transaction and an unlocking script for unlocking the output of the first transaction.
[0007] In such a model, when a second, target transaction is sent to the blockchain network to be propagated and recorded in the blockchain, one of the validity criteria 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, and another is that the output of the first transaction has not yet been redeemed by another transaction that was previously valid. Any node that finds that the target transaction is invalid according to any of these conditions will not propagate the transaction (potentially registering an invalid transaction as a valid transaction) or not include it in the new block recorded in the blockchain.
[0008] An alternative type of transaction model is the account-based model, where each transaction does not define the amount transferred by referencing back to the UTXO of the preceding transaction in the sequence of past transactions, but rather by referencing an absolute account balance. The current state of every account is stored and constantly updated by nodes separate from the blockchain. Summary of the Invention
[0009] In blockchain transactions, UTXOs are typically locked to predefined users by including the recipient's public key in the locking script. However, there may be situations where the recipient of a UTXO is unknown at the time of generating the locking script.
[0010] According to one aspect disclosed herein, there is provided a computer-implemented method of generating a blockchain transaction, in which each of a plurality of second parties has a respective secret number k from which a respective r portion can be derived, and a Merkle tree is defined, at least one leaf node of the Merkle tree being based on at least one of the respective r portions. The method includes the steps of: generating a first blockchain transaction executed by a first party, the first blockchain transaction including a first locking script including a target Merkle tree portion corresponding to the Merkle tree, the first locking script being configured, when executed with a first unlocking script of a second blockchain transaction, to: extract an r portion from the first unlocking script, generate a hash value derived from the extracted r portion, calculate a candidate Merkle tree portion based on the generated hash and a Merkle proof portion of the first unlocking script, verify that the calculated candidate Merkle tree portion matches the target Merkle tree portion, and verify a signature portion of the first unlocking script based on a public key of the first unlocking script; and making the first blockchain transaction available to one or more nodes of a blockchain network.
[0011] The r part corresponds to an “R-puzzle”, a form of knowledge proof, which allows a user to unlock a UTXO using any valid public-private key pair, independent of the locking script, if they know the secret number k used to derive r. Thus, a UTXO can be locked knowing the r-puzzle, and the secret value k can then be provided to the recipient without the need to modify any previous transaction in which the UTXO is locked. That is, the transaction that locks the UTXO can be generated without the recipient's knowledge.
[0012] A Merkle tree is another form of proof of knowledge. The unlocker must know both the data from which the leaf nodes are derived and the Merkle proof, which provides the information needed to compute the Merkle root of the Merkle tree. Thus, by combining an r-puzzle with a Merkle tree, the unlocker must know the secret value k from which the leaf nodes are derived, and the Merkle proof that corresponds to that particular leaf node.
[0013] The disclosed method thus improves both the flexibility and external party confidentiality of blockchain transactions: flexibility is improved by allowing any one or any set of a group of users to unlock a transaction, while confidentiality is improved by requiring users to have knowledge of the scope of the data items (i.e., the Merkle proof portion, the signature portion, and the public key).
[0014] The use of Merkle trees in the script also provides a more efficient and scalable method over known threshold unlocking schemes, since the locking script does not contain all of the keys that may be used to unlock a UTXO, or the entire set of possible keys in the case of an M-of-N scheme. [Brief description of the drawings]
[0015] To facilitate an understanding of embodiments of the present disclosure and to show how such 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. [Figure 3A] FIG. 3A is a schematic block diagram of a client application. [Figure 3B] FIG. 3B is a schematic mock-up of an exemplary user interface that may be presented by the client application of FIG. 3A. [Figure 4] FIG. 4 is a schematic block diagram of some node software for processing transactions. [Diagram 5] FIG. 5 shows an example of a Merkle tree. [Figure 6A] FIG. 6A illustrates generally the principles behind the Elliptic Curve Digital Signature Algorithm (ECDSA). [Figure 6B] FIG. 6B illustrates generally the principles behind the Elliptic Curve Digital Signature Algorithm (ECDSA). [Figure 6C] FIG. 6C illustrates generally the principles behind the Elliptic Curve Digital Signature Algorithm (ECDSA). [Figure 6D] FIG. 6D illustrates diagrammatically the principles behind the Elliptic Curve Digital Signature Algorithm (ECDSA). [Figure 7] FIG. 7 shows a schematic of how R-puzzles and Merkle trees can be used for 1-of-N signature unlocking requirements. [Figure 8] FIG. 8 shows a schematic of how R-puzzles and Merkle trees can be used for the M-of-N signature unlocking requirement. [Figure 9] FIG. 9 shows a schematic of how to use R-puzzles, Merkle trees, and intra-script elliptic curve point addition for the M-of-N signature unlocking requirement. [Figure 10] FIG. 10 shows a schematic of an alternative method using R-puzzles, Merkle trees, and intra-script elliptic curve point addition for the M-of-N signature unlocking requirement. [Figure 11A]FIG. 11A shows a schematic of the Merkle paths in a given Merkle tree, given different Merkle parts of a locking script. [Figure 11B] FIG. 11B shows a schematic of the Merkle paths in a given Merkle tree, given different Merkle parts of a locking script. [Figure 11C] FIG. 11C shows a schematic of the Merkle paths in a given Merkle tree, given different Merkle portions of a locking script. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0016] Exemplary System Overview FIG. 1 illustrates an exemplary system 100 for implementing a blockchain 150. The system 100 may include 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 blockchain nodes 104 that may be arranged to form a peer-to-peer (P2P) network 106 within the packet-switched network 101. Although not shown, the blockchain nodes 104 may be arranged as a nearly complete graph. Thus, each blockchain node 104 is highly connected to other blockchain nodes 104.
[0017] Each blockchain node 104 includes a peer's computing device, with different ones of the nodes 104 belonging to different peers. Each blockchain 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), and application specific integrated circuits (ASICs). Each node also includes memory, i.e., computer readable storage 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., magnetic media such as hard disks, electronic media such as solid state drives, flash memory, or EEPROMs, and / or optical media such as optical disk drives.
[0018] The blockchain 150 includes a chain of blocks of data 151, a copy of each of which is maintained at each of multiple blockchain nodes 104 in a distributed or blockchain network 106. As mentioned above, maintaining a copy of the blockchain 150 does not necessarily mean storing the blockchain 150 in its entirety. Instead, the blockchain 150 may be pruned of data, so long as each blockchain node 150 stores the block header (described below) of each block 151. 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 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 representing some quantity of digital assets as a professional party, an example of which is a user 103 to whom the output is cryptographically locked (requiring that user's signature or other solution to be unlocked and thereby redeemed or spent). Each input points back to the output of a preceding transaction 152, thereby linking the transactions.
[0019] Each block 151 also contains a block pointer 155 that points back to a previously generated block 151 in the chain to define a sequential order for the blocks 151. Each transaction 152 (other than a coinbase transaction) contains a pointer that points back to a previous transaction to define an order to the sequence of transactions (NB sequence of transactions 152 can branch). The chain of blocks 151 goes back to a generator block (Gb) 153 that was the first block in the chain. One or more original transactions 152 earlier in the chain 150 pointed to the generator block 153, not to a previous transaction.
[0020] Each blockchain node 104 is configured to transfer transactions 152 to other blockchain nodes 104, which propagates the transactions 152 throughout the network 106. Each blockchain node 104 is configured to generate blocks 151 and store copies of each of the same blockchains 150 in its memory. Each blockchain node 104 also maintains an ordered set (or “pool”) 154 of transactions 152 waiting to be incorporated into blocks 151. The ordered pool 154 is often referred to as a “mempool.” This term is not intended to be limited herein to a particular blockchain, protocol, or model. This refers to an ordered set of transactions that the node 104 accepts as valid and that the node 104 is obligated to not accept other transactions that attempt to consume the same output.
[0021] For a given current transaction 152j, the input (or each input) contains a pointer that references the output of a preceding transaction 152i in the sequence of transactions, specifying that this output is redeemed or "spent" in the current transaction 152j. In general, a preceding transaction can be any transaction in the ordered set 154 or any block 151. A preceding transaction 152i does not necessarily have to exist when the current transaction 152j is created or even when it is sent to the network 106, but a preceding transaction 152i must exist and be verified for the current transaction to be valid. Thus, "preceding" herein refers to a preceding in a logical order linked by a pointer, and thus does not necessarily refer to a time of creation or transmission in a chronological order, and thus does not necessarily preclude a transaction 152i, 152j from being created or transmitted out-of-order (see the discussion below regarding orphan transactions). The preceding transaction 152i may also be referred to as an antecedent transaction or a predecessor transaction.
[0022] The input of the current transaction 152j also includes an input authorisation, e.g. the signature of the user 103a to whom 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 or entity 103b. Thus, the current transaction 152j can transfer the amount defined in the input of the previous transaction 152i to the new user or entity 103b defined in the output of the current transaction 152j. In some cases, a transaction 152 can have multiple outputs to split the input amount among multiple users or entities (one of which may be the original user or entity 103a to provide the change). In some cases, a transaction can also have multiple inputs, collecting amounts from multiple outputs of one or more previous transactions and then redistributing them against one or more outputs of the current transaction.
[0023] According to an output-based transaction protocol such as Bitcoin, when a party 103, such as an individual user or an organization, wants to execute a new transaction 152j (either manually or by an automated system adopted by the party), the enacting party sends the new transaction from its computer terminal 102 to the recipient. The entity or recipient eventually sends this transaction to one or more of the blockchain nodes 104 of the network 106 (today typically a server or a data center, but in principle it could be other user terminals). The party 103 executing the new transaction 152j can also send the transaction directly to one or more blockchain nodes 104, and in some instances it is not excluded not to send it to the recipient. The blockchain node 104 receiving the transaction checks whether the transaction is valid or not according to the blockchain node protocol applied to each blockchain node 104. Blockchain node protocols typically require blockchain nodes 104 to check that a cryptographic signature in a new transaction 152j matches an expected signature that depends on a previous transaction 152i in the ordered sequence of transactions 152. In such output-based transaction protocols, this may include checking that a cryptographic signature or other authorization of a party 103 included in the input of the new transaction 152j matches a condition defined in the output of the previous transaction 152i that the new transaction assigns. Here, the condition typically includes at least checking that the cryptographic signature or other authorization in the input of the new transaction 152j unlocks the output of the previous transaction 152i to which the input of the new transaction is linked. This condition may be defined, at least in part, by a script included in the output of the previous transaction 152i.Alternatively, it may simply be fixed by the blockchain node protocol alone, or by a combination of these. In either case, if the new transaction 152j is valid, the blockchain node 104 forwards it to one or more other blockchain nodes 104 in the blockchain network 106. These other blockchain nodes 104 apply the same tests according to the same blockchain node protocol, and so forward the new transaction 152j to one or more further nodes 104. In this way, the new transaction is propagated throughout the entire network of blockchain nodes 104.
[0024] In the output-based model, the definition of whether a given output (e.g., UTXO) is allocated (e.g., paid) is whether it has still been validly redeemed by another, onward transaction 152j input according to the blockchain node protocol. Another condition for a transaction to be valid is that the output of the preceding transaction 152i that it attempts to redeem has not already been redeemed by another transaction. If it is not valid, again, the transaction 152j is not propagated (unless it is flagged as invalid and propagated for warning purposes) or recorded in the blockchain 150. This prevents double-spending, whereby a transactor tries to allocate the same transaction output multiple times. On the other hand, the account-based model prevents double-spending by maintaining account balances. Again, since there is a defined order of transactions, the account balance has a single defined state at any one time.
[0025] In addition to validating transactions, blockchain nodes 104 also compete to be the first to create a block of transactions in a process commonly called mining, which is supported by “proof-of-work.” Blockchain nodes 104 add new transactions to an ordered pool of valid transactions 154 that have not yet appeared in a block 151 recorded in the blockchain 150. Blockchain nodes then compete to assemble a new valid block 151 of transactions 152 from the ordered set 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 a representation of the ordered pool of pending 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. Note that this is just one particular type of proof-of-work puzzle, and other types are not excluded. A property of a hash function is that it has an unpredictable output with respect to its input, so this search can only be performed by brute force, thus consuming a significant amount of processing resources at each blockchain node 104 attempting to solve the puzzle.
[0026] A first blockchain node 104 to solve the puzzle announces this to the network 106 and provides its solution as a proof, which can then be easily checked by other blockchain nodes 104 in the network (once the solution to the hash is given, it is easy to check that it produces an output of a hash that satisfies the condition). The first blockchain node 104 accepts the block and propagates it to the threshold consensus of other nodes thus enforcing the protocol rules. The ordered set of transactions 154 is then recorded as a new block 151 in the blockchain 150 by each of the blockchain nodes 104. A block pointer 155 is also assigned to the new block 151n that points back to the block 151n-1 generated earlier in the chain. The significant amount of effort, e.g., in the form of hashes, required to create a proof-of-work solution signals the intention of the first node 104 to follow the rules of the blockchain protocol. Such rules include not validating a transaction if it assigns the same output as a previously verified transaction. Once created, blocks 151 cannot be modified because they are known and maintained by each blockchain node 104 in the blockchain network 106. 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 blockchain node 104 in the network 106.
[0027] Note that different blockchain nodes 104 competing to solve the puzzle at any given time can do so based on different snapshots of the pool of yet to be published transactions 154 at any given time, depending on when they started their search for a solution or the order in which the transactions were received. Whoever solves their puzzle first defines which transactions 152 will be included in the next new block 151n and in what order, and the current pool of yet to be published transactions 154 is updated. The blockchain nodes 104 then continue competing to create blocks from the newly defined ordered pool of yet to be published transactions 154, and so on. There is also a protocol to resolve any "forks" that may occur, where two blockchain nodes 104 solve their puzzles within a very short time of each other, so that conflicting views of the blockchain are propagated between the nodes 104. In essence, whatever prongs of the fork are stretched, the longest one becomes the final blockchain 150. Note that this does not affect users or agents of the network, since the same transactions appear in both forks.
[0028] According to the Bitcoin blockchain (and most other blockchains), a node that successfully constructs a new block 104 is given the ability to allocate an additional accepted amount of the digital asset in a new special type of transaction that distributes an additional defined quantity of the digital asset (as opposed to a transaction between agents, or between users that transfers an amount of the digital asset from one agent or user to another). This special type of transaction is often called a "coinbase transaction", but is also called an "initiation transaction" or "generation transaction". It typically forms the first transaction of a new block 151n. The proof of work signals the intention of the node to construct the new block in a manner that allows this special transaction to be redeemed later, according to the protocol rules. Blockchain protocol rules may require a maturation period of, for example, 100 blocks, before this special transaction can be redeemed. Often, a regular (non-generation) transaction 152 also specifies an additional transaction fee in one of its outputs to further reward the blockchain node 104 that created the block 151n in which the transaction was published. This fee is typically called the “transaction fee” and is explained below.
[0029] Due to the resources involved in validating and publishing transactions, typically at least each blockchain node 104 takes the form of a server, including one or more physical server units or entire data centers, although in principle any given blockchain node 104 could take the form of a user terminal or a group of user terminals networked together.
[0030] The memory of each blockchain node 104 stores software configured to run on the processing unit of the blockchain node 104 to perform a respective role or roles and to process transactions 152 in accordance with the blockchain node protocol. It will be understood that any operation attributed to a blockchain node 104 may be performed by software executing on the processing unit of the respective computing device. The node software may be implemented in one or more applications, at a lower layer such as the application layer, the operating system layer, or the protocol layer, or any combination thereof.
[0031] The connected network 101 also includes computing devices 102 of multiple parties 103 each in the role of consuming users. These users may interact with the blockchain network 106 but do not participate in validating transactions or building blocks. Some of these users or agents 103 may act as senders and receivers of transactions. Other users may interact with the blockchain 150 without necessarily acting as senders or receivers. For example, some parties may act as custodial entities that store a copy of the blockchain 150 (e.g., having obtained a copy of the blockchain from a blockchain node 104).
[0032] Some or all of the parties 103 may be connected as part of a different network, for example, a network overlaid on top of the blockchain network 106. Users of the blockchain network (often referred to as "clients") may be said to be part of a system that includes the blockchain network 106, but are not blockchain nodes 104 because these users do not perform the roles required of a blockchain node. Instead, each party 103 may interact with the blockchain network 106, and thereby utilize the blockchain 150, by connecting (i.e., communicating) with the blockchain node 106. Two parties 103 and their respective devices 102 are shown for illustrative purposes, namely, a first party 103a and their respective computing device 102a, and a second party 103b and their respective computing device 102b. It will be understood that many more such parties 103 and their respective computing devices 102 may exist and participate in the system 100, but for convenience they are not shown. Each party 103 may be an individual or an organization. Purely by way of example, the first party 103a will be referred to herein as Alice and the second party 103b will be referred to as 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 the "first party" and the "second party," respectively.
[0033] The computing device 102 of each party 103 includes 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 memory, i.e., computer readable storage in the form of a non-transitory computer readable medium. This memory may include one or more memory units using one or more memory media, e.g., magnetic media such as hard disks, electronic media such as SSDs, flash memory, or EEPROMs, and / or optical media such as optical disk drives. The memory on the computing device 102 of each party 103 stores software including a respective instance of at least one client application 105 configured to operate on the processing device. It will be understood that any operation attributed to a given party 103 herein may be performed using software executing on the processing device of the respective computing device 102. The computing device 102 of each party 103 includes 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, that are accessed via the user terminal.
[0034] The client application 105 may be initially provided to the computing device 102 of any given party 103 on a suitable computer readable storage medium or media. For example, it may be downloaded from a server or 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, etc.
[0035] The client application 105 has at least a “wallet” functionality. It has two main functions. One of these is to allow each party 103 to create, authorize (e.g., sign), and send transactions 152 to one or more Bitcoin nodes 104, which are then propagated throughout the network of blockchain nodes 104 and thereby included in the blockchain 150. The other is to report back to each party the amount of digital assets he or she currently owns. In an output-based system, this second function involves reconciling the amount defined in the outputs of the various transactions 152 scattered throughout the blockchain 150 that belong to the party in question.
[0036] NOTE: While various client functions may be described as being integrated into a given client application 105, this is not necessarily limiting, and 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 at a lower layer, such as an operating system, or any combination of these. While the following is described with respect to a client application 105, it will be understood that this is not limiting.
[0037] An instance of a client application or software 105 on each computing device 102 is operatively coupled to at least one of the blockchain nodes 104 of the network 106. This allows the wallet functionality of the client 105 to send transactions 152 to the network 106. The client 105 can also contact the blockchain node 104 to query the blockchain 150 for any transactions in which the respective party 103 is a recipient (or, in an embodiment, actually inspect the transactions of other parties in the blockchain 150, since the blockchain 150 is a “public facility” that provides trust in transactions in part through public visibility). The wallet functionality on each computing device 102 is configured to form and send transactions 152 according to a transaction protocol. As described above, each blockchain node 104 executes software configured to validate transactions 152 according to the blockchain node protocol and forward transactions 152 for propagation throughout the blockchain network 106. The transaction protocol and the node protocol correspond to each other, and a given transaction protocol, together with a given node protocol, implements a given transaction model. The same transaction protocol is used for all transactions 152 in the blockchain 150. The same node protocol is used by all nodes 104 in the network 106.
[0038] When a given party 103, for example 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 the client application 105 to one or more blockchain nodes 104 to which she is connected. For example, this may be the blockchain node 104 that is best connected to Alice's computer 102. When any given blockchain node 104 receives a new transaction 152j, the node processes it according to the blockchain 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 are described in detail immediately below. In some transaction protocols, the conditions for validation can be set 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 scripts and node protocols.
[0039] Provided that the newly received transaction 152j passes the tests to be considered valid (i.e., is “validated”), any blockchain node 104 that receives the transaction 152j adds the new valid transaction 152 to the ordered set of transactions 154 maintained at that blockchain node 104. Additionally, any blockchain node 104 that receives the transaction 152j propagates the valid transaction 152 towards one or more other blockchain nodes 104 in the network 106. Because each blockchain node 104 applies the same protocol, this means that, assuming the transaction 152j is valid, it will soon be propagated throughout the network 106.
[0040] Once admitted to the ordered pool of pending transactions 154 maintained at a given blockchain node 104, that blockchain node 104 starts a race to solve a proof-of-work puzzle for the latest version of each pool of transactions 154, including the new transaction 152. (Recall that other blockchain nodes 104 are trying to solve the puzzle based on different pools of transactions 154, but whoever gets there first defines the set of transactions contained in the latest block 151. Eventually, the blockchain node 104 solves the puzzle for the part of the ordered pool 154 that contains Alice's transaction 152j.) Once the proof-of-work is done for the ordered pool 154 that contains the new transaction 152j, it becomes immutably part of one of the blocks 151 in the blockchain 150. Each transaction 152 contains a pointer back to the previous transaction, and the order of the transactions is also immutably recorded.
[0041] Different blockchain nodes 104 may initially receive different instances of a given transaction, and therefore may have conflicting views about which instance is “valid” before one instance is published in a new block 151, at which point all blockchain nodes 104 agree that the published instance is the only valid instance. If a blockchain node 104 accepts one instance as valid and then discovers that two instances have been recorded in the blockchain 150, it must accept it and discard (i.e., treat as invalid) the instance it originally accepted (i.e., the one not published in block 151).
[0042] An alternative type of transaction protocol operated by some blockchain networks may be called an “account-based” protocol as part of the account-based transaction model. In the account-based case, each transaction defines the amount to be transferred not by referencing back to the UTXO of the preceding transaction in the sequence of past transactions, but rather by referencing absolute account balances. The current state of every account is stored separately on the blockchain by the nodes of the network and is constantly updated. In such a system, transactions are ordered using the running transaction tally (also called the “position”) of the account. This value is signed by the sender as part of the cryptographic signature and hashed as part of the transaction reference calculation. In addition, an optional data field may also be signed in the transaction. This data field can point back to a previous transaction, for example if a previous transaction ID is included in the data field.
[0043] UTXO-based model FIG. 2 shows one exemplary transaction protocol. This is an example of a UTXO-based protocol. A transaction 152 (abbreviated as "Tx") is a fundamental 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 intended to be limiting to all possible embodiments. Note that the exemplary UTXO-based protocol is described with reference to Bitcoin, but may be implemented on other exemplary blockchain networks as well.
[0044] In a UTXO-based model, each transaction ("Tx") 152 includes a data structure that includes one or more inputs 202 and one or more outputs 203. Each output 203 may include an unexpired transaction output (UTXO), which can be used as a source of input 202 for another new transaction (if the UTXO has not already been redeemed). The UTXO includes a value that specifies the total value of the digital asset. This represents the number of tokens placed in the distributed ledger. The UTXO may also include, among other information, the transaction ID of the transaction from which the UTXO originated. 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 (minus the transaction ID itself) and is stored in the header 201 of the raw transaction 152 submitted to the node 104.
[0045] 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 the digital asset locked to Alice in the output 203 of the preceding transaction 152i and transfers at least a portion of it to Bob. The preceding 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 immediately next transaction in the pool 154. Tx1 can point back to any of the preceding (i.e., prior) transactions that still have unspent outputs 203 locked to Alice.
[0046] The preceding transaction Tx0 may already be validated and included in a block 151 of the blockchain 150 when Alice creates the 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 time, or it may still be waiting in the ordered set 154, in which case it will soon be included in the new block 151. Alternatively, if the node protocol allows for buffering of “orphans”, Tx0 and Tx1 may be created and sent to the network 106 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 transaction pointers specified in the transactions (e.g., which transaction points to other transactions). These may also be interchangeably referred to as "predecessor" and "successor", or "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 blockchain node 104. Nevertheless, a subsequent transaction (a descendant transaction or "child") that points to a preceding transaction (antecedent transaction or "parent") is not validated until and unless the parent transaction is validated. A child that arrives at a blockchain node 104 before reaching its parent node 104 is considered an orphan. Depending on the node protocol and / or node behavior, it may be discarded or buffered for a period of time to wait for the parent.
[0047] One of the one or more outputs 203 of the preceding transaction Tx0 includes 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 the unlocking script in the input 202 of the subsequent transaction for the subsequent transaction to be validated, and therefore for the UTXO to be successfully redeemed. Typically, the locking script locks the 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 which the preceding transaction is locked.
[0048] 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” (with capital S) used by blockchain networks. A locking script specifies the information needed to consume the transaction output 203, e.g., 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.
[0049] In the illustrated example, UTXO0 of output 203 of Tx0 is A ], which means that for UTXO0 to be redeemed (or more precisely, for a subsequent transaction that tries to redeem UTXO0 to be valid), Alice's signature Sig P A[Checksig P A ] is the public key P from Alice’s public-private key pair. A , a representation (i.e., a hash) of Tx1's UTXO0. Tx1's input 202 includes a pointer that points back to Tx1 (e.g., by its transaction ID, TxID0, which in an embodiment is a hash of the entire transaction Tx0). Tx1's input 202 includes an index that identifies UTXO0 within Tx0, to identify it among any other possible outputs of Tx0. Tx1's input 202 further includes an unlocking script that contains Alice's cryptographic signature, created by applying Alice's private key from her key pair to the predetermined portion of the data. <Sig P A > (sometimes called a “message” in cryptography). The data (or “message”) that needs to be signed by Alice to provide a valid signature can be defined by a locking script, a node protocol, or a combination of these.
[0050] When a new transaction Tx1 arrives at a blockchain node 104, the node applies the node protocol, which involves running the locking script and the unlocking script together to check whether the unlocking script satisfies the conditions defined in the locking script (where the conditions can 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 locking script (a stack-based language in this example). Similarly, the scripts can be executed one after the other, using a common stack rather than concatenating them. In either case, when executed together, the scripts use Alice's public key PA, as included in the locking script at the output of Tx0, to authenticate that the unlocking script at the input of Tx1 contains Alice's signature signing the expected portion of the data. To perform this authentication, the expected portion of the data itself (the "message") must also be included. In an embodiment, the signed data includes the entirety of Tx1 (so there is no need to include a separate element that specifies the signed portion of the data in the clear, since that is already inherently present).
[0051] The details of authentication with public key-cryptographic key cryptography will be well known to those skilled in the art. Essentially, if Alice signs a message using 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 message must have been signed by Alice. Signing typically involves hashing the message, signing the hash, and tagging the message as the signature, thus allowing any holder of the public key to authenticate the signature. Thus, note 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.
[0052] If the unlocking script in Tx1 satisfies one or more conditions specified in the locking script of Tx0 (in the example, Alice's signature is provided and authenticated in Tx1), the blockchain node 104 considers Tx1 valid. This means that the blockchain node 104 adds Tx1 to the ordered pool of pending transactions 154. The blockchain node 104 also forwards the transaction Tx1 to one or more other blockchain nodes 104 in the network 106, so that it is propagated throughout the network 106. Once Tx1 is validated and included in the blockchain 150, this defines the UTXO0 from Tx0 as spent. Note that Tx1 is only valid if it uses unspent transaction outputs 203. If it attempts to consume outputs that have already been consumed by another transaction 152, Tx1 becomes invalid even if all other conditions are met. Therefore, the blockchain node 104 also needs to check whether the UTXO referenced in the preceding transaction Tx0 has already been spent (i.e., whether it already forms a valid input to another valid transaction). This is one of the reasons why it is important for the blockchain 150 to impose a defined order on transactions 152. Indeed, a given blockchain node 104 may maintain a separate database mark of UTXOs 203 that transactions 152 have spent, but ultimately, what defines whether a UTXO is spent is whether it already forms a valid input to another valid transaction in the blockchain 150.
[0053] If all the total amounts specified in all the outputs 203 of a given transaction 152 are greater than all the total amounts pointed to by all its inputs 202, this is another basis for invalidity in most transaction models. Therefore, such a transaction is not propagated and is not included in block 151.
[0054] Note that in the UTXO-based transaction model, a given UTXO must be spent in its entirety. It is not possible to “leave behind” part of the total amount defined in a UTXO as spent while another part has been spent. However, the total amount from a UTXO can be divided among multiple outputs of a subsequent transaction. For example, the total amount defined in UTXO0 in Tx0 can be divided among multiple UTXOs in Tx1. Thus, if Alice does not want to give Bob the entire total amount defined in UTXO0, she can use the remaining amount to give herself change in the second output of Tx1 or to pay another party.
[0055] In practice, Alice will usually also need to include a fee for any Bitcoin nodes 104 that successfully include her transaction 104 in block 151. If Alice does not include such a fee, Tx0 may be rejected by the blockchain nodes 104 and thus, although technically valid, will not be propagated and included in the blockchain 150 (the node protocol does not force blockchain nodes 104 to accept the transaction 152 if they do not want to). In some protocols, the transaction fee does not need its own separate output 203 (i.e., it does not need a separate UTXO). Instead, the difference between all the total amounts indicated by the inputs 202 and all the total amounts specified in the outputs 203 of a given transaction 152 is automatically given to the blockchain node 104 that issues the transaction. For example, assume that a pointer to UTXO0 is the only input to Tx1, and Tx1 has only one output UTXO1. If the total amount of digital assets specified in UTXO0 is greater than the amount specified in UTXO1, the difference may be allocated by the node 104 that wins the proof-of-work competition to produce the block containing UTXO1. However, it is not necessarily excluded that a transaction fee may alternatively or additionally be explicitly specified in the UTXO 203 of transaction 152 itself.
[0056] Alice and Bob's digital assets consist of UTXOs locked in any transaction 152 anywhere in the blockchain 150. Thus, typically, the assets of a given party 103 are distributed throughout the UTXOs of various transactions 152 throughout the entire blockchain 150. No single number is stored anywhere in the blockchain 150 that defines the total balance of a given party 103. It is the role of the wallet function in the client application 105 to bring together the value of all the various UTXOs locked for each party and that have not yet been spent in another forward transaction. This can be done by querying the copy of the blockchain 150 as stored in any Bitcoin node 104.
[0057] Note that the scripting code is often expressed generally (i.e., without using a precise language). For example, operation codes (opcodes) may be used to represent specific functions. "OP_..." refers to a specific opcode in the scripting language. As one example, OP_RETURN is an opcode in the scripting language that, when preceded by OP_FALSE at the beginning of the locking script, generates an unspendable output of the transaction that can store data within the transaction, and thereby record the data immutably on the blockchain 150. For example, the data may include a document that is desired to be stored on the blockchain.
[0058] Typically, the input for a transaction is a public key P AThe signature includes a digital signature corresponding to the . In an embodiment, this is based on ECDSA using the elliptic curve secp256k1. The digital signature signs a specific piece of data. In some embodiments, for a given transaction, the signature signs some of the transaction inputs and some or all of the transaction outputs. The specific pieces of outputs to sign depend on the SIGHASH flag, which is a four-byte code usually included at the end of the signature that selects which outputs are signed (and therefore fixed at the time of signing).
[0059] A locking script is sometimes referred to as a "scriptPubKey", referring to the fact that each transaction typically includes the public key of the party being locked. An unlocking script is sometimes referred to as a "scriptSig", referring to the fact that it typically provides a corresponding signature. However, more generally, in all applications of blockchain 150, it is not required that the condition for a UTXO to be redeemed include verifying a signature. More generally, a scripting language may be used to define any one or more conditions. Thus, the more general terms "locking script" and "unlocking script" may be preferred.
[0060] Side Channels As shown in FIG. 1, the client applications on Alice's and Bob's computing devices 102a, 120b, respectively, may include additional communication capabilities. This additional functionality allows Alice 103a to establish a separate side channel 107 with Bob 103b (at the invitation of either party or a third party). The side channel 107 allows for the exchange of data apart from the blockchain network. Such communication is sometimes referred to as "off-chain" communication. For example, this may be used to exchange transactions 152 between Alice and Bob without the transaction being registered in the blockchain network 106 or proceeding on the chain 150 as such until one of the parties chooses to broadcast it to the network 106. Sharing transactions in this manner is sometimes referred to as sharing a "transaction plate." A transaction template may lack one or more inputs and / or outputs necessary to form a complete transaction. Alternatively or additionally, the side channel 107 may be used to exchange other transaction-related data, such as keys, negotiated amounts or terms, data content, etc.
[0061] The side channel 107 may be established over the same packet-switched network 101 as the blockchain 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 and Bob's devices 102a, 102b. In general, the side channel 107 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., separate from the blockchain 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 107. Thus, note that when Alice and Bob are said to exchange certain information or data, or the like, over the side channel 107, this does not necessarily mean that all of these data must be transmitted over the exact same links or the same type of network.
[0062] Client Software 3A illustrates an exemplary implementation of a client application 105 for implementing an embodiment of the presently disclosed scheme. The client application 105 includes a transaction engine 401 and a user interface layer 402. The transaction engine 401 is configured to implement the underlying transaction-related functionality of the client 105, such as forming transactions 152, receiving and / or sending transactions and / or other data via side channels 301, and / or sending transactions to one or more nodes 104 that are propagated through the blockchain network 106. In accordance with embodiments disclosed herein, the transaction engine 401 of each client 105 includes a function 403 that derives one or more of: a Merkle tree having leaf nodes based on one or more r-parts, a Merkle root corresponding to the Merkle tree, a Merkle proof corresponding to the Merkle tree, an r-part derived from a secret value k, a combined r-part based on two or more of the derived r-parts, and a gradient λ between two elliptic curve points.
[0063] The UI layer 402 is configured to render a user interface via user input / output (I / O) means of the device 102, including outputting information to each user 103 via the user output means of the user's computing device 102, and receiving input from each user 103 via the user input means of the device 102. For example, the user output means may include one or more display screens (touch screen or non-touch screen) for providing visual output, one or more speakers for providing audio output, and / or one or more tactile output devices for providing tactile output, etc. The user input means may include, for example, one or more touch screens (the same or different as those used for the output means), one or more cursor-based devices such as a mouse, trackpad, or trackball, and one or more microphones and voice recognition algorithms for receiving speech or voice input, one or more gesture-based input devices for receiving input in the form of manual or physical gestures, or an input array of one or more mechanical buttons, switches, or joysticks, etc.
[0064] Note: While various functionalities herein may be described as being integrated in the same client application 105, this is not necessarily limiting and may instead be implemented with two or more separate applications, e.g. one plugging into the other or interfacing via an API (Application Programming Interface). For example, the functionality of the transaction engine 401 may be implemented in a separate application from the UI layer 402, or the functionality of a given module such as the transaction engine 401 may be split between multiple applications. It is also not excluded that some or all of the described functionality may be implemented, for example, at the operating system layer. Where reference is made anywhere herein to a single or given application 10, 5, etc., it will be understood that this is by way of example only, and more generally, the described functionality may be implemented in any form of software.
[0065] 3B shows an example mockup of a user interface 500 that may be rendered by the UI layer 402 of client application 105a on Alice's device 102a. It will be appreciated that a similar UI may be rendered by client 105b on Bob's device 102b, or by any other party.
[0066] 3B illustrates the UI 500 from Alice's perspective. The UI 500 may include one or more UI elements 501, 502, 503 that are rendered as separate UI elements via user output means.
[0067] For example, the UI elements may include one or more user selectable elements 501, which may be different on-screen buttons, or different options in a menu, etc. The user input means is configured to allow the user 103 (in this case, Alice 103a) to select or otherwise manipulate one of the options, such as by clicking or touching an on-screen UI element, or by speaking the name of the desired option (note, the term “manual” is meant in contrast to automatic only, and is not necessarily limited to the use of a hand or hands). The options allow the user (Alice) to select a secret value k from which the r portion is derived, and one or more of the Merkle trees or their identifiers.
[0068] Alternatively or additionally, the UI element may include one or more data entry fields 502, through which a user may enter and select one or more of the secret value k from which the r portion is derived, and the Merkle tree or its identifier. These data entry fields are rendered via a user output means, e.g., on-screen, and data may be entered into the fields via a user input means, e.g., a keyboard or touch screen. Alternatively, data may be received orally, e.g., based on speech recognition.
[0069] Alternatively or additionally, the UI elements may include one or more information elements 503 that are output to output information to the user, for example this / these may be rendered on a screen or audibly.
[0070] It will be understood that the particular means of rendering the various UI elements, selecting options, and inputting data are not essential. The functionality of these UI elements will be described in more detail shortly. It will also be understood that the UI 500 shown in FIG. 3 is merely a schematic mockup, and may in fact include one or more additional UI elements, which are not shown for the sake of brevity.
[0071] Node Software FIG. 4 illustrates an example of node software 450 that runs on each blockchain node 104 of the network 106 in the example UTXO-based or output-based model. Note that other entities can run node software 450 without being classified as a node 104 on the network 106, i.e., without performing the actions required of a node 104. The node software 450 may include, but is not limited to, a protocol engine 451, a script engine 452, a stack 453, an application level decision engine 454, and a set of one or more blockchain-related function modules 455. Each node 104 may run node software, including, but not limited to, all three of a consensus module 455C (e.g., proof of work), a propagation module 455P, and a storage module 455S (e.g., database). The protocol engine 401 is typically configured to recognize different fields of a transaction 152 and process them according to a node protocol. Transaction 152j (Tx j ) is a different, preceding transaction 152i (Tx i ) with an input pointing to an output (e.g., a UTXO), the protocol engine 451 j The protocol engine 451 also identifies the unlocking script in Tx jBased on the pointer at the input of Tx i Identify and search for Tx i is published in the blockchain 150, in which case the protocol engine can derive Tx i Alternatively, Tx i may not yet be published in the blockchain 150. In that case, the protocol engine 451 may select Tx from the ordered set of unpublished transactions 154 maintained by the node 104. i In any case, the script engine 451 searches for Tx i The script engine 452 then identifies the locking script within the referenced output of the script.
[0072] Therefore, the script engine 452 executes the Tx i Locking script and Tx j 2, which includes a locking script from the corresponding inputs of Tx0 and Tx1. For example, transactions labeled Tx0 and Tx1 are illustrated in FIG. 2, but could be any pair of transactions. Script engine 452 executes the two scripts together, as described above, including placing data on stack 453 and popping data off stack 453 according to the stack-based scripting language (e.g., script) used.
[0073] By executing the scripts together, the script engine 452 determines whether the unlocking script meets one or more criteria defined in the locking script--i.e., whether the unlocking script will "unlock" the output it is included in. The script engine 452 returns the result of this determination to the protocol engine 451. If the script engine 452 determines that the unlocking script meets one or more criteria specified in the corresponding locking script, it returns the result "true". Otherwise, it returns the result "false".
[0074] In an output-based model, a "true" result from script engine 452 is one of the conditions for the validity of a transaction. Typically, there are also one or more further protocol-level conditions evaluated by protocol engine 451 that must also be satisfied. For example, Tx j the total amount of digital assets specified in the output of Tx does not exceed the total amount indicated by its input; j The protocol engine 451 evaluates the results from the script engine 452 together with one or more protocol-level conditions, and validates the transaction Tx only if they are all true. j The protocol engine 451 outputs an indication to the application level decision engine 454 whether the transaction is valid or not. j Only on condition that Tx is actually verified, the decision engine 454 can control both the consensus module 455C and the propagation module 455P, and Tx j , which selects to perform respective blockchain-related functions on the ordered set of transactions 154 for inclusion in block 151. jand a consensus module 455C that adds Tx j Optionally, in an embodiment, the application level decision engine 454 may apply one or more additional conditions before triggering either or both of these functions. For example, the decision engine may choose to publish a transaction only if the transaction is both valid and sufficient transaction fees remain.
[0075] It should also be noted that the terms "true" and "false" herein are not necessarily limited to returning results 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, a "true" outcome may be indicated by a combination of an implicit protocol-level validation of a signature and an additional positive output of a smart contract (if both outcomes are true, the overall outcome is considered true).
[0076] R-PUZZLES Elliptic Curve Digital Signature Algorithms (ECDSAs) Public key cryptography is used as the basis for securing transactions in several 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 a given function is easy to compute but difficult to reverse without some special knowledge. Such a function is called a trapdoor function, and the special knowledge required to reverse it is called the trapdoor of that function. Easy to compute means that it is computationally feasible to compute the trapdoor function for a given input (or set of inputs) in a reasonable time frame, and difficult to reverse means that it is computationally infeasible to infer that input (or those inputs) from the result without knowledge of the trapdoor.
[0077] 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.
[0078] 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 a reversal of the trapdoor function (i.e., decryption is performed in the “reverse direction”), which is only feasible if the trapdoor is known.
[0079] 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.
[0080] 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.
[0081] 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).
[0082] "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. The principles of ECDSA are outlined below.
[0083] In mathematical terms, ECC exploits the algebraic structure of elliptic curves over finite fields of prime order. A finite field means a finite set of elements and a set of related operations of multiplication, addition, subtraction, and division that, when applied to elements in the set, satisfy the usual rules of arithmetic (associativity, commutativity, etc.) -- that is, operations that are not necessarily addition, multiplication, etc. in the "normal" sense, but that behave essentially the same way.
[0084] Elliptic Curve Arithmetic In the context of ECC, the operations of addition, subtraction, and multiplication are respectively elliptic curve point addition, denoted herein by "+", elliptic curve point subtraction, denoted herein by "-", and elliptic curve scalar multiplication, denoted herein by "·". 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 on a scalar.
[0085] For illustrative purposes, FIG.
number
[0086] postscript :A mathematical property of ε is that given any two points on an elliptic curve ε, the line that crosses A and B re-intersects only one additional point, denoted as ε and C. The elliptic curve addition of A and B, i.e., A+B, is defined as the “reflection” of C. The reflection of C is another point on the elliptic curve where the line crosses. This definition also applies to the case A=B, with the modification that C is now the point where the tangent to ε at A re-intersects ε. This definition is made to hold for the case where the line crossing the two points is perpendicular, by defining as a point on the elliptic curve a point that is at infinity, denoted as ∞, and where any perpendicular line intersects the elliptic curve (e.g., the points labeled D and E are vertically and horizontally aligned, so D+E=∞).
[0087] Subtractive / additive inverse : The above definition of reflection applies to any point and provides the definition of elliptic curve point subtraction. AB is the sum of A with the reflection of B. The reflection of B is more formally called the "additive inverse" of B, which is then denoted as -B. Using this notation, elliptic curve subtraction can be defined in mathematical notation as follows: AB=A+(-B)
[0088] So in Figure 6B, C = -(A+B) and (A+B) = -C. Also note that under this definition, D = -E, reflecting a general rule of algebraic construction: the elliptic point addition of any point on an elliptic curve to its additive inverse is a point at infinity, i.e.: A+(-A)=∞ ∀A∈ε
[0089] The point at infinity, ∞, is more formally called the “identity element” (note both the parallelism with and deviation from ordinary arithmetic, in which the sum of any number a and its additive inverse, -a, is 0, and 0 is the identity element in ordinary arithmetic). Another property of identity elements is that ∞ mirrors ordinary arithmetic, and for any A in ε, including ∞ itself, A+∞=A (similar to the statement that for any real number a, a+0=0).
[0090] multiplicative From the definition of elliptic curve point addition, the definition of elliptic curve scalar multiplication is as follows. Multiplication of an elliptic curve point A and an integer ν is defined as follows.
number
[0091] That is, it is n-times elliptic curve point addition between A and itself.
[0092] 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.
[0093] Division / multiplicative inverse The division operation is defined in terms of scalars. For a given scalar ν, its “multiplicative inverse” is the scalar ν -1 and the result is as follows: ν -1 =1
[0094] Figure 6A provides an intuitive visualization of the above operations, where ε is the set of all real numbers
number
[0095] Figure 6B shows in more detail how the above operations are actually applied in the context of ECC. The elliptic curve ε n As shown. ε n :y 2 =x 3 +ax+b mod p Here, p is a prime number (prime modulus) and mod denotes a modulo operation. The set of points that satisfy the above formula is finite, and all but one of those points are represented as open circles in FIG. 6B, 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 must be sufficiently large. For example, in a given blockchain model, a p of 256 bits is specified.
[0096] The subscript "n", in contrast, is referred to as the order of the group formed by the points of the elliptic curve under the point addition method defined above. The "order of an elliptic curve" is referred to herein as the order of the group formed by the points of the elliptic curve under the point addition rule defined above (as a shorthand, this is the order of the group formed by the points of the elliptic curve ε n (This may be referred to as the order of .) See below.
[0097] In other words, n is the order of the group and p is the order of the field. There are a total of n elliptic curve points. Each point on the elliptic curve is represented by two numbers / coordinates (x,y), where x and y lie in the full range -(p-1),…0,…,(p-1).
[0098] We can see that ε in Fig. 6B n exhibits horizontal symmetry, similar to that of ε in Figure 6A. It is a general property of elliptic curves over the prime file, and therefore, ε n The additive inverse of a point in still holds. Some points do not have a horizontally aligned counterpoint (e.g., (0,0)), and such points are their own additive inverse.
[0099] ε n A “line” that intersects two points A and B above A,B is represented by a smaller black circle, resulting in a finite set of points that satisfy similar geometric requirements, and the definition of elliptic curve scalar multiplication still holds. Similar to Fig. 6A, Fig. 6B shows the point A+B=-C, which is the additive inverse of the point C=-(A+B), where the line l A,B is ε n and re-intersect.
[0100] ε n The elliptic curve addition A+B=-C of any two points above can be algebraically defined by the following formula:
number
[0101] For the above purposes, the multiplicative inverse ν of an integer ν -1 The definition is amended as follows: ν -1 ≡1(mod p)
[0102] That is, the multiplicative inverse of an integer v is the modular inverse of v mod p.
[0103] The case B=-A is a special case and is solved by the introduction of the identity ∞. As shown, in that case A+B=A+(-A)=∞. B=∞ is also a special case and is solved as above as A+∞=A.
[0104] The definition of elliptic curve scalar multiplication adopts this definition of elliptic curve addition and is otherwise the same.
[0105] In other contexts, the multiplicative inverse ν of the scalar ν -1 The definition of, note that: ν -1 ≡1(mod n)
[0106] In the context, it will be clear whether the multiplicative inverse is defined mod n or mod p.
[0107] In practice, the following checks can be applied to identify whether a number should be treated as mod n or mod p. 1.Does that number represent the coordinates of the EC point? a. If yes, then mod p. 2. Is that number used to multiply the EC point? a. If yes, then mod n.
[0108] Note that it is possible for both checks to give a positive answer, in which case the number must be mod p and mod n.
[0109] Elliptic Curve Cryptography (ECC) Elliptic curve arithmetic offers unique capabilities for obscuring secret values and forms the basis of many modern cryptosystems. In particular, reversing scalar multiplication of elliptic curve points over finite fields is a hard problem (computationally infeasible to perform).
[0110] The private key V takes the form of an integer, and the corresponding public key P is derived from an elliptic curve ε n At point P on the left, it is also possible to find the elliptic curve ε n Also the above point.
number
[0111] For a sufficiently large V, it is difficult, i.e., computationally infeasible, to actually perform elliptic curve addition on V to derive P. However, when V is known, P can be computed much more efficiently by exploiting the algebraic properties of elliptic curve arithmetic. One example of an efficient algorithm that can be used to compute P is the “double and add” algorithm, which, importantly, can only be implemented if V is known.
[0112] Conversely, if V is not known, then there is no computationally feasible way to derive V (i.e., to reverse scalar multiplication), even when both G and P are known (this is the so-called “discrete-logarithm problem”). An attacker could try to “brute force” by starting from G and repeatedly performing elliptic curve point additions until he reaches P, at which point he will know that V is the number of elliptic curve point additions he must perform, which he will find to be computationally infeasible. Thus, V satisfies the trapdoor requirement in the above sense.
[0113] In ECC, a public key P, a generator key G, and an elliptic curve ε n is public and assumed to be known, while the private key V is secret.
[0114] Elliptic Curve Digital Signature Verification Algorithm (ECDSA) In a private key system, a user or other entity typically holds a private key P that is used to prove their identity and the corresponding public key, and the corresponding private key P could be calculated as follows: P=V G
[0115] A private key V can be used to sign a piece of data m (a “message”) using ECDSA.
[0116] Further details of ECDSA can be found, for example, in the following documents, which are incorporated herein by reference in their entireties: “RFC 6979-Deterministic Usage of the Digital Signature Algorithm(DSA) and Elliptic Curve Digital Signature Algorithm(ECDSA)” Tools.ietf.org, 2019.
[0117] 6C shows a schematic functional block diagram of the signature generation function, in which a signature generator (signature genarator_600) generates an ECDSA signature (r, s) for a public-private key pair (V, P). An ECDSA signature is a pair of values, referred to herein as the r part (r) and the s part (s), respectively.
[0118] Signature generation is performed on the same elliptic curve ε n , and a generator point G used to derive the public key P; thus, the elliptic curve parameters a, b, and n, as well as the generator point G, are shown as inputs to signature generator 600.
[0119] An ephemeral key generator 602 of signature generator 600 generates an “ephemeral” key k, where k∈[1,n−1], i.e., the range from 1 to 10 inclusive.
[0120] The r-part generator 604 computes the corresponding public ephemeral key from k as follows: R = k G Then take the x coordinate of the calculated point ([] x shows the process of taking the x-coordinate of an elliptic curve point). r=[R] x mod n This is the r part of the signature.
[0121] The s part generator 606 generates the inverse k mod n as follows:-1 (i.e., k -1 1(mod n) --see above) and a hash of the message (truncated if necessary), denoted H(m). s=k -1 (H(m)+rV) mod n
[0122] In this example, message m contains the data (in this example, one or more transaction outputs) to be included in transaction 608. This may be referred to as the process of signing message m, and m may be referred to as the signed portion of the transaction.
[0123] The message m and the signature (r, s) form part of the transaction 608. In this embodiment, the signature (r, s) is included at the input of the transaction 608 as part of the unlocking script.
[0124] 6D shows a schematic functional block diagram of a signature verifier 620 for verifying a transaction 608. The computations performed by the signature verifier 620 are performed over the same publicly available elliptic curve ε n , and generator point G.
[0125] While a signature requires the private key V as input, knowledge of which is required to generate a valid signature, only the signature pair (r,s), the message m, and the public key P are needed to verify the signature (r,s). To verify the signature, the signature verifier 620 hashes the signed portion of the transaction m (applying the same hash function used to generate the signature (r,s)). The verification process is then performed using the following calculation: R' = H(m)s -1 G+rs -1 P
[0126] This signature is [R']x mod n=r , and it is invalid (i.e., signature verification fails) if and only if , ...
[0127] The public key P used in the signature verification process may, for example, be specified in the locking script of the preceding transaction. In this case, signature verification is performed using the public key specified in the locking script of the preceding transaction, the signed part m, and the signature (r,s) of the (later) transaction 608 - and fails if the signature (r,s) was not generated based on the public key P specified in the preceding transaction and the signed part m of the later transaction 608. Thus, only the holder of the private key V can request the output of the preceding transaction (typically by including his signature in the output of the later transaction 608), and the signed part m of the later transaction 608 cannot be changed without invalidating the signature (r,s).
[0128] Knowledge Proof An "r-puzzle" is a type of transaction script that allows spending parties to sign input UTXOs using any valid public-private key pair. The key pair can be application-specific or randomly generated for one-off use.
[0129] In such a knowledge proof, the signer uses a secret number k to derive the r part of the signature (r, s).
[0130] One exemplary locking script using r-puzzle may have the following form:
number
[0131] It will be appreciated that any opcode that performs hashing may be used instead of OP_HASH160, for example OP_RIPEMD160, OP_SHA1, OP_SHA256, or OP_Hash256.
[0132] For simplicity, the locking script can be expressed as follows:
number
number
[0133] The above script drops the first 3 bytes of the signature, then extracts the r part of the signature, and then drops the rest of the signature.
[0134] The unlocking script has the following format: <sig> <pk> Here, the signature is of the form (r,s), where r is derived from a secret number k, and <pk>is the signer's public key.
[0135] The signer, the person providing the unlocking script, knows r, such that kG=(x,y) and r=x mod n. That is, the signer knows k, which when multiplied by G, when taken modulo n, produces a point whose x coordinate is r.
[0136] <Hash(r)> is provided in the locking script and is therefore public. The secret is k. The execution of the script is in the following table: Main Stack, Script. [Table 1]
[0137] A signer can use any private-public key pair to sign a message, because neither the private key nor the corresponding public key is used when creating the locking script, so the party providing the locking script does not need to know who will provide the unlocking script at the time of generating the transaction.
[0138] The pay-to-R-Puzzle can also be represented as P2RP HASH(r).
[0139] SIGNATURE TREES Merkle Trees A Merkle tree is a hierarchical data structure that allows for secure validation of a collection of data. In a Merkle tree, each node in the tree is given an index pair (i,j) and is denoted as N(i,j), where the indices i,j are simply numeric labels associated with a particular position in the tree.
[0140] An important feature of a Merkle tree is that the composition of each of its nodes is governed by the formula:
number
[0141] A binary Merkle tree constructed according to these formulas is shown in Figure 5. As shown, it can be seen that when i=j, it corresponds to a leaf node. This is simply a function of the data D i The corresponding ith (i th ) packet. If i ≠ j, then it corresponds to an internal or parent node, which is generated by recursively hashing and concatenating the child nodes until a single parent (the Merkle root) is found.
[0142] For example, node N(0,3) is composed of four data packets D0, . . . , D3 as follows:
number
[0143] The tree depth M is defined as the lowest level of a node in the tree, and the depth m of a node is the level at which the node resides. For example, root = 0 and m leaf =M, where M=3 in FIG.
[0144] For Merkle trees in Bitcoin and some other blockchains, the hash function is double SHA256, which is two applications of the standard hash function SHA-256, i.e. H(x)=SHA256(SHA256(x)).
[0145] Merkle proofs The main feature of a Merkle tree is that, for some packet Di, there are N data packets
number
[0146] The proof of existence is given by N-1 exists and their order is known to the prover. However, this requires a much larger storage overhead than Merkle proofs, as well as requiring the entire data set to be available to the prover. A comparison between using Merkle proofs and using the entire list is shown in the table below. Here, we use binary Merkle trees, and it is assumed that the number of data blocks N is exactly equal to the square of an integer.
[0147] The table below shows the relationship between the number of leaf nodes in a Merkle tree and the number of hashes required for a Merkle proof (or Merkle illumination). [Table 2]
[0148] In this simplified scenario, where the number of data packets equals the number of leaf nodes, we can see that the number of hash values needed to compute a Merkle proof scales logarithmically. Clearly, computing a Merkle proof containing log2N hashes is much more efficient and practical than storing N data hashes and computing an explicit proof.
[0149] Method Given a Merkle root R, let D0 be a block of data D∈{D0,…,D N-1 }, we can perform a Merkle proof as follows: i. Obtain the Merkle root R from a trusted source. ii. From a source, obtain a Merkle proof Γ, where Γ is a set of hashes. Γ={N(1,1),N(2,3),N(4,7)} iii. Use D1 and Γ to compute the Merkle proof as follows: a. Hash the data block for retrieval. N(0,0)=H(D0) Concatenate with bN(1,1) and hash to get. N(0,1)=H(N(0,0)||N(1,1)) Concatenate with cN(2,3) and hash to get. N(0,3)=H(N(0,1)||N(2,3)) Concatenate with dN(4,7) and hash to get the root. N(0,7)=H(N(0,3)||N(4,7)) R'=N(0,7) e. Compare the calculated R' with the root R obtained in (i). 1. If R'=R, then the presence of D0 in the tree, and therefore the dataset D, is confirmed. 2. If R' ≠ R, then the proof fails and D0 is not confirmed as a member of D.
[0150] This is an efficient mechanism to provide a proof of existence for some data as part of a Merkle tree and the dataset represented by its root. For example, if the data D0 corresponds to a blockchain transaction and the root R is publicly available as part of the block header, we can quickly prove that the transaction was included in that block.
[0151] The process of authenticating the existence of D0 as part of an example Merkle tree is shown in Figure 6. This demonstrates that performing a Merkle proof for a given block D0 and root R is effectively traversing the Merkle tree "upwards" by using only the minimum number of hash values required.
[0152] Minimum information to build a Merkle proof When constructing a single leaf Merkle proof, the minimal information required is: 1. Leaf index: The position of a leaf in the leaf layer of a Merkle tree. 2. An ordered list of hash values: The hash values needed to compute the Merkle root.
[0153] To illustrate how leaf indexes work, consider the Merkle tree in Figure 5. Bob knows the root R, but not all the leaves of the tree. The Merkle branch of D0 consists of an index, 0, and three hash values (circled). The index indicates whether the provided hash value should be concatenated to the left or right of the computed hash value.
[0154] Merkle trees are N=2 M leaves. Let us assume that we have index i in layer 0, i0=i, b0=i0mod 2, and p0=i0+(-1). bo That is, it is as follows.
number
[0155] p0 is the index of the paired leaf node of the leaf node with index i0. They are called a pair because they are concatenated and hashed (see above) to compute their parent hash node in the Merkle tree. The node with index p0 is also called "the provided hash" or "the required hash" because it must be provided when computing the Merkle root of the i0 leaf node.
[0156] Thus, we define and have, at layer m,
number
[0157] The index of the hash provided is then:
number
[0158] The above formulas assume that indexing starts at 0.
[0159] Signature Tree A signature tree is an efficient alternative to threshold signature requirements, where a threshold number of parties are required to sign a transaction. In this method, a Merkle tree is created where each of its leaves can represent one spend condition. The locking script contains the root of the Merkle tree and an opcode to verify the Merkle proof. The unlocking script contains the Merkle proof and one of the spend conditions (i.e., one of the leaf nodes, or information from which the leaf node can be derived).
[0160] Referring to the Merkle tree in Figure 5, leaf node D n is derived from the public keys of the possible signers.
[0161] 1-of-N Multisig For a 1-of-N multisignature equivalent Merkle tree, the locking script generation steps are as follows: 1. Compute the hash of the associated public key and put the hash as a leaf in the tree, i.e., User1 has public key P1, and let X1=Hash(P1). 2. Calculate the Merkle root. 3. Create the following locking script:
number
[0162] Here, the string (OP_SWAP OP_IF OP_SWAP OP_ENDIF OP_CAT OP_SHA256)*3 means that the opcode between the brackets is:
number
[0163] The unlocking script consists of a signature, a public key, and a Merkle proof.
[0164] Merkle Proof is<sibling_node> It consists of <0 if sibling is to the left and 1 if it is to the right>.
[0165] For example, for user 5, who has public key P5, which is data item D4 in the Merkle tree of FIG. 5, we provide the following unlocking script: <sig> <pk><N(0,3)><0><N(6,7)> <1><N(5,5)> <1>
[0166] The execution of the script is as follows: [Table 3]
[0167] Merkle Proof Construct Here, we use "Merkle Root Derivation" as an abbreviation for the following: Repeat (OP_SWAP OP_IF OP_SWAP OP_ENDIF OP_CAT OP_SHA256) t times, where t is the length of the Merkle proof, and
number
[0168] Each time a string is generated it has two sibling tree nodes to be concatenated and the hash of the concatenation to be calculated, where the hash is the parent node of the two sibling tree nodes. [Merkle Root Derivation]=<Merkle Tree point A> <0 if A is left, or 1 otherwise><Merkle Tree point> →<Parent node>
[0169] For illustrative purposes, the execution of this portion of the string is as follows: [Table 4]
[0170] M-of-N Multisig The above method may be used to allow for a threshold of M-of-N signers, where each leaf corresponds to one of M-of-N combinations (i.e., N chooses M).
[0171] For example, if there are five users {U1, U2, U3, U4, U5} and there is a requirement that four of the five users sign, i.e., a 4-of-5 multisig, then the tree X is given by i It is constructed using:
number
[0172] Since there is an odd number of leaves, a "dummy" leaf X6 is introduced so that there is an even number of leaves. The dummy leaf may have a value of 1, some other predefined constant, or the value of its sibling leaf (i.e.,
number
[0173] The locking script contains the root of the tree, and the unlocking script must provide a Merkle proof proving the link to the root.
[0174] IN-SCRIPT ELLIPTIC CURVE POINT ADDITION CHECKING In-script Elliptic Curve Point Addition Checking (IECPAC) provides a method for checking in a script that P1+P2=P3, where P i =(x i ,y i ) is an elliptic curve (EC) point. It establishes the following function: <Point Add P1、P2、λ、P3> It takes as input P1, P2, λ, P3 and returns TRUE if λ is the slope of the line between P1 and P2 and P3=P1+P2. These two checks are done in the script. This function involves two steps. 1. The value of λ is verified by checking: If P1 ≠ P2, λ(x2-x1) mod p = y2-y1mod p Or, if P1=P2, then 2λy1mod p = 3x1 2 mod p 2. The value of P3 is verified by checking that the coordinates of P3=(x3,y3) satisfy: x3=λ 2 -x1-x2mod p y3=λ(x1-x3)-y1mod p
[0175] This method can be extended to any number of points. For example, the operations to verify the addition of three EC points P=P1+P2+P3 are as follows:
number
[0176] P1, P2, P3, and λ may be provided in the unlocking script, and the checks are performed within the script.
[0177] R-PUZZLE with Merkle Trees In accordance with an embodiment of the present disclosure, the concepts of R-puzzle and signature trees may be advantageously combined to provide a flexible and secure method of locking the output of a blockchain transaction. A first user (e.g., Alice 103a) constructs a first transaction, including a locking script that locks the output of the first transaction. The locking script is configured to require that an unlocking script of a second transaction, generated by a second user (e.g., Bob 103b) or group of users, includes a Merkle proof portion, a signature portion, and a public key. To successfully unlock the locking script, the signature portion must include the r portion, which generates a hash value that, when hashed, forms part of a Merkle tree. The locking script performs a Merkle proof using the hash value and the Merkle proof, and verifies that it matches a node (or portion) of the Merkle tree included in the locking script (Test 1). For example, the node may be the Merkle root of the Merkle tree. In addition, the signature portion is verified using the public key (Test 2). Only if each test is satisfied are the locking and unlocking scripts executed successfully.
[0178] A set of users each know a secret value k. The Merkle tree is defined with nodes based on r or R values (or "r-portions") derived from the users' secret values. As stated above, r = [R] x mod n R = kG where the ECDSA signature is of the form (r,s).
[0179] The term "r portion" is used herein to refer to both R and r, where r is the r portion of the ECDSA signature.
[0180] Although reference is made herein to ECDSA signatures, it should be noted that ECDSA is just one type of digital signature scheme, and in general, any equivalent scheme may be used.
[0181] 1-of-N R-values FIG. 7 shows an example Merkle tree, a first transaction Tx1, and a second transaction Tx2 for implementing a system in which one of N users is required to unlock the locking script 203A of the first transaction Tx1, generated by the first user 103a.
[0182] In this case, each user U i is a secret i Each leaf node of the Merkle tree contains a secret value k i is the hash of the r part derived from
[0183] The following steps are performed: 1. R i = k i G = (x i ,y i ) to calculate 2.r i = x i Get mod N. 3. Leaf value X i = Hash(r i ) 4. Remaining users or coordinators and X i , so that a Merkle tree can be constructed. 5. Leaf X i From this, we compute the Merkle root of the tree.
[0184] X i From i Since it is not possible to derive X i Sharing does not affect security.
[0185] The Merkle root is also referred to as a “Merkle tree portion.” Similarly, a leaf node or an intermediate node of a Merkle tree may also be referred to as a Merkle tree portion.
[0186] A locking script can take the following form:
number
[0187] Where:
number
[0188] The unlocking script may be of the following form: <sig> <pk><Merkle Proof>
[0189] That is, the unlocking script is i ,s i ), where r i is the r part of the locking script, the signer's public key PK, and the Merkle proof part.
[0190] The unlocking script 202A is provided in a second transaction Tx2, generated by a second user 103b. In the example of FIG. 7, user 5 generates the unlocking script 202A. In this instance, the Merkle proof is <z1> <0> <y4> <1> <x6><1> It is.
[0191] When executed in conjunction with the unlocking script 202A, the unlocking script 203A causes the following steps to be performed. 1. The r portion of the signature is extracted from the unlocking script 202A. 2. The r part is hashed. 3. Using the extracted r portion and the Merkle proof of the unlocking script 202A, a candidate Merkle tree root is generated (Step A). 4. The candidate Merkle proof is verified by checking that it equals the Merkle root provided in the locking script 203A (the target Merkle root). 5. The signature is verified using the public key provided in the unlocking script 202A.
[0192] The unlocking script can be used to unlock any <sig> <pk>It is valid for. 1. The hash of the r value extracted from the signature matches one of the leaves of the tree. 2. The provided Merkle proof is used to calculate a root that matches the value in the locking script. 3. <sig> <pk>The pair is verified by OP_CHECKSIG.
[0193] M-of-N R-value FIG. 8 shows an example Merkle tree, a first transaction Tx1, and a second transaction Tx2 for implementing the system, where M out of N users are required to unlock the locking script 203B of the first transaction Tx1, generated by the first user 103a.
[0194] Again, each user U i is a secret i However, in this case, each leaf node of the Merkle tree has a secret value k associated with a group of users who can together unlock the locking script 202B. i is a hash of the combination of r parts derived from
[0195] In a 2-of-4 system, each leaf X i corresponds to one of six possible 4-choose-2 combinations (4C2).
number
[0196] The corresponding Merkle tree has 6 leaves, i.e. there are no X7 or X8. To balance the tree, there are no leaf nodes, Y4 is set to 1. Y4 is called a "dummy" node. Instead, if there is an odd number of leaf nodes, the dummy node is a dummy leaf node and is also equal to 1.
[0197] The above r Ui It will be appreciated that although the values are summed, the values may be combined in any other way, for example, by concatenating or multiplying the r portions of each user in the group.
[0198] The locking script may contain two r-extractors, a single Merkle proof, and two OP_CHECKSIGs.
number
[0199] The unlocking script consists of two <sig> <pk>and one Merkle Proof. <sig1> <pk1> <sig2> <pk2><Merkle proof>
[0200] That is, the unlocking script 202B contains a signature-key pair for each user, and each signature contains an r part and a Merkle proof part.
[0201] The execution of the script for X6 is as follows: where U3 calculates r3 and <Sig U3 > <PK U3 > uses k3 to provide U4, and U5 similarly uses k4, and <Sig U4 > <PK U4 > to provide. [Table 5]
[0202] Referring to Figure 8, two users, U1 and U2, generate a second transaction that includes the unlocking script 202B. U1 +r U3 corresponds to leaf node X2, and the resulting Merkle proof is <z2> <1> <y2> <1> <x1><0> It is.
[0203] When the locking script 203B is executed together with the unlocking script 202B, the following steps are performed. 1. The r portion of each signature is extracted from the unlocking script 202B. 2. The two r parts are summed and then the sum is hashed. 3. Using the extracted r portion and the Merkle proof of the unlocking script 202B, candidate Merkle tree roots are generated (Step A). 4. The candidate Merkle proof is verified by checking that it equals the target Merkle root, provided in the locking script 203B. 5. Each signature is verified using the corresponding public key provided in the unlocking script 202B.
[0204] The unlocking script can execute any <sig> <pk>It is effective against. 1. The hash of the combination of r values extracted from the signature matches one of the leaves of the tree. 2. The provided Merkle proof is used to calculate a root that matches the value in the locking script. 3. Signature-Key Pair <sig> <pk>Both are verified by OP_CHECKSIG.
[0205] The above method can be extended to any M-of-N, so that the locking script can be given by:
number
[0206] where t is the length of the Merkle proof.
number
[0207] The use of a Merkle tree as described above, where the leaf nodes are hashes of M combinations of r values, is a more efficient solution for M-of-N signature requirements because the locking and unlocking scripts are smaller than for alternative solutions to M-of-N systems, where there are M separate paths for M signers, each leaf corresponding to a single user, resulting in a Merkle tree with N leaves.
[0208] In the case of M distinct paths, the unlocking script contains M Merkle proofs, where a single Merkle proof is of length
number
[0209] However, if each leaf node is set to correspond to one of the N-choose-M possibilities, the tree becomes
number
number
[0210] For all positive integers, always
number
[0211] Therefore, the use of the M-of-N tree described above is cheaper and more efficient as the size, and therefore the cost, of the trees and scripts is reduced.
[0212] The method proposed above requires repeating OP_CHECKSIG M times. To remove this requirement, each group of users (corresponding to leaves in the Merkle tree) has a single signing key. This reduces the number of OP_CHECKSIG opcodes to one and reduces the size of the unlocking script. This reduces the cost and improves efficiency, since both the unlocking script and the locking script are shorter and their execution has fewer steps.
[0213] R POINTS ELLIPTICAL CURVE ADDITION The signature tree containing the leaf nodes of the r puzzle can be modified so that the EC point addition method is used to generate the leaves. IECPAC then uses the EC points extracted from the unlocking script, R xi But in reality, there are M EC points, R1,…,R M It is also extracted from the unlocking script. Once the IECPAC check is performed, the R xi The link to, and subsequently to the root value provided in the locking script, is verified using Merkle proof derivation.
[0214] As in the previous section, a Merkle tree is formed, where each leaf corresponds to each of the possible N-choose-M combinations.
[0215] Use of the IEPCA method provides a technique for a user to prove knowledge of both the leaf data (i.e., the sum of the R values) and the R values (or r portions) from which the leaf data are derived (i.e., the R values for M users).
[0216] Individual Signature Scheme FIG. 9 shows an example Merkle tree, a first transaction Tx1, and a second transaction Tx2 for implementing a system in which M out of N users are requested to unlock the locking script 203C of the first transaction Tx1, generated by the first user 103a.
[0217] Again, each user U i is a secret i Each leaf node of the Merkle tree contains a secret value k of a group of users who together can unlock the locking script 202C. i The hash of the x coordinate derived from the sum of the M r values derived from
number
[0218] A 2-of-4 multisig system is provided as an example. Each leaf of the Merkle tree, X i corresponds to one of the six possible 4-choose-2 combinations of the user that can unlock the locking script 203C, as in the example of FIG. 8. For example, leaf X i is generated by users U1 and U2. Y4 is again set to 1 to balance the Merkle tree.
[0219] In an individual signature scheme, each group member provides their own signature.
[0220] The following steps are performed: 1. Each U i is the secret value k i has. 2. R i = k i G = (x i ,y i ) 3. Add the elliptic curve points to R X1 =R1+R3=(x X1 ,y X1 ) is obtained. 4. X1 = hash(x X1 )
[0221] Each of the N-choose-M groups chooses their X to build a Merkle tree. i Share it with either other users or the coordinator
[0222] The Merkle tree itself is similar to that shown in FIG. 8, however, the locking script 203C and the unlocking script 202C include additional components that are used for IECPAC.
[0223] The locking script 203C includes the following: 1. the root of said tree, 2. Two OP_CHECKSIG opcodes, 3. Two Extract_r opcode strings, 4. The opcode string for the IECPAC, 5. Merkle root derivation opcode string.
[0224] The second transaction is provided by users 1 and 3 corresponding to leaf node X3. The unlocking script 202C includes the following: 1. Two signatures and two public keys, each pair corresponding to one of the users. <r1,s1> <pk1> <r3,s3> <pk3> do. 2. Elliptic Curve Points <R1,R3,R X3 > 3. Gradient between two EC points R1 and R3 < λ R1R3 > 4.<Merkle Proof>
[0225] Gradient < λ R1R3 > is R1+R3=R X3 Used by IECPAC to verify that
[0226] A Merkle tree can be constructed for each of the users using either R or r. In the example of FIG. 9, each X i is the hash of the sum R (or its x-coordinate), e.g., R1+R3=R X3 =(x X3 ,y X3 ), and X3=hash(x X3 ), and the pre-image of the leaf is R X3 That is, the pre-image of a leaf contained in the unlocking script 202C depends on what type of r-part the leaf node is derived from.
[0227] When the locking script 203C is executed together with the unlocking script 202C, the following steps occur. 1. From signature U1 and r U2 is extracted. 2.r i = x i r1 and r2 are extracted from R1 mod n. i are those Ui It is checked whether it matches (Step A). 3. Using the IECPAC algorithm described above, R1+R3=R X3 (Step B). 4. X3 is hash(x X3 ), where x X3 =[R X3 ] x It is. 5. Candidate Merkle Proofs<Merkle Proof> and X3 (Step C). 6. The candidate Merkle root is checked to see if it is equal to the target Merkle root provided in the locking script (Step D). 7. The two signatures are independently verified.
[0228] X U3 The value x used to calculate X3 is included in the unlocking script, R X3 Extracted from.
[0229] In general, where M>2, a locking script contains M OP_CHECKSIG opcodes, M Extract_r opcode strings, (M-1) IECPAC strings, and a single Merkle root derivation opcode string.
[0230] The unlocking script consists of M signatures and public keys, and (M-1) gradient values <λ1>…<λ M-1 > and M EC points, (M-2) intermediate EC points, and EC point R Xj , i.e. the sum of all M points for running IECPAC, and a single Merkle proof.
[0231] Single signature per group To reduce the length of both the locking and unlocking scripts, and subsequently the execution time, the method of FIG. 9 can be adapted so that each group of users shares a single signature.
[0232] In this case, each of the N-choose-M groups selects a single R puzzle to represent the group. IECPAC is used to prove to an outside observer that the provided signatures were generated from multiple users. This embodiment assumes a high level of trust between the members of each group, since any group member can provide a signature and modify the transaction.
[0233] Figure 10 shows one exemplary implementation of the single signature embodiment using IECPAC. As mentioned above, in a 2-of-4 system, there are four individual users, each of whom has their own secret value k i It has.
[0234] The Merkle tree is
number
number
[0235] In the example of FIG. 10, there are therefore six leaves, each derived from the sum of the R values of the two users in the signatory group associated with the leaf node.
[0236] The locking script 203D includes the following: 1. A single OP_CHECKSIG opcode, 2. A single Extract_r opcode string, 3. A string opcode to execute IECPAC (M-1) times, 4. A single Merkle root derivation opcode string, and 5. Merkle Root.
[0237] The unlocking script 202D is provided by one of the users in the group, either U1 or U3, and contains the following: 1. Single signature (r X3 ,s X3 ) and the corresponding public key, 2. <λ X3 >Gradient value 3. <r1> 、 <r3>, 4. Merkle Proofs, and 5. R X3
[0238] In general, for any M-of-N group, the unlocking script is: 1. Single signature (r X3 ,s X3 ) and the corresponding public key, 2. <λ1>…<λ M-1 >Gradient value 3. <r1>… <R M >, 4. Merkle Proofs, and 5. R Xi
[0239] signature(r Xi ,s Xi ), all group members must share their secret k i Shared. Xi To compute Xi must be known, where R Xi =k Xi G = (k1 + … + k M )G
[0240] When the locking script 203D is executed together with the unlocking script 202D, the following steps are performed. 1.r X3 is extracted from the signature, and [R X3 ]x mod n= r X3 (Step A). 2. R U1 , R U3 Using the above IECPAC with the gradient λ, R U1 +R U3 =R X3 (Step B). 3. X3 = hash(x Xi3 ) is used to calculate X3. 4.<Merkle Proof> From X and X3, a candidate Merkle root is computed (Step C). 5. The candidate Merkle root is checked for equality with the target Merkle root provided to the locking script (Step D). 6. The signature is verified.
[0241] In a more general M-of-N embodiment, step 1 above uses all (M-1) gradients and M R values provided in the unlocking script, the IEPAC method is run (M-1) times, and (M-2) intermediate EC points are included.
[0242] Value X i is extracted from the group signature as described above. Xi Alternatively, the value X i is a group (R Ui ) can be calculated using the R value provided in the unlocking script corresponding to each individual user, i.e., X3=hash([R U1 +R U3 ] x ).
[0243] Whether the single group signature or multiple individual signature embodiment is used, the complexity of IECPAC grows linearly with M.
[0244] PATH CHOICE In the above example, the Merkle root is provided in the locking script, and any user can provide an unlocking script if they know k and the Merkle proof, where k=k1+k2+...+k M It is.
[0245] To limit the users who can provide an unlocking script, the creator of the locking script may instead provide a node of a Merkle tree in the locking script, in this way only the user whose r value is used to generate the leaf nodes located below that node in the Merkle tree may be the creator of the unlocking script.
[0246] 11A-11C show a Merkle tree containing eight leaf nodes, where each Xi is a Hash(r i ), i.e., each node corresponds to a single user. Each of these figures shows a path traversed along the Merkle tree from a leaf node derived from the r portion extracted from the unlocking script, to the Merkle tree portion provided in the locking script, as indicated by the dashed lines.
[0247] In each embodiment, user 3 corresponding to X3 provides an unlocking script, as described above, that includes r3 in its signature.
[0248] Figure 11A shows an example where a locking script contains a Merkle root Root such that any of the eight users can unlock the locking script, where the Merkle proof contains X4, Y1, and Z2.
[0249] The following locking script can be unlocked by any of {U1, ..., U8}.
number
[0250] Instead, for example, as shown in FIG. 11B, if the locking script includes Z1, then only users 1-4 can unlock the locking script. The Merkle proof portion provided in the unlocking script is one level shorter in the Merkle tree than if the locking script included the root. That is, the Merkle proof portion of the unlocking script is a binary <z2><1> Just shorter.
[0251] In this case the locking script would look like this:
number
[0252] As a result, users {U1,...,U4} can provide unlocking scripts.
[0253] The creator of the transaction can further limit the possible script unlockers to two, for example by inserting Y2 in the locking script as shown in Figure 11C, where only users 3 and 4 can unlock the transaction.
[0254] In this case, the locking script can take the following form:
number
[0255] Note that the [Merkle Root Derivation] in the first locking script derives the root from a 3-point Merkle proof, while the [Merkle Root Derivation] in the second and third locking scripts require 2-point and 1-point Merkle proofs, respectively. The number of points refers to the number of node values provided in the Merkle proof portion of the unlocking script that are used to compute a candidate Merkle proof.
[0256] The locking script of any of the above embodiments may be modified to provide a node of the Merkle tree rather than the Merkle root, and thus define a subset of users or groups of users for which unlocking scripts can be created.
[0257] CONCLUSION Other variations or use cases of the disclosed techniques may become apparent to those of ordinary skill in the art once given the disclosure herein. The scope of the disclosure is not limited by the described embodiments, but only by the appended claims.
[0258] For example, some embodiments above have been described with respect to the Bitcoin network 106, the Bitcoin blockchain 150, and the Bitcoin nodes 104. However, it will be understood that the Bitcoin blockchain is one particular example of the blockchain 150, and the above description may generally apply to any blockchain. That is, the present invention is not limited to the Bitcoin blockchain. More generally, any references above to the Bitcoin network 106, the Bitcoin blockchain 150, and the Bitcoin nodes 104 may be replaced with references to the blockchain network 106, the blockchain 150, and the blockchain nodes 104, respectively. The blockchains, blockchain networks, and / or blockchain nodes may share some or all of the described characteristics of the Bitcoin blockchain 150, the Bitcoin network 106, and the Bitcoin nodes 104, as described above.
[0259] In a preferred embodiment of the present invention, the blockchain network 106 is the Bitcoin network, and the Bitcoin nodes 104 perform at least all of the described functions of creating, issuing, propagating, and storing blocks 151 in the blockchain 150. It is not excluded that there may be other network entities (or network elements) that perform only one or some, but not all, of these functions. That is, a network entity may perform the function of propagating and / or storing blocks without creating and issuing blocks (recall that these entities are not considered to be preferred Bitcoin network 106 nodes).
[0260] In other embodiments of the invention, the blockchain network 106 may not be the Bitcoin network. In these embodiments, it is not excluded that a node may perform at least one or some, but not all, of the functions of creating, issuing, propagating, and storing blocks 151 of the blockchain 150. For example, in these other blockchain networks, a "node" may be used to refer to a network entity that is configured to create and issue blocks 151 but not store and / or propagate those blocks 151 to other nodes.
[0261] Moreover, more generally, any reference above to the term “bitcoin node” 104 may be replaced with the term “network entity” or “network element,” where such entity / element is configured to perform some or all of the roles of creating, issuing, propagating, and storing blocks. The functionality of such network entities / elements may be implemented in hardware in the same manner as described above with reference to blockchain nodes 104.
[0262] It will be understood that the above embodiments have been described by way of example only. More generally, a method, an apparatus, or a program may be provided according to any one or more of the following statements:
[0263] Statement 1. According to a first aspect, there is provided a computer-implemented method of generating a blockchain transaction, in which each of a plurality of second parties has a respective secret number k from which a respective r portion can be derived, and a Merkle tree is defined, at least one leaf node of the Merkle tree being based on at least one of the respective r portions. wherein the method is performed by a first party; and generating a first blockchain transaction, the first blockchain transaction including a first locking script that includes a target Merkle tree portion that corresponds to the Merkle tree; The first locking script, when executed together with a first unlocking script of a second blockchain transaction, Extracting the r portion from the first unlocking script; generating a hash value derived from the extracted r portion; Computing a candidate Merkle tree portion based on the generated hash and a Merkle proof portion of the first unlocking script; verifying that the computed candidate Merkle tree portion matches the target Merkle tree portion; verifying a signature portion of the first unlocking script based on a public key of the first unlocking script; making the first blockchain transaction available to one or more nodes of a blockchain network.
[0264] Statement 2. The r portion is extracted from an Elliptic Curve Digital Signature Algorithm (ECDSA) signature of the signature portion of the first unlocking script, the r portion being the r portion of the ECDSA signature. An embodiment of the method according to statement 1.
[0265] Statement 3. Each leaf node of the Merkle tree is a hash of a combination of r portions, where the first locking script is configured to extract r portions from the first unlocking script and combine the r portions, and the hash value is a hash of the combined r portions. An embodiment according to the method described in statement 2.
[0266] Statement 4. The r portions are combined using one of addition and concatenation. An embodiment according to the method described in statement 3.
[0267] Statement 5. The at least one leaf node of the Merkle tree is a hash of a sum of multiple r parts, where the first locking script: extracting a plurality of r portions from the first unlocking script, each of the plurality of r portions corresponding to one of a plurality of parties; Calculate the sum of the extracted r portions; extracting an r-part sum from the first unlocking script, the r-part sum being a sum of the plurality of r parts; and verifying the extracted r portions based on the calculated sum of the extracted r portions and the extracted r portion sum; the plurality of r portions and the r portion sum are elliptic curve points; An embodiment of the method according to statement 1.
[0268] Statement 6. The hash value is the calculated sum of the extracted r portions and a hash of one of the extracted r portion sums. An embodiment according to the method described in statement 5.
[0269] Statement 7. The first locking script further comprises: Extracting one or more gradient values from the first unlocking script; verifying, based on the extracted one or more gradient values and the extracted plurality of r portions, that each of the extracted one or more gradient values is equal to a gradient between two of the extracted plurality of r portions. An embodiment according to the method according to statement 5 or statement 6.
[0270] Statement 8. The number of the gradient values is less than the number of the extracted r portions corresponding to one of the secret numbers k. An embodiment according to the method described in statement 7.
[0271] Statement 9. The first locking script is configured to verify each of a plurality of signature portions of the first unlocking script, each of the plurality of signature portions being provided with a corresponding public key, and the verification of each of the plurality of signature portions is based on the provided corresponding public key. An embodiment of the method according to any of statements 3 to 8.
[0272] Statement 10. The corresponding public key is provided in the first unlocking script. An embodiment according to the method described in statement 9.
[0273] Statement 11. The r-part sum is extracted from a signature portion of the unlocking script. An embodiment of the method according to any of statements 5 to 8.
[0274] Statement 12. The at least one leaf node of the Merkle tree is a hash of a combination of multiple r portions, and the extracted r portion is equal to the combination of the multiple r portions of the leaf node corresponding to the Merkle tree portion of the first locking script. An embodiment according to the method described in statement 1 or statement 2.
[0275] Statement 13. A Merkle tree part is the Merkle root of said Merkle tree. An embodiment of the method according to statement 1.
[0276] Statement 14. A Merkle tree part is a node of the Merkle tree other than the Merkle root. An embodiment of the method according to any of statements 1 to 10.
[0277] Statement 15. The r portion is an elliptic curve point. An embodiment of the method according to any one of statements 1 or 5 to 14.
[0278] Statement 16. According to a second embodiment, there is provided a computer-implemented method of generating a blockchain transaction, in which each of a plurality of second parties has a secret number k from which r portions can be derived, a Merkle tree is defined, at least one leaf node of the Merkle tree is based on at least one of the respective r portions, and a first blockchain transaction includes a target Merkle tree portion corresponding to the Merkle tree; a first locking script, when executed with a first unlocking script of a second lock transaction, is configured to: extract an r portion from the first unlocking script; generate a hash value derived from the extracted r portion; compute a candidate Merkle tree portion based on the generated hash and a Merkle proof portion of the first unlocking script; verify that the computed candidate Merkle tree portion matches the target Merkle tree portion of the first locking script; and verify a signature portion of the first unlocking script based on a public key of the first unlocking script, wherein: the method being performed by at least one of the second parties; and generating a second blockchain transaction, the second blockchain transaction including an input referencing the first locking script and the first unlocking script of the first blockchain transaction, the first unlocking script including the Merkle proof portion, the signature portion, and the public key; Making the second blockchain transaction available to one or more nodes of a blockchain network.
[0279] Statement 17. The signature portion includes an Elliptic Curve Digital Signature Algorithm (ECDSA) signature of the signature portion of the first unlocking script; the r portion is the r portion of the ECDSA signature; An embodiment according to the method described in statement 16.
[0280] Statement 18. The r portion is a combination of multiple r portions derived from the secret numbers k of the multiple second parties. An embodiment according to the method described in statement 17.
[0281] Statement 19. The first unlocking script further comprises the r portion. An embodiment according to the method described in statement 16.
[0282] Statement 20. The first unlocking script further includes one or more gradient values, the first unlocking script being configured to extract the one or more gradient values from the first unlocking script, and verify, based on the extracted one or more gradient values and the plurality of r portions extracted from the first unlocking script, that each of the extracted one or more gradient values is equal to a gradient between two of the extracted plurality of r portions. An embodiment of the method according to any of statements 15 to 18.
[0283] Statement 21. The first unlocking script includes a number of gradient values extracted from the unlocking script and less than the number of r portions corresponding to one of the plurality of secret numbers k. An embodiment according to the method described in statement 20.
[0284] Statement 22. The r portion is derived from a public key corresponding to the secret number. An embodiment of the method according to any one of statements 1 to 21.
[0285] Statement 23. According to a third aspect, there is provided a computer apparatus, the apparatus comprising: a memory comprising one or more memory units; a processing device comprising one or more processing units, The memory stores code configured to be executed on the processing device, the code being configured, when executed, to cause the processing device to perform a method as described in any of statements 1 to 22.
[0286] Statement 24. According to a fourth aspect, there is provided a computer program stored in a computer readable storage device and configured, when executed on one or more processors, to perform the method according to any of statements 1 to 22. < / r1> < / pk1> < / pk> < / sig> < / pk> < / sig> < / y2> < / z2> < / sig2> < / pk1> < / sig1> < / pk> < / sig> < / pk> < / sig> < / pk> < / sig> < / y4> < / z1> < / pk> < / sig> < / pk> < / sig> < / pk> < / pk> < / sig>
Claims
1. 1. A computer-implemented method for generating blockchain transactions, comprising: each of the plurality of second parties has a respective secret number k from which a respective r portion can be derived; Merkle trees are defined, at least one leaf node of the Merkle tree is based on at least one of the respective r-parts; The method is performed by a first party; and generating a first blockchain transaction; the first blockchain transaction includes a first locking script that includes a target Merkle tree portion that corresponds to the Merkle tree; The first locking script, when executed together with a first unlocking script of a second blockchain transaction, Extracting the r portion from the first unlocking script; generating a hash value derived from the extracted r portion; Computing a candidate Merkle tree portion based on the generated hash and a Merkle proof portion of the first unlocking script; verifying that the computed candidate Merkle tree portion matches the target Merkle tree portion; verifying a signature portion of the first unlocking script based on a public key of the first unlocking script; It is configured as follows: Steps and making the first blockchain transaction available to one or more nodes of a blockchain network; A method comprising:
2. the r portion is extracted from an Elliptic Curve Digital Signature Algorithm (ECDSA) signature of the signature portion of the first unlocking script; the r portion being the r portion of the ECDSA signature; The method of claim 1.
3. Each leaf node of the Merkle tree is a hash of a combination of multiple r parts, the first locking script is configured to extract a plurality of r parts from the first unlocking script and combine the plurality of r parts; the hash value is a hash of the combined r portions; The method of claim 2.
4. the r moieties are combined using one of addition and linkage; The method according to claim 3.
5. the at least one leaf node of the Merkle tree is a hash of a sum of multiple r parts; The first locking script comprises: extracting a plurality of r portions from the first unlocking script, each of the plurality of r portions corresponding to one of a plurality of parties; Calculate the sum of the extracted r portions; extracting an r-part sum from the first unlocking script, the r-part sum being a sum of the plurality of r parts; verifying the extracted r portions based on the calculated sum of the extracted r portions and the extracted r portion sum; It is structured as follows: the plurality of r parts and the r part sum are elliptic curve points; The method of claim 1.
6. the hash value being the calculated sum of the extracted r portions and a hash of one of the extracted r portion sums; The method according to claim 5.
7. The first locking script further comprises: Extracting one or more gradient values from the first unlocking script; verifying, based on the extracted one or more gradient values and the extracted plurality of r portions, that each of the extracted one or more gradient values is equal to a gradient between two of the extracted plurality of r portions; The method of claim 5 , wherein the method is configured as follows:
8. the number of said gradient values being less than the number of extracted r portions corresponding to one of said secret numbers k; The method according to claim 7.
9. the first locking script is configured to verify each of a plurality of signature portions of the first unlocking script; Each of the plurality of signature portions is provided using a corresponding public key; the verification of each of the plurality of signature portions is based on the provided corresponding public key. The method according to claim 3.
10. the corresponding public key is provided in the first unlocking script; 10. The method of claim 9.
11. The r-part sum is extracted from a signature portion of the first unlocking script. The method according to claim 5.
12. the at least one leaf node of the Merkle tree is a hash of a combination of multiple r parts; the extracted r portion is equal to a combination of the r portions of the leaf nodes corresponding to the Merkle tree portions of the first locking script; The method of claim 1.
13. a Merkle tree part is the Merkle root of the Merkle tree; The method of claim 1.
14. A Merkle tree part is a node of the Merkle tree other than the Merkle root. The method of claim 1.
15. The r portion is an elliptic curve point. The method of claim 1.
16. 1. A computer-implemented method for generating blockchain transactions, comprising: Each of the plurality of second parties has a secret number k from which a portion r can be derived; Merkle trees are defined, at least one leaf node of the Merkle tree is based on at least one of the respective r-parts; the first blockchain transaction includes a target Merkle tree portion corresponding to the Merkle tree; The first locking script, when executed together with the first unlocking script of the second locking transaction, Extracting the r portion from the first unlocking script; generating a hash value derived from the extracted r portion; Computing a candidate Merkle tree portion based on the generated hash and a Merkle proof portion of the first unlocking script; verifying that the computed candidate Merkle tree portion matches the target Merkle tree portion of the first locking script; verifying a signature portion of the first unlocking script based on a public key of the first unlocking script; It is structured as follows: The method is performed by at least one of the second parties; and generating a second blockchain transaction; the second blockchain transaction includes an input that references the first locking script and the first unlocking script of the first blockchain transaction; the first unlocking script includes the Merkle proof portion, the signature portion, and the public key; Steps and making the second blockchain transaction available to one or more nodes of a blockchain network; A method comprising:
17. the signature portion includes an Elliptic Curve Digital Signature Algorithm (ECDSA) signature of the signature portion of the first unlocking script; the r portion being the r portion of the ECDSA signature; 17. The method of claim 16.
18. the r portion being a combination of multiple r portions derived from the secret numbers k of the multiple second parties; 20. The method of claim 17.
19. the first unlocking script further comprises the r portion; 17. The method of claim 16.
20. the first unlocking script further comprises one or more gradient values; The first unlocking script comprises: Extracting the one or more gradient values from the first unlocking script; and verifying, based on the extracted one or more gradient values and a plurality of r portions extracted from the first unlocking script, that each of the extracted one or more gradient values is equal to a gradient between two of the extracted plurality of r portions; It is configured as follows:
17. The method of claim 16.
21. the first unlocking script is extracted from the unlocking script and includes a number of gradient values less than a number of r portions corresponding to one of the plurality of secret numbers k; 21. The method of claim 20.
22. the r portion is derived from a public key corresponding to the secret number; The method of claim 1.
23. 1. A computing device comprising: a memory comprising one or more memory units; a processing device comprising one or more processing units, the memory storing code configured to be executed on the processor; The code, when executed, is configured to cause the processing device to perform the method of any one of claims 1 to 22. Computer equipment.
24. A computer program comprising: stored in a computer readable storage device; and When executed on one or more processors, the method is adapted to perform the method according to any one of claims 1 to 22. Computer program.
