Blockchain nodes and methods for high-volume transaction processing
By using Merkle trees to process and propagate transaction identifiers, the method addresses the challenge of high transaction volumes in blockchain networks, enhancing their efficiency and throughput.
Patent Information
- Application Number
- JP2026527010
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-02
- Filing Date
- 2024-10-15
- Publication Date
- 2026-11-20
AI Technical Summary
Managing high volumes of transactions in blockchain networks is challenging, particularly in systems like Mastercard or Visa's payment networks, which require solutions that can handle thousands of transactions per second.
Implementing a method that involves appending transaction identifiers to an array, determining a summary value, and propagating this data to other nodes in the blockchain network, using Merkle trees to optimize transaction processing and improve throughput.
Enhances the ability of blockchain networks to manage large transaction volumes by optimizing transaction processing and improving network efficiency.
Smart Images

Figure 2026539192000001_ABST
Abstract
Description
[Technical Field]
[0001] This disclosure relates to blockchain networks, and more particularly to methods and devices for storing and retrieving Merkle tree data. [Background technology]
[0002] A blockchain is a form of decentralized data structure in which copies of the blockchain are maintained on each of several nodes within a decentralized peer-to-peer (P2P) network (hereinafter referred to as the "blockchain network") and are widely publicized. A blockchain is formed from a chain of data blocks, each containing one or more transactions. Each transaction, other than a so-called "coinbase transaction," refers to a preceding transaction in a sequence that may span one or more blocks and one or more coinbase transactions. Coinbase transactions are explained below. Transactions submitted to the blockchain network are included in a new block. New blocks are created by a process often called "mining," which involves each of several nodes competing to perform "proof-of-work," that is, solving a cryptographic puzzle based on a defined set of ordered and validated pending transactions waiting to be included in a new block of the blockchain. Note that blockchains can be pruned at nodes, and block publication can be achieved simply by publishing the block header.
[0003] Transactions within a blockchain are used to perform one or more of the following: transferring digital assets (i.e., a certain number of digital tokens), ordering a set of journal entries in a virtual ledger or registry, receiving and processing timestamp entries, and / or chronologically arranging index pointers. Blockchains can also be leveraged to overlay additional functionality on top of them. Blockchain protocols can enable the storage of additional user data or indices to data within transactions. There are no predetermined limits on the maximum amount of data that can be stored within a single transaction, and therefore more complex data can be incorporated. For example, this can be used to store electronic documents or audio or video data on a blockchain.
[0004] Nodes in a blockchain network (often called "miners") perform a decentralized transaction registration and verification process, which is described in detail below. In short, during this process, nodes validate transactions and insert them into block templates that attempt 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, allowing each node to record the new block on the blockchain. To have a transaction recorded on the blockchain, a user (e.g., a blockchain client application) sends the transaction to one of the nodes in the network to propagate it. The node that receives the transaction can then compete to find a proof-of-work solution that incorporates the validated transaction into a new block. Each node is configured to enforce the same node protocol, which includes one or more conditions for a transaction to be valid. Invalid transactions are neither propagated nor incorporated into blocks. Assuming a transaction is validated and accepted onto the blockchain, the transaction (including any user data) remains registered and indexed at each node in the blockchain network as an immutable public record.
[0005] Nodes that successfully solve the proof-of-work puzzle and create the latest block are typically rewarded with a new transaction called a "coinbase transaction," which distributes a certain amount of digital assets, i.e., a certain number of tokens. The detection and rejection of invalid transactions is enforced by the actions of competing nodes, which act as agents of the network and are incentivized to report and block fraud. Extensive disclosure of information allows users to continuously audit the performance of nodes. By simply publishing block headers, participants can ensure the continued integrity of the blockchain.
[0006] In an "output-based" model (sometimes called a UTXO-based model), the data structure of a given transaction includes one or more inputs and one or more outputs. Any available output includes an element specifying the amount of digital assets that can be derived from the preceding sequence of the transaction. Available outputs are sometimes called UTXOs ("unused transaction outputs"). Outputs may further include lock scripts that specify the conditions for redeeming the output in the future. A lock 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) includes a pointer (i.e., a reference) to such an output in a preceding transaction and may further include an unlock script to unlock the lock script of the pointed-to output. A pair of transactions may be labeled as a first and second transaction (or "target" transaction). The first transaction includes at least one output that specifies the amount of digital assets and has a lock script that defines one or more conditions for unlocking the output. The second target transaction has at least one input which includes a pointer to the output of the first transaction and a lock release 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, propagated, and recorded on the blockchain, one of the validity criteria applied at each node is that the unlock script satisfies all of one or more conditions defined in the lock script of the first transaction. Another is that the output of the first transaction has not yet been redeemed by another valid transaction. A node that discovers a target transaction is invalid according to any of these conditions will neither propagate it (as a valid transaction, but potentially propagate it to register an invalid transaction) nor include it in a new block to be recorded on the blockchain.
[0008] Another type of transaction model is the account-based model. In this case, each transaction defines the amount to be transferred by referencing the absolute account balance, rather than by referencing the UTXO of a preceding transaction in a sequence of past transactions. The current state of all accounts is stored and constantly updated by nodes, separate from the blockchain.
[0009] As blockchain technology is applied to an increasing number of transactions, managing the volume of transactions becomes more challenging. For example, common credit card payment networks, such as Mastercard or Visa's payment networks, typically handle thousands of transactions per second collectively. Having a solution that allows blockchain networks to manage a similar level of throughput could be advantageous. [Brief explanation of the drawing]
[0010] Here, as an example, we refer to the accompanying drawings illustrating exemplary embodiments of the present application. [Figure 1]shows an exemplary system for implementing a blockchain. [Figure 2] shows an exemplary transaction protocol. [Figure 3A] shows an exemplary implementation of a client application. [Figure 3B] shows an example of a user interface for a client application. [Figure 4] shows exemplary node software for a blockchain node. [Figure 5A] shows an example of a Merkle tree. [Figure 5B] shows an example of a "partial" Merkle tree. [Figure 6] shows an example of a Merkle path. [Figure 7] schematically depicts a simplified exemplary blockchain node for processing a large number of blockchain transactions. [Figure 8] shows an exemplary method for transaction processing at a blockchain node in flowchart form. [Figure 9] shows an exemplary method for managing unconfirmed transactions when a proof-of-work solution is found, in flowchart form. [Figure 10] shows an example of a simplified Merkle tree of a first array.
[0011] In the drawings, like reference numerals are used to designate like elements and features. [Mode for Carrying Out the Invention]
[0012] In one embodiment, a computer implementation method for processing blockchain transactions on a node may be provided, which may include the steps of: appending the transaction identifiers of validated transactions to an array as an ordered list of transaction identifiers; and determining that the array has reached its maximum size. The method may in turn include the steps of: determining an array summary value of the ordered list of transaction identifiers; adding the ordered list of transaction identifiers to a candidate block containing previously completed ordered lists of transaction identifiers to form a unified ordered list of transaction identifiers; determining a top-level summary value of the unified ordered list of transaction identifiers using the array summary value and the array summary values of the previously completed ordered lists of transaction identifiers; modifying the block header of the candidate block to include the top-level summary value; and propagating the array to several other nodes on the blockchain network.
[0013] In some implementations, the method may further include the step of providing candidate block header data to one or more mining units for proof-of-work search in response to determining that the array has reached its maximum size. In some cases, each of the one or more mining units receives the partially completed block header and array summary value and performs the operations of determining the top-level summary value and modifying the block header to include the top-level summary value.
[0014] In some implementations, the method further includes the steps of initializing a new array to contain a new ordered list of transaction identifiers for transactions subsequently received and validated, in response to determining that the array has reached its maximum size, and appending the new ordered list of transaction identifiers to the unified ordered list of transaction identifiers when the new array reaches its maximum size.
[0015] In some implementations, the step of determining that the array has reached its maximum size includes the step of determining that the transaction count has reached its maximum count, and optionally the maximum count is 2 n This is a number of transactions, where n is an integer.
[0016] In some implementations, the method may further include the steps of receiving a block solution containing coinbase transactions and resolved block headers from a mining unit on a node, propagating the block solution to other nodes on the blockchain network, and initializing a new, empty first array.
[0017] In some implementations, the method may further include the steps of receiving a block solution from another node on the blockchain network, validating the block solution, comparing transaction identifiers from the block solution with transaction identifiers in a unified ordered list of transaction identifiers in response to the validation of the block solution, removing matching transaction identifiers from the unified ordered list of transaction identifiers, and initializing a new first array containing the remaining mismatched transactions in the unified ordered list of transaction identifiers.
[0018] In some cases, a block solution includes an ordered set of array identifiers and a block header, and the step of validating a block solution includes the step of retrieving array data from memory corresponding to the ordered set of array identifiers, wherein the array data includes previously validated array summary values; the step of determining a block summary value using the previously validated array summary values; and the step of verifying that the determined block summary value is in the block header.
[0019] In some implementations, the method may further include the steps of: constructing a first array, the first array containing placeholder transactions; determining a Merkle path for the placeholder transactions; propagating the first array to several other nodes on the blockchain network, and optionally propagating the Merkle path for the placeholder transactions to several other nodes on the blockchain. In some cases, the method may further include, in a mining unit, replacing the placeholder transactions with coinbase transactions; and determining a first array summary value of the first array using the Merkle path.
[0020] In some implementations, the method may further include the steps of receiving array data from another node on the blockchain network, which includes a first array identifier, a first array containing placeholder transactions, and a Merkle path for the placeholder transactions; validating the Merkle path; and storing the array data in memory in association with the first array identifier.
[0021] In some cases, the method may further include the steps of: receiving a block solution from another node, the block solution including a coinbase transaction and an ordered set of array identifiers including a first array identifier; retrieving a first array and a Merkle path from memory based on the first array identifier; and determining a first array summary value using the coinbase transaction and the Merkle path. In some cases, the block solution includes a block header, and the step of validating the block solution includes the steps of: retrieving array data from memory corresponding to an ordered set of array identifiers, the array data including a previously validated array summary value; determining a block summary value using the first array summary value and the previously validated array summary value; and verifying that the determined block summary value is in the block header.
[0022] In some implementations, the summary value is the Merkle root.
[0023] In another embodiment, a computing device that implements a node on a blockchain may be provided. The computing device may include memory, one or more processors, and computer executable instructions, which, when executed, cause the processors to perform one or more of the methods described herein.
[0024] In yet another embodiment, a computer-readable medium for storing processor-executable instructions may be provided, the processor-executable instructions including instructions that, when executed by one or more processors, cause the processors to perform at least one of the methods described herein.
[0025] Other exemplary embodiments of this disclosure will become apparent to those skilled in the art by considering the following detailed description in conjunction with the drawings.
[0026] In this application, the term "and / or" is intended to cover all possible combinations and subcombinations of the enumerated elements, including any one of the enumerated elements, any subcombination, or all of the elements, but not necessarily excluding additional elements.
[0027] In this application, the expression "at least one of... or..." is intended to cover one or more of the enumerated elements, including only one of the enumerated elements, any subcombination, or all of the elements, but not necessarily excluding any additional elements, nor necessarily requiring all of the elements.
[0028] Overview of the Exemplary System Figure 1 shows an exemplary system 100 for implementing blockchain 150. System 100 may include a packet-switched network 101, which is typically a wide-area internet such as the internet. The packet-switched network 101 may include a plurality of blockchain nodes 104 that can be configured to form a peer-to-peer (P2P) network 106 within the packet-switched network 101. Although not shown, the blockchain nodes 104 may be configured as a nearly complete graph. Thus, each blockchain node 104 is highly connected to other blockchain nodes 104.
[0029] Each blockchain node 104 includes the peer's computer equipment, and different nodes 104 belong to different peers. Each blockchain node 104 comprises one or more processors, which are implemented by other devices such as 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 comprises memory, i.e., computer-readable storage in the form of one or more non-temporary computer-readable media. The memory may comprise one or more memory units employing one or more memory media, such as magnetic media such as hard disks, solid-state drives (SSDs), electronic media such as flash memory or EEPROM, and / or optical media such as optical disc drives.
[0030] Blockchain 150 contains a chain of data blocks 151, and each copy of blockchain 150 is maintained at each of the multiple blockchain nodes 104 within a decentralized or blockchain network 160. As mentioned above, maintaining a copy of blockchain 150 does not necessarily mean completely memorizing blockchain 150. Instead, blockchain 150 can be pruned, as long as each blockchain node 150 remembers the block header (described later) of each block 151. Each block 151 in the chain contains one or more transactions 152, where a 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 has at least one input and at least one output. Each output specifies an amount representing the quantity of a digital asset as a property, an example being user 103, whose output is cryptographically locked (requiring the user's signature or other solution to be unlocked and thereby redeemed or used). Each input points to the output of the preceding transaction 152, thereby linking the transactions.
[0031] Each block 151 also contains a block pointer 155 that points to a previously created block 151 in the chain to define the order of the blocks 151. Each transaction 152 (other than coinbase transactions) has a pointer that goes back to the previous transaction to define the order of the transaction sequence (note: the sequence of transactions 152 can branch). The chain of block 151 goes back to the genesis block (Gb) 153, which was the first block in the chain. One or more original transactions 152 early in chain 150 pointed to the genesis block 153, rather than a preceding transaction.
[0032] Each blockchain node 104 is configured to forward transaction 152 to other blockchain nodes 104, thereby propagating transaction 152 throughout the network 106. Each blockchain node 104 is configured to create block 151 and store each copy of the same blockchain 150 in their respective memory. Each blockchain node 104 also maintains an ordered set 154 of transactions 152 waiting to be incorporated into block 151. This ordered set 154 is often referred to as the “mempool”. In this specification, this term is not intended to be limited to any particular blockchain, protocol, or model. It refers to an ordered set of transactions that a node 104 has accepted as valid, to which the node 104 is obligated not to accept other transactions attempting to use the same output.
[0033] In a given current transaction 152j, its input (or each input) contains a pointer to the output of a preceding transaction 152i in the sequence of transactions, specifying that this output should be redeemed or "used" in the current transaction 152j. Generally, a preceding transaction can be any transaction in an ordered set 154 or any block 151. A preceding transaction 152i must exist and be validated for the current transaction to be valid, but it does not necessarily have to exist when the current transaction 152j is created or sent to network 106. Thus, "preceding" as used herein refers to something preceding in a logical sequence linked by a pointer, and not necessarily to a time in a time sequence, and therefore does not necessarily exclude the creation or transmission of transactions 152i, 152j from being created or sent out of order (see the following explanation of orphan transactions). A preceding transaction 152i is also called an antecedent transaction or predecessor transaction.
[0034] The input to the current transaction 152j also includes input authorization, for example, the signature of user 103a whose output of the preceding transaction 152i is locked. The output of the current transaction 152j can then be cryptographically locked to a new user or entity 103b. Thus, the current transaction 152j can transfer the amount defined in the input of the preceding transaction 152i to the new user or entity 103b, as defined in the output of the current transaction 152j. In some cases, transaction 152j may have multiple outputs to divide the input amount among multiple users or entities (one of which may be the original user or entity 103a to give the remainder (change)). In some cases, a transaction may also have multiple inputs to aggregate amounts from multiple outputs of one or more preceding transactions and redistribute them to one or more outputs of the current transaction.
[0035] According to output-based transaction protocols such as Bitcoin, when an entity 103, such as a user or machine, wishes to complete a new transaction 152j, the entity sends the new transaction from its computer terminal 102 to a recipient. The entity or recipient then sends this transaction to one or more blockchain nodes 104 on the network 106 (which are currently typically servers or data centers, but in principle may also be other user terminals). The entity 103 completing the new transaction 152j sends the transaction to one or more blockchain nodes 104, and in some examples, it is not excluded that it does not send it to a recipient. The blockchain node 104 receiving the transaction checks whether the transaction is valid according to the blockchain node protocol applicable to each blockchain node 104. The blockchain node protocol typically requires the blockchain node 104 to check that the cryptographic signature in the new transaction 152j matches the expected signature that depends on the previous transaction 152i within the ordered sequence of transactions 152. In such an output-based transaction protocol, this may include checking that the cryptographic signature or other authorization of entity 103 included in the input of the new transaction 152j matches a condition defined in the output of the preceding transaction 152i to which the new transaction assigns, the condition typically includes checking that the cryptographic signature or other authorization in the input of the new transaction 152j unlocks the output of the preceding transaction 152i to which the input of the new transaction is linked. The condition may be defined at least in part by a script included in the output of the preceding transaction 152i. Alternatively, it may be fixed simply by the blockchain node protocol alone, or by a combination of these.In any case, if the new transaction 152j is valid, 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 test according to the same blockchain node protocol and forward the new transaction 152j to one or more further nodes 104, and so on. In this way, the new transaction is propagated throughout the network of blockchain nodes 104.
[0036] In an output-based model, the definition of whether a given output (e.g., a UTXO) is allocated is whether it has been validly redeemed by the input of another preceding transaction 152j 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 is allocating or redeeming has not yet been allocated / redeemed by another transaction. In this case as well, if it is not valid, transaction 152j will neither propagate nor be recorded in blockchain 150 (unless it is flagged as invalid and propagated for a warning). This prevents double-spending, where a transactor attempts to allocate the output of the same transaction multiple times. Account-based models, on the other hand, prevent double-spending by maintaining account balances. Again, since transaction order is defined, account balances are always in a single, defined state.
[0037] In addition to validating transactions, blockchain node 104 also competes to be the first to create a block of transactions in a process commonly known as mining, supported by "proof of work." At blockchain node 104, a new transaction is added to an ordered set 154 of valid transactions that have not yet appeared in block 151 recorded on blockchain 150. The blockchain nodes then compete to assemble a new valid block 151 of transaction 152 from the ordered set 154 of transactions 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 set 154 of transactions and hashed, the output of the hash satisfies a predetermined condition. For example, the predetermined condition may be that the output of the hash has a specific predetermined number of leading zeros. Note that this is just one specific type of proof of work puzzle, and does not exclude other types. A property of a hash function is that it has an unpredictable output for its input. Therefore, this search can only be performed by brute force, which consumes a considerable amount of processing resources on each of the 104 blockchain nodes attempting to solve the puzzle.
[0038] The blockchain node 104 that first solves the puzzle publishes it to the network 106, providing its solution as a proof that can later be easily checked by other blockchain nodes 104 in the network (given a solution for a hash, it is easy to check that the output of the hash satisfies the conditions). This first blockchain node 104 propagates the block to a threshold consensus of other nodes that accept this block and thus enforce the protocol rules. The ordered set of transactions 154 is then recorded as a new block 151 in blockchain 150 by each of the blockchain nodes 104. The block pointer 155 is also assigned to a new block 151n that points to a previously created block 151n-1 in the chain. The considerable amount of effort required to create a proof of work solution, for example in the form of a hash, demonstrates the first node 104's intention to follow the rules of the blockchain protocol. Such rules include not accepting a transaction as valid if it assigns the same output as a previously validated transaction, also known as double-use. Once created, block 151 is recognized and maintained at each of the blockchain nodes 104 within the blockchain network 106, and therefore cannot be modified. The block pointer 155 also assigns order to block 151. Transaction 152 is recorded in an ordered block at each blockchain node 104 within the network 106, thus providing an immutable public ledger of transactions.
[0039] It should be noted that different blockchain nodes 104 competing to solve the puzzle at any given time may do so based on different snapshots of an ordered set of yet-to-be-published transactions 154 at any given time, depending on when they began searching for the solution or the order in which the transactions were received. Whoever solves their respective puzzle first defines which transactions 152 will be included in the next new block 151n in what order, and updates the current set of unpublished transactions 154. The blockchain nodes 104 then continue to compete to create a block from the newly defined, unprocessed ordered set of unpublished transactions 154, and so on. There also exists a protocol for resolving any "forks" that may occur when two blockchain nodes 104 solve the puzzle in a very short time and conflicting views of the blockchain propagate between the nodes 104. In short, whichever branch of the fork grows the longest becomes the deterministic blockchain 150. It should be noted that this does not affect the network's users or agents, as the same transactions appear in both forks.
[0040] According to the Bitcoin blockchain (and most other blockchains), a node that successfully constructs a new block 104 is granted the ability to allocate an accepted amount of digital assets in a new special type of transaction that distributes a defined amount of digital assets (as opposed to inter-agent or inter-user transactions that transfer a certain amount of digital assets from one agent or user to another agent or user). This special type of transaction is usually called a "coinbase transaction," but is sometimes called an "initiation transaction." It typically forms the first transaction of a new block 151n. Proof of work indicates the intention of the node constructing the new block to follow protocol rules that will allow this special transaction to be redeemed later. Blockchain protocol rules may require a maturity period, for example, 100 blocks, before this special transaction can be redeemed. Often, a normal (non-generated) transaction 152 also specifies an additional transaction fee in one of its outputs to further reward the blockchain node 104 that created block 151n in which the transaction was published. This fee is usually called a "transaction fee" and is described below.
[0041] Due to the resources involved in transaction validation and publication, typically, at least each of the blockchain nodes 104 takes the form of a server including one or more physical server units, or even an entire data center. However, in principle, any given blockchain node 104 can take the form of a user terminal or a group of user terminals networked together.
[0042] The memory of each blockchain node 104 stores software configured to run on the processing unit of the blockchain node 104 in order to perform one or more of its respective roles and process transactions 152 in accordance with the blockchain node protocol. It will be understood herein that any action attributable to a blockchain node 104 may be performed by software running on the processing unit of the respective computer device. Node software may be implemented in one or more applications at the application layer, or at lower layers such as the operating system layer or protocol layer, or at any combination thereof.
[0043] The computer devices 102 of each of the multiple parties 103 acting as consumer users are also connected to the network 101. These users can interact with the blockchain network but do not participate in the validation, construction, or propagation of transactions and 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 storage entities that store copies of the blockchain 150 (e.g., they obtain a copy of the blockchain from a blockchain node 104).
[0044] 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 called “clients”) can be said to be part of the system including the blockchain network, but these users are not blockchain nodes 104 because they do not perform the role required of blockchain nodes. Instead, each party 103 may interact with the blockchain network 106 and thereby be able to utilize the blockchain 150 by connecting to (i.e., communicating with) the blockchain nodes 106. Two parties 103 and their respective devices 102, namely the first party 103a and its respective computer device 102a, and the second party 103b and its respective computer device 102b, are shown for illustrative purposes. There are many more such parties 103 and their respective computer devices 102 that could participate in the system 100, but for convenience they are not illustrated. Each party 103 may be an individual or an organization. For purely illustrative purposes, the first party 103a is referred to herein as Alice, and the second party 103b as Bob; however, this is not restrictive, and it should be understood that any reference to Alice or Bob herein may be replaced with “the first party” and “the second party,” respectively.
[0045] Each computer device 102 of Party 103 comprises one or more processors, each of which includes, for example, one or more CPUs, GPUs, other accelerator processors, application-specific processors, and / or FPGAs. Each computer device 102 of Party 103 further comprises memory, i.e., computer-readable storage in the form of one or more non-temporary computer-readable media. This memory may comprise one or more memory units employing one or more memory media, for example, magnetic media such as hard disks, electronic media such as SSDs, flash memory or EEPROMs, and / or optical media such as optical disc drives. The memory on each computer device 102 of Party 103 stores software, such as each instance of at least one client application 105 configured to run on the processing unit. It will be understood herein that any action attributable to a given Party 103 may be performed using software running on the processing unit of each computer device 102. Each computer device 102 of Party 103 includes at least one user terminal, for example, a desktop or laptop computer, a tablet, a smartphone, or a wearable device such as a smartwatch. The computer equipment 102 of a given party 103 may also include one or more other networked resources, such as cloud computing resources, accessed via a user terminal.
[0046] The client application 105 may first be provided to the computer equipment 102 of any given party 103 on one or more suitable computer-readable storage media, for example, by downloading from a server, or by being provided on a removable storage device such as a removable SSD, flash memory key, removable EEPROM, removable magnetic disk drive, magnetic floppy disk or tape, optical disk such as a CD or DVD ROM, or removable optical drive.
[0047] The client application 105 has at least a “wallet” function, which has two main functions. One of these is to enable each party 103 to create, authorize (e.g., sign) a transaction 152 and send it to one or more Bitcoin nodes 104, thereby propagating the transaction 152 throughout the network of blockchain nodes 104 and including it in blockchain 150. The other is to report to each party the amount of digital assets that the party currently owns. In an output-based system, this second function includes matching the amounts defined in the outputs of various transactions 152 scattered throughout blockchain 150 belonging to that party.
[0048] Various client functions may be described as being integrated into a given client application 105, but are not necessarily limited to this. Instead, it should be understood that any client function described herein may be implemented, for example, in a set of two or more separate applications that interface via an API or where one is a plug-in to the other. More generally, client functions may be implemented in the application layer, a lower layer such as the operating system, or any combination thereof. The following description will focus on client application 105, but should not be limited to this.
[0049] Each computer device 102 instance of a client application or software 105 is operably coupled to at least one of the blockchain nodes 104 of the network 106. This allows the wallet function of client 105 to send transaction 152 to the network 106. Client 105 can also contact blockchain node 104 to query blockchain 150 for any transaction in which each party 103 is the recipient (or, in an embodiment, blockchain 150 is a public facility that provides trust in transactions through its public visibility, so it can actually inspect the transactions of other parties in blockchain 150). The wallet function on each computer device 102 is configured to formulate and send transaction 152 according to the transaction protocol. As described above, each blockchain node 104 runs software configured to validate transaction 152 according to the blockchain node protocol and forward transaction 152 to propagate them throughout the blockchain network 106. Transaction protocols and node protocols correspond to each other; a given transaction protocol follows (goes with) a given node protocol, and together they implement a given transaction model. The same transaction protocol is used for all 152 transactions in blockchain 150. The same node protocol is used by all 104 nodes in network 106.
[0050] When a given party 103, for example Alice, wishes to send a new transaction 152j to be included in blockchain 150, Alice formulates the new transaction according to the relevant transaction protocol (using the wallet function in Alice's client application 105). Alice then sends transaction 152 from the client application 105 to one or more blockchain nodes 104 to which Alice is connected. For example, this could be the blockchain node 104 best connected to Alice's computer 102. When any given blockchain node 104 receives the new transaction 152j, it 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 for being "valid," examples of which are described in more detail below. In some transaction protocols, the conditions for validation may be configurable on a per-transaction basis by a script included in transaction 152. Alternatively, the conditions may simply be built-in features of the node protocol, or they may be defined by a combination of the script and the node protocol.
[0051] Provided that the newly received transaction 152j passes the tests required to be considered valid (i.e., is "validated"), any blockchain node 104 receiving transaction 152j adds the new validated transaction 152 to the ordered set 154 of transactions maintained at that blockchain node 104. Furthermore, any blockchain node 104 receiving transaction 152j propagates the validated transaction 152 to one or more other blockchain nodes 104 in the network 106. Since each blockchain node 104 applies the same protocol, assuming transaction 152j is valid, this means it will propagate immediately throughout the network 106.
[0052] Once an ordered set of transactions 154 maintained on a given blockchain node 104 is approved, that blockchain node 104 begins to compete to solve a proof-of-work puzzle against the latest version of each ordered set of transactions 154, including the new transaction 152. (It should be noted that other blockchain nodes 104 may be attempting to solve the puzzle based on different ordered sets of transactions 154, but the first node to solve it will define the ordered set of transactions included in the latest block 151. Ultimately, blockchain node 104 will solve the puzzle for a portion of ordered set 154 that includes Alice's transaction 152j.) Once proof-of-work is performed on ordered set 154 that includes the new transaction 152j, it immutably becomes part of one of the blocks 151 in blockchain 150. The order of transactions is also immutably recorded, as each transaction 152 contains a pointer back to the previous transaction.
[0053] Different blockchain nodes 104 may initially receive different instances of a given transaction, and therefore have conflicting views on which instance is "valid" until 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 another instance is recorded in blockchain 150, that blockchain node 104 must accept this and discard the first instance it accepted (i.e., the one not published in block 151) (i.e., treat it as invalid).
[0054] Alternative transaction protocols operated by several blockchain networks can be called “account-based” protocols as part of an account-based transaction model. In the account-based case, each transaction defines the amount to be transferred by referencing the absolute account balance, rather than by referencing the UTXO of a preceding transaction in a sequence of past transactions. The current state of all accounts is stored and constantly updated by the network's nodes, separate from the blockchain. In such a system, transactions are ordered using the account’s running transaction tally (also called “position”). This value is signed by the sender as part of its cryptographic signature and hashed as part of the transaction reference calculation. In addition, an optional data field in a transaction may also be signed. This data field may point to a previous transaction, for example, if the previous transaction ID is included in the data field.
[0055] UTXO-based model Figure 2 shows an exemplary transaction protocol, which is an example of a UTXO-based protocol. A transaction 152 (abbreviated as "Tx") is the basic data structure of blockchain 150 (each block 151 contains one or more transactions 152). The following discussion will refer to output-based or "UTXO"-based protocols. However, this is not limited to all possible embodiments. While the exemplary UTXO-based protocol is described with reference to Bitcoin, it should be noted that it can be equally implemented on other exemplary blockchain networks.
[0056] In a UTXO-based model, each transaction ("Tx") 152 is a data structure having one or more inputs 202 and one or more outputs 203. Each output 203 may contain an unused transaction output (UTXO), which can be used as the source for the input 202 of another new transaction (if the UTXO has not yet been redeemed). The UTXO contains a value that specifies the amount of the digital asset, which represents the number of tokens set on the distributed ledger. The UTXO may also contain the transaction ID of the transaction from which it originates, among other information. The transaction data structure may also contain a header 201 which may contain an indicator showing the size of the input field(s) 202 and the output field(s) 203. The header 201 may also contain the ID of the transaction. In some embodiments, the transaction ID is a hash of the transaction data (excluding the transaction ID itself) and is stored in the header 201 of the raw transaction 152 submitted to node 104.
[0057] Suppose Alice 103a wants to create transaction 152j to transfer the amount of the digital asset to Bob 103b. In Figure 2, Alice's new transaction 152j is labeled "Tx1". This takes the amount of the digital asset locked in Alice in output 203 of the preceding transaction 152i in the sequence and transfers at least a portion of it to Bob. The preceding transaction 152i is labeled "Tx0" in Figure 2. Tx0 and Tx1 are merely arbitrary labels. They do not necessarily mean that Tx0 is the first transaction in blockchain 151, or that Tx1 is the next transaction in pool 154. Tx1 could point to any preceding (i.e., earlier) transaction that still has the unused output 203 locked in Alice.
[0058] The preceding transaction Tx0 may already be validated and included in block 151 of blockchain 150 by the time Alice creates the new transaction Tx1, or at least by the time Alice sends it to network 106. It may already be included in one of the blocks 151 at that point, or it may still be waiting in ordered set 154, in this case it will immediately be included in the new block 151. Alternatively, Tx0 and Tx1 could be created and sent together to network 106, or Tx0 could even be sent after Tx1 if the node protocol allows buffering of “orphan” transactions. As used herein in the context of transaction sequences, the terms “preceding” and “following” refer to the order of transactions in a sequence defined by transaction pointers specified within the transactions (such as which transaction points to which other transactions). These can similarly be replaced with “predecessor” and “successor,” or “antecedent” and “descendant,” “parent” and “child,” etc. This does not necessarily imply the order of their creation, transmission to network 106, or arrival at any given blockchain node 104. Nevertheless, a subsequent transaction (a later transaction or “child”) pointing to a preceding transaction (a earlier transaction or “parent”) will not be validated unless the parent transaction is validated. A child that arrives at blockchain node 104 before its parent is considered an orphan. It may be buffered for a certain amount of time to wait for its parent or discarded, depending on the node protocol and / or node behavior.
[0059] One of the one or more outputs 203 of the preceding transaction Tx0 is a specific UTXO, labeled herein as UTXO0. Each UTXO includes a value specifying the amount of the digital asset represented by the UTXO, and a lock script, which defines the conditions that the unlock script in the input 202 of the subsequent transaction must satisfy in order for the subsequent transaction to be validated and thus the UTXO to be successfully redeemed. Typically, the lock script locks that amount to a specific party (the beneficiary of the transaction in which it is contained). That is, the lock script typically defines unlock conditions that include the condition that the unlock script in the input of the subsequent transaction contains the cryptographic signature of the party to whom the preceding transaction is locked.
[0060] The lock script (commonly known as 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" (uppercase S), used by blockchain networks. The lock script specifies what information is needed to use transaction output 203, for example, the need for Alice's signature. The unlock script appears in the transaction output. The unlock script (commonly known as scriptSig) is a piece of code written in a domain-specific language that provides the information needed to satisfy the lock script criteria. For example, it may include Bob's signature. The unlock script appears in transaction input 202.
[0061] In other words, in the illustrated example, the UTXO0 in output 203 of Tx0 is redeemed (more precisely, for subsequent transactions attempting to redeem the UTXO0 to be valid) by Alice's signature Sig P A Lock script that requires [Checksig P A ] includes. [Checksig P A ] is the public key P of Alice's public key-private key pair.A , i.e., a hash. The input 202 of Tx1 includes a pointer pointing to Tx0 (e.g., by its transaction ID, TxID0, which in some embodiments is the hash of the entire transaction Tx0). The input 202 of Tx1 includes an index that identifies UTXO0 in Tx0, so as to distinguish UTXO0 from any other possible outputs of Tx0. The input 202 of Tx1 has an unlocking script with Alice's cryptographic signature, which is created by Alice applying her private key of the key pair to a predetermined part of the data (sometimes referred to as a "message" in cryptography) <Sig P A >. The data (or "message") that needs to be signed by Alice to provide a valid signature may be defined by the lock script, or by the node protocol, or by a combination thereof.
[0062] When the new transaction Tx1 arrives at the blockchain node 104, the node applies the node protocol. This may include executing the lock script and the unlocking script together to check whether the unlocking script satisfies the condition (which may include one or more criteria) defined in the lock script. In some embodiments, this may include concatenating the two scripts. <Sig P A ><P A >||[Checksig P A
[0063] Here, "||" represents concatenation, "<...>" means putting data onto the stack, and "[...]" is a function executed by the lock script (stack-based language in this example). Equivalently, rather than concatenating the scripts, the scripts may be executed one after another using a common stack. In any case, when executed together, the scripts process Alice's public key P contained in the lock script in the output of Tx0 A The unlock script in the input of Tx1 authenticates that it contains Alice's signature to sign the expected portion of the data. For this authentication to work, the expected portion of the data itself ("message") must also be included. In this embodiment, the data to be signed includes the entirety of Tx1 (i.e., a separate element specifying the signed portion of the plaintext data does not need to be included, as it already essentially exists).
[0064] The details of authentication using public-secret cryptography are well known to those skilled in the art. Essentially, if Alice signs a message using her private key, another entity, such as node 104, given Alice's public key and the plaintext message, can authenticate that the message must have been signed by Alice. Signing typically involves hashing the message, signing the hash, and tagging the message with this as the signature, thereby allowing any holder of the public key to authenticate the signature. Therefore, any reference herein to signing a particular portion of data or part of a transaction, etc., may in embodiments mean signing a hash of that portion of data or part of a transaction.
[0065] If the unlock script in Tx1 satisfies one or more conditions specified in the lock script of Tx0 (i.e., in the illustrated example, Alice's signature is provided and authenticated in Tx1), blockchain node 104 considers Tx1 to be valid. This means that blockchain node 104 adds Tx1 to the ordered set of transactions 154. Blockchain node 104 also forwards transaction Tx1 to one or more other blockchain nodes 104 in network 106 so that transaction Tx1 is propagated throughout network 106. Once Tx1 is validated and included in blockchain 150, this defines the UTXO0 from Tx0 as used. Note that Tx1 can only be valid if it uses an unused transaction output 203. If Tx1 attempts to use an output that has already been used by another transaction 152, Tx1 becomes invalid, even if all other conditions are met. Therefore, blockchain node 104 also needs to check whether the referenced UTXO in the preceding transaction Tx0 has already been used (i.e., whether it has already formed a valid input to another valid transaction). This is one reason why it is important for blockchain 150 to impose a defined order on transaction 152. In practice, a given blockchain node 104 could maintain a separate database marking which UTXO 203 in which transaction 152 has been used, but ultimately, what defines whether a UTXO has been used is whether it has already formed a valid input to another valid transaction in blockchain 150.
[0066] If the total amount specified in all outputs 203 of a given transaction 152 is greater than the total amount indicated by all inputs 202, this constitutes another ground for invalidity in most transaction models. Therefore, such a transaction will neither propagate nor be included in block 151.
[0067] In a UTXO-based transaction model, it should be noted that a given UTXO must be used as a whole. A portion of the amount defined as used in a UTXO cannot be "reserved" while another portion is being used. However, an amount from a UTXO can be split among multiple outputs of subsequent transactions. For example, the amount defined in UTXO0 within Tx0 can be split among multiple UTXOs within Tx1. Therefore, if Alice does not want to give Bob the entire amount defined in UTXO0, she can use the remainder to give the remainder to herself in a second output of Tx1, or to pay another party.
[0068] In practice, Alice also typically needs to include a fee for the Bitcoin node 104 that publishes Alice's transaction. If Alice does not include such a fee, Tx0 may be rejected by blockchain node 104 and, therefore, may not be propagated and included in blockchain 150, even if technically valid (the node protocol does not force blockchain node 104 to accept transaction 152 if it does not want to). In some protocols, the transaction fee does not require its own separate output 203 (i.e., it does not require a separate UTXO). Instead, any difference between the total amount indicated by the input(s) 202 of a given transaction 152 and the total amount specified by the output(s) 203 is automatically given to the blockchain node 104 that publishes the transaction. For example, suppose a pointer to UTXO0 is the sole input to Tx1, and Tx1 has a sole output UTXO1. If the amount of the digital asset specified in UTXO0 is greater than the amount specified in UTXO1, the difference may be allocated by node 104 that publishes the block containing UTXO1. However, this does not necessarily preclude the possibility that, alternatively or additionally, a transaction fee may be explicitly specified in one of the UTXO203s of transaction 152.
[0069] Alice and Bob's digital assets consist of UTXOs locked to them in any transaction 152 somewhere within blockchain 150. Thus, typically, the assets of a given party 103 are scattered across various transactions 152 throughout blockchain 150. Nowhere within blockchain 150 is a number that defines the total balance of a given party 103. The role of the wallet function in the client application 105 is to match together all the values of the various UTXOs locked to each party that have not yet been used in another subsequent transaction. This can be done by querying a copy of blockchain 150 stored in one of the Bitcoin nodes 104.
[0070] It should be noted that script code is often expressed in general terms (i.e., without using the exact language). For example, operation codes (opcodes) may be used to represent specific functions. "OP_..." refers to a specific opcode in the scripting language. For example, OP_RETURN is a scripting language opcode that creates an unusable output of a transaction, which can store data within the transaction, thereby immutably recording the data within the blockchain, when preceded by OP_FALSE at the beginning of the lock script. For example, the data may include documents that are desired to be stored on the blockchain.
[0071] Typically, the input to a transaction is the public key P AThis includes a corresponding digital signature. In embodiments, this is based on ECDSA using elliptic curve secp256k1. The digital signature signs a specific portion of the data. In some embodiments, for a given transaction, the signature signs a portion of the transaction input and some or all of the transaction output. The specific portion of the signed output depends on the SIGHASH flag. The SIGHASH flag is a 4-byte code typically included at the end of the signature to select which output is signed (and therefore fixed at signing).
[0072] A lock script is sometimes referred to as a "scriptPubKey," typically because it contains the public keys of the parties whose transactions are being locked. An unlock script is sometimes referred to as a "scriptSig," typically because it supplies the corresponding signature. However, more generally, it is not mandatory in all blockchain applications for a UTXO to be redeemed to include the authentication of a signature. More generally, a scripting language can be used to define any one or more conditions. Thus, the more general terms "lock script" and "unlock script" may be preferred.
[0073] As shown in Figure 1, the client applications on Alice's and Bob's computer devices 102a and 120b, respectively, may each include additional communication capabilities. This additional capability allows Alice 103a to establish a separate side channel 301 with Bob 103b (at the instigation of either party or a third party). The side channel 301 enables the exchange of data separately from the blockchain network. Such communication is sometimes called “off-chain” communication. For example, this could be used to exchange transaction 152 between Alice and Bob without the transaction being registered on the blockchain network 106 or progressing onto chain 150 until one of the parties chooses to broadcast the transaction to network 106. Sharing a transaction in this manner is sometimes called sharing a “transaction template.” A transaction template may lack one or more inputs and / or outputs required to form a complete transaction. Alternatively or additionally, the side channel 301 may be used to exchange any other transaction-related data, such as keys, negotiated amounts or terms, or data content.
[0074] Side channel 301 may be established via the same packet-switched network 101 as blockchain network 106. Alternatively or additionally, side channel 301 may be established via a different network such as a mobile cellular network, or a local area network such as a local wireless network, or via a direct wired or wireless link between Alice's device 102a and Bob's device 102b. In general, wherever referred to herein, side channel 301 may include any one or more links via one or more networking technologies or communication media for exchanging data "off-chain," i.e., separately from blockchain network 106. If two or more links are used, the bundle or collection of off-chain links as a whole may be referred to as side channel 301. Therefore, when it is said that Alice and Bob are exchanging certain parts of information or data etc. over side channel 301, it should be noted that this does not necessarily mean that all of these parts of data must be transmitted over the exact same link or network of the same type.
[0075] Client software Figure 3A shows an exemplary implementation of a client application 105 for implementing an embodiment of the scheme of the present disclosure. The client application 105 may include a transaction engine 401 and a user interface (UI) layer 402. The transaction engine 401 is configured to implement basic transaction-related functions of the client 105, for example, to formulate a transaction 152, receive and / or transmit the transaction and / or other data on the side channel 301, and / or transmit the transaction to one or more nodes 104 for propagation through the blockchain network 106, in accordance with the process described above.
[0076] The UI layer 402 is configured to render a user interface via the user input / output (I / O) means of each user's computer device 102, including outputting information to each user 103 via the user output means of the 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 (touchscreen or non-touchscreen) for providing visual output, one or more speakers for providing audio output, and / or one or more haptic output devices for providing haptic output. The user input means may include, for example, an input array of one or more touchscreens (identical or different from those used for the output means), one or more cursor-based devices such as a mouse, trackpad, or trackball, one or more microphones and speech or 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 body gestures, or one or more mechanical buttons, switches, or joysticks.
[0077] While various functions described herein may be described as being integrated into the same client application 105, this is not necessarily limiting. Instead, they may be implemented in two or more separate sets of applications, for example, one being a plug-in to the other, or interfaced via an API (Application Programming Interface). For example, the functionality of the transaction engine 401 may be implemented in an application separate from the UI layer 402, or the functionality of a given module such as the transaction engine 401 may be divided among two or more applications. It is not excluded that some or all of the described functions may be implemented, for example, in the operating system layer. Wherever a single or given application 105, etc., is referred to herein, this is merely an example, and it should be understood that, more generally, the described functions may be implemented in any form of software.
[0078] Figure 3B provides a mockup of an example of a user interface (UI) 500 that can be rendered by the UI layer 402 of the client application 105a on Alice's device 102a. It will be understood that a similar UI can be rendered by client 105b on Bob's device 102b, or on any other party's device.
[0079] As an example, Figure 3B shows UI500 from Alice's perspective. UI500 may include one or more UI elements 501, 502, 502 which are rendered as separate UI elements via a user output means.
[0080] For example, a UI element may include one or more user-selectable elements 501, which may be different on-screen buttons or different options in a menu. User input means are configured to allow a user 103 (in this case, Alice 103a) to select one of the options or otherwise act on it by clicking or touching a UI element on the screen or by saying the name of the desired option (Note: As used herein, the term “manual” is used in contrast to “automatic” and is not necessarily limited to the use of one or more hands).
[0081] Alternatively or additionally, a UI element may include one or more data input fields 502. These data input fields 502 may be rendered via user output means, such as on-screen, and data may be entered into the fields via user input means, such as a keyboard or touchscreen. Alternatively, data may be received orally, for example, based on speech recognition.
[0082] Alternatively or additionally, a UI element may include one or more information elements 503 that are output to the user to provide information. For example, the information may be rendered on the screen or as audio.
[0083] It will be understood that the specific means of rendering various UI elements, selecting options, and entering data are not important. The functionality of these UI elements will be explained in more detail below. It will also be understood that UI500 shown in Figure 3B is merely a diagrammatic mockup and may actually include one or more additional UI elements that are not shown for the sake of brevity.
[0084] Node software Figure 4 shows an example of node software 450 running on each blockchain node 104 of network 106 in an example of a UTXO-based or output-based model. Note that another entity may run node software 450 without being classified as a node 104 on network 106, i.e., without performing any actions required of a node 104. Node software 450 may include, but is not limited to, a protocol engine 451, a scripting engine 452, a stack 453, an application-level decision engine 454, and one or more blockchain-related functional modules 455. Each node 104 may run node software including, but is not limited to, all three: 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 transaction 152 and process them according to the node protocol. Another preceding transaction 152i (Tx m-1 Transaction 152j(Tx) has an input that points to the output (e.g., UTXO) of ) j When ) is received, protocol engine 451 will j Identify the unlock script within and pass it to script engine 452. Protocol engine 451 also handles Tx j Based on the pointer in the input, Tx i Identify and extract Tx i This can be published on blockchain 150, in which case the protocol engine takes a copy of block 151 of blockchain 150 stored at node 104. i It is possible to extract Tx. Alternatively, i The transaction does not need to be publicly available on blockchain 150. In this case, the protocol engine 451 will take the transaction from an ordered set of unpublished transactions 154 maintained by node 104. i It can extract. In any case, script engine 451 is Txi Identify the lock script in the referenced output and pass it to script engine 452.
[0085] Therefore, script engine 452 is Tx i The lock script and Tx j It has a lock-unlocking script from the corresponding input. For example, Figure 2 shows transactions labeled Tx0 and Tx1, but the same can be applied to any pair of transactions. The script engine 452 executes the two scripts together as described above, which involves placing data on the stack 453 and retrieving data from there, according to the stack-based scripting language being used (e.g., Script).
[0086] By executing the scripts together, the script engine 452 determines whether the unlock script satisfies one or more criteria defined in the lock script, i.e., whether it "unlocks" the output containing the lock script. The script engine 452 returns this determination result to the protocol engine 451. If the script engine 452 determines that the unlock script satisfies one or more criteria specified in the corresponding lock script, it returns the result "true". Otherwise, it returns the result "false".
[0087] In output-based models, the result "true" from script engine 452 is one of the conditions for transaction validity. Typically, Tx j The total value of the digital assets specified in the output(s) does not exceed the total value indicated by the input, and Tx iThere are also one or more further protocol-level conditions, which must be satisfied and evaluated by the protocol engine 451, such as the indicated output not yet being used by another valid transaction. The protocol engine 451 evaluates the result from the script engine 452 together with one or more protocol-level conditions, and only if they are all true does transaction Tx proceed. j The protocol engine 451 validates the transaction. The protocol engine 451 outputs an instruction to the application-level determination engine 454 indicating whether the transaction is valid. j Decision engine 454 will only proceed if it is actually validated. j Regarding the respective blockchain-related functions, it is possible to choose to control both the consensus module 455C and the propagation module 455P. This means that the consensus module 455C will convert the nodes' respective transactions 154 into an ordered set of Tx j Adding the propagation module 455P to another blockchain node 104 in network 106 will enable Tx j This includes forwarding. Optionally, in the embodiment, the application-level decision engine 454 may apply one or more additional conditions before triggering one or both of these functions. For example, the decision engine may choose to publish a transaction only if the transaction is valid and leaves sufficient transaction fees.
[0088] It should be noted that the terms “true” and “false” as used herein are not necessarily limited to returning a result expressed in the form of a single binary number (bits), although that is certainly one possible implementation. More generally, “true” can refer to any state indicating success or a positive outcome, and “false” can refer to any state indicating failure or a non-positive outcome. For example, in an account-based model, a “true” result may be indicated by a combination of implicit protocol-level validation of the signature and an additional positive output from the smart contract (if both individual results are true, the overall result is considered to indicate true).
[0089] Other variations or use cases of the techniques disclosed may become apparent to those skilled in the art once the disclosure herein is given. The scope of this disclosure is not limited by the embodiments described, but only by the appended claims.
[0090] For example, some of the embodiments described above relate to Bitcoin Network 106, Bitcoin Blockchain 150, and Bitcoin Node 104. However, it will be understood that Bitcoin Blockchain is one specific example of Blockchain 150, and the above description may generally apply to any blockchain. That is, the present invention is not limited to Bitcoin Blockchain. More generally, any above references to Bitcoin Network 106, Bitcoin Blockchain 150, and Bitcoin Node 104 may be replaced with references to Blockchain Network 106, Blockchain 150, and Blockchain Node 104, respectively. Blockchains, Blockchain Networks, and / or Blockchain Nodes may share some or all of the described properties of Bitcoin Blockchain 150, Bitcoin Network 106, and Bitcoin Node 104 as described above.
[0091] In some embodiments of the present invention, the blockchain network 106 is a Bitcoin network, and the Bitcoin node 104 performs at least all of the described functions of creating, issuing, propagating, and storing block 151 of blockchain 150. It is not excluded that there may be other network entities (or network elements) that perform only one or some of these functions, rather than all of them. That is, a network entity may perform the function of propagating and / or storing blocks without creating and issuing blocks (it should be recalled that these entities are not considered nodes of the preferred Bitcoin network 106).
[0092] In some other embodiments of the present invention, the blockchain network 106 may not be a Bitcoin network. In these embodiments, it is not excluded that a node may perform some, but not all, of the functions of creating, issuing, propagating, and storing blocks 151 of blockchain 150. For example, on those other blockchain networks, “node” may be used to refer to a network entity configured to create and issue blocks 151 but not to store and / or propagate those blocks 151 to other nodes.
[0093] More generally, any reference to the term “Bitcoin node” 104 above can be replaced with the term “network entity” or “network element,” such entities / elements are 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 node 104.
[0094] Merkle certification As explained above, mining nodes group transactions into blocks. The block payload contains an ordered set of transactions, including coinbase transactions. Each block has a block header containing various data fields, including a field containing a summary value determined based on the block's contents. The summary value represents a fingerprint or summary of the block's contents. In particular, the summary value is determined from the ordered set of transactions within the block. In many implementations, this summary value is the Merkle root. The Merkle root is determined by constructing a Merkle tree from the ordered set of transactions. The following description refers to the Merkle root, but the term “summary value” may be understood as including the Merkle root or any other such data value that represents the contents of the payload, such as a hash chain.
[0095] A Merkle tree of an ordered set of elements is constructed by recursively creating the next layer by hashing each element, concatenating adjacent pairs of hashed elements, and then hashing the concatenated hashed elements. A simplified example of a Merkle tree 500 is shown in Figure 5A.
[0096] In this example, the Merkle tree 500 relates to an ordered set of only eight elements for the sake of explanation. Merkle trees in other examples may be smaller, or more generally, much larger. The layers of the Merkle tree 500 are labeled from bottom to top, with layer 0 being the base layer and layer 3 being the Merkle root 502 in this example. The Merkle tree 500 is formed by first creating the base layer by hashing the elements; that is, each base layer node 504 is the hash of the corresponding element at its position. In the case of Bitcoin, each base layer node 504 is the hash (double-SHA256 in the case of Bitcoin) of its corresponding transaction. The double-SHA256 hash of a transaction is also its transaction identifier, TxID. Thus, in the case of Bitcoin, each base layer node 504 is the TxID corresponding to the transaction at its position in the ordered set of transactions in a block.
[0097] To construct a layer 1 node in a Merkle tree 500, base layer nodes are grouped into pairs. Within each pair, the elements are concatenated and then hashed to obtain the value of the parent node in the higher layer. For example, if base layer pair 506 contains TxID2 and TxID3, these two TxIDs are concatenated as TxID2||TxID3, and the resulting value is hashed to compute element 508.
[0098] Layer 2 elements are computed as hashes of concatenated pairs of Layer 1 elements, and so on. For example, element 512 is computed from the hash of the concatenated pair of elements 510 and 508. Layer construction by computed intermediate hashes for nodes in the intermediate layers of the Merkle tree 500 continues until a single element in the top layer, called the Merkle root 502, is obtained.
[0099] Every block is exactly 2 nIt will be understood that we do not have a complete set of transactions containing all elements. In such cases, a "partial" Merkle tree may result. Figure 5B shows an example where layer 0 has five elements, for example, five transactions in a block. The first four elements can be paired, but the last transaction, indicated by reference number 520, does not have a corresponding paired element. It will be understood that the absence of a paired element in the base layer only occurs if the last element is the left-hand element of the pair. To construct the Merkle tree in this situation, a "copy" of the left-hand element is used as the right-hand element. That is, TxID4, indicated by number 520, is concatenated with itself and hashed to obtain the value of its parent element at node 522. Similarly, since node 522 does not have a corresponding right-hand element in its pair, the element at node 522 is concatenated with itself and hashed to obtain the value of its parent element at node 524 in layer 2.
[0100] Merkle Root 502 is inserted into the block header and serves as a fingerprint of the transactions within the block.
[0101] Merkle trees are useful for enabling lightweight nodes, such as client applications on end-user devices, to determine whether a particular transaction exists in a block on the blockchain without necessarily having to download the entire block or the full blockchain. A client application may determine whether a transaction is in a block based on a Merkle proof. A Merkle proof involves tracing a path from a transaction to a Merkle root (a Merkle path) through the Merkle tree to verify that the transaction was included in the block. The term "Merkle proof" can refer to the hash / nodes of adjacent Merkle trees that are needed to compute the parent node on the Merkle path, i.e., the pair of adjacent Merkle trees needed to compute the node along the Merkle path to verify the Merkle root.
[0102] A node may request Merkle proof data related to a transaction and, based on that, perform a Merkle proof, for example, trace a Merkle path. For example, the requested data may be provided in the form of an ordered set of hashes corresponding to pairs of hashes in the Merkle tree required along the path to reach the Merkle root, along with a binary signal indicating whether the computed and / or provided hash is the left-hand or right-hand element of each pair.
[0103] For the purposes of this specification, the following notation may be used: An element computed using hashing of available data (e.g., transaction data or concatenated elements of a Merkle tree) may be denoted by c[n], where n is a layer of the tree, with the lowest or base layer located at n=0. An element of the tree provided by another node for the purpose of a Merkle proof, such as an intermediate hash, may be denoted by p[n]. Such an intermediate hash may be called a “paired hash,” or derived from a “paired intermediate node,” or “intermediate paired node,” in the sense that each node has a corresponding paired node used when determining its parent hash value.
[0104] Figure 6 shows an example of a Merkle path through a Merkle tree 600. In this case, the Merkle path relates to validating the existence of transaction Tx within a block. To complete a Merkle proof using this Merkle path, the computing device has transaction Tx (or at least TxID) and an ordered set of hashes (intermediate hashes) corresponding to the elements necessary to form pairs along the Merkle path. In this example, the ordered set includes p[0], p[1], and p[2].
[0105] Computing devices also require a mechanism to determine whether a provided intermediate hash is a left-hand or right-hand element of a pairing. This can sometimes be signaled using binary flags. For each layer, the binary flag may indicate whether the computed hash (or provided hash) is a left-hand or right-hand element. In some cases, instead of signaling whether the computed hash (or provided hash) is a left-hand or right-hand element at each layer, the position of the computed hash in the lowest or base layer, i.e., its index in an ordered set of elements, may be signaled. In some implementations, these may be virtually equivalent. For example, bitwise signaling of a left-hand (0) or right-hand (1) path tracing a computed element from layer 2 moving down the Merkle path from Merkle root 602 would be bit[0,1,0]. Similarly, the index i=2 of element c[0] may be signaled, which is 010 in binary. Other implementations may use different signaling or coding.
[0106] To perform a Merkle proof, the computing device determines the c[0] element by hashing transaction Tx (double-SHA256 in this example) to obtain the TxID. In some cases, the computing device may already have the TxID. It then concatenates it with the first hash provided in the ordered set of hashes p[0]. The computing device determines from index i or bit signaling whether the computed hash c[0] is a left-hand or right-hand element and concatenates accordingly. It then hashs the concatenation to determine c[1]. This process continues until c[3] is determined, and then it is compared to the Merkle root 602 contained within the block header. If they match, the computing device determines that transaction Tx is included in the block. If they do not match, transaction Tx is not in the block (or the Merkle proof hash it was provided with contains an error).
[0107] The position of an element within an ordered set of elements in a given layer is sometimes called an "index," and can be represented by i, or by indexOf(c[n]) when referring to the calculated index of an element in the nth layer. In the lowest or base layer, index i ranges from 0 to the count of transactions in the block minus 1.
[0108] Processing a large volume of transactions As network capacity increases to accommodate more transactions, nodes need to adapt to handle a substantial volume of transaction flows. In some possible scenarios, the flow of new transactions could increase to tens of thousands, hundreds of thousands, or even millions of transactions per minute.
[0109] The current structure of the Bitcoin blockchain architecture assumes that a node maintains a "mempool," which is a data structure containing all pending transactions validated by the node. The node then selectively chooses a subset of those transactions to include in a candidate block that the node's mining unit(s) are mining in an attempt to find proof of work. As new transactions enter a node and are validated, they are added to the mempool. When the current node finds proof of work for a candidate block, it propagates the solution. If a solution is received from another node, the node validates it. Once a valid proof of work is found, the node updates the mempool to remove any currently validated transactions within the block where the proof of work was found and constructs a new candidate block from the subset of current transactions in the block. The selection of the subset of transactions to include in a block may be based on transaction fees, time in the mempool, or other factors.
[0110] As transaction volume increases, the capacity of this architecture may struggle to keep up with the flow of new transactions. It would be beneficial to modify the architecture and processes for handling new transactions and building candidate blocks to enable greater processing capacity.
[0111] In one aspect of this application, a node architecture and transaction processing process are described that enables the processing of a large volume of transaction flows. Instead of maintaining a mempool, a node may add all new validated transactions to a candidate block. Transactions are added in a certain order, and their corresponding transaction identifiers are added to an array that tracks an ordered set of transactions by transaction identifier. When the array reaches a threshold size, for example, the maximum count of transactions, the node may determine the Merkle root of the ordered list of transaction identifiers in the array and add it to the candidate block header, which is then provided to the mining unit to find proof of work. The node may continuously build new arrays, and when each is completed, append its list of transactions to the current candidate block, increasing the size of the candidate block each time to include an unified ordered list of transactions, and provide the updated and / or modified candidate block header to the node's mining unit. When each new array is added to the current ordered list of transaction identifiers, the Merkle root of that array is used, along with the Merkle roots for the previously added ordered list of transaction identifiers, to determine the current Merkle root of the block and update the block header.
[0112] In another aspect of this application, a placeholder transaction may be placed in the first position of the first in an ordered list of transaction identifiers. The placeholder transaction is replaced by a coinbase transaction inserted by the mining unit before the mining unit performs the proof-of-work search. Thus, the mining unit determines the actual Merkle root for the first ordered list of transactions, and consequently the overall top-level Merkle root for the candidate block, which is inserted into the block header before being hashed for proof-of-work.
[0113] As used in this application, the term “transaction identifier” may in many implementations refer to a TxID created from a transaction using double hashing, but in some implementations, the “transaction identifier” may be any other unique identifier for a transaction. It may, in some cases, be derived from a different hash or combination of hashes. It may, in some cases, be an abbreviation of a conventional TxID, such as BIP152.
[0114] Referring to Figure 7, a simplified, exemplary blockchain node 700 for processing a large volume of blockchain transactions is schematically shown. In this example, node 700 is shown as a single device, but it will be understood that node 700 may be implemented using one or more computing devices. A computing device includes, among other systems, one or more processors, memory, an internal communication bus, and an external network communication subsystem.
[0115] Node 700 is configured to receive incoming transactions via the computer network 702. Transactions may be received from user devices, point-of-sale devices, merchant computing devices, or other sources of transactions. In some cases, transactions may be received from other blockchain nodes. Node 700 includes a transaction validation component 706. The transaction validation component 706 performs transaction validation according to the applicable blockchain protocol. This may include determining whether the input to a transaction is validly formatted and available within a set of UTXOs 704 maintained in a data structure stored in the memory of node 700. The transaction validation component 706 may be configured to validate transactions in parallel in many implementations to increase throughput.
[0116] Next, validated transactions may be added to candidate blocks. In this example, node 700 adds the transaction identifiers of valid transactions to array 708. Array 708 may, in some cases, be a one-dimensional array. In some implementations, the array may be multi-dimensional, but the transaction identifiers are added to array 708 in such a way that they form an ordered list or set of transaction identifiers. The transactions themselves may similarly be stored in a data structure having the same order. In some cases, transactions are added directly to candidate block 710, which is maintained in node 700's memory, by appending them to a set of transactions in candidate block 710 in the same order in which their corresponding transaction identifiers are added to array 708. In some implementations, a separate data structure for storing transactions is maintained by the node for the transactions corresponding to the transaction identifiers in array 708 until array 708 is complete, and then the transactions from the separate data structure are added together to the transactions in candidate block 710.
[0117] It will be understood that there is no separate mempool maintained by node 700 that stores all pending and unconfirmed transactions, and that node 700 does not selectively choose a subset of pending transactions to include in the candidate block. Instead, all incoming validated transactions are added to the candidate block 710, and array 708 maintains a corresponding list of transaction identifiers.
[0118] When array 708 is complete, node 700 determines the Merkle root for the ordered list of transaction identifiers. Array 708 may be considered "complete" when it reaches some threshold size, such as the maximum count of transaction identifiers, or the maximum byte size, or some other similar measure. In many implementations, arrays are considered complete when the size of all but the last array is 2 nIt is necessary that, in some embodiments, the array 708 may contain hundreds of thousands, perhaps millions, of transaction identifiers in order to handle a large volume of transactions.
[0119] For the first array to complete, since only its transactions are in candidate block 710, its Merkle root is the top-level Merkle root to candidate block 710 and is subject to special processing for coinbase transactions, as described below. Node 700 may provide data about candidate block 710 to the mining units to enable them to begin searching for proof of work. In some cases, this may involve providing the mining units with an ordered list of transactions from the array and Merkle root information determined by node 700, along with additional block header information. In some cases, this may involve providing the units with only block header data and Merkle path data to enable the mining units to add coinbase transactions and determine the top-level Merkle root from the coinbase transactions and Merkle path data.
[0120] Node 700 continues to build arrays of transaction identifiers from the flow of validated transactions. Once each array is complete, its Merkle root is determined, an ordered list of transactions is added to a candidate block to create a unified ordered set of transactions, and the top-level Merkle root is determined from the new Merkle root and the Merkle roots of all previously added arrays. Thus, Node 700 generates a set of arrays, each containing an ordered set of non-duplicate transaction identifiers. Once each array is complete, the candidate block is updated to add a new set of transactions, and the modified / updated candidate block header and / or candidate block data is pushed to the mining unit to search for proof of work.
[0121] Node 700 is further configured to “pre-share” array information before discovering proof of work. That is, Node 700 transmits data about the completed array to other Node 700 across the blockchain network 720. The blockchain network 720 may be the same network as computer network 702, a different network from computer network 702, a subnetwork within computer network 702, or an overlay network on computer network 702. Networks 702 and 720 may include wired and / or wireless communication networks using various possible communication protocols.
[0122] By sending the complete array to other nodes, the other nodes can determine if they have lost a transaction and request one from node 700. Upon receiving a new transaction, they can validate it and add it to their own array and candidate blocks. Other nodes can also store the array data of the received array. In this way, if proof of work is found by node 700, validation is faster because the other nodes have already seen the array(s) and determined that it contains validated transactions that they have already examined, thus validating the Merkle root determination. They only need to combine the Merkle roots of the array and check the top-level Merkle root in the block header.
[0123] In some cases, array 708 may be called a subtree because its transaction identifiers form part of a unified, ordered list of all possible transaction identifiers within a candidate block, and thus transaction identifiers from the array can be used to find part of the Merkle tree of the candidate block, i.e., the “subtree”. Each array has a unique array identifier, or “subtree identifier,” that is transmitted with the array when it is propagated to other nodes through the blockchain network 720. The other node can then store the array identifier in memory in association with the array data after determining that it has recognized and validated all transactions in the array. Similarly, when node 700 receives an array from another node, the node determines whether it has received and validated all transactions listed in the array by their transaction identifiers, then validates the Merkle root of the array, and stores the array identifier in memory in association with the array data.
[0124] Therefore, if the mining unit at node 700 finds a valid proof of work for the candidate block, it outputs a solution that includes the nonce and other block header data, as well as the coinbase transaction contained in the block. Node 700 forwards the solution to other nodes via the blockchain network 720. The solution forwarded to other nodes may include the block header, coinbase transaction, and an ordered set of array identifiers. The ordered set of array identifiers tells other nodes which arrays were in the candidate block that was successfully mined. This allows the node to reconstruct the resolved block from the stored array data based on the ordered set of array identifiers. Since the transactions in the arrays have already been validated and the Merkle root of the arrays has been previously validated, the receiving node only needs to construct the top of the Merkle tree using the Merkle root of the arrays, the coinbase transaction, and the corresponding Merkle path data for the coinbase transaction, as described below. Thus, the Merkle root in the block header can be verified, and the validity of the block solution can be confirmed.
[0125] If one of the other nodes is unaware of one of the arrays specified by the array identifier, that node may request one of the arrays from node 700, for example, using an INV message or an equivalent request message.
[0126] When node 700 receives a block solution from another node in blockchain network 720, the node performs the same process: it retrieves the stored array from memory based on the array identifier sent in the solution, finds the Merkle root from the coinbase transactions and array Merkle root, verifies that it matches the Merkle root in the block header, and validates that the hash of the block header is a valid solution. If the solution is valid, i.e., a resolved block, node 700 adds the block to its copy of the blockchain in the usual manner, and then the node removes all transactions in the resolved block from its own candidate block and from any stored arrays used when constructing the candidate block. Since no separate mempool is maintained, there is no mempool to update, but confirmed transactions are extracted or removed from arrays and candidate blocks. As a result, all transactions in the candidate block and arrays may be removed, or some unconfirmed transactions may remain. If unconfirmed transactions remain, they are grouped into an ordered set of transactions that form a new one or more arrays, a new candidate block containing the new one or more arrays is generated, and the mining process continues.
[0127] Many of the functions performed by Node 700 can be implemented using a microservices architecture.
[0128] Referring here to Figure 8, an exemplary method 800 for transaction processing in a blockchain node is shown. Method 800 can be implemented by a node, such as node 700 (Figure 7), using one or more computing devices, each having one or more processing units, memory, and communication subsystems. Appropriate software stored in memory and executable by one or more processing units can configure the processing units to perform the described functions or operations. In some cases, a microservices architecture may be used to implement Method 800. Although the operations described below are written in a linear form, it will be understood that some implementations may at least partially parallelize some of the operations and / or execute them in a different order without substantially affecting the operation of Method 800.
[0129] In operation 802, the node validates the incoming transaction. Transaction validation is performed in the usual manner according to the applicable blockchain protocol and may include verifying that the input to the transaction has not yet been consumed. This may include verifying that the input is available using a set of UTXOs stored in memory. Then, in operation 804, the node may update the set of UTXOs to indicate that the input to the transaction has been consumed in order to avoid possible double-use by subsequent transactions. Various techniques may be employed to resolve conflicts between two unconfirmed transactions using the same input(s) and to determine which one should be considered valid and which one invalid.
[0130] In operation 806, the node adds a validated transaction identifier to the array by appending it to an ordered list of transaction identifiers in the array. Transactions may be added to candidate blocks and / or held in memory associated with transaction identifiers. As described above, the array may be a one-dimensional array holding an ordered list of transaction identifiers. In some cases, the array may be implemented as a multi-dimensional array using an appropriate data structure, provided that the transaction identifiers in the array are still arranged in serial order using some known storage pattern. In this example, the array is stored in the node's memory.
[0131] In operation 810, the node evaluates whether the array is complete. The determination of whether the array is complete may be based on whether the contents of the array have reached the maximum amount or a threshold amount. This determination may be based on whether the array has N transaction identifiers, where N is an integer value. In order to enable the concatenation of lists of transaction identifiers from the array and the reliance on the array Merkle root to construct the top level of the Merkle tree after the arrays have been merged, the transaction count in each array is 2 n It fits the size of the array. If not complete, the node continues to add newly validated transactions to the array as they flow in and are processed by transaction validation components or services.
[0132] If the array is considered complete, the node determines the Merkle root for the array in operation 810. Based on an ordered list of transaction identifiers, the node constructs a Merkle tree by concatenating and hashing pairs of transaction identifiers, building one level at a time until it reaches the top-level Merkle root of the array. The node may store the Merkle root for the array in association with the array in memory. In some cases, the Merkle root of the array also functions as a unique array identifier. In some cases, a distinct array identifier is determined for an array, such as by hashing the entire array or by generating a unique identifier using some other mechanism.
[0133] In operation 812, the node updates the candidate block header data. In some cases, this may involve calculating the Merkle root for the candidate block header based on the Merkle root determined in operation 810 for the newly completed array. If the transactions of the newly completed array are appended to an ordered set of existing transactions in the candidate block corresponding to a previously completed array, the determination of the Merkle root for the candidate block is based on the Merkle roots of those previously completed arrays and the Merkle root of the newly completed array.
[0134] The node maintains candidate blocks in memory, containing, in order, the transactions corresponding to the complete array. In some cases, the node appends the transactions to the candidate blocks when it adds the transaction identifiers to the array in operation 806. In some cases, when a transaction identifier is added to the current array, the node stores the transactions in a separate data structure in memory, and then, when the array is complete, appends the complete set of transactions from the separate data structure to the candidate blocks.
[0135] A candidate block has an associated candidate block header. The candidate block header may be a partially completed header that does not yet have a value in the Merkle root field. In some cases, the candidate block header data updated in operation 812 includes inserting the Merkle root to the unified list of transactions represented by the array(s) added to the candidate block. In some cases, operation 812 includes adding the newly completed array Merkle root to the list of array Merkle roots provided to the mining unit, which then uses those array Merkle roots and the coinbase transactions that the mining unit adds to the block to determine the top-level block Merkle root. In some cases, the candidate block header data includes the Merkle path to the coinbase transactions, so that the mining unit can quickly determine the Merkle root to the first array in the block after determining each coinbase transaction.
[0136] In operation 814, the node propagates the newly completed array to other blockchain nodes on the blockchain network. Array propagation involves sending array data, such as an ordered list of transaction identifiers and an array identifier. Propagation may further involve sending the array Merkle root. In some cases, the array Merkle root is also the array identifier.
[0137] The node also causes the mining unit to begin mining the updated candidate block, i.e., the block to which the newly completed array transactions have been appended, as shown by operation 816. This may involve pushing the updated candidate block header data to the mining unit, which then determines and inserts the coinbase transactions, calculates the top-level Merkle root, and then begins the proof-of-work search.
[0138] In operation 818, the node initializes a new array and returns to operation 802 to begin building the new array using the incoming validated transactions.
[0139] Referring now to Figure 9, an exemplary method 900 for managing pending transactions when a proof-of-work solution is found is shown. Method 900 may be implemented by a node, such as node 700 (Figure 7), using one or more computing devices, each having one or more processing units, memory, and communication subsystems. Appropriate software stored in memory and executable by one or more processing units may configure the processing units to perform the described functions or operations. In some cases, method 900 may be implemented using a microservices architecture. Although the operations described below are written in a linear form, it will be understood that some implementations may at least partially parallelize some of the operations and / or execute them in a different order without substantially affecting the operation of method 900.
[0140] Operation 902 represents the array construction and mining process as described above in relation to Figure 8. This may include validating transactions, constructing an array containing an ordered set of transaction identifiers, sharing that array with other nodes, adding transactions to candidate blocks, and determining the Merkle root for the array and the top-level Merkle root for the candidate block header based on the combined set of transactions in the candidate block and their respective array Merkle roots. As described above, array construction and mining are performed without using a mempool, so that all validated transactions are added to the array and used to construct candidate blocks.
[0141] In operation 904, the node evaluates whether its mining unit was able to find a proof of work. In operation 910, the node evaluates whether a proof of work solution has been received from another node on the blockchain network. Although shown sequentially in Figure 9, it will be understood that these operations may be performed in parallel. In many implementations, the operations may be performed by an interrupt or other notification from any one of the mining units or from one of the other nodes on the blockchain network. If there is no such interrupt or notification regarding a solution, method 900 returns to operation 902 and continues building the array and mining.
[0142] As shown in operation 904, if a proof of work is found by one of the mining units, in operation 906, the node propagates its solution across the blockchain network. In particular, since the node has previously propagated an array reflecting the contents of the candidate block mined by the mining unit, the message propagating the solution may include block header data such as the top-level Merkle root, nonce, and other such data, and may include the coinbase transaction used by the mining unit in the candidate block. The message propagating the solution may further include an ordered list of array identifiers signaling the contents of the candidate block. Any other node that has not received any arrays may then respond to the message with a request for any missing arrays. The other node may construct the resolved block based on retrieving the array data corresponding to the array identifiers from local memory, and then its solution may be validated. In many cases, the other node has previously validated the array in such a way that the transaction identifiers in the array are recognized and independently validated by that other node, and that the array Merkle root is valid. Therefore, upon receiving notification of a solution, other nodes only need to construct the top of the Merkle tree using the already validated array Merkle root in order to validate the block header.
[0143] In operation 908, the node may clear its array and candidate block data, since all previously pending unconfirmed transactions listed in the array are included in the mined block. Furthermore, it may update the copy of the blockchain maintained by the node with the newly mined block. An empty array may then be initialized, and method 900 returns to operation 902 and continues again. Initializing an empty array may involve inserting placeholder transactions in place of coinbase transactions at the first index position, as will be further described below.
[0144] If, in operation 910, a node determines that proof of work has been found by another node in the blockchain network, for example, through the receipt of a block-solving message, then in operation 912, the node validates the newly mined block. Block validation may involve constructing a Merkle tree to find the Merkle root in the block header received in the block-solving message. The block-solving message may further include an ordered list of array identifiers signaling which sets of transactions are in which order within the block. The node confirms that it has already received and validated the array data for each array identifier, including confirming the array Merkle root. If the node has not yet received and validated the array corresponding to one of the array identifiers, the node requests that data from the blockchain network.
[0145] Since the node has already validated the array and the array Merkle root, it only needs to construct the top level of the Merkle tree to validate the top-level Merkle root in the block header. The node has also already validated the transactions listed in the array by their Merkle roots. Therefore, validating the block solution can be done considerably faster than in previous blockchain systems.
[0146] Once the block solution is validated, in operation 914, the node compares the transactions and transaction identifiers in the newly resolved block with the transactions and transaction identifiers in the node's current candidate block and its array stored in memory. The node removes or deletes any matching transactions and transaction identifiers, leaving only the unconfirmed transactions and transaction identifiers that were not included in the resolved block. In other words, it purges the confirmed transactions from that candidate block and its array. The remaining transactions are unconfirmed and will be included in the next candidate block that the node intends to mine.
[0147] In operation 916, the node forms a new array(s) containing unconfirmed transactions that remain after purging confirmed transactions from the old array(s). Method 900 then returns to operation 902 to build the array(s) and mine candidate blocks using the incoming flow of new confirmed transactions.
[0148] Here, we refer to Figure 10, which schematically shows a simplified Merkle tree 1000 of the first array. The first array may be a first array constructed for a candidate block. In this simplified example, the first array contains a set of eight transaction identifiers TxID at level 0 of the array. The first TxID is a placeholder transaction at p[0,0].
[0149] In this example, the coinbase transaction is placed at the beginning of the list of all transactions included in the block being mined. Normally, a mining unit might insert its own coinbase transaction and compute the block's Merkle tree in order to insert the Merkle root into the block header before mining the block. However, in this example, the node provides the mining unit(s) after the array has been built and the array Merkle root has been determined. Therefore, the node inserts a placeholder transaction in the position that would normally be occupied by the coinbase transaction. The mining unit can then replace the placeholder transaction with the coinbase transaction before mining the candidate block.
[0150] It will be understood that a node cannot provide an exact array Merkle root for an ordered set of transactions if one of the ordered sets of transactions is replaced. However, it can provide a Merkle path that allows for a quick determination of the array Merkle root for the first array. Using the illustrated, simplified tree, a node can determine a Merkle path that includes nodes p[0,1], p[1,1], and p[2,1], where the notation uses the notation convention p[level,index] to indicate which nodes are computed by the node and provided as part of the Merkle path.
[0151] Next, when the mining unit inserts the coinbase transaction at position p[0,0], the mining unit uses the Merkle path values at p[0,1], p[1,1], and p[2,1] to calculate the values at c[1,0], c[2,0], and the array Merkle root at c[3,0].
[0152] Therefore, to the extent that the above description explains the operation of sending or propagating an array with an array Merkle route, for the first array, it will be understood that this includes sending a Coinbase Merkle path instead of an array Merkle route. This allows mining units and other nodes on the blockchain network to easily determine the array Merkle route once the Coinbase transaction becomes available and is used in place of a placeholder transaction.
[0153] The various embodiments presented above are merely examples and are not intended to limit the scope of this application. Variations of the innovations described herein will be obvious to those skilled in the art, and such variations fall within the intended scope of this application. In particular, features from one or more embodiments of the exemplary embodiments described above may be selected to create alternative exemplary embodiments that include subcombinations of features not expressly described above. In addition, features from one or more embodiments of the exemplary embodiments described above may be selected and combined to create alternative exemplary embodiments that include combinations of features not expressly described above. Features suitable for such combinations and subcombinations will be readily apparent to those skilled in the art by considering this application as a whole. The subject matter described herein and in the claims is intended to cover and encompass all appropriate modifications in the art.
Claims
1. A computer implementation method for blockchain transaction processing on a node, The steps include: adding the transaction identifiers of validated transactions to the array as an ordered list of transaction identifiers; The steps include determining that the array has reached its maximum size, and accordingly, The steps include determining the array summary value of the ordered list of transaction identifiers, The steps include adding the ordered list of transaction identifiers to a candidate block containing an ordered list of previously completed transaction identifiers to form a unified ordered list of transaction identifiers, The steps include determining the top-level summary value of the unified ordered list of transaction identifiers using the array summary value and the array summary value of the ordered list of previously completed transaction identifiers, The steps include modifying the block header of the candidate block to include the top-level summary value, The steps include: propagating the aforementioned array to multiple other nodes on the blockchain network; A method that includes this.
2. The method according to claim 1, further comprising the step of providing header data of the candidate blocks to one or more mining units for searching for proof of work in response to the determination that the array has reached its maximum size.
3. The method according to claim 2, wherein each of the one or more mining units receives a partially completed block header and the array summary value and performs an operation to determine the top-level summary value and an operation to modify the block header to include the top-level summary value.
4. The method according to any one of claims 1 to 3, further comprising the steps of: initializing a new array to include a new ordered list of transaction identifiers of transactions subsequently received and validated, in response to determining that the array has reached its maximum size; and appending the new ordered list of transaction identifiers to the unified ordered list of transaction identifiers when the new array has reached its maximum size.
5. The step of determining that the array has reached its maximum size includes the step of determining that the transaction count has reached its maximum count, and optionally the maximum count is 2 n The method according to any one of claims 1 to 4, wherein the transaction is a number of transactions, and n is an integer.
6. The steps include receiving a block solution, including the coinbase transaction and the resolved block header, from the mining unit in the node, The steps include: propagating the aforementioned block solution to other nodes on the blockchain network; The steps include initializing a new, empty first array and The method according to any one of claims 1 to 5, further comprising:
7. The method according to any one of claims 1 to 5, further comprising the steps of: receiving a block solution from another node on the blockchain network; validating the block solution; in response to the validation of the block solution, comparing a transaction identifier from the block solution with a transaction identifier in a unified ordered list of transaction identifiers; removing matching transaction identifiers from the unified ordered list of transaction identifiers; and initializing a new first array containing the remaining non-matching transactions in the unified ordered list of transaction identifiers.
8. The block solution includes an ordered set of array identifiers and a block header, and the step of validating the block solution is: A step of retrieving array data from memory corresponding to an ordered set of array identifiers, wherein the array data includes previously validated array summary values. The steps include determining block summary values using array summary values that have been previously validated, A step of verifying that the determined block summary value is located within the block header. The method according to claim 7, including the method described in claim 7.
9. A step of constructing a first array, wherein the first array includes placeholder transactions, The steps include determining the Merkle path for the aforementioned placeholder transaction, The steps include: propagating the first array to the plurality of other nodes on the blockchain network, and optionally propagating the Merkle path for the placeholder transaction to the plurality of other nodes on the blockchain; The method according to any one of claims 1 to 8, further comprising:
10. The method according to claim 9, further comprising the steps of: replacing the placeholder transaction with a coinbase transaction in a mining unit; and determining a first array summary value of the first array using the Merkle path.
11. The steps include receiving array data from another node on the blockchain network, which includes a first array identifier, a first array containing placeholder transactions, and a Merkle path for the placeholder transactions. A step to validate the aforementioned Merkle path, The steps include storing the array data in memory in association with the first array identifier, and The method according to any one of claims 1 to 8, further comprising:
12. The method according to claim 11, further comprising: receiving a block solution from the other node, wherein the block solution includes a coinbase transaction and an ordered set of array identifiers including the first array identifier; retrieving the first array and the Merkle path from memory based on the first array identifier; and determining a first array summary value using the coinbase transaction and the Merkle path.
13. The aforementioned block solution includes a block header, and the step of validating the aforementioned block solution is: A step of retrieving array data from memory corresponding to an ordered set of array identifiers, wherein the array data includes previously validated array summary values. The steps include determining a block summary value using the first array summary value and the previously validated array summary value, A step of verifying that the determined block summary value is located within the block header. The method according to claim 12, including the method described in claim 12.
14. The method according to any one of claims 1 to 13, wherein the summary value is Merkle root.
15. A computing device, One or more processors, Memory and Computer executable instructions stored in the aforementioned memory and The computer executable instruction, when executed by one or more processors, causes the processors to perform the method according to any one of claims 1 to 14. Computing device.
16. A computer-readable medium for storing processor-executable instructions, wherein the processor-executable instructions, when executed by one or more processors, include instructions that cause the processors to perform the method according to any one of claims 1 to 14.
