Securely providing undetermined data of undetermined source into locked script of blockchain transaction

By using signature hash types and unlocking scripts in blockchain unlocking transactions, the problem of secure provision of undetermined data sources is solved, ensuring the security and integrity of data in locking scripts, and enhancing the security of blockchain transactions. .

CN118569851APending Publication Date: 2024-08-30NCHAIN HLDG LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410624131.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2017-05-22
Filing Date
2018-05-14
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Existing blockchain technology has security issues such as unknown data sources and data changes when providing undetermined data securely into locking scripts, making it difficult to achieve effective verification and protection of data.

Method used

Secure embedding and protection of data is achieved by using signature hash types and unlocking scripts in the field value set of the unlocking transaction to generate and verify signatures, ensuring that the locking script can access and verify the fields of the unlocking transaction.

Benefits of technology

It ensures the security and integrity of data without verifying the source of the data, prevents data changes, and enhances the security and reliability of blockchain transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569851A_ABST
    Figure CN118569851A_ABST
Patent Text Reader

Abstract

The invention relates to a distributed ledger technology, such as a consensus-based blockchain. A computer-implemented method for securely providing undetermined data from a determined or undetermined source is described. The method is implemented by using a block chain network. A first transaction to be validated is received at a node in a blockchain network, wherein the first transaction includes a first script. The first script at least comprises a first value, and at least one part of the first value comprises data which is not constrained by a second script; and a second value. A second transaction is obtained, wherein the second transaction has been verified and includes a second script. The second script, as a result of being executed, causes the node to: obtain the first value and the second value due to execution of the first script; and confirming that the data is associated with a data source based at least in part on the first value and the second value. The first transaction is verified by executing the first script and the second script.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of a patent application with Chinese application number 201880033760.9, filing date May 14, 2018, and titled “Securely Providing Undetermined Data of Undetermined Source into a Locking Script of a Blockchain Transaction”. Technical Field

[0002] The present invention relates generally to distributed ledger technology, including blockchain transactions, and more particularly to enabling fields from a blockchain transaction to be injected into an unlocking transaction script. The present invention utilizes cryptographic and mathematical techniques to enhance security associated with electronic transfers made over a blockchain network. The present invention is particularly suitable for, but not limited to, use in smart contracts and state machines. Background Art

[0003] In this article, we use the term "blockchain" to include all forms of computer-based electronic distributed ledgers. These include consensus-based blockchain and transaction chain technologies, permissioned and unpermissioned ledgers, shared ledgers, and variations thereof. It should be noted that alternative blockchain implementations and protocols, including non-commercial applications, also fall within the scope of the present invention. For example, both technologies can provide advantages, using blockchain implementations with restrictions on what can be encoded within a transaction.

[0004] A blockchain is a peer-to-peer electronic ledger implemented as a computer-based, decentralized, distributed system consisting of blocks, which in turn consist of transactions and other information. In some examples, a "blockchain transaction" refers to an input message that encodes a structured set of field values ​​including data and a set of conditions, the satisfaction of which is a prerequisite for writing the set of fields to the blockchain data structure. For example, each transaction is a data structure that encodes the transfer of control of a digital asset between participants in a blockchain system, and includes at least one input and at least one output. In some implementations, the transfer of control of a digital asset can be performed by reassociating at least a portion of the digital asset from a first entity to a second entity. Each block includes a hash of the previous block, so blocks are linked together to create a permanent, immutable record of all transactions that have been written to the blockchain since its creation. A transaction includes small programs called scripts embedded in its inputs and outputs that specify how and by whom the output of the transaction can be accessed. These scripts are written using a stack-based scripting language.

[0005] That is, stack-based scripting languages ​​can make use of stacks. Using a stack, values ​​can be pushed to or popped from the top of the stack. Various operations performed on a stack can cause one or more values ​​to be pushed to or popped from the top of the stack. For example, the OP_EQUAL operation pops the top two items from the stack, compares them, and then pushes the result (e.g., 1 if equal, 0 if unequal) to the top of the stack. Other operations performed on the stack, such as OP_PICK, can allow items to be selected from locations other than the top of the stack. In some scripting languages ​​used in some embodiments of the present invention, there may be at least two stacks: a main stack and a backup stack. Some operations of the scripting language can move items from the top of one stack to the top of another stack. For example, OP_TOALTSTACK moves a value from the top of the main stack to the top of the backup stack.

[0006] In order for a transaction to be written to the blockchain, it must be "validated". Network nodes perform work to ensure that each transaction is valid, and invalid transactions are rejected by the network. A node can have different validity criteria than other nodes. Since validity in the blockchain is based on consensus, a transaction is considered valid if a majority of nodes agree that it is valid. The software client installed on the node performs this validation work on transactions that partially reference UTXO by executing the unspent transaction (UTXO) lock and unlock scripts. If the execution of the lock and unlock scripts evaluates to true, and other validation conditions are met (if applicable), the transaction is validated by the node as valid. The validated transaction is propagated to other network nodes, which may then choose to include the transaction in the blockchain. Therefore, in order for a transaction to be written to the blockchain, it must: i) be validated by the first node that receives the transaction - if the transaction is validated, the node relays the transaction to other nodes in the network; and ii) add the transaction to a new block; and iii) add the transaction to the public ledger of past transactions. A transaction is considered confirmed when a sufficient number of blocks have been added to the blockchain to make the transaction effectively irreversible. Summary of the invention

[0007] This invention describes technical aspects of one or more blockchain-based computer programs. A blockchain-based computer program is a machine-readable and executable program recorded in a blockchain transaction. A blockchain-based computer program includes rules that can process inputs to produce results, and actions can then be performed based on those results. If a locking script has access to both unlocking transactions and previous transactions, a blockchain can be utilized to implement highly flexible and complex smart contracts. One area of ​​current research is the use of blockchain-based computer programs to implement "smart contracts." Unlike traditional contracts that would be written in a natural language, a smart contract can be a computer program designed to automatically execute the terms of a machine-readable contract or agreement.

[0008] In an embodiment, although the interaction with a specific entity can be encoded at a specific step in the smart contract, the smart contract can be automatically executed and self-enforced in other ways. In some examples, automatic execution refers to the execution of a smart contract that is successfully executed to achieve the transfer of UTXO. It should be noted that in such examples, the "entity" that enables the UTXO transfer refers to an entity that can create an unlocking script without proving certain secret knowledge. In other words, the unlocking transaction can be confirmed without verifying whether the data source (e.g., the entity that created the unlocking transaction) has access to the cryptographic secret (e.g., a private asymmetric key, a symmetric key, etc.). Similarly, in such examples, self-enforcement refers to making the verification node of the blockchain network enforce the unlocking transaction according to the constraints. In some examples, using "unlocking" UTXO in a technical sense (also called "spending" UTXO) refers to creating an unlocking transaction that references UTXO and is effectively executed.

[0009] Blockchain transaction outputs include a locking script and information about the ownership of a digital asset. A locking script, also known as an encumbrance, "locks" a digital asset by specifying conditions that must be met to transfer the UTXO. For example, a locking script may require certain data to be provided in an unlocking script to unlock the associated digital asset. A locking script is also known as a "scriptPubKey." Techniques for requiring a party to provide data to unlock a digital asset involve embedding a hash of the data within a locking script. However, problems arise if the data is undetermined (e.g., unknown and unfixed) when the locking script is created.

[0010] It is therefore desirable to provide improved methods and systems that improve blockchain technology in one or more of these aspects.Accordingly, one or more methods and corresponding systems are provided in accordance with the present invention.

[0011] The present invention may be described as a verification method / system, and / or as a control method / system for controlling the verification of blockchain transactions. In some embodiments, a verified blockchain transaction causes the transaction to be recorded on the blockchain, which in some applications may enable the exchange or transfer of digital assets via the blockchain. A digital asset is a unit of resources managed by a blockchain. In embodiments, it is contemplated that digital assets may be used in addition or alternatively in other situations. It should be noted that while the present invention is applicable to the control of digital assets, the present invention is technical in nature and may be used in other situations that utilize blockchain data structures and do not necessarily involve the transfer of digital assets. As described below, the present invention may also be described as a security method / system for a new, improved, and advantageous way of performing operations via a blockchain network or platform.

[0012] As will be described in more detail below, in an embodiment, a locking script may be given access to certain fields of an unlocking transaction by taking as input a set of field values ​​of the unlocking transaction and a signature hash (SIGHASH) type of an unlocking script from the unlocking transaction and performing signature generation and verification operations.

[0013] As will be described in more detail below, in an embodiment, by constraining a transaction identifier (ID) extracted from certain fields of an unlocking transaction so that a serialized previous transaction is included in an unlocking script of an unlocking transaction, a locking script may be given access to a set of fields in a previous transaction. According to an embodiment, a method for injecting a serialized previous transaction into a blockchain transaction locking script may be provided, the method taking a first field value set corresponding to a first transaction and a second field value set corresponding to another transaction as input, extracting a transaction identifier from the first field value set, and determining that another transaction corresponds to the transaction identifier based on the second field value set.

[0014] As will be described in more detail below, in an embodiment, locking and unlocking scripts can be used to enable secure provision of undetermined data from a determined or undetermined source. In order to protect data from an undetermined source from changes, the data can be embedded in a serialized previous transaction. It should be noted that even if the data is in a serialized previous transaction, it is undetermined in the sense that the locking script will not constrain the data to a certain value. In order to prevent data from being changed from a determined source, a public key from a determined source can be included in the locking script, in which the public key can be modified using the data, and then the public key can be used to verify the signature of the data signed using the modified private key. According to an embodiment, a method can be provided to obtain undetermined data and a second value, and to verify that the undetermined data is associated with the source of the data based on the data and the second value provided in the unlocking script.

[0015] As will be described in more detail below, in embodiments, a parameterized smart contract may be created by extracting constraint parameters from a previous transaction and applying the constraint parameters to fields of an unlocking transaction. A parameterized smart contract may be implemented by a locking script having constraints parameterized by secure undetermined data provided in an unlocking script of an unlocking transaction from a determined or undetermined source. According to embodiments, a method may be provided to obtain the undetermined data, determine a set of constraints to be applied to reassociation of a digital asset based on the undetermined data, and reassociate the digital asset with a second entity based on the set of constraints.

[0016] As will be described in more detail below, in an embodiment, the smart contract is created to be self-replicating until a termination condition is reached. According to an embodiment, a method can be provided to check whether the termination condition is met, and if the termination condition is not met, check whether the locking script of the previous transaction matches the locking script of the unlocking transaction.

[0017] As will be described in more detail below, in embodiments, a parameterized self-replicating smart contract may be used to create an untrusted deterministic state machine. According to embodiments, a method may be provided to verify a self-replicating locking script and determine a next state of the untrusted deterministic state machine based at least in part on input from a determined source and a current state of the untrusted deterministic state machine.

[0018] The novel techniques described and suggested herein extend the functionality of blockchains without undermining the characteristics of blockchains that ensure the integrity of data stored within blockchain data structures. For example, these techniques improve the field of computing, particularly the field of digital record verification, by leveraging blockchain networks to set and enforce standards for re-association of digital assets, and in particular the field of digital record verification where conditions for verification are defined as smart contracts embedded in the records. Additionally, the techniques described and suggested herein can improve the functionality of blockchain networks by enabling blockchain transactions to act as state machines, with computer program functionality dependent on the states recorded in such state machines.

[0019] Furthermore, the techniques described and suggested by the present invention may have to be rooted in computer technology in order to overcome problems specific to blockchain technology that is specifically designed to limit functionality for security reasons. For example, scripts themselves do not support complex flow control functions, such as loops. One advantage of this limitation is that the program has a predictable execution time. Another significant advantage of limiting scripts to linear or tree-like decision tasks is that it avoids infinite loops, which may be used as a means to launch vulnerabilities such as denial of service (DoS or DDoS) attacks. Therefore, the security of blockchain transfers / exchanges is enhanced and preserved, but mechanisms need to be found to implement functions that the language itself does not allow or provide. The present invention has made progress in this regard, at least partially solving the current limitations of blockchain transactions through the implementation of self-replicating and self-referencing blockchain transaction locking scripts. Therefore, the present invention provides a technical solution to the technical problem and provides advantages in terms of security, improved control of digital asset exchanges / transfers via blockchains, and expansion of current blockchain-related functions.

[0020] Therefore, according to the present invention, a computer-implemented method (and corresponding system) may be provided. The computer-implemented method may be described as a blockchain data constraint method. The computer-implemented method may include: i) receiving a first transaction at a node in a blockchain network to transfer control of a digital asset, the first transaction including a first script, the first script at least: including a field value set of the first transaction; and causing the node to obtain the field value set due to being executed; ii) obtaining a second transaction, the second transaction being associated with the digital asset and including a second script, the second script causing the node to at least: generate a signature based at least in part on the field value set provided due to the execution of the first script; and iii) verifying the first transaction by executing the first script and the second script.

[0021] Authentication of the first transaction may be successfully performed without verifying whether the entity creating the first transaction has access to the secret information.

[0022] The first script may further include a private encryption key in the asymmetric key pair. Additionally or alternatively, the second script may further cause the node to generate a signature based at least in part on the private encryption key and the mask number. Additionally or alternatively, verifying the first transaction may further include verifying whether the signature is associated with a public encryption key in the asymmetric key pair.

[0023] The first script may further specify a signature hash type. Additionally or alternatively, the field value set may be based at least in part on the signature hash type.

[0024] The signature hash type may be a value indicating which field values ​​of the set of field values ​​of the first transaction are to be included in the signature.

[0025] The second script may be a locking script that imposes a set of conditions for verifying the first transaction. Additionally or alternatively, execution of the locking script may cause the node to verify the first transaction by determining whether the set of conditions has been met.

[0026] The first script may be an unlocking script for satisfying the condition set of the second script.

[0027] Digital assets can be associated with unspent transaction outputs in a blockchain network.

[0028] A node may be a computing device that is communicatively connected to at least one other node in a blockchain network.

[0029] A blockchain network can be composed of distributed electronic devices running instances of the blockchain protocol.

[0030] The first script and the second script may be written using a Turing incomplete instruction set.

[0031] The first script and the second script are written using a Turing complete instruction set.

[0032] By including a field set, a first script may cause a node to make the field set available as input to a second script as a result of the execution of the first script.

[0033] It is also desirable to provide a system comprising: a processor; and a memory comprising executable instructions, the executable instructions causing the system to perform any of the claimed methods due to execution by the processor.

[0034] It is also desirable to provide a non-transitory computer-readable storage medium having stored thereon executable instructions which, due to execution by a processor of a computer system, cause the computer system to perform at least any of the claimed methods.

[0035] Therefore, according to the present invention, a computer-implemented method (and corresponding system) may be provided. The computer-implemented method may be described as a blockchain data constraint method. The computer-implemented method may include: i) receiving a first transaction at a node in a blockchain network to transfer control of a digital asset, the first transaction including a first script, the first script, due to being executed, causing the node to at least: obtain a first field value set corresponding to the first transaction; and obtain a second field value set corresponding to a specific transaction; ii) obtaining a second transaction, the second transaction being associated with the digital asset and including a second script, the second script, due to being executed, causing the node to at least: obtain a first field value set and a second field value set for a specific transaction provided due to the execution of the first script; extract a transaction identifier from the first field value set; and determine that the specific transaction corresponds to the transaction identifier based at least in part on the second field value set; and iii) verifying the first transaction by executing the first script and the second script.

[0036] The second set of field values ​​may be in a normalized format.

[0037] The node may determine that the particular transaction corresponds to the transaction identifier by generating a hash of the second field value set. Additionally or alternatively, the node may determine that the particular transaction corresponds to the transaction identifier by verifying that the hash matches the transaction identifier.

[0038] Certain transactions may be associated with control of the digital asset being transferred.

[0039] The particular transaction may be associated with a second digital asset that is different than the digital asset being transferred.

[0040] The first transaction may be successfully authenticated without verifying whether the entity creating the first transaction has access to the secret information.

[0041] A node can be a validator of a blockchain network.

[0042] Verifying the first transaction may further include adding the first transaction to a blockchain in the blockchain network due to successful verification of the first transaction.

[0043] The second script may be a locking script that imposes a set of conditions for verifying the first transaction. Additionally or alternatively, execution of the locking script may cause the node to verify the first transaction by determining whether the set of conditions has been met.

[0044] The first script may be an unlocking script for satisfying the condition set of the second script.

[0045] The first script may specify a signature hash type. Additionally or alternatively, the second script may further, due to being executed, cause the node to obtain a signature hash type provided due to the execution of the first script.

[0046] The second script may further, as a result of being executed, cause the node to determine that the particular transaction is part of a transaction set associated with the first transaction based at least in part on the signature hash type.

[0047] The second script may further, as a result of being executed, cause the node to determine that the particular transaction corresponds to the second transaction based at least in part on the signature hash type.

[0048] It is also desirable to provide a system comprising: a processor; and a memory comprising executable instructions, the executable instructions causing the system to perform any of the claimed methods due to execution by the processor.

[0049] It is also desirable to provide a non-transitory computer-readable storage medium having stored thereon executable instructions which, due to execution by a processor of a computer system, cause the computer system to perform at least any of the claimed methods.

[0050] Thus, according to the present invention, a computer-implemented method (and corresponding system) may be provided. The computer-implemented method may be described as a blockchain data constraint method. The computer-implemented method may include: i) receiving a first transaction at a node in a blockchain network to transfer control of a digital asset, the first transaction including a first script, the first script including at least: a first value, at least a portion of the first value including data that is not constrained by a second script; and a second value; ii) obtaining a second transaction, the second transaction being associated with the digital asset and including a second script, the second script, due to being executed, causing the node to at least: obtain the first value and the second value due to the execution of the first script; and verify that the data is associated with a particular source based at least in part on the first value and the second value; and iii) verifying the first transaction by executing the first script and the second script.

[0051] The second script may be a locking script including a set of conditions for verifying the second transaction. Additionally or alternatively, the first script may be an unlocking script for satisfying the set of conditions of the locking script.

[0052] Verification of the first transaction may be performed without verifying whether the entity creating the first transaction has access to the secret information.

[0053] Failed verification of the association of data with the data source may result in failure to verify the first transaction.

[0054] The identity of a particular source may not be constrained by the second script.

[0055] The specific transaction may be a specific source of data. Additionally or alternatively, the first value may be a field value set for the specific transaction. Additionally or alternatively, the second value may include a transaction identifier associated with the specific transaction. The second script may verify that the data is associated with the source of the data by verifying that the specific transaction corresponds to the transaction identifier.

[0056] The second script may verify that the particular transaction corresponds to the transaction identifier by verifying that the transaction identifier matches a hash of the set of fields for the particular transaction.

[0057] By including a set of fields for a specific transaction, a first script may cause a node, as a result of the execution of the first script, to make the set of fields for the specific transaction available as input to a second script.

[0058] The specific transaction may be a second transaction.

[0059] Data may be encoded in transaction-specific fields.

[0060] A second script may constrain the identity of a particular source.

[0061] The second value may be a signature. Additionally or alternatively, the second script may further cause the node to obtain a public key associated with the source of the data, and additionally or alternatively, generate a modified public key based at least in part on the public key and the data. Additionally or alternatively, the second script may verify that the data is associated with the source of the data based at least in part on the modified public key.

[0062] The modified public key may be generated by performing an elliptic curve point multiplication on the public key and the data value.

[0063] It is also desirable to provide a system comprising: a processor; and a memory comprising executable instructions, the executable instructions causing the system to perform any of the claimed methods due to execution by the processor.

[0064] It is also desirable to provide a non-transitory computer-readable storage medium having stored thereon executable instructions which, due to execution by a processor of a computer system, cause the computer system to perform at least any of the claimed methods.

[0065] Therefore, according to the present invention, a computer-implemented method (and corresponding system) may be provided. The computer-implemented method may be described as a blockchain data constraint method. The computer-implemented method may include: i) receiving a first transaction at a node in a blockchain network to transfer control of a digital asset, the first transaction comprising a first script, the first script causing the node to obtain at least data and a first field value set of the first transaction due to being executed; ii) obtaining a second transaction, the second transaction comprising a second script, the second script causing the node to at least: determine a constraint set based at least in part on data provided due to execution of the first script; and verify the constraint set for the first transaction based at least in part on the first field value set; and iii) transferring control of the digital asset according to the constraint set obtained due to execution of the first script and the second script.

[0066] The transfer of control of the digital asset may be performed without verifying whether the entity creating the first transaction has access to the secret information.

[0067] The identity of the source of the data may not be constrained by the second script.

[0068] A second script may constrain the identity of the source of the data.

[0069] The second script may include a public key that may be used to authenticate the particular data origin of the data.

[0070] Verifying the data may include generating a modified public key based at least in part on the public key and the data, and additionally or alternatively determining that the data is associated with a source of the data based at least in part on the modified public key.

[0071] The set of constraints may be derived, at least in part, from a set of parameters in the data.

[0072] Satisfaction of the set of constraints may be a condition for reassociating at least a portion of the digital asset.

[0073] Transferring control of the digital asset may include reassociating the digital asset from the first entity to the second entity.

[0074] The identity of the second entity may be determined based at least in part on the set of constraints.

[0075] The source of the data may be a second transaction. Additionally or alternatively, the data includes a second field value set of the second transaction. Additionally or alternatively, execution of the second script may cause the constraint set to be derived at least in part from the second field value set.

[0076] The identity of the second entity may be determined based at least in part on the set of constraints.

[0077] The set of constraints may further reassociate at least a portion of the digital asset with a third entity.

[0078] It is also desirable to provide a system comprising: a processor; and a memory comprising executable instructions, the executable instructions causing the system to perform any of the claimed methods due to execution by the processor.

[0079] It is also desirable to provide a non-transitory computer-readable storage medium having stored thereon executable instructions which, due to execution by a processor of a computer system, cause the computer system to perform at least any of the claimed methods.

[0080] Therefore, according to the present invention, a computer-implemented method (and corresponding system) may be provided. The computer-implemented method may be described as a blockchain data constraint method. The computer-implemented method may include: i) receiving a first transaction at a node in a blockchain network to transfer control of a digital asset, the first transaction including a first script, the first script, due to being executed, causing the node to at least: obtain a first field value set of the first transaction, the first field value set including a third script; and obtain a second field value set of a second transaction, the second field value set including a copy of the second script; ii) obtaining a second transaction, the second transaction including a second script, the second script, due to being executed, causing the node to at least: obtain a third script from the first field value set due to determining that a termination condition is not satisfied; and determine that the copy of the second script matches the third script; and iii) transferring control of the digital asset due to the execution of the first script and the second script.

[0081] The second transaction may be a transaction associated with the digital asset. Additionally or alternatively, the first transaction may be a transaction that reassociates at least a portion of the digital asset from the first entity to the second entity.

[0082] The first script may be an unlocking script for satisfying the condition set of the second script.

[0083] The second script may be a locking script that imposes a set of conditions for validating the first transaction.

[0084] The third script may be a locking script that imposes a set of conditions for validating future transactions.

[0085] Transferring control of the digital asset may include reassociating the digital asset from the first entity to the second entity.

[0086] Determining that the termination condition is not satisfied may include determining that the amount of the digital asset associated with the second transaction is sufficient to reassociate at least a portion of the digital asset.

[0087] The third script may be embedded in the field values ​​of the first field value set.

[0088] A blockchain network can be composed of distributed electronic devices running instances of the blockchain protocol.

[0089] The transfer of control of the digital asset may be performed without verifying whether the entity creating the first transaction has access to the secret information.

[0090] As another condition for transferring control of the digital asset, the second script may further cause the node to verify that the first transaction complies with additional constraints.

[0091] The first and second transactions may be components of a recurring set of smart contracts associated with the digital asset.

[0092] A set of repeating smart contracts can be terminated by a termination condition.

[0093] It is also desirable to provide a system comprising: a processor; and a memory comprising executable instructions, the executable instructions causing the system to perform any of the claimed methods due to execution by the processor.

[0094] It is also desirable to provide a non-transitory computer-readable storage medium having stored thereon executable instructions which, due to execution by a processor of a computer system, cause the computer system to perform at least any of the claimed methods.

[0095] Therefore, according to the present invention, a computer-implemented method (and corresponding system) may be provided. The computer-implemented method may be described as a blockchain data constraint method. The computer-implemented method may include: a computer-implemented method comprising: i) receiving a first transaction at a node in a blockchain network to transfer control of a digital asset, the first transaction comprising a first script, the first script causing the node to obtain at least a first field value set of the first transaction, a second field value set of the second transaction, and an input due to being executed; ii) obtaining a second transaction, the second transaction comprising a second script, the second script comprising a rule set, the second script causing the node to at least: verify that the second script matches a third script embedded in the first field value set; determine a current state based at least in part on the second field value set; and determine a next state based at least in part on the current state, the input, and the rule set; verify that the next state is included in the first field value set; and iii) transferring control of the digital asset due to the execution of the first script and the second script.

[0096] The second script may constrain the identity of the source of the input.

[0097] Any of the claimed methods may further include verifying the cryptographic secret of the source of the input.

[0098] The rule set may be a state transition matrix.

[0099] The third script may be a locking script that imposes a set of conditions for validating future transactions.

[0100] The second script may further cause the node to determine that the termination condition is not satisfied.

[0101] The input can be embedded in the second field value set.

[0102] The termination condition may be that the size of the digital asset associated with the second transaction is insufficient to be transferred.

[0103] The current status may indicate a status of the second transaction.

[0104] The next state may indicate the state of the first transaction upon verification.

[0105] Any of the methods claimed may further include receiving a third transaction. Additionally or alternatively, any of the methods claimed may further include obtaining a fourth script from the first transaction, the fourth script causing the node to determine another state different from the next state and the current state based at least in part on the next state, the second input, and the rule set due to being executed.

[0106] The current state and the next state may be components of a set of possible states for the first and second transactions.

[0107] Transferring control of the digital asset may include reassociating the digital asset from the first entity to the second entity.

[0108] It is also desirable to provide a system comprising: a processor; and a memory comprising executable instructions, the executable instructions causing the system to perform any of the claimed methods due to execution by the processor.

[0109] It is also desirable to provide a non-transitory computer-readable storage medium having stored thereon executable instructions which, due to execution by a processor of a computer system, cause the computer system to perform at least any of the claimed methods.

[0110] Therefore, according to the present invention, a method (and corresponding system) may be provided. The method may be described as a blockchain data constraint method. The method may include: i) receiving a first transaction to be verified at a node in a blockchain network, the first transaction including a first script, the first script at least: including a field value set of the first transaction; and causing the node to obtain the field value set due to being executed; ii) obtaining a second transaction, the second transaction has been verified and includes a second script, the second script causing the node to at least: generate a signature based at least in part on the field value set provided due to the execution of the first script; and iii) verifying the first transaction by executing the first script and the second script.

[0111] Authentication of the first transaction may be successfully performed without verifying whether the entity creating the first transaction has access to the secret information.

[0112] The first script may further include a private encryption key in the asymmetric key pair. Additionally or alternatively, the second script may further cause the node to generate a signature based at least in part on the private encryption key and the mask number. Additionally or alternatively, verifying the first transaction may further include verifying that the signature is associated with a public encryption key in the asymmetric key pair.

[0113] The first script may further specify a signature hash type. Additionally or alternatively, the field value set may be based at least in part on the signature hash type.

[0114] The signature hash type may be a value indicating which field values ​​of the set of field values ​​of the first transaction are to be included in the signature.

[0115] The second script may be a locking script that imposes a set of conditions for verifying the first transaction. Additionally or alternatively, execution of the locking script may cause the node to verify the first transaction by determining whether the set of conditions has been met.

[0116] The first script may be an unlocking script for satisfying the condition set of the second script.

[0117] Verifying the first transaction allows the unspent transaction outputs to be transferred.

[0118] A node may be a computing device that is communicatively connected to at least one other node in a blockchain network.

[0119] A blockchain network can be composed of distributed electronic devices running instances of the blockchain protocol.

[0120] The first script and the second script may be written using a Turing incomplete instruction set.

[0121] The first script and the second script are written using a Turing complete instruction set.

[0122] By including a field set, a first script may cause a node to make the field set available as input to a second script as a result of the execution of the first script.

[0123] It is also desirable to provide a system comprising: a processor; and a memory comprising executable instructions, the executable instructions causing the system to perform any of the claimed methods due to execution by the processor.

[0124] It is also desirable to provide a non-transitory computer-readable storage medium having stored thereon executable instructions which, due to execution by a processor of a computer system, cause the computer system to perform at least any of the claimed methods.

[0125] Therefore, according to the present invention, a method (and corresponding system) can be provided. The method can be described as a blockchain data constraint method. The method may include: i) receiving a first transaction to be verified at a node in a blockchain network, the first transaction including a first script, the first script being executed so that the node at least: obtains a first field value set corresponding to the first transaction; and obtains a second field value set corresponding to a specific transaction; ii) obtaining a second transaction, the second transaction has been verified and includes a second script, the second script being executed so that the node at least: obtains a first field value set provided by the execution of the first script and a second field value set for a specific transaction; extracts a transaction identifier from the first field value set; and determines that a specific transaction corresponds to the transaction identifier based at least in part on the second field value set; and iii) verifying the first transaction by executing the first script and the second script.

[0126] The second set of field values ​​may be in a normalized format.

[0127] The node may determine that the particular transaction corresponds to the transaction identifier by generating a hash of the second field value set. Additionally or alternatively, the node may determine that the particular transaction corresponds to the transaction identifier by verifying that the hash matches the transaction identifier.

[0128] A particular transaction may be associated with control of the digital asset that is transferred as a result of validating the first transaction.

[0129] The particular transaction may be associated with a second digital asset that is different than the digital asset transferred as a result of validating the first transaction.

[0130] The first transaction may be successfully authenticated without verifying whether the entity creating the first transaction has access to the secret information.

[0131] A node can be a validator of a blockchain network.

[0132] Verifying the first transaction may further include adding the first transaction to a blockchain in the blockchain network due to successful verification of the first transaction.

[0133] The second script may be a locking script that imposes a set of conditions for verifying the first transaction. Additionally or alternatively, execution of the locking script may cause the node to verify the first transaction by determining whether the set of conditions has been met.

[0134] The first script may be an unlocking script for satisfying the condition set of the second script.

[0135] The first script may specify a signature hash type. Additionally or alternatively, the second script may further, due to being executed, cause the node to obtain a signature hash type provided due to the execution of the first script.

[0136] The second script may further, as a result of being executed, cause the node to determine that the particular transaction is part of a transaction set associated with the first transaction based at least in part on the signature hash type.

[0137] The second script may further, as a result of being executed, cause the node to determine that the particular transaction corresponds to the second transaction based at least in part on the signature hash type.

[0138] It is also desirable to provide a system comprising: a processor; and a memory comprising executable instructions, the executable instructions causing the system to perform any of the claimed methods due to execution by the processor.

[0139] It is also desirable to provide a non-transitory computer-readable storage medium having stored thereon executable instructions which, due to execution by a processor of a computer system, cause the computer system to perform at least any of the claimed methods.

[0140] Therefore, according to the present invention, a method (and corresponding system) may be provided. The method may be described as a blockchain data constraint method. The method may include: i) receiving a first transaction to be verified at a node in a blockchain network, the first transaction including a first script, the first script including at least: a first value, at least a portion of the first value including data that is not constrained by a second script; and a second value; ii) obtaining a second transaction, the second transaction having been verified and including a second script, the second script, due to being executed, causing the node to at least: obtain the first value and the second value due to the execution of the first script; and verify that the data is associated with a specific source based at least in part on the first value and the second value; and iii) verifying the first transaction by executing the first script and the second script.

[0141] The second script may be a locking script including a set of conditions for verifying the second transaction. Additionally or alternatively, the first script may be an unlocking script for satisfying the set of conditions of the locking script.

[0142] Verification of the first transaction may be performed without verifying whether the entity creating the first transaction has access to the secret information.

[0143] Failed verification of the association of data with the data source may result in failure to verify the first transaction.

[0144] The identity of a particular source may not be constrained by the second script.

[0145] The specific transaction may be a specific data source. Additionally or alternatively, the first value may be a field value set for the specific transaction. Additionally or alternatively, the second value may include a transaction identifier associated with the specific transaction. The second script may, as a result of being executed, verify that the data is associated with the data source by verifying that the specific transaction corresponds to the transaction identifier.

[0146] The second script, as a result of being executed, may verify that the particular transaction corresponds to the transaction identifier by verifying that the transaction identifier matches a hash of the set of fields for the particular transaction.

[0147] By including a set of fields for a specific transaction, a first script may cause a node, as a result of the execution of the first script, to make the set of fields for the specific transaction available as input to a second script.

[0148] The specific transaction may be a second transaction.

[0149] Data may be encoded in transaction-specific fields.

[0150] A second script may constrain the identity of a particular source.

[0151] The second value may be a signature. Additionally or alternatively, the second script may further cause the node to obtain a public key associated with the source of the data, and additionally or alternatively, generate a modified public key based at least in part on the public key and the data. Additionally or alternatively, the second script may, as a result of being executed, verify that the data is associated with the source of the data based at least in part on the modified public key.

[0152] The modified public key may be generated by performing an elliptic curve point multiplication on the public key and the data value.

[0153] It is also desirable to provide a system comprising: a processor; and a memory comprising executable instructions, the executable instructions causing the system to perform any of the claimed methods due to execution by the processor.

[0154] It is also desirable to provide a non-transitory computer-readable storage medium having stored thereon executable instructions which, due to execution by a processor of a computer system, cause the computer system to perform at least any of the claimed methods.

[0155] Therefore, according to the present invention, a method (and corresponding system) may be provided. The method may be described as a blockchain data constraint method. The method may include: i) receiving a first transaction to be verified at a node in a blockchain network, the first transaction comprising a first script, the first script causing the node to obtain at least data and a first field value set of the first transaction due to being executed; ii) obtaining a second transaction, the second transaction comprising a second script, the second script causing the node to at least: determine a constraint set based at least in part on the data provided due to the execution of the first script; and verify the constraint set for the first transaction based at least in part on the first field value set; and iii) verifying the first transaction according to the constraint set obtained due to the execution of the first script and the second script.

[0156] Verification of the first transaction may be performed without verifying whether the entity creating the first transaction has access to the secret information.

[0157] The identity of the source of the data may not be constrained by the second script.

[0158] A second script may constrain the identity of the source of the data.

[0159] The second script may include a public key that may be used to authenticate the particular data origin of the data.

[0160] Verifying the data may include generating a modified public key based at least in part on the public key and the data, and additionally or alternatively determining that the data is associated with a source of the data based at least in part on the modified public key.

[0161] The set of constraints may be derived, at least in part, from a set of parameters in the data.

[0162] Satisfaction of the set of constraints may be a condition for reassociating at least a portion of the digital asset.

[0163] Verifying the first transaction may include reassociating the digital asset from the first entity to the second entity.

[0164] The set of constraints may further reassociate at least a portion of the digital asset with a third entity.

[0165] The identity of the second entity may be determined based at least in part on the set of constraints.

[0166] The source of the data may be a second transaction. Additionally or alternatively, the data includes a second field value set of the second transaction. Additionally or alternatively, execution of the second script may cause the constraint set to be derived at least in part from the second field value set.

[0167] The identity of the second entity may be determined based at least in part on the set of constraints.

[0168] The set of constraints may further reassociate at least a portion of the digital asset with a third entity.

[0169] It is also desirable to provide a system comprising: a processor; and a memory comprising executable instructions, the executable instructions causing the system to perform any of the claimed methods due to execution by the processor.

[0170] It is also desirable to provide a non-transitory computer-readable storage medium having stored thereon executable instructions which, due to execution by a processor of a computer system, cause the computer system to perform at least any of the claimed methods.

[0171] Therefore, according to the present invention, a method (and corresponding system) may be provided. The method may be described as a blockchain data constraint method. The method may include: i) receiving a first transaction to be verified at a node in a blockchain network, the first transaction including a first script, the first script being executed so that the node at least: obtains a first field value set of the first transaction, the first field value set including a third script; and obtains a second field value set of the second transaction, the second field value set including a copy of the second script; ii) obtaining a second transaction, the second transaction including a second script, the second script being executed so that the node at least: obtains a third script from the first field value set due to determining that a termination condition is not met; and determines that a copy of the second script matches the third script; and iii) verifying the first transaction due to the execution of the first script and the second script.

[0172] The first script may be an unlocking script for satisfying the condition set of the second script.

[0173] The second script may be a locking script that imposes a set of conditions for validating the first transaction.

[0174] The third script may be a locking script that imposes a set of conditions for validating future transactions.

[0175] The second transaction may be a transaction associated with the digital asset. Additionally or alternatively, the first transaction may be a transaction that reassociates at least a portion of the digital asset from the first entity to the second entity.

[0176] Verifying the first transaction may include reassociating the digital asset from the first entity to the second entity.

[0177] Determining that the termination condition is not satisfied may include determining that the amount of the digital asset associated with the second transaction is sufficient to reassociate at least a portion of the digital asset.

[0178] The third script may be embedded in the field values ​​of the first field value set.

[0179] A blockchain network can be composed of distributed electronic devices running instances of the blockchain protocol.

[0180] Verification of the first transaction may be performed without verifying whether the entity creating the first transaction has access to the secret information.

[0181] As another condition for verifying the first transaction, the second script may further cause the node to verify that the first transaction complies with additional constraints.

[0182] The first and second transactions may be components of a recurring set of smart contracts associated with the digital asset.

[0183] A set of repeating smart contracts can be terminated by a termination condition.

[0184] It is also desirable to provide a system comprising: a processor; and a memory comprising executable instructions, the executable instructions causing the system to perform any of the claimed methods due to execution by the processor.

[0185] It is also desirable to provide a non-transitory computer-readable storage medium having stored thereon executable instructions which, due to execution by a processor of a computer system, cause the computer system to perform at least any of the claimed methods.

[0186] Therefore, according to the present invention, a method (and corresponding system) can be provided. The method can be described as a blockchain data constraint method. The method may include: i) receiving a first transaction to be verified at a node in a blockchain network, the first transaction including a first script, the first script being executed so that the node obtains at least a first field value set of the first transaction, a second field value set of the second transaction, and an input; ii) obtaining a second transaction, the second transaction including a second script, the second script including a rule set, the second script being executed so that the node at least: verifies that the second script matches a third script embedded in the first field value set; determines a current state based at least in part on the second field value set; and determines a next state based at least in part on the current state, the input, and the rule set; verifies that the next state is included in the first field value set; and iii) verifies the first transaction due to the execution of the first script and the second script.

[0187] The second script may constrain the identity of the source of the input.

[0188] Any of the claimed methods may further include verifying the cryptographic secret of the source of the input.

[0189] The rule set may be a state transition matrix.

[0190] The third script may be a locking script that imposes a set of conditions for validating future transactions.

[0191] The second script may further cause the node to determine that the termination condition is not satisfied.

[0192] The input can be embedded in the second field value set.

[0193] The termination condition may be that the size of the digital asset associated with the second transaction is insufficient to be transferred.

[0194] Verifying the first transaction may include reassociating the digital asset from the first entity to the second entity.

[0195] The current status may indicate a status of the second transaction.

[0196] The next state may indicate the state of the first transaction upon verification.

[0197] Any of the methods claimed may further include receiving a third transaction. Additionally or alternatively, any of the methods claimed may further include obtaining a fourth script from the first transaction, the fourth script causing the node to determine another state different from the next state and the current state based at least in part on the next state, the second input, and the rule set due to being executed.

[0198] The current state and the next state may be components of a set of possible states for the first and second transactions.

[0199] It is also desirable to provide a system comprising: a processor; and a memory comprising executable instructions, the executable instructions causing the system to perform any of the claimed methods due to execution by the processor.

[0200] It is also desirable to provide a non-transitory computer-readable storage medium having stored thereon executable instructions which, due to execution by a processor of a computer system, cause the computer system to perform at least any of the claimed methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0201] These and other aspects of the invention will be apparent from and elucidated with reference 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:

[0202] Figure 1 illustrates a blockchain environment in which various embodiments may be implemented;

[0203] Figure 2 An example of an untrusted deterministic state machine according to an embodiment is shown;

[0204] Figure 3 illustrates an example of a problem associated with locking scripts that is solved by an embodiment;

[0205] Figure 4 shows an example of data accessible to an unlocking script according to an embodiment;

[0206] Figure 5 An example of generating a signature from a serialized set of transaction fields according to an embodiment is shown;

[0207] Figure 6 is a flow chart illustrating an example of enabling injection of a serialized unlock transaction field set according to an embodiment;

[0208] Figure 7 Another example of a problem associated with locking scripts that is solved by an embodiment is shown;

[0209] Figure 8 An example of enabling injection of a serialized previous transaction according to an embodiment is shown;

[0210] Fig. 9 shows an example of available field sets depending on the signature hash type according to an embodiment;

[0211] Fig.10 An example of extracting a transaction identifier from a serialized transaction according to an embodiment is shown;

[0212] Fig.11 is a flow chart illustrating an example of enabling injection of a serialized previous transaction according to an embodiment;

[0213] Fig.12 An example of insecurely providing undetermined data from an undetermined source according to an embodiment is shown;

[0214] Fig.13 An example of securely providing undetermined data from a determined source according to an embodiment is shown;

[0215] Fig.14 An example of securely providing undetermined data from an undetermined source into a locking script according to an embodiment is shown;

[0216] Fig.15 is a flow chart illustrating an example of securely providing undetermined data into a locking script according to an embodiment;

[0217] Fig.16 An example of a parameterized smart contract according to an embodiment is shown;

[0218] Fig.17 is a flow chart illustrating an example of executing a parameterized smart contract according to an embodiment;

[0219] Fig.18 An example of a smart contract replication problem solved by an embodiment is shown;

[0220] Fig.19 An example of a solution to the smart contract replication problem according to an embodiment is shown;

[0221] Fig. 20 Another example of a smart contract replication problem solved according to an embodiment is shown;

[0222] Fig.21 An example of a self-replicating smart contract according to an embodiment is shown;

[0223] Fig. 22 A flow chart illustrating an example of a self-replicating smart contract with a termination condition according to an embodiment;

[0224] Fig.23 An example of a next state determination problem solved according to an embodiment is shown;

[0225] Fig.24 illustrates an example of an untrustworthy deterministic state machine according to an embodiment;

[0226] Fig.25 A flow chart illustrating an example of an untrustworthy deterministic state machine according to an embodiment; and

[0227] Fig.26 A computing environment is shown in which various embodiments may be implemented. DETAILED DESCRIPTION

[0228] First, refer to Figure 1 , which illustrates an example blockchain network 100 associated with a blockchain according to an embodiment of the present invention. In an embodiment, the example blockchain network 100 is composed of peer-to-peer distributed electronic devices running an instance of a blockchain protocol. In some examples, the distributed electronic devices are referred to as nodes 102.

[0229] Node 102 may be implemented by any suitable computing device (e.g., by a server in a data center, by a client computing device (e.g., a desktop computer, a laptop computer, a tablet computer, a smart phone, etc.), by multiple computing devices in a distributed system of a computing resource service provider, or by, for example, Fig.26 The device may be composed of any suitable electronic client device such as a computing device 2600.

[0230] In an embodiment, one or more of the nodes 102 are communicatively connected to one or more other nodes in the nodes 102. Such communication connections may include one or more of wired or wireless communications. In an embodiment, the nodes 102 each maintain at least a portion of a "ledger" of all transactions in the blockchain. In this way, the ledger is a distributed ledger. Transactions processed by a node affecting the ledger can be verified by one or more of the other nodes, thereby maintaining the integrity of the ledger.

[0231] In an embodiment, at least some of the nodes 102 perform complex computations, such as solving a cryptographic problem. The node that solves the cryptographic problem creates a new block for the blockchain and broadcasts the new block to the other nodes in the nodes 102. The other nodes in the nodes 102 verify the work of the node that solves the cryptographic problem and accept the block into the blockchain after verification (e.g., by adding it to the distributed ledger of the blockchain). In some examples, a block is a group of transactions, typically marked with a timestamp and a "fingerprint" (e.g., a hash) of the previous block. In this way, each block is linked to the previous block, thereby creating a "chain" of linked blocks in the blockchain. In an embodiment, a valid block is added to the blockchain by consensus of the nodes 102. In addition, in some examples, the blockchain includes a list of verified blocks.

[0232] In an embodiment, at least some of the nodes 102 serve as validation nodes for validating transactions, as described in the present invention. In some examples, a transaction includes data that provides proof of ownership of a digital asset and conditions for accepting or transferring ownership / control of the digital asset. In some examples, an "unlocking transaction" refers to a transaction that re-associates (e.g., transfers ownership or control) at least a portion of a digital asset indicated by an unspent transaction output (UTXO) of a previous transaction to an entity associated with a blockchain address. In some examples, a "previous transaction" refers to a transaction that includes a UTXO referenced by an unlocking transaction. In some embodiments, a transaction includes a "locking script" that places a lien on the transaction with conditions that must be met to transfer ("unlock") ownership / control. In some embodiments, a blockchain address is a string of alphanumeric characters that is associated with an entity to which control of at least a portion of a digital asset is transferred / re-associated. In some blockchain protocols implemented in some embodiments, there is a one-to-one correspondence between a public key associated with an entity and a blockchain address. Verification of a transaction may include verifying one or more conditions specified in a locking script and / or an unlocking script. After successfully validating transaction 104 , the validating node adds transaction 104 to the blockchain and distributes it to nodes 102 .

[0233] Figure 2 An example embodiment 200 of the present invention is shown. Specifically, Figure 2 Depicted is a previous blockchain transaction 202 encoding a first state 206 and an unlocking blockchain transaction 204 encoding a second state 208. In the example embodiment 200, the first state 206 at the first time is represented as a parameter embedded in the previous blockchain 202. More details on parameterized constraints can be found at Fig.16 The unlocking blockchain transaction 204 will include parameters representing the second state 208.

[0234] In the example embodiment 200, transactions 202 and 204 are field value sets that include one or more inputs and one or more outputs. In some embodiments, the inputs and outputs reflect an intention to reassociate at least a portion of a digital asset from at least one entity to at least another entity. In the example embodiment 200, the previous blockchain transaction 202 is the latest, confirmed transaction included in the blockchain. In the example embodiment 200, the unlocking blockchain transaction 204 is a recent transaction that has yet to be confirmed and has not yet been included in the blockchain. Each input of the unlocking blockchain transaction 204 receives an output of the previous blockchain transaction 202.

[0235] Some blockchain technologies use the Elliptic Curve Digital Signature Algorithm (ECDSA) as a mathematical scheme for digital signatures. In an embodiment, ECDSA is a cryptographic digital signature used to protect UTXO from being obtained by unauthorized entities. Elliptic Curve Digital Signatures (ECDS) typically append a signature hash tag (SIGHASH type) to the end of the signature; however, it is contemplated that the techniques of the present invention may be used with blockchain technologies that do not implement the SIGHASH type. In such blockchain technologies, ECDS is contemplated as a signature generation principle that conforms to the particular blockchain technology.

[0236] In an embodiment, a SIGHASH type refers to a set of fields extracted from a transaction before being serialized (e.g., normalized) and hashed. For example, the SIGHASH type affects which fields of a transaction are included in a signature. In some examples, the SIGHASH type may be one or more of SIGHASH_ALL, SIGHASH_NONE, SIGHASH_SINGLE, or SIGHASH_ANYONECANPAY. In an embodiment, the type SIGHASH_ALL indicates that all fields in a transaction are to be hashed and signed in addition to the input script. In an embodiment, the type SIGHASH_NONE indicates that the output does not need to be signed, which may allow others to update the transaction. In an embodiment, the type SIGHASH_SINGLE indicates that the input is signed but the sequence number is left blank, so that others can create a new version of the transaction, but the only output that is signed is the output in the same position as the input. In an embodiment, the type SIGHASH_ANYONECANPAY is combined with other types and indicates that the input including SIGHASH_ANYONECANPAY is signed, but other inputs do not need to be signed. The SIGHASH type may be represented by a value indicating the SIGHASH type. For example, in some implementations, SIGHASH_ALL is represented by a byte with a value of 1, SIGHASH_NONE is represented by a byte with a value of 2, SIGHASH_SINGLE is represented by a byte with a value of 3, and SIGHASH_ANYONECANPAY is represented by a byte with a value of 80. In some implementations, combining SIGHASH types is performed by adding the byte values ​​together.

[0237] In some examples, the set of transaction fields determined by the SIGHASH type refers to a subset of the corresponding transaction encoded in bytes determined by the SIGHASH type. For example, in the case where the SIGHASH type is SIGHASH_ANYONECANPAY, only one transaction input is included in the signature.

[0238] In an embodiment, ECDS is represented by a pair of 256-bit numbers (r, s) encoded in the Distinguished Encoding Rules (DER) format. However, it should be noted that the techniques of the present invention can be used with other encoding formats, such as the Basic Encoding Rules (BER) or the Canonical Encoding Rules (CER). The parameters used in ECDSA include K (elliptic curve point with coordinates (x, y)), k (256-bit number; usually a random number to protect the private key), G (base point on the elliptic curve with order n: n×G=0, where 0 represents the same elliptic curve point), n is a large prime number used as a parameter in the finite field of the elliptic curve, r (one of the 256-bit numbers in ECDS), s (another 256-bit number in the signature), k-1 (k's modular inverse, i.e. k -1 k≡1mod n), m (the message / data being signed; in an embodiment, it is adjusted to 256 bits by a hash function), a (private key; for example, a 256-bit number). In an embodiment, ECDS is generated as follows.

[0239] First, determine the elliptic curve point K by multiplying k with the generator:

[0240] K=k×G

[0241] Then, the point x is determined from K, and the first of the 256-bit numbers in the ECDS, r, is determined according to the following formula:

[0242] r = x mod n

[0243] Then, the second of the 256-bit numbers in the ECDS, s, is determined according to the following formula:

[0244] s=k -1 (m+r×a)mod n

[0245] Finally, (r, s) is encoded in DER format. Given the signature (r, s), the message / data m, and the public key A corresponding to the private key a, the signature is verifiable. To verify the signature, calculate v = s -1 ×(m×G+r×y). If v=r, the signature is valid.

[0246] Some blockchains use a scripting system called "scripts". In the present invention, reference is made to various script opcodes and keywords to perform various operations. However, it is contemplated that other blockchain technologies may implement different instruction sets, and therefore, the opcodes described in the present invention are considered to be descriptions of the operations performed by the opcodes rather than specific opcodes in the script. In some embodiments, the scripting system is a Turing incomplete instruction set (e.g., does not support loops, recursion, jump statements, etc.). In other embodiments, the scripting system is a Turing complete instruction set.

[0247] Certain embodiments of the present invention operate under the assumption that the scripting system or other system for implementing the described instruction set allows more than 200 instructions (e.g., opcodes) in a single script. Likewise, certain embodiments of the present invention also assume that:

[0248] ● In a system executing an opcode script / instruction set, the functionality provided by the opcode referenced by the present disclosure is present and enabled; and / or

[0249] The desired functionality can be implemented by creating custom functions, which are written to provide the desired behavior. These custom functions may be written to implement the functionality of an op_code that existed in the language but has been disabled, or they may be "new" op_codes that provide specific functionality not provided by the scripting language itself.

[0250] Examples of opcodes referenced in this disclosure include:

[0251] OP_ECPX, which returns the x-coordinate of an elliptic curve point

[0252] OP_ADD, which adds the top two items on the stack

[0253] OP_BIGMOD, which returns the remainder after dividing the top two items on the stack

[0254] OP_BIGMODADD, which performs a modulo addition of the top two items on the stack modulo the third item on the stack

[0255] OP_BIGMODINVERSE, which performs a modulus negative exponentiation operation

[0256] OP_BIGMODMUL, which performs a multiplication of the top two items on the stack modulo the third item on the stack

[0257] OP_CAT, which concatenates the top two items on the stack together

[0258] OP_CHECKSIG, where the public key and signature are popped from the stack based on the SIGHASH type and verified against the signature of the transaction field. If the signature is valid, 1 is returned, otherwise 0 is returned.

[0259] OP_CHECKSIGVERIFY, which does the same thing as OP_CHECKSIG, but executes OP_VERIFY afterwards

[0260] OP_DERENCODE, which encodes the top two items in the stack in DER format

[0261] OP_DUP, which copies the top item on the stack

[0262] OP_ECPMULT, which performs elliptic curve point multiplication (also known as elliptic curve scalar multiplication) on the top two items on the stack

[0263] OP_ELSE, if the previous OP_IF or OP_NOTIF or OP_ELSE is not executed, these statements will be executed; otherwise, if the previous OP_IF or OP_NOTIF or OP_ELSE is executed, these statements will not be executed

[0264] ●OP_ENDIF, which ends an if / else block

[0265] ●OP_EQUAL, which returns 1 if the inputs are exactly equal and 0 otherwise

[0266] ●OP_EQUALVERIFY, which is the same as OP_EQUAL but then runs OP_VERIFY

[0267] ●OP_FROMALTSTACK, which places the input on top of the main stack and removes it from the alternate stack

[0268] ●OP_HASH256, where the input is hashed twice: first with SHA-256 and then with RIPEMD-160

[0269] ●OP_IF, which executes the statement and removes the top value from the stack if the top value on the stack is not false

[0270] ●OP_MUL, which multiplies the top two items on the stack

[0271] ●OP_NOTIF, which executes the statement and removes the top value from the stack if the top value on the stack is false

[0272] ●OP_ROLL, where the item n deep in the stack is moved to the top

[0273] ●OP_SUBSTR, which returns a part of a string

[0274] ●OP_SWAP, where the top two items on the stack are swapped

[0275] ●OP_TOALTSTACK, which places the input on top of the alternate stack and removes it from the main stack

[0276] ●OP_VERIFY, which marks the transaction as invalid if the top value on the stack is not true

[0277] In an embodiment, opcodes can be used to create an ECDS generation script, which can be extended to create a signature generation script OP_GENSIG by appending the SIGHASH byte to the end.

[0278] Table 1:

[0279]

[0280] In the above script, the <SIGHASH byte>, the message <m>, Private Key and numbers <k>Enter into the main (last in, first out) stack in the above order. Execute script operation "OP_DUP OP_TOALTSTACK<PubK G> OP_ECPMULT" will cause the number <k>to the backup stack and <k>With elliptic curve generator<PubK G> Multiply to produce the elliptic curve point K at the top of the main stack. Execute script operation "OP_ECPX <n>OP_BIGMOD OP_DUP OP_TOALTSTACK" causes r to be computed based on the x coordinate of K modulo n. A copy of r is pushed onto the alternate stack. Execute the script operation" <n>OP_BIGMODMUL <n>OP_BIGMODADD OP_FROMALTSTACK OP_SWAP OP_FROMALTSTACK <n>OP_BIGMODINVERSE <n>OP_BIGMODMUL” computes s according to = k -1 (m + r × a) mod n. Finally, performing the script operations "OP_DERENCODE OP_SWAP OP_CAT" encodes r and s in DER format and concatenates them with <SIGHASH bytes>. In the present invention, this script is referred to as OP_GENSIG. Therefore, references to OP_GENSIG in embodiments of the present invention should be regarded as shorthand for the operations performed in the above script.

[0281] < / n> < / n> < / n> < / n> < / n> < / k> < / k> < / k> Figure 3 is an example 300 illustrating a problem associated with blockchain transactions that is solved by an embodiment of the present invention. Figure 3 In the embodiment of example 300 shown in FIG. 304 , the locking script 306 in the previous transaction 302 cannot directly read the fields of the unlocking transaction 304. As mentioned, in some embodiments, the previous transaction 302 is the latest confirmed transaction included in the blockchain. Likewise, in some embodiments, the unlocking transaction 304 is a future transaction that has not yet been confirmed and is not yet included in the blockchain, representing an attempt to reassociate at least a portion of the digital assets controlled by the previous transaction 302.

[0282] As described above, in some embodiments, the locking script 306 is a script that sets a transaction in place by specifying conditions that need to be met in order to transfer an output. More specifically, the locking script 306 is executed to: receive data from the unlocking script executed as a result of being executed by a validating node of the blockchain system, perform certain operations based on the data, and return an indication of whether the execution of the unlocking script successfully "unlocked" (i.e., satisfied the set of conditions set therein) the locking script. In some embodiments, the locking script 306 defines (e.g., through data provided by the unlocking script) one or more data constraints that must be satisfied in order to successfully verify the transaction. For example, the locking script 306 may require that certain data be provided in the unlocking script to unlock the associated digital asset of the previous transaction 302.

[0283] Figure 4 An example 400 is depicted showing that an unlocking script 408 of the present invention, which is different from the locking script 406 of the previous transaction 402, has access to fields of an unlocking transaction 404 in one embodiment (e.g., a set of unlocking transaction fields determined according to the SIGHASH type). In some embodiments, the previous transaction 402 is similar to Figure 3 In some embodiments, unlocking transaction 404 is similar to unlocking transaction 304. In some embodiments, locking script 406 has the same Figure 3 The locking script 306 has similar characteristics.

[0284] In some embodiments, unlocking script 408 is an executable script placed on the input of a transaction that attempts to satisfy the set of conditions placed on the output of the transaction by the locking script. The unlocking script is also referred to as "scriptSig". As described above, unlocking script 408 has been designed to provide a set of unlocking transaction fields determined according to the SIGHASH type as input to the locking script, thereby giving the locking script access to the fields of the unlocking transaction. More details on the content and structure of serialized transactions can be found below. Figure 5 402 and 404 include additional fields. For example, in some embodiments, "nVersion" refers to the blockchain protocol version, "#vin" refers to the count of the number of inputs of the transaction, "hash" refers to the pay-to-public-key-hash of the entity to which the digital asset is to be reassociated, "#vout" refers to the count of the number of outputs of the transaction, "nValue" refers to the remaining unspent digital asset amount, and "nLockTime" refers to the timestamp when the transaction was completed.

[0285] Figure 5 An example 500 is shown of how to form a serialized transaction field set. Figure 5 As shown, a serialized transaction 510 (i.e., a transaction represented by a series of bytes in a particular format) includes a set of field values ​​for the transaction. At 512, the signer selects a SIGHASH type and a number k. The number k is typically a random number or a pseudo-random number to mask / protect the private key, and is therefore sometimes referred to as a "masked number" in the present invention. A modified copy 514 of the transaction is an example of a set of fields of the serialized transaction 510 selected based on the specified SIGHASH type (e.g., SIGHASH_NONE+ANYONECANPAY in example 500). The signer hashes the modified copy 514 of the transaction (e.g., performs a double SHA-256 hash), thereby generating a message m 516. The signer then uses the SIGHASH type, message m, the signer's private key, and the number k to create a signature, such as the above in combination. Figure 2 The way described.

[0286] The following table shows an example of a typical unlock and unlocking script, where the supposed signature of entity A specified in the unlocking script is checked against entity A's public key using the OP_CHECKSIG opcode.

[0287] Table 2:

[0288] Unlocking Script Locking Scripts <Sig A> <PubK A>OP_CHECKSIG

[0289] Therefore, by understanding Figure 5 The following table shows examples of unlocking and locking scripts where part of the process shown in example 500 is moved into the unlocking script.

[0290] Table 3:

[0291]

[0292] The unlocking script may be further modified to include a step of computing the message m in the unlocking script.

[0293] Table 4:

[0294]

[0295] However, it should be noted that other than the SIGHASH type and the set of unlock transaction fields determined according to the SIGHASH type, the rest of the process can be moved to the locking script.

[0296] Table 5:

[0297]

[0298] Therefore, by moving the operation "OP_HASH256" inside the locking script <k>OP_GENSIG", so that the unlocking script includes the SIGHASH type and the set of unlocking transaction fields determined by the SIGHASH type in order to be valid.

[0299] In this way, the serialized previous transaction is injected into the locking script. The following table shows how the locking and unlocking scripts perform each step of the example 500 process and verify the transaction.

[0300] Table 6:

[0301]

[0302] In the present invention, the above script may be referred to as OP_UNLOCKINGTXINJECTION. Therefore, references to OP_UNLOCKINGTXINJECTION in embodiments of the present invention should be considered shorthand for the operations performed in the above script. However, it should be noted that any entity that provides a SIGHASH type and an unlocking transaction field set determined according to the SIGHASH type can receive the transaction output. However, this will become a useful feature, as will be described in more detail below. As described above, in some examples, receiving a transaction output refers to creating an unlocking transaction that references the transaction output and will be evaluated as valid and therefore receives the transaction output.

[0303] According to various embodiments,< / k> Figure 6 600 that enables injection of an unlocking transaction field set determined according to a SIGHASH type, according to an embodiment. Some or all of process 600 (or any other process described, or variations and / or combinations of these processes) may be performed under the control of one or more computer systems configured with executable instructions and / or other data, and may be implemented as executable instructions that execute together on one or more processors. The executable instructions and / or other data may be stored on a non-transitory computer-readable storage medium (e.g., a computer program permanently stored on a magnetic, optical, or flash memory medium).

[0304] For example, some or all of process 600 may be performed by, for example Figure 1 The verification node in the blockchain network of the example blockchain network 100 of the embodiment of the present invention is executed. Such a verification node can be performed by any suitable computing device (e.g., by a server in a data center, by a client computing device, by multiple computing devices in a distributed system of a computing resource service provider, or by, for example, Fig.26 Process 600 includes a series of operations, wherein the system performing process 600 is combined with Figure 5 Execute the unlocking and locking scripts of an unverified transaction in the manner described in , thereby obtaining the SIGHASH type and transaction field values ​​set, generating a signature, and verifying the signature.

[0305] At 602, the system obtains an unverified transaction from an entity seeking to reassociate at least a portion of a digital asset. The unverified transaction includes a locking script and an unlocking script. The unlocking script is executed by the system before executing the locking script. The unlocking script may be similar to the unlocking scripts shown in Tables 5 and 6 above, and specifies a SIGHASH type and includes a serialized field set of unverified transactions. Therefore, at 604 and 606, the system executing process 600 obtains a serialized transaction field value set of SIGHASH type and unverified transactions from the unlocking script and places them in the main stack. After successfully completing the execution of the unlocking script, the system will begin executing the locking script using the state of the main stack (in some implementations, the state of the standby stack) when the execution of the unlocking script is completed. The locking script may be similar to the locking scripts shown in Tables 5 and 6 above.

[0306] At 608, based on the locking script, the system generates a signature using at least the SIGHASH type and the set of transaction field values ​​placed on the main stack as a result of the execution of the unlocking script and the private key associated with the public-private key pair. At 610, based on the locking script, the system successfully verifies the signature against the public key of the key pair. In this way, the set of transaction fields is injected into the locking script via the unlocking script. It should be noted that operations 602 to 610 may be performed in various orders and combinations depending on the implementation, and some operations may be performed in parallel with other operations of process 600.

[0307] Figure 7 is an example 700 illustrating a problem associated with blockchain transactions that is solved by an embodiment of the present invention. That is, Figure 7 In the example 700 shown, the locking script 706 cannot read the inputs of the transaction in which it is embedded, and therefore cannot directly read the fields of the previous transaction. In some embodiments, the transaction 704 is similar to Figure 3 An unlock transaction 304 represents an attempt to reassociate at least a portion of the digital assets controlled by a previous transaction. As described above, in some embodiments, similar to Figure 3 The locking script 306 of the transaction, the locking script 706 is a script that holds the transaction in place by specifying the conditions that need to be met in order to transfer the output.

[0308] Figure 8 An example 800 is shown in which an unlocking script 808 includes serializing a previous transaction by extracting a transaction ID and performing a constraint check. Specifically, Figure 8 Depicted is an unlocking transaction 804 with an unlocking script 808 utilizing outputs from previous transactions 802A to 802B. As can be seen, the unlocking script 808 causes a serialized previous transaction to be retrieved. In some examples, a serialized previous transaction refers to an unmodified version of a field value set of a previous transaction.

[0309] This can be understood by observing that a transaction ID is a double SHA-256 of a serialized transaction and that a transaction ID has a one-to-one mapping with a transaction. Figure 8 Thus, by applying the constraints shown in Table 7 below, it is possible to inject transactions into the unlocking script.

[0310] Table 7:

[0311] Unlock Script Locking Scripts <Serialized transaction> OP_HASH256 <Transaction ID> OP_EQUAL

[0312] Embodiments of the present invention further improve this injection by allowing not only any serialized transaction to be injected, but also one or more serialized previous transactions (e.g., previous transactions 802A to 802B) referenced in the inputs of unlocking transaction 804 to be injected. Figure 7 As described above, the unlocking script 806 can inject the unlocking transaction field set determined according to the SIGHASH type into the locking script, and Fig. 9 Shows which fields are included in the serialized transaction depending on the SIGHASH type specified.

[0313] Fig. 9 An example 900 is shown of the set of fields available in a serialization transaction depending on the specified SIGHASH type. However, it should be noted that Fig. 9 is intended to be illustrative, and in various embodiments, there are Fig. 9 There are many more SIGHASH types as described in . Fig. 9 As shown, in the case of different SIGHASH types, different sets of previous transaction IDs are included in the unlocking transaction field set determined according to the SIGHASH type (it should be noted that the "hash" field represents the transaction ID in a big-endian format). In some embodiments, the transaction ID of the previous transaction embedded in the locking script is always available, regardless of which SIGHASH type is specified.

[0314] Therefore, it is possible to make certain fields appear in the set of unlocked transaction fields determined by constraining the SIGHASH type in the following way: First, copy the SIGHASH type. Next, push the SIGHASH type onto the stack (e.g., SIGHASH_ALL). Finally, call OP_EQUALVERIFY. From Fig. 9 As can be seen, SIGHASH_ALL (as shown in unlocking transaction 904A) includes a hash that, as mentioned, represents the transaction IDs of the previous transactions y and z. In contrast, SIGHASH_ALL+ANYONECANPAY (as shown in unlocking transaction 904B) includes only the hash of the immediately preceding transaction y. In some embodiments, unlocking transactions 904A to 904B are similar to Figure 3 The unlocked blockchain transaction 204 represents an attempt to reassociate at least a portion of the digital assets controlled by a previous transaction (e.g., transaction y and / or x). Extracting the transaction ID can be accomplished by parsing the serialized transaction using the substring opcode until the desired field is reached, such as Fig.10 shown.

[0315] Fig.10 An example 1000 of extracting a transaction ID in an embodiment of the present invention is shown. Specifically, Fig.10 Hash 1020, which is shown to consist of a transaction ID in big-endian format, is a substring of serialized transaction 1010 that can be extracted by using a substring opcode within a script. In some embodiments, serialized transaction 1010 is first parsed to determine the location of hash 1020 before the transaction ID can be extracted because some fields (e.g., #vin, scriptSigLen, scriptSig, scriptPubKeyLen, and scriptPubKey) have variable byte lengths. However, it is contemplated that in embodiments where the fields have fixed lengths, parsing may not be necessary.

[0316] Therefore, in some embodiments, by constructing a locking script, the Figure 6 The described manner of injecting a specific serialized previous transaction referenced in an unlocking transaction can make the previous transaction ID accessible. For example, the SIGHASH type constraint is first determined, the transaction ID is extracted, and the serialized previous transaction is copied and checked against the transaction ID extracted from the unlocking transaction serialized field set (according to the SIGHASH type). It should be noted that this process can be performed so that multiple different serialized previous transactions are injected. As an example, Table 8 provides a script that injects a previous transaction corresponding to input X of an unlocking transaction.

[0317] Table 8:

[0318]

[0319] In the above script, OP_EXTRACTXID is an opcode / script that takes data including the transaction ID and the transaction ID location as input and outputs the extracted transaction ID. In the present invention, the above script may be referred to as OP_PREVTXINJECTION. Therefore, references to OP_PREVTXINJECTION in embodiments of the present invention should be considered as shorthand for the operations performed in the above script.

[0320] However, it should be noted that any entity that provides a SIGHASH type, an unlocking transaction field set determined according to the SIGHASH type, and serializes a previous transaction can obtain the transaction output. However, this will become a useful feature, as will be described in more detail below.

[0321] As another example, Table 9 provides a script that enables injection of a previous transaction corresponding to an input being signed.

[0322] Table 9:

[0323]

[0324] In the present invention, the above script in Table 8 may also be referred to as OP_SELFTXINJECTION, like the script in Table 8. Therefore, references to OP_SELFTXINJECTION in embodiments of the present invention should be regarded as shorthand for the operations performed in the above script.

[0325] It should also be noted that any entity that provides a SIGHASH type, an unlocking transaction field set determined according to the SIGHASH type, and serializes a previous transaction can obtain a transaction output. However, this will be a useful feature as described in more detail below. As mentioned above, in some examples, obtaining a transaction output refers to creating an unlocking transaction that references the transaction output and successfully verifying the unlocking transaction.

[0326] Fig.11 1 is a flow chart illustrating an example of a process 1100 that enables injection of serialized previous transactions according to various embodiments. Some or all of the process 1100 (or any other process described, or variations and / or combinations of these processes) may be performed under the control of one or more computer systems configured with executable instructions and / or other data, and may be implemented as executable instructions that execute together on one or more processors. The executable instructions and / or other data may be stored on a non-transitory computer-readable storage medium (e.g., a computer program permanently stored on a magnetic, optical, or flash memory medium).

[0327] For example, some or all of process 1100 may be performed by, for example Figure 1 The verification node in the blockchain network of the example blockchain network 100 of the embodiment of the present invention is executed. Such a verification node can be performed by any suitable computing device (e.g., by a server in a data center, by a client computing device, by multiple computing devices in a distributed system of a computing resource service provider, or by, for example, Fig.26 The process 1100 includes a series of operations in which the system executing the process 1100 executes the unlocking script and the locking script of the unverified transaction in conjunction with each other, and thereby obtains a serialized previous transaction corresponding to the transaction ID extracted from the unverified transaction.

[0328] At 1102, the system obtains an unverified transaction from an entity seeking to reassociate at least a portion of a digital asset. The unverified transaction includes a locking script and an unlocking script. The locking script and the unlocking script may be similar to the locking script and the unlocking script shown in Tables 8 and 9 above. That is, the locking script includes an instruction set that is used as input values ​​stored in the primary stack and the backup stack, for example, by the unlocking script. If the evaluation is true, the execution of the instruction set will successfully verify the unverified transaction. Therefore, the unlocking script is executed before the locking script, thereby setting the values ​​to be used by the locking script in the primary stack and the backup stack. Fig.11 The unlocking script of an unverified transaction in an embodiment includes a serialized previous transaction, a SIGHASH type, and a serialized unlocking transaction field set.

[0329] Due to the execution of the unlocking script followed by the locking script, at 1104, the system obtains the serialized previous transaction, the SIGHASH type, and the serialized unlocking transaction field set included in the unlocking script. At 1106, the system generates a signature based on the serialized field value set of the unverified transaction based on the SIGHASH. It should be noted that the SIGHASH type affects which fields are used in the signature generation, and the expected SIGHASH can depend on the specific previous transaction sought. For example, Table 8 shows the locking script and unlocking script for extracting a previous transaction (but not necessarily a previous transaction that includes the same locking script), and this table uses a SIGHASH type of SIGHASH_ALL. As shown in Fig. 9 As shown in Table 9, the SIGHASH_ALL type enables the retrieval of inputs of other previous transactions of the unlocking transaction. In contrast, Table 9 shows the locking script and unlocking script for extracting previous transactions with the same locking script (i.e., previous transactions corresponding to the signed inputs), which uses the SIGHASH type of SIGHASH_ALL|ANYONECANPAY. Fig. 9 As shown, the SIGHASH type of SIGHASH_ALL|ANYONECANPAY deletes the inputs of previous transactions except the previous transaction with the signed input.

[0330] At 1108, the system verifies the previously generated signature, and then at 1110, by performing a double SHA-256 on the obtained serialized previous transaction, a value that should match the transaction ID of the unlocking transaction (i.e., the serialized field value set) is generated. Using the substring opcode, at 1112, the system extracts the transaction ID of the serialized field value set, and then at 1114, the system determines whether the transaction ID generated by the double SHA-256 of the serialized previous transaction matches the transaction ID of the serialized field value set. It should be noted that in various embodiments, a match does not necessarily require equality. For example, if two values ​​are not equal, but mathematically equivalent, the two values ​​can match. As another example, if two values ​​correspond to a common object (e.g., a value) or are complementary in some predetermined manner and / or they meet one or more matching criteria, the two values ​​can match. In general, any way of determining whether a match exists can be used. It should also be noted that one or more operations performed in 1102 to 1114 can be performed in various orders and combinations (including in parallel).

[0331] Fig.12 An example 1200 is shown that illustrates the problems associated with locking scripts that are solved by embodiments of the present invention. That is, Fig.12 The example 1200 depicted in exemplifies the problems that arise by providing undetermined data to a locking script. In some examples, the term "undetermined data" refers to data provided by an unlocking script that unlocks a locking script without prior instructions from the node executing the locking script.

[0332] In some embodiments, the previous transaction 1202 is similar to Figure 3 302. Likewise, in some embodiments, unlocking transaction 1204 is similar to 304. In some embodiments, blockchain 1224 consists of a set of transaction blocks in a peer-to-peer electronic ledger. In an embodiment, each block of blockchain 1224 includes a hash of the previous block, so that blocks are joined (i.e., "chained") together to create a permanent, immutable record of all verified transactions in the blockchain.

[0333] In some embodiments, undetermined source 1222A may be an entity attempting to obtain the UTXO of previous transaction 1202. Undetermined source 1222B may be the same as undetermined source 1222A or may be a different entity than undetermined source 1222A. In either case, the node executing the locking script has no knowledge of undetermined sources 1222A-1212B prior to executing the locking script.

[0334] In example 1200, locking script 1206 is blank, allowing it to accept data without knowing in advance where the data is coming from or what the data will be. When unlocking transaction 1204 is created (e.g., by undetermined source 1222A), the data (" <d>”). However, such a locking script presents security issues because unlocking transaction 1204 is easily altered (that is, is mutable), such as by undetermined source 1222B before it is confirmed on blockchain 1224 (at which point unlocking transaction 1204 becomes immutable).

[0335] Fig.13 An example 1300 is shown that illustrates how undetermined data from a determined source can be securely provided to a locking script 1306 in an embodiment of the present invention. That is, Fig.13 The example 1300 depicted in FIG. 1306 illustrates a problem that arises when the node executing the locking script 1306 has a priori knowledge of the source that will provide the data (e.g., determining the source 1326) but has no a priori knowledge of what the data will be. In some embodiments, the previous transaction 1302 is similar to Figure 3 302. Likewise, in some embodiments, unlocking transaction 1304 is similar to 304. In some embodiments, blockchain 1324 is similar to Fig.12 Blockchain 1224.

[0336] In example 1300, the locking script 1306 is used to cause the verification node executing the locking script 1306 to check whether the data provided in the unlocking script 1308 has been provided by a determined data source. That is, the private key can be modified based on the data (d) to produce a modified private key (a′) by multiplying the data in the following manner:

[0337] a′=a×d

[0338] The public key (A) corresponding to the unmodified private key can be similarly modified by performing elliptic curve point multiplication to produce a modified public key (A′) as follows:

[0339] A′=d×A

[0340] Thus, the locking script 1306 can be used to cause a verification node to evaluate a signature signed with a private key that is modified based on data using the public key (A) of the source of the data. More specifically, a signature check opcode can be included in the locking script 1306 that checks whether the signature (SigA') signed with the modified private key corresponds to the modified public key and is therefore a valid signature. The check can be performed, for example, by using the OP_CHECKSIG opcode.

[0341] As can be seen in example 1300, execution of the locking script 1306 causes the node to place the public key in the stack and perform an elliptic curve point multiplication operation (OP_ECMULT) between the public key and the data placed in the stack by the previous execution of the unlocking script 1308. The data can then be determined when the unlocking transaction is created by the source specified in the locking script (e.g., determine the source 1326). Therefore, the locking script knows the source that provides the data, but does not know what the data will be. Further execution of the locking script 1306 results in a signature verification result (e.g., if the values ​​match, OP_CHECKSIG returns true) for the data signed using the modified private key (also placed in the stack by the previous execution of the unlocking script 1308). This method is safe because changes to the unlocking transaction 1304 will invalidate the transaction. However, the source of the data must be specified (determine the source 1326). The signature verification algorithm in ECDSA involves checking whether the signature, public key, and message have a specific mathematical relationship. The message can be any data. The verification opcode OP_CHECKSIG prevents any arbitrary data from becoming a message by limiting the message to serialized transactions while still allowing verification that the message comes from a specific source. Embodiments of the present invention provide an alternative solution to this limitation.

[0342] In some embodiments, undetermined source 1322 is an entity that cannot change the data. In some embodiments, determined source 1326 is a known entity when locking script 1306 is generated, so that locking script 1306 includes the public key of determined source 1326.

[0343] Fig.14 An example 1400 is shown that illustrates how undetermined data from an undetermined source can be securely provided into a locking script 1406. Specifically, Fig.14 Depicted is an unlock transaction 1404, which is based on combining Fig.11 In some embodiments, the previous transaction 1402 is similar to Figure 3 302. Likewise, in some embodiments, unlocking transaction 1404 is similar to 304. In some embodiments, blockchain 1424 is similar to Fig.12 Blockchain 1224.

[0344] Example 1400 with Fig.13 The difference between example 1300 and example 1400 is that the data in example 1400 may be undetermined when creating the locking script 1406. The data in question will be embedded somewhere in the previous transaction 1402 and can therefore be accessed by the same method as described above with respect to Figures 8 to 11 The parsing described serializes the previous transaction to extract.

[0345] In this manner, the node executing the locking script 1406 does not need to have prior knowledge of the entity providing the serialized previous transaction, nor does it require the node to have prior knowledge of the previous transaction 1402. Furthermore, the previous transaction 1402 submitted to the blockchain 1424 is already immutable at the time the unlocking transaction 1404 is created, and is therefore immune to change without invalidating the unlocking transaction 1404. However, although the node executing the locking script 1406 does not have prior knowledge of the data, the data is certain at the time the previous transaction 1402 was created.

[0346] In some embodiments, the locking script 1406 is based on Fig.11 In some embodiments, the unlock script 1408 is similar to the script described in the process 1100. Figures 8 to 11 For example, as can be seen in example 1400, unlocking script 1408 includes at least one serialized unlocking transaction field set that serializes the previous transaction, the SIGHASH type, and the unlocking transaction 1404.

[0347] Undetermined source 1422A is an entity that provides data encoded in a serialized previous transaction. Undetermined source 1422B is an entity that attempts to intercept and change unlocking transaction 1404. In some embodiments, undetermined sources 1422A to 1422B can be the same or different entities. As can be seen in example 1400, the identity of undetermined source 1422A does not need to be known when creating locking script 1406. In addition, the data does not need to be known when creating locking script 1406. But undetermined source 1422B is still blocked from changing the data.

[0348] In an embodiment, in addition to the locking script executed by the unlocking transaction 1404, various fields of the previous transaction 1402 can be used to store secure undetermined data, including the amount of the digital asset in the output of the previous transaction 1402 or metadata encoded in the locking script of another output of the previous transaction 1402. Therefore, the embodiment of example 1400 actually allows any entity to embed data in a previous transaction, pay for certain changes to the locking script 1406, and ensure that no other entity can modify the data. This feature is applicable in other embodiments described below.

[0349] Fig.15 1 is a flow chart illustrating an example of a process 1500 for securely providing undetermined data according to various embodiments. Some or all of the process 1500 (or any other process described, or variations and / or combinations of these processes) may be performed under the control of one or more computer systems configured with executable instructions and / or other data, and may be implemented as executable instructions that execute together on one or more processors. The executable instructions and / or other data may be stored on a non-transitory computer-readable storage medium (e.g., a computer program permanently stored on a magnetic, optical, or flash memory medium).

[0350] For example, some or all of process 1500 may be performed by, for example Figure 1 The verification node in the blockchain network of the example blockchain network 100 of the embodiment of the present invention is executed. Such a verification node can be performed by any suitable computing device (e.g., by a server in a data center, by a client computing device, by multiple computing devices in a distributed system of a computing resource service provider, or by, for example, Fig.26 The process 1500 includes a series of operations in which an unverified transaction is received, undetermined data and a second value are obtained due to the execution of an unlocking script, and the undetermined data is verified to be associated with a trusted data source.

[0351] At 1502, the system obtains an unverified transaction from an entity seeking to reassociate at least a portion of a digital asset. The unverified transaction includes a locking script and an unlocking script. The locking script and the unlocking script may be similar to Fig.13 and 14 The locking script and unlocking script shown in . If evaluated to true, the execution of the instruction set will successfully verify the unverified transaction. Therefore, the unlocking script is executed before the locking script, setting the values ​​to be used by the locking script in the main and alternate stacks.

[0352] exist Fig.13 In an embodiment of the present invention, the unlocking script of an unverified transaction includes undetermined data (" <d>”) and the signature of the undetermined data signed with the modified private key ("<SigA'> ”), wherein the modified private key is modified by multiplying the private key of a determined data source (e.g., “Bob”) by the value of the undetermined data using elliptic curve point multiplication. The private key will therefore be a point on the elliptic curve. It should be noted that, as mentioned above, the term “undetermined” in this context means that the data is not specified or otherwise constrained by the locking script itself. In a similar manner, an “undetermined data source” is a data source whose identity is not specified or constrained by the locking script, while a “determined data source” is one whose identity is constrained within the locking script to a specific data source (e.g., by including the data source’s public key). Fig.14 In an embodiment of the present invention, the unlocking script of an unverified transaction includes the undetermined data of the serialized previous transaction, the SIGHASH type, and the serialized unlocking transaction field set. In this way, since the data source is the serialized previous transaction, the data source does not need to be specified or constrained by the locking script itself.

[0353] As a result of execution of the unlocking script followed by the locking script, at 1504, the system obtains undetermined data, as well as a value that can be used to verify the data using a determined or undetermined source associated with the data (e.g., a signature signed using a modified private key, or a serialized unlocking transaction field set from which a transaction identifier can be extracted).

[0354] At 1506, the system verifies the data. For example, Fig.13 In an embodiment of , the system confirms that the data is associated with the public key included in the locking script by modifying the public key with the data using elliptic curve point multiplication (as described above) and verifying that the modified public key is associated with a signature generated using the corresponding private key (which itself was modified using elliptic curve point multiplication). As another example, in Fig.14 In the embodiment of Fig.11 The process 1100 determines whether the hash of the serialized previous transaction matches the transaction ID extracted from the serialized unlocking transaction field set to verify that the data corresponds to a specific previous transaction. It should be noted that one or more operations performed in 1502 to 1506 can be performed in various orders and combinations (including in parallel).

[0355] Fig.16 An example parameterizable smart contract 1600 of an embodiment of the present invention is shown. Specifically, Fig.16 Depicted is a previous transaction 1602 having a locking script 1606 that imposes constraints on an unlocking script 1608 of an unlocking transaction 1604. By recalling the invention in Figures 3 to 6 The description of how to inject the unlock transaction field set determined by the SIGHASH type into the locking script 1606 has been described. Fig.16 Further review Figures 7 to 11 , the present invention describes how the substring opcode can be used to extract the transaction ID to parse the unlocking transaction field set determined by the SIGHASH type before applying constraints to serialize the previous transaction to be injected into the locking script 1606. This process can be extended to handle any field in the unlocking transaction field set.

[0356] It should be noted that Figure 6 and 11 The locking script described in the context of does not impose constraints on the specific entity that creates the unlocking transaction. For example, the locking script does not need to prove whether a specific entity has access to a secret (e.g., a private key, a value that produces a specific hash, etc.). Fig.16 The embodiments of apply this concept indiscriminately with respect to the specific entity that creates the unlocking transaction, but impose certain constraints on how UTXOs are claimed. In this way, Fig.16 Embodiments of the smart contract are self-executing and self-enforcing. In other words, if the conditions of the smart contract are not met (i.e., the specified constraints are not met), the contract will not execute because the verification will fail.

[0357] In some embodiments, smart contracts in the locking script can be made interactive by imposing constraints (e.g., parameters) on the inputs to unlocking transaction 1604 (e.g., requiring input from "Alice"). Because unlocking script 1608 is the source of input to locking script 1606, in embodiments, secure undetermined data in unlocking script 1608 can be used to parameterize smart contracts in locking script 1606. In embodiments, in combination with Figures 13 to 15 The described approach to parameterizing undefined and secure data can protect smart contracts from modification. In an embodiment, the parameterized data is undefined.

[0358] This invention describes two methods for providing secure undetermined data to a locking script (e.g., a smart contract). The first method is to obtain secure undetermined data from a certain source, such as in Fig.13 and 15 A second approach is to obtain secure undetermined data from an undetermined source (e.g., a previous transaction), as described in Figures 14 to 15 In embodiments using the first method, the parameters will be determined by the entity creating the unlocking transaction and will be set when the unlocking transaction is created (e.g., in the unlocking script 1608). In embodiments using the second method, the parameters will be determined by the entity creating the previous transaction and will be set when the previous transaction is created (i.e., embedded in the serialized previous transaction). It should also be noted that in embodiments, the first method and the second method can be combined such that one or more parameters can be embedded in the previous transaction and one or more other parameters can be embedded in the unlocking script of the unlocking transaction.

[0359] The following example is provided to illustrate how these methods can be used to create a smart contract. In the example, a smart contract is created for or by Alice to transfer 70% of her income to her savings and 30% of her income to her investment manager Bob. Her savings account is associated with cryptographic public key A (PubK A), while her account with Bob is associated with cryptographic public key B (PubK B). Alice's employer implements this smart contract, which divides Alice's income in the manner described above on payday. Thus, Alice's income is automatically separated in the way she wants.

[0360] In this example, the parameter is the amount of the digital asset transferred as a result of the execution of the smart contract. The execution of the smart contract will cause the parameters to be extracted from the previous transaction 1602 before determining the constraints on the output of the unlock transaction 1604 according to the above criteria. Table 10 provides example unlocking and locking scripts implementing the above example:

[0361] Table 10:

[0362]

[0363] Fig.17 1700 is a flow chart illustrating an example of a process 1700 for implementing a parameterized smart contract according to various embodiments. Some or all of the process 1700 (or any other process described, or variations and / or combinations of these processes) may be performed under the control of one or more computer systems configured with executable instructions and / or other data, and may be implemented as executable instructions that are executed together on one or more processors. The executable instructions and / or other data may be stored on a non-transitory computer-readable storage medium (e.g., a computer program permanently stored on a magnetic, optical, or flash memory medium).

[0364] For example, some or all of process 1700 may be performed by, for example Figure 1 The verification node in the blockchain network of the example blockchain network 100 of the embodiment of the present invention is executed. Such a verification node can be performed by any suitable computing device (e.g., by a server in a data center, by a client computing device, by multiple computing devices in a distributed system of a computing resource service provider, or by, for example, Fig.26 The process 1700 comprises a series of operations in which constraints are extracted from parameters embedded in secure undetermined data.

[0365] At 1702, the system executes a script that causes injection of a serialized previous transaction (e.g., Fig.16 The script may be a variation of the script from Table 8 or 9. Note that for Fig.16 and 17 Parameterizable smart contracts may not require a complete reference Fig.11 1100 because if the parameter from the undetermined source is not needed, then there may be no need to serialize the previous transaction.

[0366] At 1704, the system extracts the parameters in a manner that depends on whether the source of the parameters is an undetermined source or a determined source. Fig.13 Extracting parameters from the unlocking script 1608 in the manner described above is performed to extract parameters from the data of the determined source. As another example, the unlocking script 1608 may be combined with Fig.14 Extracting parameters from data from an undetermined source is performed in the manner described above by extracting parameters from serialized previous transactions. As another example, if some parameters are embedded in data from an undetermined source and some parameters are received from a determined source, a script can be written to combine Fig.13 and 14 operation, extracting parameters from data both from undetermined and determined sources.

[0367] At 1706, the system derives constraints from the parameters. For example, in the example script of Table 10, the parameter is the amount to be paid to the smart contract, and the derived constraints include determining the amounts (e.g., 70% and 30%) to be transferred to Alice and Bob's pay-to-public-key ("P2PK") addresses. However, it is contemplated that the parameters and constraints that may be derived from the parameters may be numerous and vary beyond the above examples.

[0368] At 1708, the system verifies the constraints against the set of unlock transaction field values ​​determined according to the SIGHASH type. That is, the system verifies that the relevant subset of the unlock transaction complies with the constraints. If the relevant subset of the unlock transaction complies with the constraints, the unlock transaction is confirmed to be valid; otherwise, if the relevant subset of the unlock transaction does not comply with the constraints, the unlock transaction is considered invalid. It should be noted that one or more operations performed in 1702 to 1708 can be performed in various orders and combinations (including in parallel).

[0369] Fig.18 An example 1800 of a problem associated with a repetitive smart contract that is solved by an embodiment of the present invention is shown. That is, in order to create a transaction that is repeated a known number of times (e.g., five times), a known number of unlocking transactions can be created in advance. While this is manageable for a few transactions, for a contract with many repetitive transactions, generating all of the unlocking transactions 1804A to 1804N in advance can become cumbersome and the scripts 1806A to 1806N can become very numerous. In the example, Alice has a certain amount of digital assets whose value can be exchanged for goods or services. Alice has allocated this amount to her son Bob to pay for his daily school lunch. Fig.18 Example 1800 shows that Alice can create unlocking transactions 1804A to 1804N for each of Bob's lunch transactions in advance. Fig.19 As shown, the present invention contemplates alternative solutions available to Alice.

[0370] Fig.19 An example 1900 of a self-replicating smart contract according to an embodiment of the present invention is shown. Fig.19 As shown in , instead of creating a predetermined number of unlocking transactions to obtain a duplicate contract, it is possible to combine Figures 16 to 17 The parameterizable smart contract described above is used to create a self-replicating smart contract 1904 with a termination condition. In this way, in the above example, Alice only needs to create one unlock transaction to consume the initial amount of digital assets in the previous transaction 1902. Unlock transaction 1904A includes a script that causes unlock transaction 1904A to copy itself to the next unlock transaction. The script includes a termination condition that causes unlock transaction 1904N to stop replicating after the termination condition is met (e.g., after n occurrences).

[0371] In one possible implementation, in order to create a transaction chain for a contract, future transactions are created in advance, and the locking script of each transaction embeds the locking script of the subsequent transaction, such as Fig. 20 However, for a self-replicating unlocking transaction, in order to verify that the constraints of the unlocking transaction are not modified, the locking script of each previous transaction (e.g., a smart contract) will need to be securely verified to see if it matches the locking script in the unlocking transaction.

[0372] Fig. 20 Example 2000 illustrates the problem of duplicate transactions solved by an embodiment of the present invention. That is, the locking script of the previous transaction 2002 (locking script 0) merges the locking script of the first unlocking transaction 2004A (locking script 1), and the locking script of the first unlocking transaction 2004A itself merges the locking script of the second unlocking transaction 2004B (locking script 2), and so on, until the last unlocking transaction 2004N. If fully expanded, it is obvious that locking script 0 is different from locking script 1, and locking script 1 is different from locking script 2, and so on. Therefore, example 2000 cannot be said to be self-replicating because the locking scripts are different. This problem can be understood as a problem that stems from self-reference. That is, the locking script will need to embed a copy of itself, thus becoming an endless and unsolvable loop. Therefore, the locking script will be undeterminable. Example 2000 fixes the number of times the loop can be unwound (n), and then assigns the value to the nth lock script, which in turn allows the n-1th lock script to embed the nth lock script, which in turn allows the n-2th lock script to embed the n-1th lock script, etc. However, this will form n different lock scripts.

[0373] Fig.21 An example 2100 of a solution to the problem of a simple implementation of self-replicating transactions is shown. Specifically, Fig.21 A replicating smart contract is depicted, which reduces the amount of digital assets sent to itself by one unit each time and also pays Alice 1 unit of digital assets. That is, the previous transaction 2102 maintains the initial amount X. The first unlocking transaction 2104A pays 1 unit of digital assets to a pay-to-public-key-hash ("P2PKH") address belonging to Alice, outputs a new total (X'=X-1) and copies itself to the second unlocking transaction 2104B. In some examples, P2PK or P2PKH can be used to transfer digital assets directly to the address of an entity associated with a corresponding public key. The second unlocking transaction 2104B also pays 1 unit of digital assets to Alice, outputs a new total (X"=X'-1) and also replicates itself.

[0374] Thus, it can be seen that as the process continues regardless of the initial amount X, an unlock transaction will eventually be generated to output an unconvertible amount of digital assets (e.g., zero). This can be intuitively understood by observing that each subsequent unlock transaction will have a smaller amount of digital assets than its previous transaction, even without deducting the minimum transaction fees deducted in various blockchain protocols. Therefore, the output amount will converge to zero, at which point it becomes meaningless to process the transaction. However, embodiments of the present invention include a solution to this problem by implementing a termination condition to avoid such unconvertible unlock transactions.

[0375] Furthermore, in the embodiments, Fig. 20 The solution to the problem shown in is to have the locking script 1 receive first data (e.g., unlocking transaction data) and second data (e.g., previous transaction data), both of which are embedded with the locking script. In these embodiments, the locking script 1 verifies whether the locking scripts from the first data and the second data match. Then, if the locking script 1 verifies that the second data (previous transaction data) is embedded with the locking script 1, it verifies that the first data is also embedded with the locking script 1.

[0376] A basic overview of such scripts is provided in Table 11 below:

[0377] Table 11:

[0378]

[0379] As can be seen from the above script, the locking script of the previous transaction 2102 has been verified for the locking script of the first unlocking transaction 2104A, and the locking script of the previous transaction 2102 is the locking script that is currently running and will unlock the UTXO. The first unlocking transaction will be redeemed in the future when the current unlocking transaction is the previous transaction of another unlocking transaction (for example, the second unlocking transaction 2104B). Fig.18 and 20 As shown, instead of creating a different unlocking transaction for each transaction, the script forces each locking script to be the same. If the locking script of the previous transaction 2102 is the same as the locking script (e.g., the first unlocking transaction 2104A) that the second unlocking transaction 2104B will try to unlock, then the locking script is guaranteed to be authentic.

[0380] In an embodiment, the termination condition avoids the situation where there is not enough funds for a previous transaction but the locking script is still verified; i.e., an unconvertible transaction. For example, a termination condition can be implemented to verify whether there is enough digital assets to perform the next transaction, otherwise the verification is terminated. As a more specific example, if the initial pool includes 365 units of digital assets plus the amount required for each transaction fee (e.g., enough to conduct one transaction per day for a year), the termination condition can verify that the remaining number of units exceeds the number required to complete the transaction; for example, as long as there are sufficient funds, the transaction can continue to be verified. Otherwise, if there are insufficient funds, the termination condition is met and the verification is terminated. Therefore, if there are insufficient funds on the 366th day, it is confirmed that the locking script for the 366th unlocking transaction is not needed, and the termination condition ensures that it terminates the self-replication of the locking script.

[0381] Fig. 22 2200 for a self-replicating smart contract with a termination condition according to various embodiments. Some or all of process 2200 (or any other process described, or variations and / or combinations of these processes) may be performed under the control of one or more computer systems configured with executable instructions and / or other data, and may be implemented as executable instructions that are executed together on one or more processors. The executable instructions and / or other data may be stored on a non-transitory computer-readable storage medium (e.g., a computer program permanently stored on a magnetic, optical, or flash memory medium).

[0382] For example, some or all of process 2200 may be performed by, for example Figure 1 The verification node in the blockchain network of the example blockchain network 100 of the embodiment of the present invention is executed. Such a verification node can be performed by any suitable computing device (e.g., by a server in a data center, by a client computing device, by multiple computing devices in a distributed system of a computing resource service provider, or by, for example, Fig.26 The process 2200 includes a series of operations, wherein if the termination condition is not met, the locking scripts of the unlocking transaction and the previous transaction are verified to be the same, and other constraints are verified.

[0383] At 2202, the system receives an unverified transaction. The system begins by running the unlocking script of the unverified transaction, and then begins executing the locking script of the previous (verified) transaction associated with the digital asset referenced by the unverified transaction. Process 2200 is depicted as a variation of executing the example script of Table 11. For example, at 2204, the system executing process 2200 determines whether a termination condition is met. As described above, in an implementation, the termination condition may be met if the amount of the digital asset is insufficient to complete the transaction. However, it is contemplated that other termination conditions are also possible. For example, the termination condition may be time-based; if the unverified transaction is not verified before a specific date, the termination condition may be met.

[0384] When the termination condition is met, process 2200 terminates and verification ends at 2206. Otherwise, the system extracts the first locking script from the unverified transaction at 2208. It should be noted that the first locking script is the locking script that will be executed after the current unverified transaction is verified, when another unverified transaction attempts to transfer the UTXO of the current transaction.

[0385] At 2210, the system extracts a second locking script from the serialized previous transaction. In this embodiment, the second locking script is a copy of the currently executing locking script. At 2212, the system performing process 2200 determines whether the first locking script matches the second locking script (e.g., whether the two locking scripts are identical). If the locking scripts do not match, then at 2214, the system determines that the unverified transaction has failed verification and remains unverified.

[0386] Otherwise, at 2216, the system verifies any remaining constraints in the script (e.g., verifying a digital signature or other requirement of a previous transaction). If there are no remaining constraints, or if all remaining constraints have been successfully verified, the transaction is successfully verified. Upon successful verification, the transaction can be added to the blockchain. It should be noted that one or more of the operations performed in 2202 to 2216 can be performed in various orders and combinations, including in parallel.

[0387] Fig.23 An example 2300 of a problem solved by an embodiment of the present invention is shown. Specifically, Fig.23 A state machine is depicted that uses blockchain transactions to transition from a first state to a second state. In some examples, the state transitions of the state machine are interpreted as determining the next state given a current state, one or more inputs 2326, and a state rule set 2306. Fig.23 Example 2300 shows a previous transaction 2302 with a state rule set 2306 and a first state 2328A embedded in the parameters. In some embodiments, unlock transaction 2304 is created to accept input 2326 from a determined source. Input 2326 in combination with first state 2328A can be used to determine a second state 2328B embedded in the parameters of unlock transaction 2304 with reference to state rule set 2306.

[0388] In an embodiment, the state rule set is a state transition matrix, which can be combined with Fig.16 and 17 The described approach is represented by constraints on the unlock transaction 2304. In such embodiments, the constraints are parameterized by the current state and the inputs from which the next state is determined. The constraints include checks to ensure that the unlock transaction 2304 includes a next state value in a specific field.

[0389] In an embodiment, the current state is represented as a parameter embedded in the transaction, and the unlock transaction 2304 will have a next state value also embedded in the unlock transaction 2304. The next state value is the current state of the smart contract within the field value set of the unlock transaction 2304, which is accessible when the unlock transaction 2304 is created, as described above. In some embodiments, at least one input is provided as external data in the parameters determined when the unlock transaction 2304 is created. For security reasons, such parameters come from a deterministic source. This provides a deterministic state transition. Finally, by adopting the above in combination with Figures 18 to 22 The script of the self-replicating smart contract described above can create an untrusted deterministic state machine embodiment. In some examples, "untrusted" refers to the property that any entity can create a valid unlocking transaction as long as the constraints are met; however, in some cases, the entity may need to interact with a deterministic source to obtain the required input. It should be noted that although combined with Figures 23 to 25 Various embodiments described refer to obtaining inputs from determined sources, but it is contemplated that in some embodiments one or more inputs may be obtained from an undetermined source (eg, from serializing previous transactions).

[0390] Fig.24 An example 2400 of an untrusted deterministic state machine according to an embodiment of the present invention is shown. Fig.24 As shown, example 2400 may include a previous transaction 2402 at a first state 2428A ("S1") in a state rule set 2406. In example 2400, state rule set 2406 provides two possible states 2430A ("S2" or "S3") for the next state. As can be seen in example 2400, unlock transaction 2404 takes as input the input 2426 in its unlock script and the first state 2428A ("S1") in the set of field values ​​embedded in previous transaction 2402, and determines the appropriate second state 2428B ("S2") according to state rule set 2406. As further seen in example 2400, the state transition matrix now provides possible new states 2430B ("S4" or "S5") for the next state transition from second state 2428B. Note that the state rule set 2406 can be encoded as a switch statement or other conditional statement (e.g., "if-then-else") parameterized by the current state and one or more inputs.

[0391] In an embodiment, in a self-replicating locking script, each possible state is represented in a set of rules for state changes (e.g., a state transition matrix), and a particular transaction represents a state machine in a particular state. In such embodiments, the locking script of a transaction is copied to each unlocking transaction that attempts to transfer control of the digital asset to the next transaction, which must be linked to the current transaction. This process is repeated until the termination condition is met. Because the input is not fixed and can be undetermined data, the state of the state machine can be changed based on specific external inputs. Therefore, the undetermined data provides input that may affect the next state.

[0392] In an illustrative example, Alice lends Bob some money, and Bob agrees to repay Alice. As described in the present invention, an untrusted deterministic state machine can be implemented as a smart contract to represent the transfers made by Bob to Alice. For example, a smart contract can be constructed so that Bob pays Alice monthly for the next three months, and if the payment is overdue, Bob's debt will enter the debt collection phase. Therefore, as long as Bob makes a monthly transfer, the current state remains in the repayment state. However, an external entity provides input indicating that Bob has overdue transfers, and the state then shifts to the overdue non-transferred state. In the overdue non-transferred state, Alice can release the transaction and hand it over to the debt collector, after which the untrusted deterministic state machine switches to the debt collection state. In the debt collection state, the debt collector will collect the debt from Bob. It can be used Figures 23 to 25 Such smart contracts can be created using variations of the scripts of the embodiments depicted in .

[0393] In another example, Alice is a very charitable person who donates 1 unit of digital assets every month. Her rule is that anyone can claim digital assets, but only 1 unit per month. Alice creates a smart contract in the manner described in the present invention and seeds it with an initial pool of 3 units of digital assets. Alice can construct a script that allows any entity to collect 1 unit of digital assets per month. The remainder of the digital assets will be copied to subsequent smart contracts. The following table shows an example of unlocking and locking scripts that implement the trustless deterministic state machine of the present invention.

[0394] Table 12:

[0395]

[0396] Fig.25 25 is a flow chart illustrating an example of a process 2500 for an untrusted deterministic state machine according to various embodiments. Some or all of process 2500 (or any other process described, or variations and / or combinations of these processes) may be performed under the control of one or more computer systems configured with executable instructions and / or other data, and may be implemented as executable instructions that execute together on one or more processors. The executable instructions and / or other data may be stored on a non-transitory computer-readable storage medium (e.g., a computer program permanently stored on a magnetic, optical, or flash memory medium).

[0397] For example, some or all of process 2500 may be performed by, for example Figure 1 The verification node in the blockchain network of the example blockchain network 100 of the embodiment of the present invention is executed. Such a verification node can be performed by any suitable computing device (e.g., by a server in a data center, by a client computing device, by multiple computing devices in a distributed system of a computing resource service provider, or by, for example, Fig.26 The process 2500 includes a series of operations in which the locking script of the self-replicating smart contract is verified, the current state is obtained from the serialized previous transaction, the input is obtained from the unlocking script, and the next state is determined based at least in part on the state rule set. The process 2500 reflects a variation of the example script seen in Table 12.

[0398] At 2502, the system receives an unlock transaction. The system begins by running the unlock script of the unlock transaction, which causes the inputs serialized from the previous transaction and embedded in the lock script to be placed on the stack. These inputs are retrieved at 2512. At 2504, the system executing process 2500 determines whether a termination condition is satisfied. The termination condition can be, for example, a combination of Figures 19 to 22 The termination condition described. In an embodiment, the termination condition is a condition that causes the state machine transition to end when satisfied. If the termination condition is satisfied, the system executing process 2500 proceeds to 2506, after which the untrusted deterministic state machine stops self-replication.

[0399] In 2508, the system Fig. 22 Verify whether the previous transaction locking script matches the unlocking transaction locking script in the manner described in 2212 of . If the locking scripts do not match, the verification fails and the unlocking transaction is not verified. Otherwise, if the locking scripts match, then at 2510, the system extracts the current state of the possible state set from the serialized previous transaction. At 2512, due to the execution of the locking script, the system obtains one or more inputs placed in the stack. Then, at 2514, the system applies the state rule set to determine the next state of the possible state set of the untrusted deterministic state machine based on the current state and one or more inputs. At 2516, the system verifies that the next state (e.g., state variables and other state-related data, if applicable) is embedded in the unlocking transaction. The system can also apply any remaining constraints specified in the locking script. After successfully completing the operations from 2502 to 2516, the process ends with 2500, after which the system executing the process can regard the unlocking transaction as valid. It should be noted that one or more operations performed in 2502 to 2518 can be performed in various orders and combinations (including in parallel).

[0400] It should be noted that in the context of describing the disclosed embodiments, unless otherwise specified, the use of expressions about executable instructions (also referred to as code, applications, agents, etc.) that perform operations that "instructions" do not typically perform independently (e.g., transferring data, computing, etc.) means that a machine is executing the instructions, causing the machine to perform the specified operations.

[0401] Fig.26 is a schematic simplified block diagram of a computing device 2600 that can be used to practice at least one embodiment of the present invention. In various embodiments, computing device 2600 can be used to implement any of the systems shown and described above. For example, computing device 2600 can be configured to function as a data server, a network server, a portable computing device, a personal computer, or any electronic computing device. Fig.26 As shown, the computing device 2600 may include one or more processors 2602, which may be configured to communicate with multiple peripheral subsystems through a bus subsystem 2604 and be operably connected to multiple peripheral subsystems. The processor 2602 may be used to traverse the decision tree in the random forest of the supervised model in an embodiment of the present invention (e.g., to evaluate the reverse document frequency of various search terms, etc.). These peripheral subsystems may include a storage subsystem 2606, which includes a memory subsystem 2608 and a file / disk storage subsystem 2610, one or more user interface input devices 2612, one or more user interface output devices 2614, and a network interface subsystem 2616. Such a storage subsystem 2606 can be used for temporary or long-term storage of information, such as details associated with the transactions described in the present invention, a database of historical records described in the present invention, and storage of decision rules of the supervised model in the present invention.

[0402] The bus subsystem 2604 may provide a mechanism for enabling the various components and subsystems of the computing device 2600 to communicate with each other as intended. Although the bus subsystem 2604 is schematically shown as a single bus, alternative embodiments of the bus subsystem may utilize multiple buses. The network interface subsystem 2616 may provide an interface to other computing devices and networks. The network interface subsystem 2616 may be used as an interface for the computing device 2600 to receive data from other systems and to transmit data to other systems. For example, the network interface subsystem 2616 may enable a data technician to connect the device to a wireless network so that the data technician can transmit and receive data when in a remote location (e.g., a user data center). The bus subsystem 2604 may be used to communicate data such as details, search terms, etc. to the supervisory model of the present invention, and may be used to communicate the output of the supervisory model to one or more processors 2602 and to merchants and / or creditors through the network interface subsystem 2616.

[0403] The user interface input devices 2612 may include one or more user input devices, such as a keyboard; a pointing device, such as an integrated mouse, trackball, touchpad, or graphics tablet; a scanner; a barcode scanner; a touch screen incorporated into a display; an audio input device, such as a voice recognition system, a microphone; and other types of input devices. In general, the use of the term "input device" is intended to include all possible types of devices and mechanisms for inputting information to the computing device 2600. One or more user interface output devices 2614 may include a display subsystem, a printer, or a non-visual display, such as an audio output device, etc. The display subsystem may be a cathode ray tube (CRT), a flat panel device, such as a liquid crystal display (LCD), a light emitting diode (LED) display, or a projection or other display device. In general, the use of the term "output device" is intended to include all possible types of devices and mechanisms for outputting information from the computing device 2600. One or more user interface output devices 2614 may be used, for example, to present a user interface to facilitate user interaction with an application, performing the described processes and variations thereof when such interaction may be appropriate.

[0404] Storage subsystem 2606 can provide computer-readable storage media for storing basic programming and data structures that can provide the functions of at least one embodiment of the present invention. When executed by one or more processors, applications (programs, code modules, instructions) can provide the functions of one or more embodiments of the present invention and can be stored in storage subsystem 2606. These application modules or instructions can be executed by one or more processors 2602. Storage subsystem 2606 can additionally provide a repository for storing data used according to the present invention. Storage subsystem 2606 can include memory subsystem 2608 and file / disk storage subsystem 2610.

[0405] The memory subsystem 2608 may include a plurality of memories, including a main random access memory (RAM) 2618 for storing instructions and data during program execution, and a read-only memory (ROM) 2620 that may store fixed instructions. The file / disk storage subsystem 2610 may provide non-transitory permanent (non-volatile) storage for program and data files, and may include a hard disk drive, a floppy disk drive and associated removable media, a compact disk read-only memory (CD-ROM) drive, an optical drive, removable media cartridges, and other similar storage media.

[0406] The computing device 2600 may include at least one local clock 2624. The local clock 2624 may be a counter that indicates the number of ticks that have occurred since a specific start date, and may be integrally located within the computing device 2600. The local clock 2624 may be used to synchronize data transfers in the processors of the computing device 2600 and all subsystems included therein with specific clock pulses, and may be used to coordinate synchronization operations between the computing device 2600 and other systems in the data center. In one embodiment, the local clock 2624 is an atomic clock. In another embodiment, the local clock is a programmable interval timer.

[0407] The computing device 2600 can be of various types, including a portable computer device, a tablet computer, a workstation, or any other device described below. In addition, the computing device 2600 can include another device that can be connected to the computing device 2600 through one or more ports (e.g., USB, headphone jack, lightning port, etc.). The device that can be connected to the computing device 2600 can include multiple ports configured to accept fiber optic connectors. Therefore, this device can be configured to convert optical signals into electrical signals, which can be transmitted through the port connecting the device to the computing device 2600 for processing. Due to the ever-changing nature of computers and networks, Fig.26 The description of the computing device 2600 depicted in FIG. 2 is intended to illustrate a specific example of a preferred embodiment of the device. Fig.26 Many other configurations of more or fewer components of the systems depicted are possible.

[0408] Therefore, the description and drawings should be regarded as illustrative rather than restrictive. However, it is obvious that various modifications and changes can be made thereto without departing from the scope of the invention as set forth in the claims. Likewise, other variations are also within the scope of the invention. Therefore, although the disclosed technology is susceptible to various modifications and alternative constructions, some of its illustrated embodiments are shown in the drawings and have been described in detail above. However, it should be understood that there is no intention to limit the invention to the specific form disclosed, on the contrary, the purpose is to cover all modifications, alternative constructions and equivalents that fall within the scope of the invention as defined in the appended claims.

[0409] The use of the terms "a" and "an" and "the" and similar referents in describing the disclosure (especially in the context of the following claims) are to be construed to cover both the singular and the plural, unless otherwise indicated herein or clearly contradicted by context. Unless otherwise noted, the terms "comprising," "having," "including," and "containing" are to be construed as open-ended terms (i.e., meaning "including, but not limited to,"). The term "connected," when unmodified and referring to a physical connection, should be construed as partially or fully contained, attached, or joined together, even if there are some intervening conditions. Recitation of ranges of values ​​in the present disclosure is merely intended to serve as a shorthand method of referring individually to each separate value falling within the range, unless otherwise indicated, and each separate value is incorporated into the specification as if individually recited. Use of the term "set" (e.g., "a set of items") or "subset" should be construed as a non-empty set that includes one or more components, unless otherwise noted or contradicted by context. Further, the term "subset" of a corresponding set does not necessarily mean a proper subset of the corresponding set, but rather a subset and the corresponding set may be the same, unless otherwise noted or contradicted by context.

[0410] Unless expressly stated otherwise or clearly contradicted by context, conjunction language, such as phrases of the form "at least one of A, B, and C" or "at least one of A, B, and C," is otherwise understood by context to be generally used to indicate that an item, term, or the like, may be A or B or C, or any non-empty subset of the set of A and B and C. For example, in the illustrative example of a set having three components, the conjunction phrases "at least one of A, B, and C" and "at least one of A, B, and C" refer to any of the following sets: {A}, {B}, {C}, {A, B}, {A, C}, {B, C}, {A, B, C}. Thus, such conjunction language is generally not meant to imply that certain embodiments require that at least one A, at least one B, and at least one C are all present.

[0411] Unless otherwise specified or clearly contradicted by the context, the operations of the described processes may be performed in any suitable order. The described processes (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) that is executed together on one or more processors by hardware or a combination thereof. The code may be stored on a computer-readable storage medium, for example, in the form of a computer program that includes a plurality of instructions that may be executed by one or more processors. The computer-readable storage medium may be non-transitory.

[0412] Unless otherwise required, the use of any and all examples or exemplary language (e.g., "such as") provided is intended merely to better illustrate embodiments of the invention and does not impose limitations on the scope of the invention. No language in this specification should be construed as indicating any non-claimed element as essential to the practice of the invention.

[0413] Embodiments of the present invention are described, including the best mode known to the inventor for implementing the present invention. After reading the foregoing description, variations of these embodiments will become apparent to those of ordinary skill in the art. The inventor expects that skilled artisans will appropriately adopt these variations, and the inventor intends to practice the embodiments of the present invention in a manner different from that specifically described. Therefore, the scope of the present invention includes all modifications and equivalents of the subject matter recited in the appended claims as allowed by applicable law. In addition, unless otherwise stated or the context is clearly contradictory, any combination of all possible variations of the above elements is included within the scope of the present invention.

[0414] All references, including publications, patent applications, and patents, cited are hereby incorporated by reference to the same extent as if each reference were individually and specifically indicated to be incorporated by reference and were set forth in its entirety.

[0415] It should be noted that the embodiments mentioned above illustrate the invention rather than limit it, and that a person skilled in the art will be able to design many alternative embodiments without departing from the scope of the invention as defined by the appended claims. In the claims, any reference numerals placed in parentheses shall not be interpreted as limiting the claims. The words "comprising, compries" and the like do not exclude the presence of elements or steps other than those listed in any claim or the entire specification. In this specification, "comprises" means "includes or consists of", and "comprising" means "including or consists of". A singular reference to an element does not exclude a plural reference to such an element, and vice versa. The present invention can be implemented by hardware comprising several different elements and by a suitably programmed computer. In a device claim listing several components, several of these components can be implemented by the same object in hardware. The mere fact that certain measures are described in different dependent claims does not indicate that the combination of these measures cannot be used to obtain the effect.< / d> < / d> < / m>

Claims

1. A computer-implemented method comprising: i) receiving, at a node in a blockchain network, a first transaction for transferring control of a digital asset, the first transaction comprising a first script, the first script being executed so that the node at least: obtains a first field value set of the first transaction, the first field value set comprising a third script; and obtains a second field value set of a second transaction, the second field value set comprising a copy of a second script; ii) obtaining a second transaction, the second transaction comprising a second script, the second script being executed so that the node at least: obtains the third script from the first field value set due to determining that a termination condition is not satisfied; and determining that the copy of the second script matches the third script; as well as iii) Transferring control of the digital asset as a result of the execution of the first script and the second script.

2. The method according to claim 1, wherein: The second transaction is a transaction associated with the digital asset.

3. The method according to claim 1, wherein: The first transaction is a transaction that re-associates at least a portion of the digital asset from a first entity to a second entity.

4. The method according to claim 1, wherein: The first script may be an unlocking script for satisfying a condition set of the second script.

5. The method according to claim 1, wherein: The second script may be a locking script that imposes a set of conditions for validating the first transaction.

6. The method according to claim 1, wherein: The third script may be a locking script that imposes a set of conditions for validating future transactions.

7. The method according to claim 1, wherein: Transferring control of the digital asset may include reassociating the digital asset from the first entity to the second entity.

8. The method according to claim 1, wherein: Determining that a termination condition is not satisfied may include determining that the amount of digital assets associated with the second transaction is sufficient to reassociate at least a portion of the digital assets.

9. The method according to claim 1, wherein: The third script is embedded in the field values ​​of the first set of field values.

10. The method according to claim 1, wherein: The blockchain network consists of distributed electronic devices running blockchain protocol instances.

11. The method according to claim 1, wherein: The transfer of control of the digital asset is performed without verifying whether the entity creating the first transaction has access to the secret information.

12. The method according to claim 1, wherein: As another condition for transferring control of the digital asset, the second script further causes the node to verify that the first transaction complies with additional constraints.

13. The method according to claim 1, wherein: The first transaction and the second transaction are components of a set of repeating smart contracts associated with the digital asset.

14. The method according to claim 1, wherein: A set of repeating smart contracts can be terminated by a termination condition.

15. A system, comprising: processor; and a memory comprising executable instructions, which, due to being executed by the processor, cause the system to perform the method according to claim 1.

16. A non-transitory computer-readable storage medium having executable instructions stored thereon, the executable instructions causing the computer system to at least perform the method according to claim 1 when executed by a processor of the computer system.

17. A computer-implemented method comprising: i) receiving, at a node in a blockchain network, a first transaction for transferring control of a digital asset, wherein the first transaction includes a first script, and the first script, when executed, enables the node to obtain at least a first field value set of the first transaction, a second field value set of a second transaction, and an input; ii) obtaining a second transaction, the second transaction comprising a second script, the second script comprising a set of rules, the second script, as a result of being executed, causing the node to at least: verify that the second script matches a third script embedded in the first set of field values; determining a current state based at least in part on the second set of field values; and determining a next state based at least in part on the current state, the input, and the rule set; verifying that the next state is included in the first field value set; as well as iii) Transferring control of the digital asset as a result of the execution of the first script and the second script.

18. A system, comprising: processor; and a memory comprising executable instructions, the executable instructions causing the system to perform the method according to claim 17 due to execution by the processor.

19. A non-transitory computer-readable storage medium having executable instructions stored thereon, the executable instructions causing the computer system to at least perform the method according to claim 17 when executed by a processor of the computer system.

20. A computer-implemented method comprising: i) receiving, at a node in a blockchain network, a first transaction for transferring control of a digital asset, wherein the first transaction includes a first script, and the first script, when executed, enables the node to obtain at least a first field value set of the first transaction, a second field value set of a second transaction, and an input; ii) obtaining a second transaction, the second transaction comprising a second script, the second script comprising a set of rules, the second script, as a result of being executed, causing the node to at least: verify that the second script matches a third script embedded in the first set of field values; determining a current state based at least in part on the second set of field values; and determining a next state based at least in part on the current state, the input, and the rule set; verifying that the next state is included in the first field value set; as well as Control of the digital asset is transferred as a result of execution of the first script and the second script.

21. A system, comprising: processor; and a memory comprising executable instructions, which, due to execution by the processor, cause the system to perform the method according to claim 20.

22. A non-transitory computer-readable storage medium having executable instructions stored thereon, the executable instructions causing the computer system to at least perform the method according to claim 20 when executed by a processor of the computer system.