A counting system and method implemented with a blockchain used for secure voting and distribution

By integrating a blockchain with parallel computing resources to emulate Turing-complete functions, the system addresses the limitations of Bitcoin script, enabling secure and complex automation and control tasks while maintaining security.

JP7711162B2Active Publication Date: 2025-07-22NCHAIN LICENSING AG
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2023216396
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2016-02-23
Filing Date
2023-12-22
Publication Date
2025-07-22
Estimated Expiration
2037-02-14

AI Technical Summary

Technical Problem

Existing blockchain technologies, particularly those based on Bitcoin script, are limited by their lack of Turing completeness, which restricts their ability to execute complex control flow mechanisms such as loops, limiting their application to linear tasks and making them vulnerable to attacks like DoS or DDoS.

Method used

A system that integrates a blockchain with parallel computing resources to emulate and execute Turing-complete functions externally, using a manager to monitor the blockchain's state and execute loop-based processing, allowing complex tasks like automated vote counting and device control.

Benefits of technology

Enables the blockchain to function as a non-erasable tape of a Turing machine, providing a persistent and tamper-resistant record while maintaining security by preventing infinite loops, thus expanding its application to complex automation and control tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007711162000001
    Figure 0007711162000001
  • Figure 0007711162000002
    Figure 0007711162000002
  • Figure 0007711162000003
    Figure 0007711162000003
Patent Text Reader

Abstract

To implement a turing-complete functionality such as looping mechanisms and other complex control structures to be integrated or combined with blockchain scripts.SOLUTION: A method is a method to be executed by a manager to respawn a repeat loop code block at i-th iteration of a loop. The manager runs in parallel with a blockchain platform, monitors a blockchain for transactions that contain hashes of a code block that matches entries in a managed code registry, reads metadata of the transactions, in accordance with detection of the transactions containing the hashes to extract a code, determines that the code has not been changed, stores an index, and respawns the code in the i-th iteration. A signature of a user is included in a multi-signature pay-to-script-hash command to verify an origin of the metadata.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention generally relates to the implementation and technology of blockchain. Without limitation, the present invention is particularly suitable for use by the Bitcoin blockchain and for applications such as device / system control, process control, distributed computing, and storage. In particular, the present invention relates to a technical solution 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 Art

[0002] As used herein, the term "blockchain" is used to include all forms of consensus-based electronic and computer-based distributed ledgers. This includes, without limitation, 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. Here, Bitcoin is referenced for convenience and explanation purposes, but it should be noted that the present invention is not limited to use by the Bitcoin blockchain, and other blockchain implementations and protocols fall within the scope of the present invention.

[0003] A blockchain is a consensus-based digital ledger implemented as a computer-based decentralized distributed system composed of blocks consisting of transactions. Each transaction is a data structure encoding the transfer of control of digital assets between participants in the blockchain system and includes at least one input and at least one output. Each block includes the hash of the previous block for the chained blocks together so as to create a permanent and immutable record of all transactions written to the blockchain since its inception. Transactions include a small program known as a script embedded in their inputs and outputs that specifies how, and by whom, the output of the transaction can be accessed. 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 needs to be “validated”. Network nodes (miners) perform work to ensure that each transaction is valid by having invalid transactions rejected from the network. The software client installed on the node performs the validation work for the unspent transaction outputs (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 needs to be i) verified by the first node that receives the transaction, and if the transaction is verified, the node relays it to other nodes in the network, ii) added to a new block constructed by the miner, and iii) mined, i.e., added to the public ledger of past transactions.

[0005] While blockchain technology is most widely known for its use in the implementation of virtual currencies, digital entrepreneurs have begun to explore the use of both Bitcoin-based cryptographic security systems and data that can be stored on the blockchain to implement new systems. These include, but are not limited to, · Storage of metadata · Realization of digital tokens · Finalization of contracts signed with digital signatures including.

[0006] If the blockchain can be used for automated tasks and processes not limited to the area of virtual currencies, it would be very effective. Such solutions would be more versatile in their applications while leveraging the benefits of the blockchain (such as permanent tamper-resistant recording of events, distributed processing, cryptographic security functions, etc.).

[0007] One current area of interest within the blockchain community is Turing completeness, specifically how to implement Turing-complete behavior, which is designed to limit functionality for security reasons, in blockchain technology.

[0008] It has been considered whether the Bitcoin script language is Turing complete, because it does not natively support complex flow control functions such as the execution of loops, for example. One effect of this limitation is that programs have a predictable number of execution times.

[0009] Another significant effect of limiting Bitcoin script to linear or tree-shaped decision tasks is that it avoids infinite loops that can be used as a means of launching attacks such as DoS (Denial of Service) or DDoS attacks. As a result of this limitation, Bitcoin script is often limited to being used for linear tasks rather than more complex applications such as the control of automated tasks and device management.

[0010] The Ethereum blockchain approaches this problem by incorporating a "built-in" Turing-complete language called Solidity. This language is derived from the Ethereum platform, and scripts written in Solidity can include control flow mechanisms such as loops. However, Ethereum has suffered from multiple attacks and exploits.

[0011] Due to the security concerns described above, and also due to the widespread use and familiarity of the scripting languages utilized by Bitcoin, there also remains a requirement within a significant portion of the blockchain community to maintain the use of these limited scripting languages in relation to blockchain technology. SUMMARY OF THE INVENTION

[0012] Accordingly, it is desirable to provide a solution that implements Turing-complete features such as loop mechanisms and other complex control structures that are integrated or combined into blockchain scripts while avoiding the detrimental effects of potential security vulnerabilities such as infinite loops. Such a solution would · enable the automation of complex blockchain-related transactions · control the metadata stream recorded on the blockchain · extend the functionality and utility of blockchain platforms that do not intentionally rely on or incorporate Turing-complete languages provide a number of advantages including.

[0013] Such an improved solution has now been devised. The present invention provides a solution having a novel combination of a blockchain coupled to parallel computing resources that enables the emulation, simulation, and / or hosting of loops and other Turing-complete functions external to typical blockchain scripts. Further, this enables a number of applications for automated tasks related to, for example, distributed data storage, distributed computing, and the control of drones or any IoT (Internet of Things) device. Such applications may include using the blockchain for metadata storage, managing digital tokens, and finalizing contracts. Other useful applications are the automation of vote or selection counting processes.

[0014] The following provides background information on 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 the 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 Accordingly, according to the present invention, a solution as defined in the appended claims is provided. According to the present invention, a (processing) control method and corresponding system may be provided. The present invention may be referred to as a control method / system implemented by a blockchain. It may control automated tasks or processes.

[0015] The present invention may be configured to emulate / simulate Turing completeness using a blockchain. Additionally or alternatively, the present invention may enable an application related to a Turing complete control mechanism to be executed on a blockchain platform.

[0016] Additionally or alternatively, the present invention may be described as a method or system configured to control a process executed on off-chain computing resources using a blockchain and / or one or more blockchain transactions. Accordingly, the present invention has a configuration in which separate computing components that are functionally and structurally different from each other interact to provide a novel technical result. The interaction of different computing systems (computing resources and blockchains) provides a very powerful control means.

[0017] From the perspective of computing resources, the present invention provides the effect of a persistent and tamper-resistant record of program execution. From the perspective of the blockchain, the present invention provides an improved blockchain implementation. This is because it enables at least partial simulation of Turing complete behavior through the use of a blockchain, and then enables the placement of more functionally complex blockchain-based applications. All of this is achieved while maintaining the use of a limited scripting language for blockchain transactions. The scripting language may be limited in that its design or implementation prevents or at least does not natively support the inclusion of complex control flow mechanisms such as loops in the code written in the language. The instruction set of the language available to the programmer, i.e., the "commands" or "opcodes", may be configured not to include commands for complex flow control mechanisms.

[0018] A blockchain may be associated with or utilized with a blockchain protocol having a limited language. This may be a scripting language. The present invention may utilize the blockchain to extend the functionality of a limited scripting language for task execution.

[0019] The present invention may utilize the state of the blockchain to perform loop-based processing. The loop-based processing may be executed on a computing resource that operates in parallel with the blockchain network. The computing resource may be separate (not part) from the blockchain network. The computing resource may be referred to as an "oracle" or a "bot".

[0020] This enables the realization of control flow mechanisms such as loop mechanisms away from the blockchain while allowing the blockchain protocol to utilize a functionally limited scripting language. This novel combination enhances the versatility of blockchain technology while ensuring security.

[0021] According to one or more embodiments of the present invention, an event handling, monitoring, detecting and / or counting process and a corresponding system implemented by a computer may be provided. Embodiments 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 the sake of convenience here, the terms "vote" or "decision" may be used to refer to events monitored, counted, recorded and / or detected etc. by the present invention.

[0022] One or more embodiments of the present invention may be described as a control method and corresponding system. It may be described as a method / system implemented by a blockchain. The present invention may be configured to control a process. The process may be an industrial or non-industrial process. Events such as decisions may be made by machines, electronic / software-based entities, natural persons, legal persons or others. One or more embodiments of the present invention may have a method / system for counting, monitoring, recording, detecting and / or processing events. The event may be a decision or selection such as a vote made by an entity within an application area. It is available 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 has made a particular selection or how many times a cell has mutated. The decision may be binary or non-binary. It may count or record the number of times an event occurs / does not occur.

[0023] The method may include distributing or allocating at least one token to at least one predetermined entity, wherein the at least one token is represented by a pair of an encrypted public key and a private key, and executing a loop on a computing resource to maintain a count of one or more events (e.g., votes, selections, actions or decisions) generated by the at least one entity. It may have.

[0024] The present invention may include distributing or allocating at least one token to at least one predetermined entity, wherein the at least one token is represented by a pair of a public key and a private key, and executing a loop on a computing resource to maintain a count of one or more votes or decisions made by the at least one entity. A voting or decision counting method implemented by a computer having

[0025] The pair of encryption keys may be referred to as the "pair of public and private keys of the blockchain". This is for use with the blockchain platform and may be configured for secure transfer of values between the input and output of blockchain transactions, as is known in the art. The keys may function as blockchain addresses.

[0026] The present invention Distributing or allocating at least one token to at least one predetermined entity, wherein the at least one token is represented by a pair of a public key and a private key of a blockchain; Executing a loop implemented using a script on computing resources to maintain a count of one or more votes or decisions generated by or associated with the at least one entity, and generating an encrypted hash of the script; A voting or decision counting method implemented by a computer having

[0027] The present invention Distributing or allocating at least one token to at least one predetermined entity, wherein the at least one token is represented by a pair of a public key and a private key of a blockchain; Executing a loop on computing resources to maintain a count of one or more votes or decisions made by the at least one entity; And having A voting or decision counting method implemented by a computer, wherein information related to at least one iteration of the loop is stored in a transaction on the blockchain.

[0028] The present invention distributing or allocating at least one token to at least one predetermined entity, wherein the at least one token is represented by a pair of a public key and a private key of a blockchain; executing a loop on computing resources to maintain a count of one or more votes or decisions made by the at least one entity; generating an encrypted hash of code associated with the loop; and preferably, providing a voting or decision counting method implemented by a computer having a step of storing the encrypted hash in a transaction on the blockchain.

[0029] The present invention distributing or allocating at least one token to at least one predetermined entity, wherein the at least one token is represented by a pair of a public key and a private key of a blockchain; executing a loop on computing resources to maintain a count of one or more votes or decisions made by the at least one entity; and the computing resources providing a voting or decision counting method implemented by a computer configured to monitor a state of the blockchain for transactions having an encrypted hash of code associated with the loop.

[0030] At least one predetermined / preselected entity may be a machine, an electronic / software entity. In other embodiments, the entity may be a natural person, a legal person, or otherwise. The blockchain may be a Bitcoin blockchain or other blockchain platform. The distribution may be performed by broadcasting to a 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 these multiple entities.

[0031] The counting of one or more votes or decisions may be stored in a blockchain (e.g., in a transaction) and / or in an alternative stack of the blockchain.

[0032] The method may have a step of implementing a loop using a script. The script may be described 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 form prevents or at least does not natively support complex control flow mechanisms such as loops from being incorporated into the code described in the language. The instruction set of the language available to the programmer, i.e., the "commands" or "opcodes", may be configured so that it does not include commands for complex flow control mechanisms.

[0033] The method may further have a step of generating an encrypted hash of the script or a part thereof.

[0034] The method may further have a step of distributing or allocating at least one token to at least one entity using a secret exchange protocol.

[0035] The method may further comprise the step of loading each public key and address together with an item representing one or more actions, preferably, the item being an amount of currency. The currency may be bitcoin-related.

[0036] The method may further comprise the step of maintaining a list of public keys associated with each authenticated entity and / or token on or in relation to computing resources. The method may further comprise the step of destroying (or never storing) a mapping / association between a list of private keys, identification information of entities, and their allocated tokens.

[0037] The method may further comprise the step of maintaining a list of addresses. The list may be an empty list or may have 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 the step of transferring the list of addresses to an (blockchain) alternative stack for storage, preferably, the address being removed from the alternative stack when a vote (or other condition) for the address is counted, detected, and / or processed.

[0039] The method may further comprise the step of executing a loop until the list of addresses becomes empty.

[0040] The method may comprise the step of executing the loop on computing resources (e.g., a server or servers), and using the state of the blockchain to affect the execution of the loop, and / or affecting the state of the blockchain as a result of executing the loop, and may have.

[0041] The computing resource may be any processor-based device or system. It may be, for example, a server or multiple servers. It may be a stand-alone 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 "If condition then action" (ICTA) instructions.

[0043] The method may further include generating an encrypted hash of the code related to the loop and preferably storing the encrypted hash within a transaction on the blockchain. The code may be a code block that includes control flow statements such as "If condition then action" statements.

[0044] The computing resource may be configured to monitor the state of the blockchain for transactions having an encrypted hash of the code related to the loop.

[0045] The method for each iteration of the loop further includes evaluating a condition and performing at least one action based on the result of the evaluation, wherein the at least one action includes writing at least one transaction to the blockchain and / or performing an off-chain action and may further include.

[0046] The condition may be used to monitor any value, signal, or input, whether on or off the blockchain, regardless of where, how, or by whom it is generated. The condition may relate to data received, detected, or generated by computing resources and / or to the state of the blockchain. The condition may be described as a "trigger". It may be or relate to a particular state of the blockchain, an event detected off-chain (such as a date or temperature reading), or a combination of both.

[0047] The action may include sending a signal to clock off an event, broadcasting a new transaction, or a combination of both. The index may be (i) maintained off-chain within a manager or (ii) a value stored within a transaction to be subsequently broadcast. (i) and (ii) represent two alternative ways of maintaining control data.

[0048] The computing resources may be configured to monitor the state of the blockchain, values generated or received by the computing resources, and / or data or signal sources provided off-chain.

[0049] The method may i) using the blockchain as a storage component for data, instructions, or pointers to data and / or instructions; and ii) using computing resources as a control flow management component for Turing-complete processing, where the computing resources are configured to execute a looping mechanism. It may have.

[0050] Therefore, the blockchain can function as a non-erasable tape of a Turing machine. The computing resources may function to control the flow of execution of a process, implement loops, and extend the capabilities of a scripting language.

[0051] The method may further include the step of restarting the loop in a specified iteration. If the computing resources detect a predetermined hash of a portion of the code in a transaction within the blockchain, the loop may be restarted. The portion of the code may be related to the body of the loop. It may have an ICTA statement.

[0052] The computing resources may restart the loop in each iteration. This may be performed in various ways. For example, the code block of the loop may be hard-coded into the computing resources themselves, stored in a file that is privately or publicly available, stored as an entry on a private or public hash table file, or a combination of the above.

[0053] The code block may be static with hard-coded variables or, alternatively, static but include inputtable parameters. The parameters may be a single value in any data format, or a small chunk of code, or a combination of the above. The parameters may be input by directly extracting them from the metadata in a transaction (e.g., a Bitcoin transaction) or 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 values may be stored in the metadata in the transaction.

[0054] Information regarding repetition may be specified using metadata provided within or in relation to a transaction.

[0055] The computing resource may have a registry that enables the computing resource to access a pre-stored version of the subroutine, or may communicate. The registry may alternatively be described as a database, repository or other form of storage facility. The registry i) may store the cryptographic hash of the code related to the loop, and ii) information indicating the location of the access source where a copy of the code is accessible, and may store.

[0056] The method may further include the step of updating the code for the loop such that an existing code is replaced with a new code using a blockchain transaction. Preferably, the transaction is a multisignature P2SH transaction. The hash of the existing code and the 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. It may be described as an event counting, monitoring, detecting and / or processing system implemented by a computer. The event may be a vote, decision, selection or any other type of event. It may be configured to simulate or emulate Turing completeness. The system includes a blockchain, and a computing resource configured to execute a loop such that the execution of the loop is affected by the state of the blockchain, and may have.

[0059] Information related to at least one iteration of the loop is stored in a transaction on the blockchain. Preferably, the information is stored as metadata in the transaction.

[0060] Preferably, the computing resource is configured to generate an encrypted hash of the code related to the loop. Preferably, the encrypted hash is stored within a transaction on the blockchain. Additionally or alternatively, the computing resource is configured to monitor the state of the blockchain for transactions having an encrypted hash of the code related to the loop.

[0061] Preferably, for each iteration of the loop, a condition is evaluated and at least one action is performed based on the result of the evaluation, and at least one action is causing at least one transaction to be written to the blockchain and / or causing an off-chain action to be performed, having.

[0062] The condition may be related to data received, detected or generated by the computing resource, or the state of the blockchain.

[0063] The computing resource is monitoring the state of the blockchain, values generated or received by the computing resource, and / or data or signal sources provided off the blockchain may be configured to monitor.

[0064] The blockchain may function as a storage component for data, instructions, or pointers to data and / or instructions. The computing resource may function as a control flow management component for Turing-complete processing, and the computing resource is configured to execute a loop mechanism.

[0065] If the computing resource detects a predetermined hash of a part of the code in a transaction within the blockchain, the loop may be resumed in the specified iteration. Information related to the iteration may be specified using metadata provided within or in relation to the transaction.

[0066] The computing resource may have or communicate with a storage facility that can be referred to as a registry, database, or repository that enables the computing resource to access a pre-stored version of a subroutine. The registry may i) store the encrypted hash of the code related to the loop, and ii) store information indicating the location of the source from which a copy of the code is accessible.

[0067] The system may be configured to update the code for the loop such that the existing code is replaced with new code using a blockchain transaction. Preferably, the transaction is a multisignature P2SH transaction. Preferably, the system is configured to store the hash of the existing code and the hash of the new code.

[0068] Any feature described in relation to an aspect or embodiment of the present invention may also be applicable to any other aspect or embodiment. For example, any feature described in relation to the method may also be utilized in relation to the system, and vice versa.

[0069] The above and other aspects of the present invention will be apparent from and will be elucidated with reference to the embodiments described herein. The embodiments of the present invention are illustrated merely by way of example with reference to the accompanying drawings.

Brief Description of the Drawings

[0070]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Mode for Carrying Out the Invention

[0071] The following describes an illustrative example of using the Bitcoin blockchain. However, other blockchain protocols and implementations may be used. The present invention is not limited thereto.

[0072] The present invention realizes Turing completeness on an operation-limited blockchain platform (i.e., one using a scripting language that does not support complex control mechanisms), and thus solves the problem of how to expand the uses or applications where a blockchain can be deployed. Marvin Minsky (Minksy et al., Computation: Finite and Infinite Machines, Prentice Hall, Inc, 1967) explained how a non-erasable tape can be used to realize a machine that is Turing complete and can execute any algorithm that can also be executed on a universal Turing machine.

[0073] The present invention utilizes it as a non-erasable tape in an implementation form of a Turing machine and includes computing resources related to operating in connection with a blockchain. This computing resource is executed in parallel with the blockchain network while managing and processing the execution of loop processing. The loop processing is designed to execute a given task such as, for example, automation of a process or control of a device or system. This parallel resource monitors the state of the blockchain and enables transactions to be written to the blockchain. Thus, it may be referred to herein as a "manager" for reference convenience.

[0074] The features and effects of the present invention are · enabling the blockchain to function as a non-erasable tape of a Turing machine · the functions and implementation forms of a computer-based monitoring and management component (manager) that operates in parallel with the blockchain · using the manager as an instruction table of a Turing machine · managing the manager using a code registry · transaction metadata related to the restart of the code and loops of the manager ·Implementing software updates for the manager using digital signatures ·Special implementation forms of the manager using other blockchains are included.

[0075] Blockchain as an indelible tape of a Turing machine Referring to FIG. 1, the present invention utilizes a blockchain as a non-erasable tape of a Turing machine with the following definitions and features. 1. The blockchain operates as a tape of a Turing machine. Each transaction in the blockchain represents a cell on the tape. This cell can contain symbols from a finite alphabet. 2. The tape head can read information from the blocks already written in the blockchain. 3. The tape head can write a new block containing multiple transactions to the end of the blockchain. However, they cannot be written to the existing blocks. Also, the blockchain tape is non-erasable. 4. The metadata of each transaction can be stored as part of a multi-signature pay-to-script-hash (P2SH) transaction.

[0076] An important 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-chain source. Depending on the state of the blockchain and / or the received inputs, the manager may execute specific actions. The manager determines which actions should be executed. These may relate to actions in the "real world" (i.e., off-chain) and / or actions on the blockchain (such as creating and broadcasting new transactions), or not. 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 actions of the manager are executed in parallel and simultaneously with the Bitcoin network. In a sense, this stores the functionality of Bitcoin script with restricted operations. This continuous monitoring realizes a "loop" control flow configuration that makes the combined manager and blockchain system Turing complete.

[0078] Manager as an instruction table of a Turing machine According to an embodiment of the present invention, a Turing machine has · A data stack: This is represented by the blockchain as described above. · A control stack: This is represented by the manager function. This stores information related to the iterative control flow function.

[0079] The separation of the control stack from the data stack provides the effect of preventing infinite loops from occurring within the Bitcoin core. Furthermore, this reduces DoS attacks against the Bitcoin system.

[0080] The manager manages and executes subroutines that can loop through any type of loop construct (e.g., FOR-NEXT; REPEAT UNTIL, etc.). The exemplary embodiments described herein include a process utilizing an example of a "repetitive" configuration (see Figure 2). The user specifies an index (i) and a limit (J). These represent the current iteration number of the repeat loop (typically starting from 0 and counted) and the total number of repetitions, respectively.

[0081] For each iteration, 1. The index is incremented by only 1. For the exit condition, when the index reaches the limit, the repetition stops. 2. A code block containing the "if condition then action" (ICTA) statement is executed, and the action can be any action either on the blockchain or elsewhere. 3. The cryptographic hash of this subroutine is calculated. This can be stored on the blockchain as part of a transaction. Since the hash is unique to each code, it enables verification of which code was used.

[0082] The body of the loop contains code blocks. Each code block contains the "if condition then action" (ICTA) statement (see Figure 3). This · Starts or triggers a condition (e.g., when a specific Bitcoin address reaches 10 BTC) · Repetition condition (i.e., metadata or hash related to the previous iteration) · Stop condition (i.e., the last iteration of the loop) Monitors the current state of the blockchain for transactions that match.

[0083] The ICTA statement enables 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 the new transaction to the blockchain. This serves as a record that the iteration has been executed. When a transaction is written to the blockchain, the manager will detect that the previous iteration has been executed and written to the blockchain and will execute the next iteration. The latter condition continues until the iteration loop exits when the index (i) reaches the limit (J) specified in the code block.

[0084] Each transaction is stored on the blockchain in a reusable manner. In the Bitcoin implementation, each signature in a transaction is attached with a SIGHASH flag. This flag can take different values indicating whether each value can be corrected without the involvement of the owner of the signature by other parts of the transaction. A reusable transaction has the SIGHASH flag "SigHash_AnyoneCanPay" in one of the transaction inputs. This allows anyone to contribute to the input of the transaction. This parameter enables the ICTA function of the manager to be executed and repeated multiple times with different inputs. The use of this function can be restricted to authorized entities, for example, via the copyright of the reusable transaction.

[0085] The "If condition" part of the ICTA code block can monitor any type of condition. This is similar to other programming languages (e.g., C, C++, Java) and is not limited to the information stored on the blockchain. Some specific examples of 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 10°C or below 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 a game) · Monitor information from IoT (Internet of Things) (i.e., 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 the results from cloud computing (i.e., when a calculation is complete and the results are received) · Monitor remote data storage (i.e., when a file still exists remotely) The "Then action" part of the ICTA code block can perform several actions. The present invention is not limited with respect to the number or type of possible actions. A transaction including metadata related to the action can be written to the blockchain, but the action is not limited to a transaction on the blockchain.

[0086] The metadata can have any form 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 functions as a lookup key in a hash table and a hyperlink to a hash table containing more data or instructions related to the action. The embodiment may utilize a link in a style similar to the BitTorrent magnet URL format.

[0087] A list of exemplary actions is listed below. · Bitcoin transaction (i.e., sending Bitcoin to a specific address) · Social media (i.e., sending a message to a friend) · Trading (i.e., selling stock X) · IoT (i.e., switching off an incandescent bulb) · Commerce (i.e., purchasing an item online) · Online service (i.e., paying a monthly fee or paying for a service requested using Bitcoin) Since the present invention is not limited with respect to the nature, type or number of actions to be performed, it provides a very versatile solution that can be applied with great effect over a wide range of applications.

[0088] The manager's control stack can be implemented in several ways specific to each user's needs. For example, the repeating loop of the control stack 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 continue to align the control stack in a known and widely used Bitcoin script and programming style.

[0089] Use of an alternative stack of Bitcoin script as a data storage space Bitcoin script includes commands also called opcodes, which enable the user to move data to an alternative stack known as the "alt stack".

[0090] The opcodes are · OP_TOALTSTACK - Move data from the top of the main stack to the top of the alternative stack · OP_FROMALTSTACK - Move data from the top of the alternative stack to the top of the main stack (see Figure 4) This enables data to be stored in an alternative stack, similar to the "memory" function that enables data to be stored in a computer. According to an exemplary embodiment of the present invention, the alternative stack is used to set Bitcoin script to solve a small computing task and return the result in the computation.

[0091] Use of a code register for managing a manager The manager also manages a register of all the code it owns and executes. This register is configured similar to a lookup table or dictionary that maps a specific key to a specific value (see FIG. 5). The pair of key and value are represented by the hash (H1) of the code block and the IPv6 address where the code is stored, respectively. To extract the code block using the key H1, the lookup table is used to extract the relevant value (which is the location where the code is stored), and the source code is extracted.

[0092] Various implementations of the code registry are possible. For example, the lookup table can be implemented using a locally managed 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 achieved by any link format using the magnet URI format or shared zero-knowledge encryption.

[0093] Transaction metadata and resumption of loops of the manager's code The information required to resume the manager's loop in a particular iteration is stored as metadata in a transaction recorded on the blockchain (see FIGS. 6 and 7).

[0094] In this way, a transaction on the blockchain stores information regarding a given iteration of a loop being executed on the manager or provides access to such information. This information can include the value of any variable associated with the loop, such as index i, and any other necessary information, such as the value of a parameter utilized in a data or code block related to a location specifying where further required information is accessible.

[0095] The metadata itself is stored as part of a multi-signature pay-to-script-hash script (P2SH) in the transaction. The metadata recorded with the transaction also provides the ability to record a trace of how the code was previously executed.

[0096] There are several ways for the manager to resume the code block of the iterative loop in each iteration. The code block may be hard-coded into the manager itself, or it may be stored in a file that is privately or publicly available, 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 can be static with hard-coded variables or it can be static but include inputtable parameters. The parameters can be a single value in any data format, or they can be a small chunk of code, or they can be a combination of the above. The parameters can be input by directly extracting them from the metadata in a transaction (e.g., a Bitcoin transaction), or from an external source such as an internal database, a private / public file, or a hash table, or from any combination of the above. A pointer to the external source of the parameter value may be stored in the metadata in the transaction.

[0097] The following steps provide an example of how a manager can resume the code block of a loop in the i-th iteration. In this example, the code register is a hash table, such that the hash value functions as a lookup key for the table and is stored in the metadata on the transaction. 1. The manager monitors the blockchain for transactions that contain the hash of the code block that matches the entry in the code registry. 2. The manager detects a transaction that contains the corresponding hash (H1). 3. The manager reads “Metadata-CodeHash”, obtains 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 modified and it is safe to proceed to the next step. 4. The manager reads “Metadata-CodeHash” that stores the index I and resumes the code in the i-th iteration. That is, the loop is “reloaded” in 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 “Metadata-OutputHash” and “Metadata-OutputPointer” (see Figure 6), and if these data are required for the said iteration of the loop, extracts the output of the previous step.

[0098] Multiple signatures may be required to unlock the transaction (e.g., the user, operating system, software developer, and software vendor). This enables a digital rights management (DRM) system that manages rights to execute the code by all parties involved in the P2SH transaction.

[0099] Update of the manager's code The software is associated with the manager and updates and patches the securely authenticated code blocks 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 switch from the old code to the new code, thereby providing a tracking record of the software update. The manager needs to store all the hashes of the old and new blocks of the source code. The hashes of the new and old source code blocks are available to verify the integrity of the code files.

[0100] According to an embodiment of the present invention, multiple signatures are required to unlock the transaction (e.g., user, operating system, software developer, and software vendor). This provides a DRM system for managing software updates and patches of the code utilized by the manager.

[0101] Unlike most software that does not allow the software to be updated during execution, the effect of the present invention is that the software update is executable during the execution of the loop. This provides a dynamic and responsive solution that can be reset in real time with minimal interruption to the process 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 during the loop and start the next iteration step using the metadata output from the previous iteration from the old code.

[0103] Vote counting invention The current Bitcoin Script language does not allow loops to occur. This prevents the use of Bitcoin payments from triggering continuous and automated actions without external intervention. However, when a manager continuously monitors information on the blockchain, this enables automated actions to be executed based on the latest information on the blockchain.

[0104] The following explains how the manager's control stack can be used to automate the processing related to an automated online vote counting bot.

[0105] The vote counting bot of the present invention is designed to achieve fair and pseudo-anonymous voting by means of a blockchain that records a secure and immutable record of the vote counting process. The vote counting bot is automated using the manager's control stack and a repeating loop (see Figure 10). The following scenario shows how an example of this operates.

[0106] Assume there are 100 voters. If 57 unique "Yes" votes are received by January 1, 2016, the payment is released to Chair, Jason. The voting process is · Token distribution · Counting divided into two parts.

[0107] Regarding token distribution, 100 voting tokens are distributed to each authenticated voter. Each token is represented by, for example, a pair of Bitcoin public and private keys. These are 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 the list public before the start of voting. To ensure that the vote is tamper-proof and anonymized, the list of private keys and the mapping between the voter's identification information and their token are destroyed (i.e., never stored).

[0108] Having a list of anonymized and pre-authenticated addresses provides other important advantages. It ensures that only authenticated parties can cast valid votes. It also enables the exclusion of any unwanted votes originating from specific addresses (e.g., spammers, fraudulent voters) without compromising the voter's identification information. To implement the counting process, the manager executes a loop. The list of addresses is maintained in the Bitcoin script and transferred to an alternative stack for data storage. When an address is counted, it is removed from the alternative stack and not added to the next transaction. The loop stops when the list of addresses is empty.

[0109] Instead of using an integer index i to track where the loop currently is, the vote bot manager uses it to store an intermediate value of the vote count. This ensures that the intermediate value of the vote count is stored on the blockchain. This provides an audit trail and shows that the vote counting process is fair.

[0110] If the number of received unique "Yes" votes reaches 57, the agreed-upon amount of Bitcoin is paid to Jason's account. The cryptographic hash of the vote counting script and the IPv6 address where the script is stored are publicly released. This means that the public has enough information to perform a recount and ensure that the vote counting process is fair and correct.

[0111] The above-described embodiments illustrate rather than limit the present invention, and it should be noted that those skilled in the art can design many other embodiments without departing from the scope of the present invention defined by the appended claims. In the claims, any reference signs placed in parentheses shall not be construed as limiting the claims. Words such as "comprising" do not exclude the presence of elements or steps other than those listed in any claim or the entire specification. In this specification, "comprising" means "including or consisting of". A reference to the singular form of an element does not exclude a reference to the plural of such element, and vice versa. The present invention may be implemented by hardware having a plurality of different elements or by a computer appropriately programmed. In a claim of an apparatus listing a plurality of means, some 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 is not effectively utilizable.

Claims

1. A computer-implemented method executed by a manager to resume a repeating loop code block in the i-th iteration of a loop, wherein the manager operates in parallel with a blockchain platform, and the method The manager monitors the blockchain for a transaction that includes the hash (H 1 ) of a code block that matches an entry in the code registry managed by the manager. Upon detection of the transaction including the hash (H 1 ), Read the metadata of the transaction and extract the code (C 1 ). determining that the code (C 1 ) has not been changed; includes storing an index (I) and resuming the code in the i-th iteration.

2. The method according to claim 1, further comprising extracting the output of the previous step if necessary for the iteration of the loop.

3. The method according to claim 1 or 2, wherein the code registry is a hash table and the hash represents the key of a key-value pair.

4. further comprising extracting the code block using the hash (H 1 ), wherein a lookup table is utilized to extract related values and source code, the method according to any one of claims 1 to 3.

5. The method according to any one of claims 1 to 4, wherein the metadata is stored in the transaction as a multi-signature pay-to-script hash script.

6. The manager reads "Metadata-CodeHash" and obtains a CodeHash field including the hash (H 1 ), according to the method as claimed in any one of claims 1 to 5.

7. Determining that the code has not been changed includes determining that RIPEMD-160(SHA256(C 1 )) is equal to (H 1 ), the method according to any one of claims 1 to 6.

8. The method according to any one of claims 1 to 7, wherein the code registry is configured like a lookup table that maps a specific key to a specific value.

9. The key is represented by a hash (H 1 ) of the code block, and the specific value is the IPv6 address of the location where the code is stored. The method according to claim 8

10. The method according to claim 1, wherein the code registry is implemented using a locally managed list or a P2P distributed hash table.

11. The method according to any one of claims 1 to 10, further comprising performing the loop for vote counting.

12. The method according to claim 11, wherein the manager stores an intermediate value of vote counting using the index (I).

13. The method according to any one of claims 1 to 12, wherein the manager continuously monitors the information on the blockchain, thereby enabling automated actions to be executed based on the latest information on the blockchain.

Citation Information

Patent Citations

  • Calculating method and calculating device capable of maintaining non-alteration property of information

    JP2003044770A

  • System and method for securely receiving and counting votes in an election

    US20160027229A1