Method and system for parallel processing of smart contracts on a permissioned blockchain
By grouping and parallelly executing smart contracts based on common reference values, the system addresses the inefficiencies of sequential execution, ensuring faster processing and secure asset management in blockchain networks.
Patent Information
- Application Number
- JP2024516836
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-09-16
- Filing Date
- 2022-08-24
- Publication Date
- 2024-10-16
- Estimated Expiration
- 2042-08-24
AI Technical Summary
Traditional blockchain systems require sequential execution of smart contracts, which can be time-consuming, especially when high-frequency block additions are needed, leading to inefficiencies and potential unauthorized asset transfers.
Implementing a system where blockchain nodes identify and group dispatches with common reference values, allowing for parallel execution of smart contracts by selecting a single dispatch per group based on predetermined criteria, ensuring no duplicate reference use and maintaining blockchain immutability.
This approach significantly enhances processing speed for smart contract execution without compromising security or immutability, preventing unauthorized transactions and doubling of asset transfers.
Smart Images

Figure 2024537669000001_ABST
Abstract
Description
[Technical field]
[0001] The present disclosure relates to parallel execution of dispatches within smart contracts on a blockchain, and in particular to identifying every dispatch related to a smart contract and using predefined rules among nodes so that all dispatches can be executed in parallel with consistency among all nodes, thereby maintaining correctness and immutability.
[0002] CROSS-REFERENCE TO RELATED APPLICATIONS This application claims the benefit of and priority to U.S. Patent Application No. 17 / 476,858, filed September 16, 2021, the entire disclosure of which is incorporated herein by reference. [Background technology]
[0003] Blockchain was initially created as a storage mechanism used to perform payment transactions using cryptocurrencies. Its use offers several advantages such as decentralization, distributed computing, and transaction transparency, while providing anonymity for the individuals or entities involved in the transaction. A relatively favorable property of blockchain is the immutability of its records: all transactions made part of the chain are stored and are immutable due to the computational power and bandwidth limitations required, especially as the chain grows and the blockchain network adds more nodes.
[0004] Another preferred feature of blockchains is smart contracts, which are self-executing contracts that are stored on the blockchain and that are automatically executed upon the satisfaction of criteria, with a predetermined outcome based on inputs (also called dispatches) to the contract. Smart contracts are versatile and can be used for a number of purposes, such as escrow, where an amount of currency or other assets is automatically transferred upon the satisfaction of criteria, such as a transfer of ownership of a property or other asset. In some cases, smart contracts can be configured to be executed dozens or hundreds of times for convenience or efficiency. In such cases, the contracts are executed serially, with the contracts executed for each dispatch, one at a time, until all applicable dispatches have been executed.
[0005] Traditional blockchain systems require smart contracts to be executed sequentially in case smart contract execution may violate the blockchain's rules. For example, a smart contract may have multiple dispatches attempting to transfer the same asset during smart contract execution. In such a case, only one execution should be completed successfully, and the next execution cannot be verified because it attempted to transfer an asset that has already been transferred. As a result, blockchains execute dispatches for smart contracts sequentially to prevent situations in which assets may be double-consumed or transferred. However, requiring sequential execution of smart contracts may take a significant amount of time, especially when smart contracts involve a significant amount of input. In cases where a blockchain requires blocks to be added frequently (e.g., on the order of milliseconds), sequential execution may be too slow for the blockchain.
[0006] Therefore, there is a need for a technical system that can utilize powerful computing resources to perform the desired functions, and this should be done without restrictions and delays in adding new blocks to the blockchain, while preventing unauthorized transactions and transfers of assets. Summary of the Invention
[0007] The present disclosure provides a system and method for parallel execution of dispatches in a smart contract on a blockchain. When a blockchain node executes a smart contract, the blockchain node first identifies all dispatches for execution using the smart contract. Prior to starting execution, the blockchain node identifies reference data for each dispatch, which may be a previous transaction on the blockchain where assets will be transferred again as part of the execution of the smart contract for that dispatch. All dispatches with the same reference value are grouped together, and a single dispatch from each group is selected by the blockchain node using a predefined criterion, such as an ordering of hash values contained within each dispatch. The blockchain node executes the smart contract in parallel using the selected dispatches from all groups and any single dispatch, which allows the smart contract to be executed for all valid dispatches much faster than using sequential execution. Because only a single dispatch is selected for all dispatches with a common reference value, there is no risk of the reference being used more than once, which is prohibited in the blockchain (e.g., such a transaction would fail validation). As a result, smart contracts can be executed in parallel, improving processing times, without sacrificing the benefits of blockchain or putting any blockchain data at risk.
[0008] A method for parallel execution of dispatches in a smart contract on a blockchain includes the steps of: receiving, by a receiver of a blockchain node in a blockchain network, a smart contract associated with a blockchain; identifying, by a processor of the blockchain node, a plurality of dispatches as inputs for the smart contract; and separating, by the processor of the blockchain node, the plurality of dispatches into one or more sets of dispatches, each set of dispatches including at least one dispatch, and each dispatch in a set of dispatches including a common reference value associated with an entry in a preceding block in the blockchain. determining, by a processor of the blockchain node, a valid dispatch for each of the one or more sets of dispatches based on predetermined criteria; executing, by the processor of the blockchain node, the smart contract with the one valid dispatch for each of the one or more sets of dispatches; generating, by the processor of the blockchain node, a new block for the blockchain, the new block including one or more blockchain data items, the one or more blockchain data items including data generated by the execution of the smart contract; and transmitting, by a transmitter of the blockchain node, the generated new block to a plurality of additional nodes in the blockchain network.
[0009] 10. A system for parallel execution of dispatches in a smart contract on a blockchain, the system comprising: a blockchain network; a blockchain node included in the blockchain network; and a plurality of additional nodes in the blockchain network, the blockchain node including: a receiver for receiving a smart contract associated with a blockchain; a processor configured to perform the steps of: identifying a plurality of dispatches as inputs for the smart contract; separating the plurality of dispatches into one or more sets of dispatches, each set of dispatches including at least one dispatch, and each dispatch in the set of dispatches including a common reference value associated with an item in a preceding block in the blockchain; determining a valid dispatch of each of the one or more sets of dispatches based on predetermined criteria; executing the smart contract with the one valid dispatch for each of the one or more sets of dispatches; and generating a new block for the blockchain, the new block including one or more blockchain data items, the one or more blockchain data items including data generated by execution of the smart contract; and a transmitter configured to transmit the generated new block to the plurality of additional nodes. [Brief description of the drawings]
[0010] The scope of the present disclosure is best understood from the following detailed description of illustrative embodiments when taken in conjunction with the accompanying drawing figures, which include:
[0011] [Figure 1] FIG. 1 is a block diagram illustrating a high-level system architecture for parallel execution of dispatches in smart contracts, according to an example embodiment. [Diagram 2]FIG. 2 is a block diagram illustrating a blockchain node of a system for parallel execution of dispatches within the smart contract of FIG. 1 in accordance with an exemplary embodiment. [Diagram 3] 3 is a flow diagram illustrating a process for parallel execution of dispatches in smart contracts using the blockchain nodes of FIG. 2 and the system of FIG. 1 according to an example embodiment. [Figure 4] 1 is a flow diagram illustrating an example method for parallel execution of dispatches in a smart contract, according to an example embodiment. [Diagram 5] FIG. 1 is a block diagram illustrating a computer system architecture, in accordance with an exemplary embodiment.
[0012] Further areas of applicability of the present disclosure will become apparent from the following detailed description. The detailed description of the exemplary embodiments is intended for purposes of illustration only and is not intended to necessarily limit the scope of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] Glossary Blockchain: A public ledger of all transactions of a blockchain-based currency. One or more computing devices may include a blockchain network, which may be configured to process and record transactions as part of a block in the blockchain. Once a block is complete, it is added to the blockchain, thereby updating the transaction record. In many embodiments, the blockchain may be a chronological ledger of transactions, or may be presented in any other order suitable for use by the blockchain network. In some embodiments, a transaction recorded in the blockchain may include a destination address and a currency amount. The blockchain then records how much currency is attributed to a particular address. In some embodiments, a transaction may or may not be financial-related, and may include additional or different information (e.g., source address, timestamp, etc.). In some embodiments, the blockchain may additionally or alternatively include almost any type of data in the form of transactions that is or needs to be placed in a distributed database that maintains a continuously growing list of data records that are hardened against tampering or revision. Alternatively, the blockchain may be verified and validated by the blockchain network by proof-of-work (PoW) and / or any other suitable verification technique associated therewith. In some cases, the data about a given transaction may further include additional data that is not directly part of the transaction that is added to the transaction data. In some examples, the inclusion of such data in the blockchain may constitute a transaction. In some such examples, the blockchain may not be directly associated with a particular digital, virtual, fiat, or other type of currency.
[0014] A system for parallel execution of smart contracts FIG. 1 illustrates a system 100 for grouping and parallel execution of dispatches as inputs to smart contracts on a blockchain through the use of predefined criteria.
[0015] The system 100 can include one or more blockchain nodes 102. Each blockchain node 102 can be part of a blockchain network 104. Each blockchain node 102 can be a computing system, as shown in Figures 2 and 5 and described in more detail below, configured to perform functions related to blockchain processing and management, which can include, for example: generating blockchain data values, validating proposed blockchain transactions, verifying digital signatures, generating new blocks, validating new blocks, and maintaining a copy of the blockchain.
[0016] A blockchain may be a distributed ledger that includes at least a number of blocks. Each block may include at least a block header and one or more data values. Each block header may include at least a timestamp, a block reference value, and a data reference value. The timestamp may be the time when the block header is generated and may be represented using any suitable method (e.g., UNIX timestamp, DateTime, etc.). The block reference value may be a value that references (e.g., based on the timestamp) a previous block in the blockchain. In some embodiments, the block reference value in the block header may be a reference to the block header of the most recently added block that precedes each block. In an exemplary embodiment, the block reference value may be a hash value generated by hashing the block header of the most recently added block. Similarly, the data reference value may be a reference to one or more data values stored in the block that includes the block header. In an exemplary embodiment, the data reference value may be a hash value generated by hashing the one or more data values. For example, the block reference value may be the root of a Merkle tree that is generated using one or more data values.
[0017] As a result of using a block reference value and a data reference value in each block header, the blockchain can be given immutability. Any attempt to make a change to the data value requires the generation of a new data reference value for the block, which in turn requires the generation of a new block reference value for the subsequent block, which in turn requires the generation of a new block reference value for each subsequent block. This must be performed and updated for every single blockchain node 102 in the blockchain network 104 before a new block is created and added to the blockchain in order for the change to be permanent. Computing and communication capacity limitations can make such changes extremely difficult or impossible, and thus the blockchain achieves immutability.
[0018] In some embodiments, a blockchain can be used to store information about blockchain transactions made between two different blockchain wallets. A blockchain wallet can contain a private key of a cryptographic key pair that can be used to generate a digital signature that can serve as a payer's authorization for a blockchain transaction, and the digital signature can be verified by the blockchain network 104 using the public key of the cryptographic key pair. In some cases, the term "blockchain wallet" can refer specifically to a private key. In some cases, the term "blockchain wallet" can refer to a computing device (e.g., sender device 106 or receiver device 108a, 108b) that stores a private key for use in blockchain transactions. For example, each computing device can have its own private key for each cryptographic key pair, and each can be a blockchain wallet for use in transactions with a blockchain associated with the blockchain network. The computing device can be any type of device suitable for storing and utilizing a blockchain wallet, such as a desktop computer, a laptop computer, a notebook computer, a tablet computer, a mobile phone, a smartphone, a smart watch, a smart TV, a wearable computing device, an embeddable computing device, etc.
[0019] Each blockchain data value stored in the blockchain may correspond to a blockchain transaction or storage of other data, as appropriate. A blockchain transaction may include at least the following: a digital signature of the sender of the currency (e.g., sender device 106) generated using the sender's private key, a blockchain address of the recipient of the currency (e.g., receiver devices 108a, 108b) generated using the recipient's public key, and the blockchain currency amount to be transferred or other data to be stored. If the blockchain is used for data storage purposes other than currency, such other data may be substituted for the currency amount. In some blockchain transactions, the transaction may also include: one or more sender blockchain addresses where the blockchain currency is currently stored (e.g., if access to such currency is established by a digital signature); and an address for any changes held by the sender, generated using the sender's public key. Addresses to which cryptocurrency that can be used in future transactions is sent are called "output" addresses because they were previously used to capture the output of a previous blockchain transaction, and are called "unspent transactions" because there is currency sent to the address in a previous transaction that has not yet been spent. In some cases, blockchain transactions can also include the sender's public key for entities to use in validating the transaction. For traditional processing of blockchain transactions, such data can be provided to a blockchain node 102 in a blockchain network 104 by either the sender or the recipient.The node can verify the digital signature using the public key in the sender's wallet's cryptographic key pair and can verify access to the sender's funds (e.g., if an unspent transaction has been sent to an address that has not yet been spent and is associated with the sender's wallet), a process known as "confirming" the transaction, and the blockchain transaction is then included in a new block. In a traditional blockchain implementation, the new block may be verified by other nodes in the blockchain network 104 before being added to the blockchain and distributed to all blockchain nodes 102 in the blockchain network 104. If the blockchain data value is not related to a blockchain transaction but instead to the storage of other types of data, then the blockchain data value may still include or involve verification of the digital signature.
[0020] In some embodiments, the blockchain may be a permissioned blockchain. A permissioned blockchain may be a blockchain in which only authorized participants may transact (e.g., send or receive assets or provide data) using the blockchain. In such cases, authorization may be provided to participants by the blockchain node 102, for example by being provided with a cryptographic key pair or by providing their public key to the blockchain node 102 for registration, and the blockchain node 102 may ensure that any transaction submitted to the blockchain network 104 is from an authorized device (e.g., by verifying the transaction using the registered public key). In such embodiments, the functions that may be performed by any participant in the blockchain may be limited and / or subject to authorization.
[0021] In the system 100, smart contracts can be stored in a blockchain associated with the blockchain network 104. Smart contracts can be self-executing contracts, and the result of a smart contract after execution can be a new blockchain data value, such as a new blockchain transaction to be stored in the blockchain. A smart contract can be executed with one or more inputs, also referred to as dispatches, and a new blockchain data value is generated. A smart contract can be self-executing and can automatically trigger execution when a valid dispatch is identified, or when certain criteria are met, resulting in a particular dispatch being provided to the smart contract as an input for execution. In an exemplary embodiment, each dispatch for a smart contract will point to a previous blockchain data value on the blockchain, which can be done, for example, by using a hash value or a unique identification value of the blockchain data value, which is stored in the blockchain along with the blockchain data value. When a dispatch is input to a smart contract as an input, execution of the smart contract can result in a new blockchain data value, such as a blockchain transaction, which in some cases can depend on the dispatch itself, for example, the value in the dispatch can result in a different output than the execution of the smart contract.
[0022] For example, a smart contract may be used for escrow. In such an example, a buyer associated with the sender device 106 may be interested in purchasing an asset from a seller associated with the receiver device 108a for an agreed upon currency amount. The buyer may transfer the currency amount to an escrow blockchain wallet via a blockchain transaction. The smart contract may be stored as part of the transaction or separately from the transaction, and the smart contract monitors the blockchain for evidence of a transfer of ownership of the asset from the seller to the buyer, which may include, for example, by storing the transfer agreement or a hash thereof in the blockchain. Once evidence is detected, the smart contract may execute, thereby transferring the currency from the escrow blockchain wallet to a specified seller account. In such a case, the evidence of the transfer of ownership may be a dispatch, and the result upon execution is a transaction for the currency to be transferred from the escrow wallet to the seller wallet.
[0023] In the system 100, smart contracts can be stored in a blockchain or provided to blockchain nodes 102 with which multiple different dispatches can be associated. In traditional systems, blockchain nodes 102 would execute smart contracts for each dispatch sequentially. In the system 100, blockchain nodes 102 can be configured to execute all dispatches for a smart contract in parallel.
[0024] The blockchain node 102 can first identify all dispatches applicable to the smart contract, which can be identified using information contained in the smart contract itself. For example, the smart contract can explicitly list all dispatches or can include data that can be used by the blockchain node 102 to identify the dispatch, such as by specifying one or more blockchain wallets, blockchain data values, transaction identifiers, etc. The blockchain node 102 can then group all dispatches into a set of dispatches. Each dispatch in the set of dispatches can have a common reference value, which can be a blockchain data value or other value stored in the blockchain to which the dispatch points. For example, the first dispatch can point to a blockchain transaction that transfers 100 units of currency to the sender device 106, and execution of the smart contract will transfer those 100 units of currency from the sender device 106 to the receiver device 108a. As an example, the second dispatch may point to the same blockchain transaction that transfers 100 units of currency to the sender device 106, and execution of the smart contract for that dispatch will transfer those 100 units of currency from the sender device 106 to the receiver device 108b. In such an example, both dispatches will utilize the same reference value (e.g., the blockchain transaction that transfers 100 units of currency to the sender device 106). In this manner, both dispatches will be placed into the same set by the blockchain node 102.
[0025] Once the blockchain node 102 has organized all dispatches into sets of dispatches (some dispatches may be the only dispatches in a set), the blockchain node 102 may then select a single dispatch for each set. The blockchain node 102 may select a single dispatch for a set of dispatches using any suitable predetermined criteria. As an example, the blockchain node 102 may rank all dispatches in the set and select a first priority dispatch or a predetermined dispatch in the rank (e.g., middle priority, last priority, etc.). The blockchain node 102 may use any suitable data for ranking, such as a hash of the transaction resulting from the execution of the smart contract, the time the dispatch was received or entered into the smart contract, the rank of the dispatch in the smart contract itself, a hash of the dispatch itself generated by the blockchain node 102, etc. As another example, the blockchain nodes 102 may use an algorithm for random or pseudorandom selection, with each blockchain node 102 in the blockchain network 104 utilizing the same algorithm with the same applicable inputs (e.g., seeds, weights, etc.) such that every blockchain node 102 makes the same selection. Any suitable criteria may be used that ensures that a single dispatch selected by a blockchain node 102 for a set of dispatches is the same for every blockchain node 102 processing.
[0026] Once a single dispatch is selected for each set, the blockchain node 102 may execute the smart contract for each set of dispatches using the selected single dispatch for that set. In an example embodiment, the blockchain node 102 may execute the smart contract executions in parallel, where the number of parallel executions may be based on the number of processor cores of the blockchain node 102, available computing resources, or other suitable criteria. For example, the blockchain node 102 may have a processor with eight cores and may execute eight smart contract executions at once, which may result in significantly faster (e.g., approximately eight times faster) execution of smart contracts than using sequential execution.
[0027] Execution of the smart contract for each set of dispatches may result in the generation of new blockchain data values, or data to be included in the blockchain data values, for each set of dispatches. The blockchain node 102 may then use the blockchain data values in a new block generated by the blockchain node 102, using traditional methods and systems. The generated block may be sent to other blockchain nodes 102 in the blockchain network 104 for verification and validation, using traditional methods. Once the new block is validated, the block may be added to the blockchain by all blockchain nodes 102 in the blockchain network 104.
[0028] By organizing dispatches into sets of dispatches and executing only a single dispatch from each set, invalid blockchain transactions are not added to the blockchain because no reference value is used more than once. For example, in the above example, only one of the instances of the transfer of 100 units of currency by sender device 106 is selected because each transfer instance is within a single set of dispatches. As a result, only receiver device 108a or receiver device 108b (e.g., depending on the criteria used to select a single dispatch within the set) receives 100 units of currency in the blockchain, eliminating the possibility of double spending in the blockchain network 104. Thus, the methods and systems described in this disclosure greatly increase the processing speed for smart contract execution without compromising any of the security or properties of the blockchain.
[0029] Blockchain Node 2 illustrates an embodiment of a blockchain node 102, such as the blockchain node 102 in the system 100. Those skilled in the art will appreciate that the embodiment of the blockchain node 102 illustrated in FIG. 2 is provided for illustrative purposes only and is not an exhaustive list of all possible configurations of a blockchain node 102 suitable for performing the functions of the present disclosure. For example, computer system 500 illustrated in FIG. 5 and described in more detail below may be a suitable configuration of a blockchain node 102.
[0030] The blockchain node 102 may include a receiving device 202. The receiving device 202 may be configured to receive data over one or more networks via one or more network protocols. In some examples, the receiving device 202 may be configured to receive data from other blockchain nodes 102, sender device 106, receiver device 108a, 108b, and other systems and entities via one or more communication methods, such as radio frequency, local area network, wireless area network, cellular communication network, Bluetooth, the Internet, etc. In some embodiments, the receiving device 202 may include multiple devices (e.g., different receiving devices receiving data over different networks (e.g., a first receiving device receiving data over a local area network and a second receiving device receiving data over the Internet)). The receiving device 202 may receive an electronic data signal transmitted. Then, upon receipt of the data signal by the receiving device 202, data may be superimposed on the data signal and may be decoded, parsed, read, or obtained. In some embodiments, the receiving device 202 may include an analysis module for analyzing the received data signal to obtain the data superimposed thereon. For example, the receiving device 202 may include an analysis program configured to receive and convert received data signals into usable input for functions performed by the processing device to implement the methods and systems of the present disclosure.
[0031] The receiving device 202 can be configured to receive data signals transmitted electronically by other blockchain nodes 102, which may be overlaid or otherwise encoded with blockchain data values, data value identifiers, blocks, blockchain data, confirmation messages, smart contracts, predefined criteria, dispatches, etc. The receiving device 202 can be configured to receive data signals transmitted electronically by the sender device 106 and / or the receiver devices 108a, 108b, which may be overlaid or otherwise encoded with blockchain data values, public keys, digital signatures, blockchain transaction data, smart contracts, dispatches for smart contracts, approval requests for the blockchain network 104, etc.
[0032] The blockchain node 102 may also include a communication module 204. The communication module 204 may be configured to transfer data between modules, engines, databases, memory, and other components of the blockchain node 102 for use in performing the functions of the present disclosure. The communication module 204 may include one or more communication types and may use various communication methods for communication within a computing device. For example, the communication module 204 may include a bus, a connection pin connector, wires, etc. In some embodiments, the communication module 204 may also be configured to communicate between internal components of the blockchain node 102 and external components of the blockchain node 102 (e.g., an externally connected database, a display device, an input device, etc.). The blockchain node 102 may also include a processing unit. The processing unit may be configured to perform the functions of the blockchain node 102 of the present disclosure. This will be apparent to one of ordinary skill in the art. In some embodiments, the processing unit may include multiple engines and / or modules (e.g., the query module 214, the generation module 216, the validation module 218, etc.) that are specifically configured to perform one or more functions of the processing unit. As disclosed herein, the term "module" may refer to software or hardware running on specifically programmed hardware to receive input, perform one or more operations using the input, and provide an output. The inputs, outputs, and operations performed by the various modules will be apparent to one of ordinary skill in the art based on this disclosure.
[0033] The blockchain node 102 may also include blockchain data 206, which may be stored in the memory 212 of the blockchain node 102 or stored in or accessible by a separate area within the blockchain node 102. The blockchain data 206 may include a blockchain, which may comprise a number of blocks, and which may be associated with the blockchain network 104. The blockchain data 206 may additionally or alternatively include any data associated with one or more blockchain wallets and usable by the blockchain node 102, which may include: cryptographic key pairs, unspent transaction outputs, digital asset amounts, network identifiers for the blockchain network 104, smart contracts, signature generation algorithms, encryption algorithms, transaction account data, account balances, third-party communication information, predefined criteria, registered participating devices, device registration data, etc.
[0034] The blockchain node 102 may also include a memory 212. The memory 212 may be configured to store data (e.g., public keys, private keys, symmetric keys, etc.) for use by the blockchain node 102 in performing the functions of the present disclosure. The memory 212 may be configured to store data using appropriate data formatting and schema and may be any suitable type of memory (e.g., read-only memory, random access memory, etc.). The memory 212 may include, for example, cryptographic keys and algorithms, communication protocols and standards, data formatting standards and protocols, program code for modules and application programs for the processing unit, and other suitable data used by the blockchain node 102 in performing the functions of the present disclosure. This will be apparent to those of skill in the art upon reading this disclosure. In some embodiments, the memory 212 may include a relational database using Structured Query Language (SQL) to store, identify, modify, update, access, etc., stored structured data sets. Memory 212 may be configured to store, for example, cryptographic keys, salts, nonces, communication information for other computing systems, generation algorithms, predetermined criteria, ordering rules, and the like.
[0035] The blockchain node 102 may include a query module 214. The query module 214 may be configured to run a query on a database to identify information. The query module 214 may receive one or more data values or query strings, and based thereon, may run a query string on an indicated database (e.g., memory 212 of the blockchain node 102) to identify information stored therein. The query module 214 may then output the identified information to an appropriate engine or module of the blockchain node 102 as needed. The query module 214 may, for example, run a query on the blockchain data 206 to identify all possible dispatches for smart contracts that have been launched for execution.
[0036] The blockchain node 102 may also include a generation module 216. The generation module 216 may be configured to generate data used by the blockchain node 102 in performing functions of the present disclosure. The generation module 216 may receive instructions as input values, generate data based on the instructions, and output the generated data to one or more modules of the blockchain node 102. For example, the generation module 216 may be configured to generate a cryptographic key pair, generate a digital signature, generate a blockchain data value, generate a new block, execute a smart contract using a selected dispatch, etc. The generation module 216 may also be configured to select (e.g., generate) a single dispatch from the set of dispatches using a predetermined criterion, which may include ordering each dispatch in the set of dispatches based on applicable rules and selecting a single dispatch from the ordered set as indicated by the predetermined criterion.
[0037] The blockchain node 102 may also include a validation module 218. The validation module 218 may be configured to perform validation on the blockchain node 102 as part of the functionality of the present disclosure. The validation module may receive as input instructions, which may include data used in performing the validation, perform the validation on demand, and output the results of the validation to another module or engine of the blockchain node 102. The validation module 218 may be configured to perform, for example: verify digital signatures using appropriate signature generation algorithms and keys, verify blockchain transactions, verify smart contracts, verify the eligibility of participating devices, etc.
[0038] The blockchain node 102 may also include a transmitting device 220. The transmitting device 220 may be configured to transmit data over one or more networks via one or more network protocols. In some examples, the transmitting device 220 may be configured to transmit data to other blockchain nodes 102, sender devices 106, receiver devices 108a, 108b, and other entities via one or more communication methods, such as a local area network, a wireless area network, cellular communication, Bluetooth, radio frequency, the Internet, etc. In some embodiments, the transmitting device 220 may include multiple devices (e.g., different transmitting devices for transmitting data over different networks (e.g., a first transmitting device transmitting data over a local area network and a second transmitting device transmitting data over the Internet)). The transmitting device 220 may electronically transmit a data signal with the superimposed data, the data being analyzed by a receiving computing device. In some embodiments, the transmitting device 220 may include one or more modules for superimposing, encoding, or formatting data into a data signal suitable for transmission.
[0039] The sending device 220 can be configured to electronically send data signals to other blockchain nodes 102, where the data signals can be overlaid or encoded with blockchain data values, data value identifiers, blocks, blockchain data, confirmation messages, smart contracts, predefined criteria, dispatches, etc. The sending device 220 can also be configured to electronically send data signals to the sender device 106 and / or receiver devices 108a, 108b, where the data signals can be overlaid or encoded with requests for smart contracts or dispatches, authorization data for joining the blockchain network 104, blockchain data 206, etc.
[0040] Processing for parallel execution of smart contracts FIG. 3 illustrates a process 300 for parallel execution of dispatches in smart contracts performed by a blockchain node 102 in the system 100 of FIG.
[0041] At S302, a receiving device 202 of a blockchain node 102 may receive the smart contract for execution. In some cases, the smart contract may be submitted by a participating device, such as the sender device 106 or the receiver devices 108a, 108b. In other cases, the smart contract may be stored in an existing block in a blockchain associated with the blockchain network 104 to which the blockchain node 102 belongs. The smart contract may be triggered for execution (e.g., as a result of detection of a dispatch or expiration), such as based on criteria defined in the contract itself. At S304, a query module 214 of the blockchain node 102 may perform a query on the blockchain data 206 to identify all dispatches applicable to the smart contract. This may be done, for example, by identifying the dispatch in the smart contract itself stored in the blockchain or by identifying the dispatch based on criteria in the smart contract.
[0042] In S306, the generation module 216 of the blockchain node 102 can generate a set of multiple different dispatches for all dispatches identified by the blockchain node in S304. Each dispatch in the set of dispatches can include a common reference value, which can be a hash value of a previous blockchain data value stored in the blockchain, such as the one used to transfer assets to the sender device 106 in the example above. In cases where a dispatch only has a reference value that is not shared with any other dispatch, the dispatch can be the only dispatch in the set of dispatches.
[0043] At S308, the blockchain node 102 may determine whether there are any sets of dispatches with multiple dispatches in the set. And if there is at least one set of dispatches that includes multiple dispatches, at S310, the creation module 216 of the blockchain node 102 may select a single dispatch for each such set using a predetermined criterion. In one example, the selection of a single dispatch may include ordering all of the dispatches in the set and selecting a single dispatch from the ordered set according to the predetermined criterion. Once a single dispatch has been identified for each set of dispatches, or if there was no set of dispatches with more than one dispatch, at S312, the creation module 216 of the blockchain node 102 may execute a smart contract for each set of dispatches using the single identified dispatch or only one dispatch for each set. The execution of the smart contract for each set of dispatches may generate a new blockchain data value for each set. In an example embodiment, the execution of the smart contracts executed by the blockchain node 102 at S312 may be executed in parallel.
[0044] At S314, the generation module 216 of the blockchain node 102 can generate a new block using the blockchain data values generated as a result of the execution of the smart contract. The new block can include a block header, which can include a timestamp and a reference to the previous block in the blockchain, as well as references to all blockchain data values included in the new block and the generated blockchain data values. In some cases, additional blockchain data values can also be included in the new block, such as other transactions, additional data, smart contracts, etc., which can be received by the blockchain node 102 (e.g., using the receiving device 202) in a standard process. At S316, the sending device 220 of the blockchain node 102 can electronically send the new block to multiple other blockchain nodes 102 in the blockchain network 104 for confirmation. The other blockchain nodes 102 can verify and confirm the new block using traditional methods and systems, and if confirmation is obtained, the new block can be added to the blockchain in all blockchain nodes 102 in the blockchain network 104.
[0045] An exemplary method for the parallel execution of smart contracts FIG. 4 illustrates a method 400 for parallel execution of multiple dispatches on smart contracts in a blockchain using predefined criteria.
[0046] At S402, a smart contract associated with the blockchain may receive a block by a receiver (e.g., receiving device 202) of a blockchain node (e.g., blockchain node 102) in a blockchain network (e.g., blockchain network 104). At S404, a plurality of dispatches may be identified as inputs for the smart contract by a processor of the blockchain node (e.g., via query module 214). At S406, the plurality of dispatches may be separated into one or more sets of dispatches by a processor of the blockchain node (e.g., via generation module 216). Each set of dispatches includes at least one dispatch, and each dispatch in the set of dispatches includes a common reference value associated with an item in a preceding block in the blockchain.
[0047] At S408, a valid dispatch can be determined by a processor (e.g., via the generating module 216) of the blockchain node for each of the one or more sets of dispatches based on a predetermined criterion. At S410, a smart contract is executed by a processor (e.g., via the generating module 216) of the blockchain node with a valid dispatch for each of the one or more sets of dispatches. At S412, a new block can be generated for the blockchain by the processor (e.g., via the generating module 216). The new block includes one or more blockchain data items, and the one or more blockchain data items include data generated by the execution of the smart contract. At S414, the generated new block can be transmitted by a transmitter (e.g., the sending device 220) of the blockchain node to multiple additional nodes in the blockchain network.
[0048] In one embodiment, the predetermined criteria may include ordering each dispatch within the set of dispatches, and a valid dispatch for the set of dispatches may be the first dispatch after ordering the set of dispatches. In a further embodiment, each dispatch within the set of dispatches may be ordered based on a hash value included in each dispatch. In some embodiments, the smart contract may be executed in parallel with one valid dispatch for each of one or more sets of dispatches. In one embodiment, the blockchain may be a permissioned blockchain.
[0049] In some embodiments, the common reference value can be an identifier of a blockchain transaction in the blockchain. In one embodiment, executing the smart contract with a valid dispatch can generate a new blockchain transaction that transfers assets, and the data generated by the execution of the smart contract can include a new blockchain transaction for each of one or more sets of dispatches. In a further embodiment, the assets transferred in the new blockchain transaction for a valid dispatch can be identified in a common reference value included in the set of dispatches that includes the valid dispatch.
[0050] Computer System Architecture 5 illustrates a computer system 500 in which embodiments of the present disclosure or portions thereof may be implemented as computer readable code. For example, the blockchain node 102 of FIGS. 1 and 2 may be implemented in the computer system 500 using hardware, a non-transitory computer readable medium having stored instructions, or a combination thereof, and may be implemented in one or more computer systems or other processing systems. The hardware may embody modules and components used to implement the methods of FIGS. 3 and 4.
[0051] Where programmable logic is used, such logic may be executed on commercially available processing platforms configured with executable software code, resulting in special purpose or dedicated devices (e.g., programmable logic arrays (PGAs), application specific integrated circuits (ASICs), etc.). Those skilled in the art will appreciate that embodiments of the disclosed subject matter may be implemented in a variety of computer system configurations, including multi-core, multi-processor systems, minicomputers, mainframe computers, distributed functionality linked or clustered computers, and pervasive or miniature computers that may be implemented in virtually any device. For example, at least one processor unit and memory may be used to implement the above embodiments.
[0052] A processor unit or device of the present disclosure may be a single processor, multiple processors, or a combination thereof. A processor device may have one or more processor “cores.” The terms “computer program medium,” “non-transitory computer-readable medium,” and “computer usable medium” of the present disclosure are generally used to refer to tangible media (e.g., removable storage unit 518, removable storage unit 522, and a hard disk installed in hard disk drive 512, etc.).
[0053] Various embodiments of the present disclosure are described with respect to this exemplary computer system 500. After reading this disclosure, it will be obvious to one of ordinary skill in the art how to implement the present disclosure using other computer systems and / or computer architectures. Although operations are disclosed as sequential processes, some operations may in fact be performed in parallel, concurrently and / or in a distributed environment, where the program code is stored locally or remotely for access by a single processor or multi-processor machine. Furthermore, in some embodiments, the order of operations can be rearranged without departing from the spirit of the disclosed subject matter.
[0054] The processor unit 504 may be a special purpose or general purpose processor unit that is specially configured to perform the functions of the present disclosure. The processor unit 504 may be connected to a communication infrastructure 506 (e.g., a bus, a message queue, a network, a multi-core message passing scheme, etc.). The network may be any network suitable for performing the functions of the present disclosure, and may include a local area network (LAN), a wide area network (WAN), a wireless network (e.g., Wifi), a mobile communication network, a satellite network, the Internet, fiber optics, coaxial cable, infrared, radio frequency (RF), or any combination thereof. Other suitable network types and configurations will be apparent to those skilled in the art. The computer system 500 may also include a main memory 508 (e.g., random access memory, read only memory, etc.) and may also include a secondary memory 510. The secondary memory 510 may include a hard disk drive 512 and a removable storage drive 514 (e.g., a floppy disk drive, a magnetic tape drive, an optical disk drive, a flash memory, etc.).
[0055] The removable storage drive 514 may read from and / or write to the removable storage unit 518 in a well-known manner. The removable storage unit 518 may include a removable storage medium that can be read from and written to by the removable storage drive 514. For example, if the removable storage drive is a floppy disk drive or a USB port, the removable storage unit 518 may be a floppy disk or a portable flash drive, respectively. In one embodiment, the removable storage unit 518 may be a non-transitory readable recording medium.
[0056] In some embodiments, secondary memory 510 may include alternative means for allowing computer programs or other instructions to be loaded into computer system 500 (e.g., removable storage unit 522 and interface 520). Examples of such means may include program cartridges and cartridge interfaces (e.g., as found in video game systems), removable memory chips (e.g., EEPROM, PROM, etc.) and associated sockets, other removable storage units 522 and interfaces 520, as will be apparent to those skilled in the art.
[0057] Data stored in computer system 500 (e.g., in main memory 508 and / or secondary memory 510) may be stored on any type of suitable computer-readable medium, such as optical storage (compact disc, digital versatile disc, Blu-ray disc, etc.) or magnetic tape storage (e.g., hard disk drive). The data may be organized in any type of suitable database structure (e.g., a relational database, a Structured Query Language (SQL) database, a distributed database, an object database, etc.). Suitable structures and storage types will be apparent to those skilled in the art.
[0058] Computer system 500 may also include a communications interface 524. Communications interface 524 may allow software and data to be sent and received between computer system 500 and external devices. Exemplary communications interface 524 may include a modem, a network interface (e.g., an Ethernet card), a communications port, a PCMCIA slot and card, and the like. The software and data transferred through communications interface 524 may be in the form of signals. The signals may be electronic, electromagnetic, optical, or other signals as would be apparent to one skilled in the art. The signals propagate through communications path 526. The paths are configured to carry the signals and may be implemented using wire, cable, fiber optics, a telephone line, a cellular phone link, a radio frequency link, and the like.
[0059] The computer system 500 may further include a display interface 502. The display interface 502 may be configured to allow data to be transferred between the computer system 500 and an external display 530. Exemplary display interfaces 502 may include a high-definition multimedia interface (HDMI), a digital visual interface (DVI), a video graphics array (VGA), etc. The display 530 may be any suitable type of display to display data transferred via the display interface 502 of the computer system 500. The display 830 may include a cathode ray tube (CRT) display, a liquid crystal display (LCD), a light emitting diode (LED) display, a capacitive touch display, a thin film transistor (TFT) display, etc.
[0060] The computer program medium and computer usable medium may refer to memory (e.g., main memory 508 and secondary memory 510), which may be semiconductor memory (DRAM, etc.). These computer program products may be means for providing software to the computer system 500. Computer programs (e.g., computer control logic) may be stored in the main memory 508 and / or secondary memory 510. Computer programs may also be received via the communication interface 524. Such computer programs, when executed, may enable the computer system 500 to perform the methods of the present disclosure. In particular, the computer programs, when executed, may enable the processor unit 504 to perform the methods shown in Figures 3 and 4 as described herein. Such computer programs thus represent the controller of the computer system 500. The present disclosure is implemented using software executed on hardware, which may be stored in the computer program product and may be loaded into the computer system 500 using the removable storage drive 514, the interface 520, and the hard disk drive 512 or the communication interface 524.
[0061] The processor unit 504 may include one or more modules or engines configured to perform the functions of the computer system 500. Each module or engine may be implemented using hardware, and in some embodiments, software (e.g., which corresponds to program code and / or programs stored in the main memory 508 or secondary memory 510) executing on the hardware. In such embodiments, the program code may be compiled by the processor unit 504 (e.g., by a compilation module or engine) before execution by the hardware of the computer system 500. For example, the program code may be source code (e.g., assembly language or machine code) written in a programming language that is translated into a lower-level language for execution by the processor unit 504 and / or any additional hardware components of the computer system 500. The compilation process may include the use of lexical analysis, preprocessing, syntax analysis, semantic analysis, syntax-driven translation, code generation, code optimization, and any other techniques suitable for translating program code into a lower-level language for control of the computer system 500 to perform the functions of the present disclosure. Those skilled in the art will appreciate that such processing results in computer system 500 being a specially configured computer system 500 that is uniquely programmed to perform the functions described above.
[0062] Among other features, technology consistent with the present disclosure provides a system and method for parallel execution of dispatches in smart contracts on a blockchain. While various exemplary embodiments of the systems and methods of the present disclosure are described above, it should be understood that they are presented for purposes of illustration only and not limitation. It is not exhaustive and does not limit the present disclosure to the precise forms disclosed. Modifications and variations are possible in light of the above teachings. Modifications and variations may be obtained from implementations of the present disclosure without departing from the scope or spirit of the present disclosure.
Claims
1. 1. A method for parallel execution of dispatches in smart contracts on a blockchain, comprising: receiving, by a receiver of a blockchain node in the blockchain network, a smart contract associated with the blockchain; Identifying, by a processor of the blockchain node, a plurality of dispatches as inputs for the smart contract; Separating, by the processor of the blockchain node, the plurality of dispatches into one or more sets of dispatches, each set of dispatches including at least one dispatch, and each dispatch in a set of dispatches including a common reference value associated with an item in a preceding block in the blockchain; determining, by the processor of the blockchain node, a valid dispatch of each of the one or more sets of dispatches based on predetermined criteria; executing, by the processor of the blockchain node, the smart contract with the one valid dispatch for each of the one or more sets of dispatches; generating, by the processor of the blockchain node, a new block for the blockchain, the new block including one or more blockchain data items, the one or more blockchain data items including data generated by execution of the smart contract; transmitting, by a transmitter of the blockchain node, the generated new block to a plurality of additional nodes in the blockchain network; A method comprising:
2. 10. The method of claim 1 , the predetermined criteria includes ranking each dispatch within the set of dispatches; The method, wherein the one valid dispatch for a set of dispatches is a first dispatch after ordering of the set of dispatches.
3. 3. The method of claim 2, wherein each dispatch in the set of dispatches is ordered based on a hash value included in each of the dispatches.
4. 2. The method of claim 1, wherein the smart contract is executed in parallel with the one valid dispatch for each of the one or more sets of dispatches.
5. 2. The method of claim 1, wherein the blockchain is a permissioned blockchain.
6. 2. The method of claim 1, wherein the common reference value is an identifier of a blockchain transaction within the blockchain.
7. 10. The method of claim 1 , executing the smart contract with the one valid dispatch to generate a new blockchain transaction that transfers assets; wherein the data generated by execution of the smart contract includes the new blockchain transaction for each of the one or more sets of dispatches.
8. 8. The method of claim 7, wherein the assets transferred in a new blockchain transaction for a valid dispatch are identified in the common reference value contained within the set of dispatches that includes the valid dispatch.
9. 1. A system for parallel execution of dispatches in smart contracts on a blockchain, the system comprising: Blockchain network and A blockchain node included in the blockchain network; a plurality of additional nodes in the blockchain network; The blockchain node is A receiver that receives a smart contract associated with the blockchain; 1. A processor comprising: Identifying a plurality of dispatches as inputs for the smart contract; Separating the plurality of dispatches into one or more sets of dispatches, each set of dispatches including at least one dispatch, and each dispatch in a set of dispatches including a common reference value associated with an item in a preceding block in the blockchain; determining a valid dispatch from each of the one or more sets of dispatches based on predetermined criteria; executing the smart contract with the one valid dispatch for each of the one or more sets of dispatches; generating a new block for the blockchain, the new block including one or more blockchain data items, the one or more blockchain data items including data generated by execution of the smart contract; and a transmitter that transmits the generated new blocks to the plurality of additional nodes.
10. 10. The system of claim 9, the predetermined criteria includes ranking each dispatch within a set of dispatches; The one valid dispatch for a set of dispatches is a first dispatch after ordering of the set of dispatches.
11. 11. The system of claim 10, wherein each dispatch in the set of dispatches is ranked based on a hash value included in each of the dispatches.
12. 10. The system of claim 9, wherein the smart contracts are executed in parallel with the one valid dispatch for each of the one or more sets of dispatches.
13. 10. The system of claim 9, wherein the blockchain is a permissioned blockchain.
14. 10. The system of claim 9, wherein the common reference value is an identifier of a blockchain transaction within the blockchain.
15. 10. The system of claim 9, executing the smart contract with the one valid dispatch to generate a new blockchain transaction that transfers assets; wherein the data generated by execution of the smart contract includes the new blockchain transaction for each of the one or more sets of dispatches.
16. 16. The system of claim 15, wherein the assets transferred in a new blockchain transaction for a valid dispatch are identified in the common reference value included within the set of dispatches that includes the valid dispatch.
Citation Information
Patent Citations
Intelligent contract parallel execution method and device
CN111563820A
Registration and execution method, device and system of timed smart contract in block chain
CN112837157A
Parallel Transaction Execution in Blockchain Networks Based on Smart Contract Whitelists
JP2020518880A
Adding concurrency to smart contracts
US20190087793A1
Partially-ordered blockchain
US20210194672A1
