Blockchain implemented counting system and method for use in secure voting and distribution
The integration of a parallel computational resource with the blockchain emulates Turing completeness, addressing limitations of non-Turing complete scripting languages, enabling secure and versatile applications like IoT control and automated tasks.
Patent Information
- Application Number
- JP2025115651
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2016-02-23
- Filing Date
- 2025-07-09
- Publication Date
- 2025-10-15
AI Technical Summary
Existing blockchain technologies, such as Bitcoin, are limited by their non-Turing complete scripting languages, which restrict complex control flow mechanisms, limiting their applications to linear tasks and preventing functionalities like automated tasks and device management, while also posing security risks from infinite loops.
A system that integrates a computational resource, referred to as a 'manager', operates in parallel with the blockchain to emulate Turing completeness by executing loops outside the blockchain, using a limited scripting language, ensuring security by separating control and data stacks, and utilizing blockchain as an immutable tape for transaction storage.
Enables versatile blockchain applications with Turing-complete functionality, enhancing automation and control of devices like IoT systems, while maintaining security by preventing infinite loops and mitigating denial-of-service attacks.
Smart Images

Figure 2025157329000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates generally to blockchain implementations and technologies. The present invention is particularly suitable for use with, but not limited to, the Bitcoin blockchain and for applications such as device / system control, process control, distributed computation and storage. In particular, the present invention relates to technical solutions for managing voting, counting, selection and / or decision-making processes. The present invention is not limited to use in political voting applications or scenarios. [Background technology]
[0002] The term "blockchain" is used herein to include all forms of consensus-based, electronic, computer-based distributed ledgers, including, but not limited to, blockchain and transaction chain technologies, permissioned and permissionless ledgers, shared ledgers, and variations thereof. While other blockchain implementations have been proposed and developed, the most widely known application of blockchain technology is the Bitcoin ledger. While Bitcoin is referenced herein for convenience and explanation, it should be noted that the present invention is not limited to use with the Bitcoin blockchain, and other blockchain implementations and protocols are within the scope of the present invention.
[0003] A blockchain is a consensus-based electronic ledger implemented as a computer-based, decentralized, distributed system composed of blocks, each of which consists of transactions. Each transaction is a data structure that encodes the transfer of control of a digital asset between participants in the blockchain system and includes at least one input and at least one output. Each block contains a hash of the previous block for which the blocks are chained together to create a permanent, immutable record of all transactions written to the blockchain since its inception. Transactions contain small programs, known as scripts, embedded in their inputs and outputs that specify how and by whom the transaction's outputs are accessible. In the Bitcoin platform, these scripts are written using a stack-based scripting language.
[0004] For a transaction to be written to the blockchain, it must be "validated." Network nodes (miners) perform the work of ensuring each transaction is valid, with invalid transactions being rejected by the network. A software client installed on a node performs this validation on unspent transactions (UTXOs) by executing its lock and unlock scripts. If the execution of the lock and unlock scripts evaluates to TRUE, the transaction is valid and is written to the blockchain. Thus, for a transaction to be written to the blockchain, it must i) be validated by the first node that receives the transaction; if the transaction is validated, the node relays it to other nodes in the network; ii) be added to a new block constructed by miners; and iii) be mined, i.e., added to the public ledger of past transactions.
[0005] While blockchain technology is most widely known for its use as an enabler of cryptocurrencies, digital entrepreneurs have begun to explore the use of both the cryptographic security system that Bitcoin is based on and the data that can be stored on the blockchain to enable new systems, including but not limited to: ·Storing metadata - Realization of digital tokens · Finalize signed contracts with digital signatures Includes:
[0006] It would be extremely effective if blockchain could be used to automate tasks and processes that are not limited to the cryptocurrency realm. Such a solution would be more versatile in its applications, while still being able to take advantage of the benefits of blockchain (e.g., a permanent, tamper-resistant record of events, distributed processing, cryptographic security features, etc.).
[0007] One current area of interest within the blockchain community is Turing completeness, or specifically, how to achieve Turing-complete behavior in blockchain technology, which is designed to limit functionality for security reasons.
[0008] The Bitcoin scripting language is considered Turing complete because it does not natively support complex flow control functions, such as executing loops. One effect of this limitation is that programs have predictable execution times.
[0009] Another significant effect of limiting Bitcoin scripts to linear or tree-like decision tasks is that it avoids infinite loops that can be used as a means of launching exploits such as Denial of Service (DoS) or DDoS attacks. As a result of this limitation, Bitcoin scripts are often limited to linear tasks rather than more complex uses such as controlling automated tasks, device management, etc.
[0010] The Ethereum blockchain approaches this problem by including a "built-in" Turing-complete language called Solidity. This language originates from the Ethereum platform, and scripts written in Solidity can contain control flow mechanisms such as loops. However, Ethereum has suffered from multiple attacks and exploits.
[0011] Due to the security concerns discussed above, and also due to the widespread use and familiarity of the scripting languages utilized by Bitcoin, there also remains a desire within a significant portion of the blockchain community to preserve the use of these limited scripting languages in connection with blockchain technology. Summary of the Invention
[0012] It is therefore desirable to provide a solution that allows Turing-complete functionality, such as loop mechanisms and other complex control structures, to be integrated into or combined with blockchain scripts while avoiding the harmful effects of potential security weaknesses such as infinite loops. Enabling the automation of complex blockchain-related transactions Controlling the metadata stream that is recorded on the blockchain Extending the functionality and uses of blockchain platforms that intentionally do not rely on or include a Turing-complete language It offers numerous advantages, including:
[0013] Such an improved solution has now been devised. The present invention provides a solution with a novel combination of a blockchain coupled with parallel computing resources that allows for emulation, simulation, and / or implementation of loops and other Turing-complete functions outside of typical blockchain scripts. Furthermore, this enables numerous applications for automated tasks, such as those related to distributed data storage, distributed computing, and control of drones or any Internet of Things (IoT) device. Such applications may include utilizing the blockchain for metadata storage, managing digital tokens, and finalizing contracts. Another useful application is the automation of vote or election counting processes.
[0014] The following provides background material to the technical field of the present invention: US2016 / 027229 A, WO2016 / 022864 A and US6061449 A. The following online resources available at the time of filing provide technical background: https: / / nxt.org / what-is-nxt / voting / http: / / bitcoin-development.narkive.com / uRciVtAQ / standard-bip-draft-turing-pseudocompleteness https: / / news.ycombinator.com / item?id=7287155 https: / / news.ycombinator.com / item?id=11372455 http: / / cryptonomics.org / 2014 / 02 / 01 / ethereum-turing-complete Therefore, according to the present invention, there is provided a solution as defined in the attached claims. According to the present invention, a (processing) control method and a corresponding system may be provided. The present invention may be referred to as a blockchain-enabled control method / system, which may control automated tasks or processes.
[0015] The present invention may be configured to utilize blockchain to emulate / simulate Turing completeness. Additionally or alternatively, the present invention may enable applications relating to Turing complete control mechanisms to be run on a blockchain platform.
[0016] Additionally or alternatively, the present invention may be described as a method or system configured to control processes executed on off-block computational resources using a blockchain and / or one or more blockchain transactions. Thus, the present invention comprises an arrangement in which separate computational components, functionally and structurally distinct from one another, are configured to interact to provide novel technical results. The interaction of different computational systems (computational resources and blockchain) provides a very powerful means of control.
[0017] From a computational resource perspective, the present invention provides the benefits of a persistent, tamper-resistant record of program execution. From a blockchain perspective, the present invention provides an improved blockchain implementation because it allows Turing-complete operations to be at least partially simulated through the use of blockchain, and then more functionally complex blockchain-based applications can be deployed. This is all achieved while maintaining the use of a limited scripting language for blockchain transactions. Scripting languages can be limited in that their design or implementation prevents, or at least does not natively support, complex control flow mechanisms such as loops from being incorporated into code written in the language. The language's instruction set, i.e., "commands" or "opcodes," available to a programmer may be configured so that it does not include commands for complex flow control mechanisms.
[0018] A blockchain may be associated with or utilize a blockchain protocol that has a limited language, which may be a scripting language. The present invention may utilize a blockchain to extend the functionality of the limited scripting language for the performance of tasks.
[0019] The present invention may utilize the state of the blockchain to perform loop-based processing. The loop-based processing may be performed on a computational resource that operates in parallel with the blockchain network. The computational resource may be separate from (not part of) the blockchain network. The computational resource may be referred to as an "oracle" or a "bot."
[0020] This allows blockchain protocols to utilize limited-function scripting languages while allowing control flow mechanisms such as loops to be implemented outside of the blockchain. This novel combination enhances the versatility of blockchain technology while ensuring security.
[0021] In accordance with one or more embodiments of the present invention, a computer-implemented event handling, monitoring, detecting, and / or counting system may be provided. An embodiment of the present invention may be configured to respond to events generated by an entity. The present invention may monitor / detect and / or count votes, selections, decisions, or other types of events. For convenience herein, the terms "votes" or "decisions" may be used to refer to events monitored, counted, recorded, and / or detected by the present invention.
[0022] One or more embodiments of the present invention may be described as a control method and corresponding system, which may be described as a blockchain-enabled method / system. The present invention may be configured to control a process. The process may be industrial or non-industrial. An event, such as a decision, may be made by a machine, an electronic / software-based entity, a natural person, a legal entity, or otherwise. One or more embodiments of the present invention may include a method / system for counting, monitoring, recording, detecting, and / or processing events. An event may be a decision or choice, such as a vote, made by an entity in an application area. It may be used for this purpose, but is not limited to counting political votes or events in a political context. It may be used, for example, to record how many times a machine makes a particular choice or how many times a cell mutates. The decision may be binary or non-binary. It may count or record the number of times an event is made / not made.
[0023] The method comprises: distributing or allocating at least one token to at least one predetermined entity, said at least one token being represented by a cryptographic public and private key pair; executing a loop on a computational resource to maintain a count of one or more events (e.g., votes, selections, actions, or decisions) generated by the at least one entity; may have
[0024] The present invention provides distributing or allocating at least one token to at least one predetermined entity, said at least one token being represented by a public key and a private key pair; running a loop on a computational resource to maintain a count of one or more votes or decisions made by said at least one entity; A computer-implemented voting or decision counting method may be provided having:
[0025] The cryptographic key pair may be referred to as a "blockchain public and private key pair," which may be configured for use with a blockchain platform for secure transfer of value between inputs and outputs of blockchain transactions, as known in the art. The keys may function as blockchain addresses.
[0026] The present invention provides distributing or allocating at least one token to at least one predetermined entity, wherein the at least one token is represented by a blockchain public key and private key pair; running a loop implemented using a script on a computational resource to maintain a count of one or more votes or decisions generated by or associated with said at least one entity, and generating a cryptographic hash of said script; A computer-implemented voting or decision counting method may be provided having:
[0027] The present invention provides distributing or allocating at least one token to at least one predetermined entity, wherein the at least one token is represented by a blockchain public key and private key pair; running a loop on a computational resource to maintain a count of one or more votes or decisions made by said at least one entity; and Information associated with at least one iteration of the loop may provide a computer-implemented voting or decision counting method that is stored in a transaction on the blockchain.
[0028] The present invention provides distributing or allocating at least one token to at least one predetermined entity, wherein the at least one token is represented by a blockchain public key and private key pair; running a loop on a computational resource to maintain a count of one or more votes or decisions made by said at least one entity; generating a cryptographic hash of the code associated with the loop; and Preferably, a computer-implemented voting or decision counting method may be provided that includes storing the cryptographic hash within a transaction on the blockchain.
[0029] The present invention provides distributing or allocating at least one token to at least one predetermined entity, wherein the at least one token is represented by a blockchain public key and private key pair; running a loop on a computational resource to maintain a count of one or more votes or decisions made by said at least one entity; and The computational resources may provide a computer-implemented voting or decision counting method configured to monitor the state of the blockchain for transactions having a cryptographic hash of code associated with the loop.
[0030] The at least one predetermined / preselected entity may be a mechanical, electronic / software entity. In other embodiments, the entity may be a natural person, a legal person, or other. The blockchain may be the Bitcoin blockchain or other blockchain platform. Distribution may be performed by broadcasting to the blockchain network. There may be multiple entities (e.g., voters or decision makers). At least one token may be distributed and / or allocated to each of the entities in the plurality.
[0031] The counts of one or more votes or decisions may be stored in the blockchain (e.g., in a transaction) and / or an alternative stack of the blockchain.
[0032] The method may include implementing the loop using a script. The script may be written in a scripting language. It may be based on the Forth scripting language. The language may be non-Turing complete. It may be a stack-based language. The scripting language may be limited because its design or implementation prevents, or at least does not natively support, complex control flow mechanisms such as loops in code written in the language. The language's instruction set, i.e., "commands" or "opcodes," available to a programmer may be configured such that it does not include commands for complex flow control mechanisms.
[0033] The method may further comprise generating a cryptographic hash of the script or a portion thereof.
[0034] The method may further comprise distributing or allocating the at least one token to the at least one entity using a secret exchange protocol.
[0035] The method may further comprise loading each public key and address with an item representing one or more actions, preferably an amount of currency, which may be Bitcoin related.
[0036] The method may further comprise maintaining on or in association with the computational resource a list of public keys associated with each authenticated entity and / or token, and the method may further comprise destroying (or never storing) the list of private keys and mappings / associations between entity identities and their allocated tokens.
[0037] The method may further comprise maintaining a list of addresses. The list may be an empty list or may comprise one or more addresses. At least one address may be associated with at least one entity. Preferably, at least a portion of the list is specified, represented or defined by a blockchain script.
[0038] The method may further comprise transferring the list of addresses to a (blockchain) alternative stack for storage, and preferably addresses are removed from the alternative stack once votes (or other conditions) for the addresses have been counted, detected and / or processed.
[0039] The method may further comprise the step of looping until the list of addresses is empty.
[0040] The method comprises: executing a loop on a computational resource (e.g., a server or multiple servers); Using the state of the blockchain to influence the execution of the loop; and / or A step that affects the state of the blockchain as a result of executing a loop; may have
[0041] The computational resource may be any processor-based device or system. It may be, for example, a server or multiple servers. It may be a standalone or distributed resource. The blockchain may be the Bitcoin blockchain or any other blockchain-related platform. The blockchain may be a consensus-based electronic ledger.
[0042] Information related to at least one iteration of the loop may be stored in a transaction on the blockchain. The information may be stored as metadata in the transaction. The loop may include an "If condition then action" (ICTA) instruction.
[0043] The method may further comprise generating a cryptographic hash of the code associated with the loop, preferably storing the cryptographic hash within a transaction on the blockchain. The code may be a code block containing control flow statements, such as an "If condition then action" statement.
[0044] The computational resource may be configured to monitor the state of the blockchain for transactions that have a cryptographic hash of the code associated with the loop.
[0045] The method comprises: For each iteration of the loop, further comprising the steps of evaluating the condition and performing at least one action based on a result of the evaluation; At least one action is causing at least one transaction to be written to said blockchain; and / or Steps to perform off-blockchain actions It may further include:
[0046] Conditions may be used to monitor any value, signal, or input, regardless of where, how, or to whom it is generated, on or off the blockchain. Conditions may relate to data received, detected, or generated by a computational resource and / or the state of the blockchain. A condition may be described as a "trigger." It may be or relate to a specific state of the blockchain, an event detected off-block (e.g., a date or temperature reading), or a combination of both.
[0047] The action may include sending a signal to take the event off-clock, broadcasting a new transaction, or a combination of both. The index may be (i) maintained off-block within the manager, or (ii) a value stored in a subsequently broadcast transaction. (i) and (ii) represent two alternative ways of maintaining control data.
[0048] The computational resources are It may be configured to monitor the state of the blockchain, values generated or received by the computational resources, and / or data or signal sources provided away from the blockchain.
[0049] The method comprises: i) using a blockchain as a storage component for data, instructions or pointers to data and / or instructions; ii) utilizing a computational resource as a control flow management component for a Turing-complete process, the computational resource being configured to execute a loop mechanism; may have
[0050] Thus, the blockchain may act as the indelible tape of a Turing machine. Computational resources may also serve to control the flow of execution of processes, implementing loops and extending the functionality of scripting languages.
[0051] The method may further include restarting the loop at a designated iteration. The loop may be restarted if the computational resource detects a predetermined hash of a portion of code in a transaction in the blockchain. The portion of code may be associated with the body of the loop, which may include an ICTA statement.
[0052] The computational resource may restart the loop at each iteration. This may be done in a variety of ways. For example, the code block for the loop may be: Hard-coded into the computing resources themselves, stored in a privately or publicly available file, They may be stored as entries on a private or public hash table file, or a combination of the above.
[0053] A code block may be static with hard-coded variables, or it may be static but contain parameters that can be entered. A parameter may be a single value in any data format, or a small chunk of code, or a combination of the above. Parameters may be entered directly from metadata in the transaction (e.g., a Bitcoin transaction), or by extracting them from an external source such as an internal database or a private / public file or hash table, or any combination of the above. A pointer to the external source of the parameter value may be stored in the metadata in the transaction.
[0054] Information regarding recurrence may be specified using metadata provided within or associated with the transaction.
[0055] A computing resource may have or communicate with a registry that allows the computing resource to access pre-stored versions of subroutines. A registry may alternatively be described as a database, repository, or other form of storage facility. A registry may include: i) a cryptographic hash of the code associated with the loop; and ii) information indicating the location from which copies of the code are accessible; and may be stored.
[0056] The method may further include updating the code for the loop using a blockchain transaction to replace the existing code with a new code. Preferably, the transaction is a multi-signature P2SH transaction. A hash of the existing code and a hash of the new code may be stored.
[0057] The present invention also provides a system for implementing any of the above-described method embodiments.
[0058] The present invention may provide a computer-based system, which may be described as a computer-implemented event counting, monitoring, detection and / or processing system. The events may be votes, decisions, selections or any other type of event. It may be configured to simulate or emulate Turing completeness. The system may: Blockchain and a computational resource configured to execute a loop such that execution of the loop is affected by the state of the blockchain; may have
[0059] Information relating to at least one iteration of the loop is stored in a transaction on the blockchain, preferably as metadata in the transaction.
[0060] Preferably, the computational resource is configured to generate a cryptographic hash of code associated with the loop. Preferably, the cryptographic hash is stored in a transaction on the blockchain. Additionally or alternatively, the computational resource is configured to monitor the state of the blockchain for transactions having the cryptographic hash of code associated with the loop.
[0061] Preferably, for each iteration of the loop, the condition is evaluated and at least one action is performed based on the result of the evaluation, the at least one action being: causing at least one transaction to be written to the blockchain; and / or Allowing off-blockchain actions to be performed; It has.
[0062] The conditions may relate to data received, detected, or generated by the computational resource, or to the state of the blockchain.
[0063] The computational resources are The state of the blockchain, Values generated or received by the computational resources, and / or Data or signal sources provided off the blockchain The device may be configured to monitor the
[0064] The blockchain may act as a storage component for data, instructions, or pointers to data and / or instructions. The computational resource may act as a control flow management component for Turing-complete processing, where the computational resource is configured to execute a loop mechanism.
[0065] If the computational resource detects a predetermined hash of a portion of the code in a transaction in the blockchain, the loop may be restarted at a specified iteration. Information related to the iteration may be specified using metadata provided in or associated with the transaction.
[0066] A computing resource may have or communicate with a storage facility, which may be referred to as a registry, database, or repository, that allows the computing resource to access pre-stored versions of subroutines. i) a cryptographic hash of the code associated with the loop; and ii) information indicating the location from which copies of the code are accessible; and may be stored.
[0067] The system may be configured to update a code for a loop using a blockchain transaction such that an existing code is replaced with a new code. Preferably, the transaction is a multi-signature P2SH transaction. Preferably, the system is configured to store a hash of the existing code and a hash of the new code.
[0068] Any feature described with respect to one aspect or embodiment of the present invention may also be applicable with respect to any other aspect or embodiment, for example, any feature described with respect to a method may also be utilized with respect to a system, and vice versa.
[0069] These and other aspects of the invention will be apparent from and elucidated with reference to the embodiment(s) described hereinafter, which are described, by way of example only, with reference to the accompanying drawings, in which: [Brief explanation of the drawings]
[0070] [Figure 1]We present an exemplary use of the blockchain as an indestructible tape for a Turing machine. [Figure 2] 10 shows a subroutine that can be used by a manager to implement a repeat loop in relation to a blockchain. [Figure 3] 10 shows an example of an If Condition Then Action (ICTA) code block that can be used in accordance with an embodiment of the present invention. [Figure 4] 10A-10C illustrate Bitcoin commands that allow a user to move data to and from alternative stacks according to an embodiment of the present invention. [Figure 5] 1 illustrates a code registry for a manager according to an embodiment of the present invention. [Figure 6] 10 illustrates metadata associated with a code block of a manager according to an embodiment of the present invention. [Figure 7] 10 illustrates metadata associated with the output of a particular iteration of a manager loop according to an embodiment of the present invention. [Figure 8] 1 illustrates a transaction script and metadata according to an embodiment of the present invention. [Figure 9] 1 illustrates an exemplary manager software patching verification and tracking record. [Figure 10] 1 illustrates an exemplary use of the present invention, showing an example of a vote-counting bot iteration loop in pseudocode. DETAILED DESCRIPTION OF THE INVENTION
[0071] The following describes an exemplary embodiment that utilizes the Bitcoin blockchain, although other blockchain protocols and implementations may be utilized and the invention is not limited in this respect.
[0072] The present invention achieves Turing completeness on a limited-operation blockchain platform (i.e., one that uses a scripting language that does not support complex control mechanisms), thus solving the problem of how to expand the uses or applications that blockchains can be deployed for. (Universal Turing Machines, Prentice Hall, Inc, 1967) described how inerasable tape could be used to implement a machine that was Turing complete and could run any algorithm that was also runnable on a Universal Turing Machine.
[0073] The present invention includes a computational resource that operates in conjunction with a blockchain, utilizing it as an indelible tape in a Turing machine implementation. This computational resource runs in parallel with the blockchain network, managing and processing the execution of loops designed to perform a given task, such as automating a process or controlling a device or system. This parallel resource monitors the state of the blockchain and allows transactions to be written to the blockchain. As such, it may be referred to herein as a "manager" for ease of reference.
[0074] The features and advantages of the present invention are: Enabling the blockchain to act as an indestructible tape for Turing machines Functions and implementation of the computer-based monitoring and management component (manager) that operates in parallel with the blockchain · Use the manager as an instruction table for a Turing machine · Manage managers using a code registry Transaction metadata related to manager code and loop restart · Using digital signatures to enable software updates to the manager Special implementation of the manager using other blockchains Includes:
[0075] Blockchain as the indestructible tape of a Turing machine Referring to FIG. 1, the present invention utilizes a blockchain as the indelible tape of a Turing machine with the following definition and characteristics: 1. The blockchain acts as the tape of a Turing machine. Each transaction in the blockchain represents a cell on the tape, which can contain symbols from a finite alphabet. 2. The tape head can read information from blocks that have already been written to the blockchain. 3. The tape head can write new blocks containing multiple transactions to the end of the blockchain, but they cannot write to blocks that already exist. Also, the blockchain tape is immutable. 4. Metadata for each transaction can be stored as part of a multi-signature pay-to-slash (P2SH) transaction.
[0076] The key function of the Manager is to act as an agent that monitors the current state of the blockchain. It can also receive signals or inputs from any off-block source. Depending on the state of the blockchain and / or the inputs received, the Manager may take certain actions. The Manager decides which actions should be taken. These may or may not involve actions in the "real world" (i.e., off-block) and / or actions on the blockchain (such as creating and broadcasting new transactions). The actions taken by the Manager may be triggered by the state of the blockchain. The Manager may also determine the next set of transactions to be broadcast to the Bitcoin network and subsequently written to the blockchain.
[0077] The manager's actions are executed in parallel and simultaneously with the Bitcoin network. In a sense, it acts as a bounded Bitcoin script. This continuous monitoring enables a "loop" control flow construct that makes the combined manager and blockchain system Turing complete.
[0078] The manager as a Turing machine instruction table According to an embodiment of the present invention, a Turing machine: · Data stack: This is represented by the blockchain as described above. Control stack: This is represented by a manager function. It stores information related to repeating control flow functions.
[0079] Separating the control stack from the data stack provides the benefit of preventing infinite loops from occurring within Bitcoin Core, which in turn mitigates denial-of-service attacks against the Bitcoin system.
[0080] The manager manages and executes loopable subroutines via any type of loop construct (e.g., FOR-NEXT; REPEAT UNTIL, etc.). The exemplary embodiment described herein includes a process utilizing an example of an "iterate" construct (see FIG. 2). The user specifies an index (i) and a limit (J), which represent the current iteration number (typically counted starting from 0) and total number of iterations, respectively, of the repeat loop.
[0081] For each iteration, 1. The index is incremented by 1. For the exit condition, when the index reaches the limit, the iteration stops. 2. A block of code containing an “if condition then action” (ICTA) statement is executed, where the action can be any action on or off the blockchain. 3. A cryptographic hash of this subroutine is calculated, which can be stored on the blockchain as part of the transaction. Because the hash is unique for each code, it allows for verification of which code was used.
[0082] The body of the loop contains code blocks, each of which contains an “if condition then action” (ICTA) statement (see Figure 3). Start or trigger conditions (e.g., when a specific Bitcoin address reaches 10 BTC) Iteration criteria (i.e., metadata or hash related to the previous iteration) Stopping condition (i.e., the last iteration of the loop) Monitor the current state of the blockchain for transactions that match
[0083] The ICTA statement allows the manager to determine the next transaction to be performed based on the current state of the blockchain. Performing the next transaction involves broadcasting the transaction to the Bitcoin network and writing a new transaction to the blockchain, which serves as a record that the iteration has been performed. Once the transaction has been written to the blockchain, the manager will subsequently detect that the previous iteration has been performed and written to the blockchain, and will perform the next iteration. The latter condition continues until the iteration loop exits when the index (i) reaches a limit (J) specified in the code block.
[0084] Each transaction is stored on the blockchain in a reusable manner. In Bitcoin implementations, each signature in a transaction is accompanied by a SIGHASH flag. This flag can take on different values, each value indicating whether other parts of the transaction can be amended without the signature owner's involvement. Reusable transactions have the SIGHASH flag "SigHash_AnyoneCanPay" in one of the transaction inputs, which allows anyone to contribute to the transaction's inputs. This parameter allows the manager's ICTA function to be executed and repeated multiple times with different inputs. The use of this function can be restricted to authorized parties, for example, through copyright of the reusable transaction.
[0085] The "If condition" portion of an ICTA code block can monitor any type of condition, similar to other programming languages (e.g., C, CC++, Java) and not limited to information stored on the blockchain. Some example conditions are listed below: Monitor the date and time (i.e. when a specific date and time is reached) Monitor the weather (i.e. when the temperature is below 10°C and it is raining) Monitor social media (i.e. when I receive a message from a friend) Monitor the terms of a contract or trust (i.e., when company A acquires company B) Monitor news and events (i.e., when soccer team A wins the game) IoT (Internet of Things) Monitor information from the System of Things (e.g., when an incandescent light bulb needs to be replaced) Monitor data from mobile / wearable devices (i.e., when a wearable step-tracking device counts 10,000 steps) Monitor results from cloud computing (i.e., when computations are completed and results are received) Monitor remote data storage (i.e. if files still reside remotely) The "Then action" portion of an ICTA code block can perform several actions. The present invention is not limited with respect to the number or type of actions that can be taken. Actions are not limited to transactions on the blockchain, although transactions including metadata related to the action may be written to the blockchain.
[0086] The metadata may have any format specified by the manager. However, according to one embodiment of the present invention, the metadata may store a hyperlink to a file containing more data or instructions related to the action. The metadata may store both a hash of the action that serves as a lookup key for the hash table, as well as a hyperlink to a hash table containing more data or instructions related to the action. An embodiment may utilize links in a style similar to the BitTorrent Magnet URL format.
[0087] A list of example actions is listed below. Bitcoin transactions (i.e. sending Bitcoin to a specific address) Social media (i.e. sending a message to a friend) Trading (i.e. selling X shares) IoT (i.e., switching off incandescent light bulbs) Commerce (i.e., purchasing items online) Online services (i.e., paying a monthly fee or paying for requested services using Bitcoin) Because the present invention is not limited as to the nature, type or number of actions performed, it provides an extremely versatile solution that can be applied to great effect across a wide range of applications.
[0088] The manager's control stack can be realized in several ways specific to each user's needs. For example, the control stack's iteration loop can be based on any Turing-complete language. One possible language choice is a Forth-style stack-based language. The effect of using this language is to keep the control stack consistent in programming style with the known and widely used Bitcoin script.
[0089] Using Bitcoin Script Alternative Stacks as Data Storage Spaces Bitcoin scripts contain commands, also called opcodes, that allow users to move data to an alternative stack, known as an "alt stack."
[0090] The opcode is OP_TOALTSTACK - Moves data from the top of the main stack to the top of the alternate stack OP_FROMALTSTACK - Moves data from the top of the alternate stack to the top of the main stack (see Figure 4). Similar to the "memory" feature that allows data to be stored in a computer, this allows data from intermediate steps in a computation to be stored in an alternative stack. According to an exemplary embodiment of the present invention, an alternative stack is used to configure Bitcoin scripts to solve small computational tasks and return the results of the computation.
[0091] Use of code registers to manage managers The manager also maintains a register of all the code it owns and executes. This register is organized similar to a lookup table or dictionary that maps specific keys to specific values (see Figure 5). Each key-value pair is represented by the hash of the code block (H1) and the IPv6 address where the code is stored. To extract a code block using key H1, the lookup table is used to extract the associated value (which is the location where the code is stored) and extract the source code.
[0092] The code registry can be implemented in a variety of ways. For example, the lookup table can be implemented using a locally maintained list or a P2P distributed hash table. The source code can be stored using a local, remote, or decentralized file storage system. This can be implemented using the Magnet URI format or any link format using shared zero-knowledge encryption.
[0093] Transaction metadata and loop restart in manager code The information needed to restart the manager's loop at a particular iteration is stored as metadata in the transaction recorded on the blockchain (see Figures 6 and 7).
[0094] In this way, a transaction on the blockchain stores or provides access to information about a given iteration of a loop running on the manager. This information can include the values of any variables related to the loop, such as the index i, and any other necessary information, such as location-related data specifying where further needed information can be accessed or the values of parameters used in code blocks.
[0095] The metadata itself is stored as part of the multi-signature pay-to-script-hash (P2SH) of the transaction. The metadata recorded with the transaction also provides the ability to record an audit trail of how the code was previously executed.
[0096] There are several ways in which the manager can restart a code block in a repeat loop at each iteration. The code block may be hard-coded into the manager itself, or it may be stored in a privately or publicly available file, or it may be stored as an entry in a private or public hash table file, or it may be a combination of the above. The code block may be static with hard-coded variables, or it may be static but contain input-able parameters. The parameters may be single values in any data format, or they may be small chunks of code, or it may be a combination of the above. The parameters may be input directly from metadata in the transaction (e.g., a Bitcoin transaction), or from external sources such as internal databases, private / public files, or hash tables, or by extracting them from any combination of the above. A pointer to an external source of parameter values may be stored in the metadata in the transaction.
[0097] The following steps provide an example of how the manager can restart a code block of an iterative loop at the iteration: In this example, the code register is a hash table, whereby the hash value serves as a lookup key for the table and is stored in metadata on the transaction. 1. The manager monitors the blockchain for transactions containing hashes of code blocks that match entries in the code registry. 2. The manager finds the transaction containing the corresponding hash (H1). 3. The manager reads "Metadata-CodeHash" and retrieves the CodeHash field to get H1, and uses it to extract the code (C1). If RIPEMD-160(SHA256(C1)) is equal to H1, the code has not been altered and it is safe to proceed to the next step. 4. The manager reads the "Metadata-CodeHash" that stores the index I and restarts the code at the ith iteration, i.e. the loop is "reloaded" at the appropriate iteration. 5. The user's signature is included in the P2SH command to verify the origin of the metadata. 6. The Manager extracts the "Metadata-OutputHash" and "Metadata-OutputPointer" (see Figure 6) and the output of the previous step if these data are needed for this iteration of the loop.
[0098] Multiple signatures may be required to unlock a transaction (e.g., user, operating system, software developer, and software vendor), which allows Digital Rights Management (DRM) systems that manage rights to execute code from all parties involved in a P2SH transaction.
[0099] Manager code updates The software updates and patches code blocks associated with the manager and securely authenticates them using multi-signature P2SH transactions (see Figure 8). The multi-signature transaction records the metadata of the old and new code blocks, as shown in Figure 5. This records the switchover of old code to new code, thereby providing an audit trail of the software update. The manager must store hashes of all of the old and new blocks of source code. The hashes of the new and old source code blocks can be used to verify the integrity of the code file.
[0100] According to an embodiment of the present invention, multiple signatures are required to unlock a transaction (e.g., user, operating system, software developer, and software vendor). This provides a DRM system for managing software updates and patches of code utilized by managers.
[0101] Unlike most software that does not allow software to be updated while it is running, an advantage of the present invention is that software updates can be performed in the middle of loop execution, providing a dynamic and responsive solution that can be reconfigured in real time with minimal interruption to the processes controlled by the present invention.
[0102] The information captured on the blockchain (see Figures 8 and 9) can be used to update to new code mid-loop and start the next iteration step using the metadata output from the previous iteration of the old code.
[0103] Vote counting invention The current Bitcoin scripting language does not allow loops to be performed. This prevents the use of Bitcoin payments from triggering continuous automated actions in the absence of external intervention. However, when a manager continuously monitors information on the blockchain, this allows automated actions to be performed based on the latest information on the blockchain.
[0104] The following describes how the Manager's control stack can be used to automate the processes involved in an automated online vote-counting bot.
[0105] The vote-counting bot of the present invention is designed to achieve fair and pseudo-anonymous voting with a blockchain that records a secure and immutable audit trail of the vote-counting process. The vote-counting bot is automated using a manager's control stack and a repeat loop (see Figure 10). The following scenario illustrates how this embodiment works:
[0106] Assume there are 100 voters. If 57 unique “Yes” votes are received by January 1, 2016, the payment will be made to Chair, The voting process will be released to Jason. Token Distribution Counting It is divided into two parts:
[0107] For token distribution, 100 voting tokens are distributed, one for each authenticated voter. Each token is represented by (for example) a Bitcoin public and private key pair. This is distributed to each voter using a secret exchange protocol. Key exchange protocols are known in the art. Each Bitcoin public key and address is loaded (associated) with a small amount of Bitcoin representing one vote. The bot maintains a list of public keys associated with each authenticated token and makes this list public before voting begins. To ensure that votes are tamper-proof and anonymous, the list of private keys and the mapping between voter identities and their tokens are destroyed (i.e., never stored).
[0108] Having a list of anonymized, pre-authenticated addresses provides other important advantages. It ensures that only those who are authenticated can cast a valid vote. It also allows for the elimination of any unwanted votes originating from a particular address (e.g., spammers, fraudulent voters) without compromising the voter's identity. To implement the counting process, the manager runs a repeating loop. The list of addresses is maintained in the Bitcoin script and transferred to the alternative stack for data storage. Once an address has been counted, it is removed from the alternative stack and is no longer added to the next transaction. The repeating loop stops when the list of addresses is empty.
[0109] Instead of using the integer index i to keep track of where the loop is currently at, the VoteBot Manager uses it to store intermediate vote counting values, which ensures that intermediate vote counting values are stored in the blockchain, which provides a record of authenticity and shows that the vote counting process is fair.
[0110] If the number of unique "Yes" votes received reaches 57, the agreed amount of Bitcoin will be paid to Jason's account. A cryptographic hash of the vote-counting script and the IPv6 address where it is stored will be released to the public, meaning that the public has enough information to perform a recount and ensure that the vote-counting process was fair and correct.
[0111] It should be noted that the above-described embodiments illustrate rather than limit the present invention, and that those skilled in the art can design numerous other embodiments without departing from the scope of the present invention as defined by the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The use of a word such as "comprises" does not exclude the presence of elements or steps other than those listed in any claim or the specification as a whole. In this specification, "comprises" means "comprises or comprises." The singular reference of an element does not exclude the plural reference of such elements, and vice versa. The invention may also be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a device claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The mere fact that certain means are recited in mutually different dependent claims does not indicate that a combination of these means cannot be used to advantage.
Claims
1. 1. A computer-implemented method executed by a computational resource in parallel with a blockchain platform, comprising: Distributing or allocating voting tokens to a plurality of authenticated voters, where one voting token represents one vote and each voting token is represented by a blockchain public / private key pair; the computational resource monitoring a state of a blockchain network for one or more vote-counting transactions associated with votes by one or more of the plurality of authenticated voters; and executing, by the computing resource, a loop process for implementing vote counting, which comprises managing and processing a loop, the loop having an index (i) representing a current vote count and a limit (J) representing a total number of iterations of the loop.
2. The loop iterations are a. Incrementing the current vote count (i) by 1; b. executing a code block of said loop having an "if condition then action" (ICTA) statement; c. Computing a cryptographic hash of steps (a) and (b), storing the cryptographic hash in a blockchain transaction, and broadcasting the blockchain transaction to the blockchain network to record the execution of the iteration of the loop; and repeating steps (a), (b), and (c) until the limit (J) is reached.
3. 3. The method of claim 1 or 2, wherein the computational resource is configured to monitor the state of the blockchain network for transactions having a cryptographic hash of code associated with the loop.
4. For each iteration of the loop, 4. The method of claim 1, further comprising evaluating a condition and performing at least one action based on a result of the evaluation, wherein the at least one action comprises causing an off-blockchain action to be performed.
5. The method of claim 1 , further comprising distributing or allocating said voting tokens to at least one predetermined entity using a secret exchange protocol.
6. 6. The method of claim 1, further comprising the step of loading each public key and address with an item representing one or more choices or possible courses of action, preferably said items being amounts of currency.
7. 7. The method of claim 1, further comprising maintaining on or in association with the computing resource a list of public keys associated with each authenticated entity and / or token.
8. 8. The method of claim 7, further comprising destroying or never storing the list of private keys and mappings between the entities' identities and their allocated tokens.
9. maintaining a list of addresses; At least one address is associated with at least one entity, preferably The method of claim 1 , wherein the list is expressed or defined by a blockchain script.
10. transferring the list of addresses to an alternative stack of the blockchain for storage; 10. The method of claim 9, wherein an address is preferably removed from the alternative stack once votes for that address have been counted.
11. 11. The method of claim 10, further comprising executing the loop until the list of addresses is empty.
12. The code for the loop is: hard-coded in or on the computing resource; stored in a privately or publicly available file, stored as entries in a private or public hash table file, and / or 12. The method of claim 1, wherein the method is a static code block with a hard-coded variable or at least one parameter.
13. The code of the loop is associated with or includes at least one parameter, the at least one parameter being: is populated, initialized, or instantiated with a single value in any data format; It is part of the code, extracted from metadata in a blockchain transaction or from a source external to the computational resource; extracted from a database, private / public file or hash table; and / or 13. The method of claim 1, wherein the value is entered using a value that is accessed using at least one pointer to a data source, the at least one pointer being stored as metadata in the transaction on the blockchain.
14. The computing resource has or communicates with a registry that allows the computing resource to access pre-stored versions of steps (a)-(c), the registry comprising: a cryptographic hash of the code associated with the loop; and and information indicating where a copy of the code is accessible.
15. 1. A computer-based system comprising: Blockchain network and and a computational resource configured to operate in parallel with the blockchain network and monitor the processing and execution of a loop process; The system is configured to perform a method, the method comprising: Distributing or allocating voting tokens to a plurality of authenticated voters, where one voting token represents one vote and each voting token is represented by a blockchain public / private key pair; the computational resource monitoring a state of a blockchain network for one or more vote-counting transactions associated with votes by one or more of the plurality of authenticated voters; and executing, by the computing resources, a loop process for implementing vote counting, the loop having an index (i) representing a current vote count and a limit (J) representing a total number of iterations of the loop.
16. The loop iterations are a. Incrementing the current vote count (i) by 1; b. executing a code block of said loop having an "if condition then action" (ICTA) statement; c. Computing a cryptographic hash of steps (a) and (b), storing the cryptographic hash in a blockchain transaction, and broadcasting the blockchain transaction to the blockchain network to record the execution of the iteration of the loop; and repeating steps (a), (b), and (c) until the limit (J) is reached.
17. The computing resource has or communicates with a registry that allows the computing resource to access pre-stored versions of subroutines, the registry comprising: a cryptographic hash of the code associated with the loop; and and information indicating where a copy of the code is accessible.
18. The code for the loop is hard-coded in or on the computing resource; stored in a privately or publicly available file, stored as entries in a private or public hash table file, and / or 18. The system of any one of claims 15 to 17, wherein the system is a hard-coded variable or static block of code with at least one parameter.
19. The code for the loop is: At least one parameter input, initialized, or instantiated with a single value in any data format; relating to or comprising a portion of code entered using values extracted from metadata in a blockchain transaction or from a source external to said computational resource, extracted from a database or a private or public file or hash table, and / or accessed using at least one pointer to a data source; 19. The system of claim 15, wherein the at least one pointer is stored as metadata in a transaction on the blockchain.
20. The computing resource has or communicates with a registry that allows the computing resource to access pre-stored versions of steps (a)-(c), the registry comprising: a cryptographic hash of the code associated with the loop; and and information indicating where a copy of the code is accessible.