Implementing logic gate functionality using a blockchain
The invention presents a solution in which blockchain Transactions are created to implement the functionality of a logic gate. The invention may be implemented on the Bitcoin platform or an alternative blockchain platform. The transaction includes a locking script which comprises instructions selected so as to implement the functionality of a logic gate, such as the XOR gate. When the script is executed (because a second transaction is attempting to spend the output associated with the locking script) the inputs will be processed by the conditional instructions to provide an output of TRUE or FALSE. The inputs are pre-processed by one or more computing agents so that they are evaluated to TRUE or FASLE prior to being used as inputs to the script. The second transaction is transmitted to the blockchain network for validation and, if determined to be valid, it will be written to the blockchain. Validation of the second transaction can be interpreted as a TRUE output. Thus, the locking script of the first transaction provides the functionality of the desired logic gate. The invention provides numerous advantages and can be used in a wide variety of applications, such as for the implementation of control systems and unit.
1. A computer-implemented control method comprising:
generating a locking script in a first blockchain transaction, the locking script comprising at least one instruction arranged to:
implement functionality of a logic gate; and
determine an expected output of the logic gate by processing a plurality of Boolean inputs to execute the locking script, wherein the plurality of Boolean inputs is provided as a result of using at least one computing resource or agent to process at least one input signal;
providing a further blockchain transaction comprising an unlocking script, the unlocking script comprising the functionality of the logic gate;
executing the unlocking script by presenting a combination of Boolean inputs specifying the plurality of Boolean inputs to the logic gate to produce an output of the logic gate;
as a result of determining that the output of the logic gate matches the expected output, presenting the further blockchain transaction to a blockchain network; and
as a result of the further blockchain transaction being validated, causing an action to be performed based on the output.
2. The computer-implemented control method according to claim 1 , wherein the logic gate is an OR gate, an XOR gate, a NAND gate, a NOR gate, a NOT gate, an XNOR gate, an IMPLY gate, or a Converse implication gate.
3. The computer-implemented control method according to claim 1 , wherein processing the at least one input signal to provide the plurality of Boolean inputs is performed by the at least one computing resource or agent prior to providing the plurality of Boolean inputs to the locking script.
4. The computer-implemented control method according to claim 1 , further comprising:
transmitting the further blockchain transaction and/or the first blockchain transaction to the blockchain network for validation.
5. The computer-implemented control method according to claim 1 , further comprising:
monitoring or searching the blockchain or the blockchain network to determine the presence or absence of the further blockchain transaction.
6. The computer-implemented control method according to claim 5 , further comprising:
providing an additional computing resource arranged to influence the behaviour of a device or a process based upon:
detection of the further blockchain transaction within the blockchain or the blockchain network; and/or
the validation of the further blockchain transaction.
7. The computer-implemented control method according to claim 6 , further comprising:
interpreting the detection of the further blockchain transaction within the blockchain or the blockchain network as a TRUE output of the logic gate.
8. The computer-implemented control method according to claim 1 , wherein validation of the further blockchain transaction within the blockchain network is dependent upon the execution of the unlocking script.
9. The computer-implemented control method according to claim 1 , further comprising:
controlling a device or a process based upon validity of the further blockchain transaction, wherein the validity is determined or established by a computer-based control agent, or by monitoring the blockchain network to determine that the further blockchain transaction has been validated by a network node, and/or by monitoring the state of the blockchain to determine that the further blockchain transaction has been written to the blockchain.
10. The computer-implemented control method according to claim 1 , wherein the at least one input signal comprises a numeric value, a constant value, a result of a hash function, a cryptographic key, a blockchain puzzle, and/or a Bitcoin other blockchain-related address.
11. The computer-implemented control method according to claim 1 , wherein the first blockchain transaction and/or the further blockchain transaction is generated and/or transmitted to the blockchain network by an automated process executing on a computing-based resource.
12. The computer-implemented control method according to claim 1 , wherein the at least one instruction:
comprises a Boolean condition or operator; and/or
is written and/or executed using a stack-based programming language.
13. A computer-implemented system, comprising:
one or more processors; and
memory including instructions that, as a result of execution by the one or more processors, cause the computer-implemented system to:
generate a locking script in a first blockchain transaction, the locking script comprising at least one instruction arranged to:
implement functionality of a logic gate; and
determine an expected output of the logic gate by processing a plurality of Boolean inputs to execute the locking script, wherein the plurality of Boolean inputs is provided as a result of using at least one computing resource or agent to process at least one input signal;
provide a further blockchain transaction comprising an unlocking script, the unlocking script comprising the functionality of the logic gate;
execute the unlocking script by presenting a combination of Boolean inputs specifying the plurality of Boolean inputs to the logic gate to produce an output of the logic gate;
as a result of determining that the output of the logic gate matches the expected output, present the further blockchain transaction to a blockchain network; and
as a result of the further blockchain transaction being validated, cause an action to be performed based on the output.
14. The computer-implemented system of claim 13 , wherein the logic gate is an OR gate, an XOR gate, a NAND gate, a NOR gate, a NOT gate, an XNOR gate, an IMPLY gate, or a Converse implication gate.
15. The computer-implemented system of claim 13 , wherein processing the at least one input signal to provide the plurality of Boolean inputs is performed by the at least one computing resource or agent prior to providing the plurality of Boolean inputs to the locking script.
16. The computer-implemented system of claim 13 , wherein the instructions include further instructions that further cause the system to:
transmit the further blockchain transaction and/or first blockchain transaction to the blockchain network for validation.
17. The computer-implemented system of claim 13 , wherein the instructions include further instructions that further cause the system to:
monitor or search the blockchain or the blockchain network to determine the presence or absence of the further blockchain transaction.
18. The computer-implemented system of claim 13 , wherein validation of the further blockchain transaction within the blockchain network is dependent upon the execution of the unlocking script.