Blockchain-implemented systems and methods for concurrent bytecode interpretation
Computer-implemented methods are provided that create and validate a spending blockchain transaction created by a node in a blockchain network and including a locking script representing an instance of an execution thread joined from a plurality of execution threads represented at least one previous blockchain transaction. The spending blockchain also represents an execution thread joined from the execution thread instances pointed to by the spending blockchain transaction. Once created and validated, the spending blockchain transaction can be communicated on a blockchain network for storage in a blockchain ledger. The blockchain transactions can implement thread-specific locking scripts and associated fork, join and barrier constructs for concurrent or asynchronous threads of execution. The blockchain transactions can be validated according to constraints of a smart contract that encodes the terms for the blockchain transactions. The blockchain transactions can further be mined, and stored in a blockchain ledger.
1 . A computer-implemented method comprising:
creating and validating a spending blockchain transaction that includes two or more transaction inputs Vin[x] and Vin[y], each transaction input respectively representing an execution thread of separate previous blockchain transaction, and a transaction output Vout[x] comprising a locking script representing an instance of an execution thread joined according to a join construct from execution thread instances of the transaction inputs; and
communicating the spending blockchain transaction on a blockchain network for storage in a blockchain:
wherein the spending blockchain transaction points to a plurality of locking scripts of one or more previous blockchain transactions and the plurality of locking scripts each represent an instance of the execution thread; and
wherein the locking script representing the execution thread joined from the execution thread instances pointed to by the spending blockchain transaction is generated by replicating a bytecode sequence of the plurality of locking scripts of the one or more previous blockchain transactions.
2 . The computer-implemented method of claim 1 , further comprising:
storing the one or more previous blockchain transactions in a blockchain maintained by the blockchain network.
3 . The computer-implemented method of claim 2 , wherein the spending blockchain transaction is created by a node of the blockchain network.
4 . The computer-implemented method of claim 1 , wherein the locking script representing the execution thread joined from the execution thread instances pointed to by the spending blockchain transaction is generated by replicating the bytecode sequence and interpreter code of the plurality of locking scripts of the one or more previous blockchain transactions.
5 . A system, comprising:
a processor; and
memory including executable instructions that, as a result of execution by the processor, causes the system to perform the computer-implemented method of claim 1 .
6 . A non-transitory computer-readable storage medium having stored thereon executable instructions that, as a result of being executed by a processor of a computer system, cause the computer system to perform the computer-implemented method of claim 1 .
7 . A computer-implemented method comprising:
creating and validating a spending blockchain transaction that includes two or more transaction inputs Vin[x] and Vin[y], each transaction input respectively representing an execution thread of separate previous blockchain transaction, and a transaction output Vout[x] comprising a locking script representing an instance of the execution thread joined according to a join construct from the execution thread instances of the transaction inputs;
communicating the spending blockchain transaction on a blockchain network for storage in a blockchain,
storing or accessing a collection of valid bytecode sequences; and
generating the locking script representing the execution thread joined from the execution thread instances pointed to by the spending blockchain transaction by replicating a valid bytecode sequence of the collection.
8 . The computer-implemented method of claim 7 , further comprising:
storing or accessing valid interpreter code; and
generating the locking script representing the execution thread joined from the execution thread instances pointed to by the spending blockchain transaction by replicating the valid bytecode sequence and the valid interpreter code of the collection.
9 . A computer-implemented method comprising:
creating and validating a spending blockchain transaction that includes two or more transaction inputs Vin[x] and Vin[y], each transaction input respectively representing an execution thread of separate previous blockchain transaction, and a transaction output Vout[x] comprising a locking script representing an instance of the execution thread joined according to a join construct from the execution thread instances of the transaction inputs; and
communicating the spending blockchain transaction on a blockchain network for storage in a blockchain:
wherein the spending blockchain transaction points to a plurality of locking scripts of one or more previous blockchain transactions and the plurality of locking scripts each represent an instance of the execution thread, and
wherein the spending blockchain transaction is created by generating execution state information for the execution thread joined from the execution thread instances pointed to by the spending blockchain transaction and including the execution state information into the locking script of the spending blockchain transaction.
10 . A computer-implemented method comprising:
creating and validating a spending blockchain transaction that includes two or more transaction inputs Vin[x] and Vin[y], each transaction input respectively representing an execution thread of separate previous blockchain transaction, and a transaction output Vout[x] comprising a locking script representing an instance of the execution thread joined according to a join construct from the execution thread instances of the transaction inputs;
communicating the spending blockchain transaction on a blockchain network for storage in a blockchain, wherein the spending blockchain transaction is received by a node of the blockchain network; and
validating, by the node, the spending blockchain transaction by verifying the locking script of the spending blockchain transaction against one or more conditions, wherein the verifying includes matching the locking script of the spending blockchain transaction to a plurality of locking scripts of one or more previous blockchain transactions and/or executing the plurality of locking scripts of the one or more previous blockchain transactions to generate resultant execution state information and then merging or combining such resultant execution state information.