Counting system and method for secure voting and distribution implemented with blockchain

By executing a loop process on computing resources outside the blockchain, and using a manager to monitor the blockchain state and trigger transaction writes, the Turing completeness limitation of blockchain scripting languages ​​is overcome, enabling automated tasks and process control of complex control flows, thereby enhancing the functionality and security of the blockchain.

CN114679282BActive Publication Date: 2026-03-17NCHAIN HLDG LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2017-02-14
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing blockchain scripting languages ​​are limited by Turing completeness, cannot effectively support complex control flow mechanisms, thus making it impossible to achieve complex automated tasks and process control, and also have security vulnerabilities.

Method used

By executing a loop process on computing resources outside the blockchain, using a manager (computing resource) to monitor the blockchain state and trigger transaction writes, and combining this with the use of a finite scripting language, Turing complete functionality is achieved.

Benefits of technology

It enables the simulation of Turing completeness on the blockchain platform, enhances the versatility and security of blockchain technology, and supports automated tasks and process control of complex control flow mechanisms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114679282B_ABST
    Figure CN114679282B_ABST
Patent Text Reader

Abstract

The present invention relates mainly to blockchain implementations. The invention relates to technical solutions for managing voting, counting, selection and / or decision processes, which can be used to implement automated processes such as device / system control, process control, distributed computing and storage, etc. The invention provides an event detection, monitoring and / or counting mechanism. The event can be, for example, a vote, decision or selection made by a given entity. The invention provides a counting solution in which a computing resource runs simultaneously in parallel with a blockchain and manages a loop-based operation. The computing resource continuously monitors the state of the blockchain and any other off-chain input data or sources. The execution of the loop is affected by the state of the blockchain. Each iteration of the loop executed by the computing resource is recorded in a transaction written to the blockchain and stored as a hash in the metadata of the transaction. If the computing resource finds a hash transaction containing a loop-related hash, it will access the relevant part of the code. The loop contains a conditional statement that enables the computing resource to decide which operation to take. The condition can depend on the state of the blockchain or any other data source. The operation can be any type of operation on the blockchain or off-chain. Thus, the combination of the computing resource and the blockchain provides a Turing-complete solution.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the PCT national phase application filed on February 14, 2017, with application number 201780009343.6 and invention title "Counting system and method for secure voting and allocation implemented using blockchain". Technical Field

[0002] This invention primarily relates to blockchain implementation methods and technologies. It is particularly suitable for, but not limited to, applications such as device / system control, process control, distributed computing, and storage. Specifically, this invention relates to technical solutions for managing voting, counting, selection, and / or decision-making processes. This invention is not limited to use in political voting applications or scenarios. Background Technology

[0003] In this document, we use the term "blockchain" to encompass all forms of consensus-based electronic, computer-based, and distributed ledgers, including but not limited to blockchain and transaction chain technologies, permissioned and permissionless ledgers, shared ledgers, and variations thereof. It should be noted that this invention can be used with other blockchain implementations. Furthermore, protocols also fall within the scope of this invention.

[0004] A blockchain is a consensus-based electronic ledger. An electronic ledger is a computer-based, decentralized, distributed system composed of blocks, which in turn are transactions. Each transaction is a data structure that encodes the transfer of control over digital assets between participants in the blockchain system and includes at least one input and at least one output. Each block contains the hash of the previous block. These blocks are chained together to create a permanent, immutable record—a record of all transactions written to the blockchain since its inception. Transactions contain small programs called scripts embedded in their inputs and outputs, specifying how and by whom the transaction's outputs are accessed. These scripts can be written using a stack-based scripting language.

[0005] For a transaction to be written to the blockchain, it must be "verified." Network nodes perform this work to ensure that each transaction is valid and to reject invalid transactions in the network. If the execution of the locking and unlocking scripts evaluates to TRUE, the transaction is valid and will be written to the blockchain. Therefore, for a transaction to be written to the blockchain, it must i) be verified by the first node that receives the transaction—if the transaction is verified, the node transmits it to other nodes in the network; ii) be added to a new block being built; and iii) be added to the public ledger of past transactions.

[0006] Digital entrepreneurs have begun exploring the use of secure encryption systems and data that can be stored on the blockchain to implement new systems. These include, but are not limited to:

[0007] • Store metadata

[0008] • Implementing digital tokens

[0009] • Establish contracts signed using digital signatures.

[0010] If blockchain can be used to automate tasks and processes, it would be highly advantageous. Such solutions would be able to leverage the advantages of blockchain (such as permanent, tamper-proof recording of events, distributed processing, and secure encryption) and be more versatile in applications.

[0011] One area of ​​current interest in the blockchain community is Turing completeness, particularly how to leverage it to advance blockchain technology development. For security reasons, the development of these technologies aims to limit functionality.

[0012] Whether some blockchain scripting languages ​​are Turing-complete is debatable because they do not inherently support complex flow control features, such as impending loops. One advantage of this limitation is that programs have predictable execution times.

[0013] Another important advantage of restricting some blockchain scripts to linear or tree-like decision-making tasks is that it avoids infinite loops, which can be used as a means to launch exploits such as denial-of-service (DoS or DDoS) attacks. Because of this restriction, some blockchain scripts are typically limited to linear tasks and not used in more complex applications such as automated task control, device management, etc.

[0014] The Ethereum blockchain platform addresses this issue by incorporating its "built-in" Turing-complete language, Solidity. This language is native to the Ethereum platform, allowing scripts written in Solidity to include control flow mechanisms such as loops. However, Ethereum has been subject to numerous attacks and exploits.

[0015] Given the aforementioned security concerns, and the widespread use and familiarity of some blockchain scripting languages, most of the blockchain community still hopes to retain the use of these limited scripting languages ​​related to blockchain technology.

[0016] Therefore, we aim to provide a solution that facilitates the integration or combination of Turing-complete features, such as loop mechanisms and other complex control structures, with blockchain scripts while avoiding the destructive effects of potential security weaknesses, such as infinite loops. Such a solution would offer numerous benefits, including:

[0017] • Automate complex blockchain-related transactions;

[0018] • Control the flow of metadata recorded on the blockchain;

[0019] • Expand the functionality and applications of blockchain platforms that do not rely on or intentionally assemble Turing-complete languages.

[0020] An improved solution has now been devised. This invention provides a solution that incorporates a novel combination of parallel computing resources and blockchain, enabling the simulation, imitation, and / or programming of loops and other Turing-complete functions beyond typical blockchain scripts. This, in turn, facilitates numerous applications related to the automation of tasks such as distributed data storage, distributed computing, and drone control, or any IoT (Internet of Things) device. Such applications may include using blockchain for metadata storage, managing digital tokens, and establishing contracts. Another useful application is the automation of voting or selection counting processes.

[0021] The following provides background information on the technical field of this invention: US2016 / 027229A; WO2016 / 022864A and US6061449A. The following online resources, also available at the time of filing, provide the technical background:

[0022] https: / / nxt.org / what-is-nxt / voting /

[0023] http: / / news.ycombinator.com / item?id=7287155

[0024] http: / / news.ycombinator.com / item?id=11372455

[0025] http: / / cryptonomics.org / 2014 / 02 / 01 / ethereum-turing-complete Summary of the Invention

[0026] Therefore, according to the present invention, a solution as defined in the appended claims is provided. According to the present invention, a (process) control method and a corresponding system can be provided. The present invention may be referred to as a control method / system for blockchain implementation. The present invention can control automated tasks or processes.

[0027] This invention can be used to simulate / mock Turing completeness using blockchain. Alternatively, this invention can enable applications involving Turing-complete control mechanisms to execute on a blockchain platform.

[0028] Alternatively, the present invention can be described as a method or system for controlling processes executed on off-block computing resources using blockchain and / or one or more blockchain transactions. Therefore, the present invention includes a setup in which various computing components, functionally and structurally different from each other, interact to provide new technical results. The interaction of different computing systems (computing resources and blockchain) produces a very powerful control solution.

[0029] From a computational resource perspective, this invention offers the advantage of a permanent, tamper-proof record of program execution. From a blockchain perspective, this invention provides an improved blockchain implementation scheme because it enables at least partial emulation of Turing completeness through the use of blockchain, which in turn allows for the utilization of more functionally complex blockchain-based applications. While the use of limited scripting languages ​​in blockchain transactions is preserved, all of this is also achieved. Scripting languages ​​may be limited (restricted) because their design or implementation prevents, or at least cannot naturally support, incorporating complex control flow mechanisms such as loops into code written in that language. The language's instruction set, i.e., the "commands" or "opcodes" that programmers can use, may not include commands for complex flow control mechanisms.

[0030] A blockchain can be associated with or used with a blockchain protocol that includes a finite language (possibly a scripting language). This invention can use blockchain to extend the functionality of a finite scripting language to perform tasks.

[0031] This invention can use the state of a blockchain to execute a loop-based process. This loop-based process can execute on computing resources that operate in parallel with the blockchain network. The computing resources may be different from the blockchain network (not part of it). The computing resources may be referred to as an "oracle" or a "bot".

[0032] This allows blockchain protocols to utilize scripting languages ​​with limited functionality, while permitting control flow mechanisms such as loop mechanisms to be implemented outside the blockchain. This new combination enhances the versatility of blockchain technology while preserving its security.

[0033] According to one or more embodiments of the present invention, the present invention can provide computer-implemented event processing, monitoring, detection, and / or counting processes and corresponding systems. Embodiments of the present invention can be used for events generated by entities. The present invention can monitor / detect and / or count voting, selection, or decision events or other types of events. For convenience, the terms "voting" or "decision" may be used to refer to events monitored, counted, recorded, and / or detected by the present invention.

[0034] One or more embodiments of the present invention can be described as control methods and corresponding systems. The present invention can be described as a method / system for blockchain implementation. The present invention can be used to control processes. These processes can be industrial or non-industrial. Events, such as decisions, can be made by machines, electronic / software-based entities, natural persons, legal persons, or others. One or more embodiments of the present invention can include methods / systems for counting, monitoring, recording, detecting, and / or otherwise processing events. Events can be decisions or choices, such as votes cast by entities within an application domain. While it can be used to calculate politically oriented votes or events in a political context, it is not limited to this purpose. For example, it can be used to record the number of times a machine makes a particular choice, or the number of cell mutations, etc. The decision can be binary or non-binary. It can also calculate or record the number of times an event occurs / does not occur.

[0035] The method may include the following steps:

[0036] Distribute or assign at least one token to at least one predetermined entity, wherein at least one token is represented by a pair of cryptographic public and private keys;

[0037] Perform a loop on computing resources to maintain a count of one or more events (e.g., votes, selections, actions, or decisions) generated by at least one entity.

[0038] This invention can provide a computer-implemented voting or decision counting process, comprising the following steps:

[0039] Distribute or assign at least one token to at least one predetermined entity, wherein at least one token is represented by a public key and private key pair; and perform a loop on computing resources to maintain a count of one or more votes or decisions made by at least one entity.

[0040] Cryptographic key pairs can be referred to as "blockchain public and private key pairs." As is well known in the art, they are used in conjunction with blockchain platforms and for the secure transfer of values ​​between blockchain transaction inputs and outputs. The key can also be used as a blockchain address.

[0041] This invention provides a computer-implemented method for voting or decision counting, comprising the following steps:

[0042] Distribute or assign at least one token to at least one predetermined entity, wherein at least one token is represented by a blockchain public and private key pair; execute a loop on computing resources, the loop being implemented using a script to maintain a count of one or more votes or decisions generated by or associated with at least one entity; and generate a cryptographic hash of the script.

[0043] This invention provides a computer-implemented method for voting or decision counting, comprising the following steps:

[0044] Distribute or assign at least one token to at least one predetermined entity, wherein at least one token is represented by a blockchain public key and private key pair; and perform a loop on computing resources to maintain a count of one or more votes or decisions made by at least one entity;

[0045] Information relating to at least one iteration of the cycle is stored in transactions on the blockchain.

[0046] This invention provides a computer-implemented method for voting or decision counting, comprising the following steps:

[0047] Distributing or assigning at least one token to at least one predetermined entity, wherein at least one token is represented by a blockchain public and private key pair; performing a loop on computing resources to maintain a count of one or more votes or decisions made by at least one entity; and

[0048] Generate cryptographic hashes for code related to loops;

[0049] And preferably includes the step of storing cryptographic hashes in a transaction on the blockchain.

[0050] This invention provides a computer-implemented method for voting or decision counting, comprising the following steps:

[0051] Distribute or assign at least one token to at least one predetermined entity, wherein at least one token is represented by a blockchain public key and private key pair; and perform a loop on computing resources to maintain a count of one or more votes or decisions made by at least one entity;

[0052] The computing resources are used to monitor the state of the blockchain through a transaction that includes the cryptographic hash of the code associated with the loop.

[0053] At least one pre-selected / pre-selected entity may be a machine or an electronic / software-based entity. In other embodiments, the entity may be a natural person, legal person, or other. The allocation 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 the multiple entities.

[0054] The counts of one or more votes or decisions can be stored in the blockchain (e.g., in a transaction) and / or in a backup stack of the blockchain.

[0055] This method may include steps for implementing loops using a script. The script can be written in a scripting language, which may be based on Forth scripting languages ​​and may be non-Turing complete. It may also be a stack-based language. The scripting language may be finite (restricted) because its design or implementation prevents, or at least does not naturally support, incorporating complex control flow mechanisms such as loops into code written in that language. The language's instruction set, i.e., the "commands" or "opcodes" that the programmer can use, may be used to exclude commands for complex flow control mechanisms.

[0056] The method may also include the step of generating a cryptographic hash of the script or a portion thereof.

[0057] The method may also include the step of distributing and / or assigning at least one token to at least one entity using a secret exchange protocol.

[0058] The method may also include the step of loading each public key and address with one or more selected items.

[0059] The method may further include the following steps: maintaining a list of public keys on computing resources or maintaining a list of public keys associated with computing resources, the list of public keys being associated with each authorized entity and / or token. The method may also include steps of destroying (and / or never storing) the list of private keys and the mapping / association between an entity's identity and its assigned token.

[0060] The method may also include the step of maintaining a list of addresses. This list may be an empty list or a list containing 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 in the blockchain script.

[0061] The method may also include the step of transferring the list of addresses to a (blockchain) standby stack for storage; preferably, once the votes for that address (or other condition) have been counted, detected and / or otherwise processed, the address is removed from the standby stack.

[0062] The method may also include a step of executing a loop until the address list becomes empty.

[0063] The method may include the following steps:

[0064] Execute a loop on computing resources (such as a server or multiple servers); use the state of the blockchain to influence the execution of the loop; and / or affect the state of the blockchain as a result of executing the loop.

[0065] Computing resources can be any processor-based device or system. For example, it can be a server or multiple servers; it can be a single machine or a distributed resource. A blockchain can be a blockchain-related platform or a consensus-based electronic ledger.

[0066] Information related to at least one iteration of the loop can be stored in a transaction on the blockchain. This information can be stored in the transaction as metadata. The loop can contain "If condition then action" (ICTA) instructions.

[0067] The method may also include a step of generating a cryptographic hash of the code related to the loop, and preferably, storing the cryptographic hash in a transaction on a blockchain. The code may be a block of code containing control flow statements, such as an "If conditionthen action" statement.

[0068] Computational resources can be used to monitor the state of the blockchain through a transaction that includes the cryptographic hash of code related to the loop.

[0069] The method may also include the following steps:

[0070] For each iteration of the loop:

[0071] Evaluate the conditions and perform at least one operation based on the evaluation results, wherein the at least one operation includes:

[0072] Trigger at least one transaction to be written to the blockchain; and / or

[0073] Trigger an operation outside the blockchain.

[0074] This condition can be used to monitor any value, signal, or input, whether generated on or off the blockchain, regardless of where, how, or by whom. The condition can relate to data received, detected, or generated by computing resources; and / or the state of the blockchain. The condition can be described as a "trigger," which can be or relate to a specific state of the blockchain, or an event detected off-block (e.g., a date or temperature reading), or a combination of both.

[0075] Operations may include sending a signal to trigger the start of an event, or broadcasting a new transaction, or a combination of both. Indexes may be maintained (i) outside the manager block, or (ii) stored in a subsequently broadcast transaction; (i) and (ii) represent two alternative methods for maintaining control data.

[0076] Computing resources can be used for monitoring:

[0077] The state of the blockchain; values ​​generated or received by computing resources; and / or data or signal sources provided from outside the blockchain.

[0078] The method may include the following steps:

[0079] i) Using blockchain as a storage component for data, instructions, or data pointers and / or instruction pointers; and

[0080] ii) Use computational resources as the control flow management component for Turing-complete processes, while also using computational resources to execute loop mechanisms.

[0081] Therefore, blockchain can be used as a read-only tape for Turing machines. Computational resources can be used to control the execution flow of processes, implement loops, and extend the functionality of scripting languages.

[0082] The method may also include a step of restarting (regenerating) the loop in a specified iteration. The loop can be restarted if computational resources find a predetermined hash of a portion of code within a transaction within the blockchain. This portion of code may involve the loop body and may also include an ICTA statement.

[0083] Computational resources can be used to regenerate the loop in each iteration. This can be done in various ways. For example, a loop block can:

[0084] Hard-coded into computing resources;

[0085] Stored in private or public files;

[0086] Entries stored as private or public hash table files;

[0087] Or a combination of the above methods.

[0088] A code block can be a static code block with hard-coded variables, or a static code block containing populated parameters. The parameters can be a single value in any data format, a small piece of code, or a combination of the above. Parameters can be populated either directly from the transaction's metadata or from an external source such as an internal database, private / public files, hash tables, or any combination thereof. Pointers to the external source of the parameter values ​​can be stored in the transaction's metadata.

[0089] Metadata can be used to specify information related to iteration, which is provided in or related to a transaction.

[0090] Computing resources may include or communicate with a registry that enables them to access stored versions of subroutines. Alternatively, a registry may be described as a database, repository, or other form of storage device. A registry may store:

[0091] i) Cryptographic hashes of code related to loops; and

[0092] ii) Indicates information about the location of the code copy that can be accessed;

[0093] The method may also include a step of using blockchain transactions to update the loop code so that the existing code can be replaced with the new code. The hashes of the existing code and the new code can be stored.

[0094] The present invention also provides a system for implementing any embodiment of the above-described method.

[0095] This invention can provide a computer-based system. The system can be described as a computer-implemented system for counting, monitoring, detecting, and / or processing events. Events can be voting, decisions, choices, or any other type of event. The system can be used to simulate or replicate Turing completeness. The system may include:

[0096] Blockchain; and

[0097] Computational resources are used to execute loops, making the execution of the loops subject to the state of the blockchain.

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

[0099] Preferably, computational resources are used to generate a cryptographic hash of the code related to the loop. Preferably, the cryptographic hash is stored in a transaction on the blockchain. Alternatively / or, computational resources monitor the state of the blockchain due to a transaction that includes the cryptographic hash of the code related to the loop.

[0100] Preferably, for each iteration of the loop: the conditions are evaluated and at least one operation is performed based on the evaluation result; the at least one operation includes: triggering at least one transaction to be written to the blockchain; and / or

[0101] Trigger an operation outside the blockchain.

[0102] This condition can involve data received, detected, or generated by computing resources; or the state of the blockchain.

[0103] This computing resource can be used for monitoring:

[0104] The state of the blockchain;

[0105] The values ​​generated or received by the computational resource; and / or

[0106] Data or signal sources provided outside the blockchain;

[0107] Blockchain can be used as a storage component for data, instructions, or data pointers and / or instruction pointers. Computational resources can be used as control flow management components for Turing-complete processes, while also being used to execute loop mechanisms.

[0108] If computational resources find a predetermined hash of a portion of the code within a transaction in the chain, the loop can be restarted in the specified iteration. Metadata can be used to specify information related to the iteration, which is provided within or associated with the transaction.

[0109] Computing resources may include or communicate with storage devices, such as a registry, database, or repository, and enable the computing resources to access stored versions of subroutines. The registry may store:

[0110] i) Cryptographic hashes of code related to loops; and

[0111] ii) indicates information about the location of the code copy.

[0112] The system can be configured to use blockchain transactions to update cyclical code, thereby replacing existing code with new code. Preferably, the system is used to store the hashes of the existing code and the hashes of the new code.

[0113] Any feature described in connection with one aspect or embodiment of the invention may also be applied to any other aspect or embodiment. For example, any feature described in connection with the method may also be used in a related system, and vice versa. Attached Figure Description

[0114] These and other aspects of the invention will become apparent and will be illustrated by referring to the embodiments described herein. Embodiments of the invention will now be described by way of example only and with reference to the accompanying drawings, in which:

[0115] Figure 1 This illustrates the use of blockchain as a read-only tape for a Turing machine.

[0116] Figure 2 A subroutine is described that the manager can use to implement a repeating loop with the blockchain.

[0117] Figure 3 An example of using the ICTA (If Condition Then Action) code block according to the present invention is shown.

[0118] Figure 4 Commands that allow a user to move data into and out of a spare stack are shown according to an embodiment of the invention.

[0119] Figure 5 A manager code registry is shown according to an embodiment of the present invention.

[0120] Figure 6 Metadata associated with the manager code block is shown in an embodiment according to the present invention.

[0121] Figure 7 Metadata associated with the output in a specific iteration of the manager loop is shown according to an embodiment of the invention.

[0122] Figure 8 The transaction script and metadata of an embodiment of the present invention are shown.

[0123] Figure 9 The illustrative manager software patch verification and audit trail are shown. Detailed Implementation

[0124] The following describes illustrative embodiments using some blockchains. However, other blockchain protocols and implementations may also be used. The invention is not limited in this respect.

[0125] This invention addresses the problem of how to achieve Turing completeness on operationally constrained blockchain platforms (i.e., blockchain platforms using scripting languages ​​that do not support complex control mechanisms), thereby expanding the uses or applications of blockchain. Marvin Minsky (Minksy et al., Computation: Finite and Infinite Machines, Prentice Hall Inc., 1967) described how to implement a Turing-complete machine using read-only magnetic tape, and how to execute any algorithm that can also be executed on a universal Turing machine.

[0126] This invention includes a computing resource that operates in conjunction with a blockchain, serving as a read-only tape in a Turing machine implementation. This computing resource operates in parallel with the blockchain network, overseeing and processing the execution of cyclical processes. These cyclical processes are used to perform given tasks, such as process automation or control of devices or systems. This parallel resource monitors the state of the blockchain and can trigger transactions to be written to it. Therefore, for ease of reference, it is referred to herein as a "manager".

[0127] The features and advantages of the present invention include:

[0128] • Enabling blockchain as a read-only tape for Turing machines

[0129] • Functionality and implementation of computer-based monitoring and management components (managers) that operate alongside the blockchain.

[0130] • Use the manager as the instruction table for the Turing machine

[0131] • Use the Code Registry Manager

[0132] • Transaction metadata related to manager code and loop regeneration

[0133] • Software updates for the manager are implemented using digital signatures.

[0134] • A special implementation using a manager with an alternative blockchain

[0135] Blockchain as a read-only tape of a Turing machine

[0136] refer to Figure 1 This invention utilizes blockchain as a read-only magnetic tape for a Turing machine, and has the following definitions and characteristics:

[0137] 1. Blockchain is like a magnetic tape for a Turing machine. Each transaction in the blockchain represents a cell on the tape. This cell can contain symbols from a finite alphabet.

[0138] 2. The magnetic head can read information from blocks that have already been written into the blockchain.

[0139] 3. The read / write head can write new blocks containing many transactions to the end of the blockchain, but it cannot write to existing blocks; therefore, the blockchain tape is read-only.

[0140] One important function of the manager is to act as a proxy for monitoring the current state of the blockchain. It can also receive signals or inputs from any external source.

[0141] Based on the blockchain state and / or received input, the manager can perform certain operations. The manager decides which operations to perform. These may or may not involve operations in the "real world" (i.e., out-of-block) and / or operations on the blockchain (such as creating and broadcasting new transactions). The operations taken by the manager may be triggered by the blockchain state. The manager can also decide on the next set of transactions to broadcast to the blockchain network and subsequently decide on writing this set of transactions to the blockchain.

[0142] The manager's operations run concurrently across the blockchain network. In a sense, this extends the functionality of behaviorally constrained blockchain scripts. This continuous monitoring enables a 'loop' control flow structure, making the combined manager and blockchain system Turing complete.

[0143] The manager serves as the instruction table for the Turing machine.

[0144] According to one embodiment of the present invention, a Turing machine includes two stacks:

[0145] • Data stack: As mentioned above, represented by a blockchain.

[0146] • Control Stack: Represented by manager functions. Stores information about recurring control flow functions.

[0147] Separating the control stack from the data stack provides the advantage of preventing infinite loops in the kernel, which in turn mitigates denial-of-service attacks on the system.

[0148] The manager manages and runs subroutines that can loop through any type of loop structure (e.g., FOR-NEXT; REPEATUNTIL; etc.). The illustrative embodiments described herein include a process using an instance of the "repeated" structure (see...). Figure 2 The user specifies the index (z) and the limit (J), which represent the current iteration number (usually counted from 0) and the total number of iterations of the repeating loop, respectively.

[0149] For each iteration:

[0150] 1. Index Increment: For the exit condition, iteration stops when the index reaches the limit.

[0151] 2. Execute the code block containing the "if condition then action" (ICTA) statement; this operation can be any operation on or off the blockchain;

[0152] 3. Calculate the cryptographic hash of the subroutine. This can be stored in the blockchain as part of the transaction. Since the hash is unique for each piece of code, the code that has been used can be verified.

[0153] The loop body consists of a code block. Each code block contains an "If condition then action" (ICTA) statement (see...). Figure 3 ), monitor the current state of the blockchain to find transactions that match the following:

[0154] • Start-up or trigger conditions.

[0155] • Repeating conditions (i.e. metadata or hashes associated with previous iterations).

[0156] • Stopping condition (i.e., the last iteration of the loop).

[0157] The ICTA statement enables the manager to determine the next transaction to proceed based on the current state of the blockchain. Proceeding with the next transaction involves broadcasting the transaction to the blockchain network and writing the new transaction to the blockchain. This acts as a record of this iteration being executed. Once the transaction is written to the blockchain, the manager will then discover that the previous iteration has been executed and written to the blockchain, and will execute the next iteration. The latter continues until index i) reaches the limit (J) specified in the code block, at which point the loop repeats and exits.

[0158] Each transaction is stored in the blockchain in a reusable manner. In some implementations, each signature in a transaction is appended with a SIGHASH flag. This flag can take different values, each indicating whether other parts of the transaction can be modified without the participation of the owner of that signature. Reusable transactions have the SIGHASH flag 'SigHash_AnyoneCanPay' in one of their transaction inputs, which allows anyone to contribute to the transaction's input. This parameter enables the manager's ICTA function to be repeated multiple times using different inputs. The use of this function can be limited to the authorizing party—for example, through the copyright of the reusable transaction.

[0159] The "If condition" section of an ICTA code block can monitor any type of condition. This is similar to other programming languages ​​(such as C, C++, Java) and is not limited to information stored on the blockchain. Some example conditions are listed below:

[0160] • Monitor dates and times (i.e., when a specific date and time are reached).

[0161] • Monitor the weather (i.e., when the temperature is below 10°C and it is raining).

[0162] • Monitor social media (i.e., when I receive messages from friends).

[0163] • Monitor the conditions of the contract or trust (i.e., when Company A purchases Company B).

[0164] • Monitor news and events (i.e., when football team A wins a match).

[0165] • Monitor information from the Internet of Things (i.e., when a light bulb needs to be replaced).

[0166] • Monitor data from mobile / wearable devices (i.e., when the wearable step tracker counts 10,000 steps).

[0167] • Monitor the results of cloud computing (i.e., when the computation is completed and the results are received).

[0168] • Monitor remote data storage (i.e., whether the file still exists remotely).

[0169] The "Then action" section of an ICTA code block can perform multiple operations. This invention is not limited to the number or type of operations that can be taken. Although transactions containing metadata related to operations can be written to the blockchain, operations are not limited to transactions on the blockchain.

[0170] Metadata can be in any form specified by the manager. However, according to one embodiment of the invention, metadata can store hyperlinks in a file containing more data or instructions. Metadata can be stored either in a hash table containing more data or instructions related to the operation, or in a hash of the operation used as a circular key in the hash table. Embodiments can use links similar to a bitstream magnet link format.

[0171] The following are a series of example operations:

[0172] • Social media (i.e., sending messages to friends).

[0173] • Transaction (i.e., selling X shares).

[0174] • Internet of Things (IoT) (i.e., turning off the light bulb).

[0175] • Commerce (i.e., buying goods online).

[0176] • Online services.

[0177] Since the present invention is not limited to the nature, type or number of operations performed, it provides a highly versatile solution that has great advantages in a wide range of applications.

[0178] The manager's control stack can be implemented in various ways, each tailored to the specific needs of each user. For example, a recurring loop in the control stack can be based on any Turing-complete language. One possible language choice is a stack-based Forth-style language. One advantage of using this language is that it allows for consistency between the control stack and programming style using some well-known and widely used blockchain scripting languages.

[0179] Use the script's spare stack as data storage space.

[0180] Some blockchain scripts contain commands, also known as opcodes, that enable users to move data to an alternate stack, also known as the "alt stack".

[0181] The opcode is:

[0182] •OP_TOALTSTACK - Moves data from the top of the main stack to the top of the alt stack.

[0183] • OP_FROMALTSTACK - Moves data from the top of the alt stack to the top of the main stack (see...) Figure 4 ).

[0184] This allows data from intermediate computation steps to be stored in the alt stack, similar to the "memory" function that allows data to be stored on a calculator. According to one illustrative embodiment of the invention, the alt stack is used to configure scripts to solve small computational tasks and return the results of the computation.

[0185] Use Code Register Manager

[0186] The manager also manages the registry for all the code it owns and runs. This registry is structured similarly to a lookup table or dictionary that maps specific keys to specific values ​​(see [link to registry]). Figure 5 The key-value pair is represented by the hash (Hi) of the code block and the IPv6 address where the code is stored. To retrieve the code block using the key Hi, a lookup table is used to retrieve the associated value (the location where the code is stored) and, correspondingly, the source code.

[0187] The implementation of the code registry can vary. For example, a lookup table can be implemented using a locally managed list or a P2P distributed hash table. The source code can be stored locally, remotely, or using a distributed file storage system. This can be implemented using magnet links or any linking format using shared zero-knowledge encryption.

[0188] The transaction metadata of the manager code, and the regeneration of loops.

[0189] The information required to regenerate the manager loop in a specific iteration will be stored as metadata in the blockchain-recorded transaction (see [link]). Figure 6 and Figure 7 ).

[0190] In this way, transactions on the blockchain store information about a given iteration of a loop executed on the manager, or provide access to that information. This information may include the values ​​of any variables associated with the loop, such as index i, as well as any other necessary information, such as parameter values ​​used in a code block or related data specifying the location from which other required information can be accessed.

[0191] For information on script format, please refer to [link / reference]. Figure 8 The metadata of transaction records can also be used to record audit trails of how code was executed in the past.

[0192] The manager can regenerate repeating loop blocks of code in each iteration in several ways. These blocks can be hardcoded into the manager, stored in private or publicly available files, stored as entries in private or public hash table files, or a combination of the above. The blocks can be static blocks with hardcoded variables or static blocks containing populated parameters. Parameters can be single values ​​of any data format, small pieces of code, or a combination of the above. Parameters can be populated directly from the transaction's metadata or from external sources such as an internal database, private / public files, hash tables, or any combination of the above. Pointers to the external sources of parameter values ​​can be stored in the transaction's metadata.

[0193] The following steps provide an example of how the manager regenerates the repeating loop code block in the i-th iteration. In this example, the code registry is a hash table, where hash values ​​act as lookup keys for the table and are stored in the transaction's metadata.

[0194] 1. The manager monitors the blockchain to find transactions containing code block hashes that match entries in the code registry.

[0195] 2. The manager searches for transactions containing the corresponding hash (Hi).

[0196] 3. The manager reads 'Metadata-CodeHash', obtains the CodeHash field to get Hi, and uses it to retrieve the code (Ci). If RIPEMD-160 (SHA256 (Ci)) equals Hi, the code has not been changed, and it is safe to proceed to the next step.

[0197] 4. The manager reads the 'Metadata-CodeHash' stored in the index and regenerates the code in the i-th iteration. In other words, the loop is "reloaded" in the appropriate iteration.

[0198] 5. User signatures are included in multi-signature transaction commands to verify the origin of metadata.

[0199] 6. If this iteration of the loop requires this data, the manager reads 'Metadata-OutputHash' and 'Metadata-OutputPointer' (see...). Figure 6 () to retrieve the output of the previous steps.

[0200] Multiple signatures may be required to unlock a transaction (e.g., from the user, operating system, software developer, and software vendor). This allows digital rights management (DRM) systems that manage rights to manipulate the code of parties involved in multi-signature transactions.

[0201] Update Manager Code

[0202] Software updates and patches for code blocks related to the manager are secured by multi-signature transactions (see [link]). Figure 8 Multi-signature transactions record metadata for both the old and new code blocks, such as... Figure 5 As shown. This records the transition from old to new code, thus providing an audit trail for software updates. The manager needs to store the hashes of all the old and new source code blocks. The hashes of the old and new source code blocks can be used to verify the integrity of the code files.

[0203] According to embodiments of the present invention, multiple signatures are required to unlock transactions (e.g., user, operating system, software developer, and software vendor). This provides a DRM system for managing software updates and patches used by the manager.

[0204] Unlike most software that does not allow updates during runtime, one advantage of this invention is that software updates can be performed during the execution cycle. This invention provides a dynamic response solution that can be reconfigured in real time with minimal disruption to the processes controlled by this invention.

[0205] Information captured on the blockchain (see) Figure 8 and Figure 9 This can be used to update to new code in a loop and start the next iteration step with the output metadata of the old code from the previous iteration.

[0206] Invention of vote counting

[0207] Some current blockchain scripting languages ​​do not allow loops to occur. This prevents the triggering of continuous and automated operations unless there is external intervention; however, because the manager continuously monitors information on the blockchain, it allows automated operations to be performed based on the latest information on the blockchain.

[0208] The following explains how to automate the process of an online automated vote counting robot using the manager's control stack.

[0209] The vote-counting robot in this invention aims to promote fair and pseudo-anonymous voting, with a secure and immutable audit trail of the vote-counting process recorded by blockchain. The vote-counting robot is automated through a manager's control stack and repetitive loops. The following scenario illustrates how embodiments of this can operate.

[0210] Assume there are 100 voters. If 57 unique "Yes" votes are received before January 1, 2016, payment will be made to Chairman Jason. The voting process consists of two parts:

[0211] • Token Distribution

[0212] • Count

[0213] For token distribution, one voting token is distributed to each authorized voter, for a total of 100 tokens. Each token is represented by, for example, a public-private key pair, distributed to each voter via a secret exchange protocol. The key exchange protocol is known in the art. Each public key and address is loaded (associated) with a vote. The bot maintains a list of public keys associated with each authorized token and makes this list public before voting begins. To ensure that voting cannot be manipulated and that voting is anonymous, the list of private keys and the mapping between the voter's identity and their token are destroyed (i.e., never stored).

[0214] Having an anonymous and pre-authorized address list offers other important benefits. It ensures that only authorized individuals can cast valid votes; it also facilitates the exclusion of invalid votes originating from specific addresses (such as spammers or ineligible voters) without compromising voter identity. To implement the counting process, the manager runs a recurring loop. The address list can be stored in a script and moved to a spare stack to store data. Once an address has been counted, it is removed from the spare stack and is no longer added to the next transaction. The recurring loop stops when the address list becomes empty.

[0215] Instead of using an integer index `i` to track the current position of the loop, the voting bot's manager uses it to store intermediate vote counts, ensuring that these intermediate counts are stored on the blockchain. This provides an audit trail and demonstrates that the voting counting process is fair.

[0216] If the number of unique "Yes" votes received reaches 57, the agreed amount will be paid into Jason's account. The cryptographic hash of the vote counting script and the IPv6 address where this script is stored will be released to the public. This means the public has sufficient information to conduct a recount and ensure the vote counting process is fair and correct.

[0217] It should be noted that the above embodiments are not intended to limit the invention, and those skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. Any reference numerals within parentheses in the claims should not be construed as limiting the claims. Verbs such as “comprising” and “comprises” do not exclude the presence of elements and steps other than those listed as a whole in the claims or specification. In this specification, “comprises” means “(includes or consists of) including or consisting of”, and its variant “(comprising)” means “(including or consisting of) including or consisting of”. Singular references to elements do not exclude plural references to those elements, and vice versa. The invention can be implemented by hardware comprising several different elements and by a suitably programmed computer. In device claims enumerating several means, several of these means can be embodied by the same item of hardware. The mere fact that certain steps are recited in mutually different dependent claims does not indicate that a combination of these steps cannot be beneficial.

Claims

1. A computer-implemented method for counting, monitoring, detecting, recording, or processing an event, wherein, The event is a vote, the method comprising the steps of: maintaining a list of authorized addresses associated with at least one entity; distributing or allocating at least one token to the at least one entity, the at least one entity for generating at least one event, wherein: i) the at least one token is represented by a cryptographic public and private key pair, wherein the public key is used as a blockchain address associated with the at least one entity; and ii) the distribution or allocation is performed by using a secret sharing protocol, communicating the list of authorized addresses to a backup stack; executing, supervising or managing a loop on at least one computing resource, the at least one computing resource running in parallel with or together with a blockchain or blockchain-related platform, wherein the computing resource is for monitoring a state of the blockchain, counting at least one event generated by the at least one entity originating from a blockchain address, and removing the blockchain address from the backup stack once the counting of the at least one event has been completed.

2. The method of claim 1, wherein, The at least one computing resource is for using the blockchain as a non-erasable tape of a Turing machine.

3. The method of claim 1 or 2, wherein, The at least one computing resource is for implementing a control stack of a Turing machine.

4. The method of claim 1, wherein, The loop executed or managed by the at least one computing resource is based on a Turing-complete language.

5. The method of claim 1, wherein, The public key is associated with: the at least one event; or one or more options or possible courses of action; or an item representing the at least one event.

6. The method of claim 1, wherein, The event is related to data received, detected, recorded or generated by the at least one computing resource, or to a state of the blockchain.

7. The method of claim 1, comprising the steps of: i) using the at least one computing resource to decide on a set of transactions to be broadcast to a blockchain network and written to the blockchain; or ii) using a blockchain stack as a data storage space.

8. The method of claim 1, wherein, The at least one computing resource: i) stores information related to the loop; and / or ii) is a daemon or a bot.

9. The method of claim 1, wherein, The blockchain or blockchain platform is associated with: i) a functionally limited scripting language that does not natively support the incorporation of control structures, including loops, into code written in the language; and / or ii) a blockchain network.

10. The method of claim 1, comprising the step of: implementing the loop using a script.

11. The method of claim 10, comprising the step of: generating a cryptographic hash of the script.

12. The method of claim 1, further comprising the steps of: generating a cryptographic hash of code related to the loop.

13. The method of claim 12, further comprising the step of: storing the cryptographic hash in a transaction on the blockchain.

14. The method of claim 1, wherein: i) information related to at least one iteration of the loop is stored in a transaction on the blockchain; and / or ii) the computing resource is for monitoring a state of the blockchain for transactions including a cryptographic hash of code related to the loop; and / or iii) the method comprises counting the at least one event if the computing resource has received a signature from the token and if a date condition has been met.

15. The method of claim 14, wherein, The information is stored as metadata in the transaction.

16. The method of claim 1, further comprising the step of: for each iteration of the loop: evaluating a condition and performing at least one operation based on the result of the evaluation, wherein the at least one operation comprises: causing at least one transaction to be written to the blockchain; and / or causing an off-chain operation to be performed.

17. The method of claim 16, wherein, The condition relates to: data received, detected or generated by the computing resource; or the state of the blockchain.

18. The method of claim 1, wherein, The computing resource is configured to monitor: a value generated or received by the computing resource; and / or a data or signal source provided off-chain.

19. The method of claim 1, comprising the step of: i) using the blockchain as a storage component for data, instructions or data and / or instruction pointers; and / or ii) using a computing resource as a control flow management component for a Turing complete process, the computing resource being configured to perform a looping mechanism.

20. The method of claim 1, further comprising the step of: restarting the loop at a specified iteration if the computing resource finds a predetermined hash of part of the code in a transaction within the blockchain.

21. The method of claim 20, wherein, Information relating to the iteration is specified using metadata provided within or in association with the transaction.

22. The method of claim 1, wherein, The code of the loop: i) is hardcoded into or onto the computing resource; ii) is stored in a private or publicly available file; and / or iii) is stored as an entry in a private or public hash table file; and / or iv) is a static block of code with hardcoded variables or at least one parameter; and / or v) is associated with or comprises at least one parameter that: is populated, initialised or instantiated using a single value in any data format; is part of the code; is obtained from metadata in a blockchain transaction or from a source external to the computing resource; is obtained from a database, a private or public file or hash table; and / or is populated using a value accessed using at least one data source pointer.

23. The method of claim 22, wherein, The at least one data source pointer is stored as metadata in a transaction on the blockchain.

24. The method of claim 1, wherein, The computing resource comprises or is in communication with a registry that enables the computing resource to access a pre-stored version of the loop.

25. The method of claim 24, wherein, The registry stores: i) a cryptographic hash of the code relating to the loop; and / or ii) information indicating a location from which a copy of the code can be accessed.

26. The method of claim 1, further comprising the step of: updating the code of the loop using a blockchain transaction so as to replace existing code with new code.

27. The method of claim 26, the method comprising the step of storing a hash of the existing code and a hash of the new code.

28. A computer-based system for implementing the method of any one of claims 1 to 27, comprising: a blockchain; and a computing resource. computing resources for performing loops and / or monitoring the state of the blockchain.

Citation Information

Patent Citations

  • Tiny Bone Defect Repairing Material, Matrix Material Thereof and Producing Method Thereof

    US20160022864A1

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

    US20160027229A1

  • Secure processor with external memory using block chaining and block re-ordering

    US6061449A

  • Association and retrieval method and system used for public key addresses and user accounts of crypto-currency

    CN104392354A

  • Data analytic and security mechanism for implementing a hot wallet service

    US20150287026A1