Securing block chain transactions based on undetermined data

By using public keys and private keys of undetermined data sources in blockchain technology to perform limited field arithmetic operations and generate modified public keys and private keys, the problem of data unavailability in locking and unlocking scripts is solved, and block implementation is realized. The security and flexibility of chain transactions allow unavailable data to be used for unlocking when locked, enhancing the control of the blockchain network.

CN118694520APending Publication Date: 2024-09-24NCHAIN HLDG LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410747459.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2017-04-10
Filing Date
2018-04-06
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

In existing blockchain technology, locking and unlocking scripts require the data to be deterministic, and blockchain transactions based on undetermined data cannot be effectively processed, resulting in the inability to unlock digital assets when the data is not available at the time of locking but is expected to be available.

Method used

By using the public key and private key of the undetermined data source in the locking script to perform finite field arithmetic operations, the modified public key and private key are generated, which are used to evaluate the signature in the unlocking script to ensure that the source and content of the data meet the requirements of the locking script. Constraints to unlock and spend digital assets in the blockchain network.

Benefits of technology

It realizes the unlocking and spending of blockchain transactions based on undetermined data, enhances the security and control of blockchain transactions, allows unavailable data to be unlocked when locked, and improves the flexibility and control of the blockchain network. Security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118694520A
    Figure CN118694520A
Patent Text Reader

Abstract

A computer-implemented method for locking blockchain transactions based on undetermined data is described. The method is implemented by using a block chain network. The lock node may include a lock script in the blockchain transaction for locking the digital asset. The lock script includes a public key for determining a data source and instructions to cause a verification node executing the lock script to verify the data source provided in the unlock script in the following manner: a) generating a modified public key based on the public key for determining the data source and based on data defined in the unlock script; and b) evaluating the encrypted signature in the unlocking script based on the modified public key. And the block chain transaction containing the locking script is sent to the block chain network by the locking node. The lock may be removed using a cryptographic signature generated from a private key modified based on the data.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the PCT national phase application with a filing date of April 6, 2018 and national application number 201880024000.1. Technical Field

[0002] The present invention generally relates to digital locks, and more particularly to methods and systems for locking digital assets based on undetermined data from a determined data source. The present invention is particularly suitable, but not limited to, for providing conditional unlocking of digital assets on a blockchain network based on data that was not available to the locker at the time the digital asset was locked. Background Art

[0003] In this article, we use the term 'blockchain' to include all forms of electronic, computer-based distributed ledgers. These include, but are not limited to, blockchain and transaction chain technologies, permissioned and permissionless ledgers, shared ledgers, and their variations.

[0004] A blockchain is a consensus-based electronic ledger implemented as a computer-based, decentralized, distributed system consisting of blocks, which in turn consist of transactions and other information. Each transaction can transfer control of digital assets between participants in a blockchain system and can include at least one input and at least one output. Each block contains a hash of the previous block, so that blocks are linked together to create a permanent, unchangeable record of all transactions written to the blockchain since its creation. Transactions contain small programs called scripts embedded in their inputs and outputs that specify how and by whom the outputs of the transaction can be accessed. These scripts can be written using a stack-based scripting language.

[0005] In order for a transaction to be written to the blockchain, it must be "validated". Validity is determined by nodes based on a common set of rules used by the majority of nodes with block generation capabilities. For example, some network nodes may perform work to ensure that each transaction is valid by rejecting invalid transactions from the network. For example, a software client installed on a node performs validation work on unspent transactions (UTXO) by executing lock and unlock scripts. Validation can be performed by executing its lock and unlock scripts. If the calculation result of executing the lock and unlock scripts is correct (TRUE), and if certain other conditions are met, the transaction is valid and the transaction can be written to the blockchain. Therefore, in order for a transaction to be written to the blockchain, it must i) be validated by the node that receives the transaction - if the validation passes, the node relays it to other nodes in the network; ii) be added to a new block built by the network nodes; and iii) be mined, that is, added to the public ledger of past transactions. A transaction is considered confirmed when a sufficient number of blocks are added to the blockchain to make the transaction effectively irreversible.

[0006] A transaction output includes a digital asset and a locking script, which may also be referred to as an encumbrance or lock. The locking script locks the digital asset by specifying the conditions that need to be met in order to spend the output. For example, the locking script may require certain data to be provided in the unlocking script to unlock the associated digital asset. Traditional techniques for requiring the locked party to provide data to unlock the digital asset involve embedding a hash of the data into the locking script. However, this locking and unlocking technique requires that the data be deterministic (i.e., known and fixed) when the locking script is created.

[0007] It would therefore be desirable to provide improved methods and apparatus that improve blockchain technology in one or more of these aspects. Summary of the invention

[0008] Thus, according to the present invention, there is provided a method as defined in the accompanying claims.

[0009] As will be described in greater detail below, a computer implemented method and electronic device are used to lock a transaction based on undetermined data.

[0010] Therefore, according to the present invention, a computer-implemented method (and corresponding system) may be provided. The method may be described as a security and / or control method. The method may be used to control how and / or by whom an output in a blockchain transaction (TX) is unlocked and spent via a blockchain network. The spending of the output enables the transfer of cryptocurrency. The present invention may provide a method (and corresponding system) for modifying an encrypted public key embedded in a locking script of a blockchain transaction (Tx) using undetermined data provided in an unlocking script of another transaction. The present invention may allow blockchain transactions to be protected based on undetermined data. That is, the present invention may allow blockchain transactions to be locked based on data that is not available when the lock is applied to the blockchain transaction but is expected to be available in the future.

[0011] A method according to an embodiment of the present invention may include: i) a node in a blockchain network includes a locking script in a transaction (i.e., a blockchain transaction) for blocking (i.e., locking) a digital asset associated with the transaction (i.e., a blockchain transaction), the locking script including a public key for determining a data source, and including instructions for causing a verification node that executes the locking script to verify the data source provided in an unlocking script in the following manner: a) generating a modified public key based on the public key for determining the data source and based on data defined in the unlocking script; b) evaluating a signature (i.e., an encrypted signature) in the unlocking script based on the modified public key; and ii) sending the transaction (i.e., the blockchain transaction) to the blockchain network by the node.

[0012] In some embodiments, the locking script further defines one or more data constraints, and the locking script further includes instructions that cause the verification node to invalidate a transaction (i.e., a blockchain transaction) including the unlocking script when the data does not satisfy the one or more data constraints. In some embodiments, the one or more data constraints define one or more values ​​and a comparison function that performs a comparison based on the data and the one or more values.

[0013] In some embodiments, instructions for configuring a verification node to evaluate a signature (i.e., an encrypted signature) in an unlocking script based on a modified public key are used to cause the verification node to invalidate a transaction (i.e., a blockchain transaction) including the unlocking script when the signature (i.e., the encrypted signature) is not generated using a modified private key associated with the determined data source. The modified private key can be generated by the determined data source based on the private key for the determined data source and based on the data.

[0014] In some embodiments, the locking script is used to cause a validating node to generate a modified public key by performing operations corresponding to the operations used to generate the modified private key.

[0015] In some embodiments, the modified private key is a key generated by performing a finite field arithmetic operation based on the data and a private key used to determine the source of the data.

[0016] In some embodiments, the instructions are used to cause the verification node executing the locking script to generate a modified public key by performing an elliptic curve finite field arithmetic operation based on the data and the public key for determining the data source. In some embodiments, the elliptic curve finite field arithmetic operation performs elliptic curve multiplication with a scalar.

[0017] In some embodiments, the locking script is also configured to include instructions for removing the barrier (ie, lock) on the digital asset by the node after a defined period of time.

[0018] According to the present invention, a computer-implemented method may be provided, the method comprising: a) generating, by a node, a modified private key based on data and a private key; b) using the modified private key to generate a signature (i.e., an encrypted signature) for a transaction referencing a digital asset blocked (i.e., locked) by a locking script; c) adding the (encrypted) signature and data to a (blockchain) transaction; and d) passing the (blockchain) transaction to another node.

[0019] In some embodiments, generating the modified private key includes performing a finite field arithmetic operation on the data and the private key. In some embodiments, the finite field arithmetic operation performs a multiplication.

[0020] In some embodiments, the locking script specifies a public key for determining a data source, and includes instructions that cause a verification node executing the locking script to evaluate the data source provided in the unlocking script by: a) generating a modified public key based on the public key for determining the data source and based on data defined in the unlocking script; b) evaluating the signature (i.e., encrypted signature) in the unlocking script based on the modified public key.

[0021] According to the present invention, an electronic device may be provided. The electronic device includes an interface device, a processor connected to the interface device, and a memory connected to the processor. The memory stores computer executable instructions, which configure the processor to perform the method described herein when executed.

[0022] According to the present invention, a computer-readable storage medium may be provided, wherein the computer-readable storage medium includes computer-executable instructions, which, when executed, configure a processor to perform the method described herein.

[0023] According to the present invention, a computer-readable storage medium may be provided, the computer-readable storage medium comprising a locking script, the locking script comprising computer-executable instructions, which when executed configure a processor to perform the functions of the locking script described herein. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] These and other aspects of the invention will become apparent 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:

[0025] Figure 1 A block diagram of an example blockchain network is shown.

[0026] Figure 2 A block diagram of an example electronic device that may be used as a node in a blockchain network is shown.

[0027] Figure 3 is a flow chart of an example method for configuring a transaction using a locking script.

[0028] Figure 4 is a flow diagram of an example method for configuring a proposed transaction with signatures required by a locking script.

[0029] Figure 5 is a flow chart of an example method for verifying a transaction associated with a digital asset locked by a locking script. DETAILED DESCRIPTION

[0030] First refer to Figure 1 , Figure 1 An example blockchain network 100 associated with a blockchain is shown in block diagram form. Distributed electronic devices running an instance of a blockchain protocol under which the blockchain network 100 operates can participate in the blockchain network 100. Such distributed electronic devices can be referred to as nodes 102.

[0031] The electronic devices that run the blockchain protocol and form the nodes 102 of the blockchain network 100 may be of various types, including, for example, computers such as desktop computers, laptop computers, tablet computers, servers, mobile devices such as smart phones, wearable computers such as smart watches, or other electronic devices.

[0032] The nodes 102 of the blockchain network 100 are connected to each other using suitable communication technologies, which may include wired communication technologies and wireless communication technologies. Such communication complies with the protocol associated with the blockchain.

[0033] Nodes 102 maintain a global ledger of all transactions on the blockchain. Therefore, the global ledger is a distributed ledger. Each node 102 can store a complete copy or a partial copy of the global ledger. Transactions made by nodes 102 that affect the global ledger are verified by other nodes 102 so that the validity of the global ledger is maintained. When the blockchain is a proof-of-work blockchain, the blocks are also verified by checking the proof of work submitted with the blocks.

[0034] At least some of the nodes 102 operate as network nodes 104 of the blockchain network 100 . Figure 1 The blockchain network 100 of is a proof-of-work blockchain in which network nodes 104 perform expensive computations to facilitate transactions on the blockchain. For example, a proof-of-work blockchain may require a network node to solve a cryptographic problem. When the network node 104 finds a nonce, it can cause the block header to hash with double SHA-256 to a number less than a value defined by the current difficulty. The hashing power required by the proof-of-work algorithm means that a transaction is effectively considered irreversible after a certain number of blocks have been mined on top of the transaction. The network node 104 that solves the cryptographic problem creates a new block for the blockchain and broadcasts the new block to other nodes 102. The other nodes 102 verify that the network node 104 has actually solved the cryptographic problem and has therefore proven sufficient proof of work before accepting that the block should be added to the blockchain. The other nodes 102 also verify that the block itself is valid (e.g., the block's transactions and block header are valid) before accepting that the block should be added to the blockchain. The block is added to the blockchain (i.e., added to the distributed global ledger) by consensus of the nodes 102.

[0035] The blocks created by network nodes 104 include transactions that have been broadcast to the blockchain by nodes 102. For example, a block may include a transaction from an address associated with one of nodes 102 to an address associated with another of nodes 102. In this way, the block serves as a record of transactions from one address to another address. A party requesting that a transaction be included in a block proves that they are authorized to initiate the transfer by signing the request using the private key corresponding to their public key. The transfer is only added to the block if the request is validly signed.

[0036] There can be a one-to-one correspondence between public keys and addresses. That is, each public key is associated with a single address. Therefore, any references herein to transferring a digital asset to or from a public key (e.g., paying to a public key) and to transferring a digital asset to or from an address associated with the public key refer to the common operation.

[0037] Some of the nodes 102 may not function as network nodes but may participate as validation nodes. Validation of transactions may involve checking signatures (also referred to herein as cryptographic signatures) or other conditions specified in locking scripts, confirming references to valid UTXOs, and the like.

[0038] Figure 1 The example includes five nodes 102, two of which participate as network nodes 104. In practice, the number of nodes 102 or the number of network nodes 104 may be different. In many blockchain networks, the number of nodes 102 and the number of network nodes 104 may be much larger than Figure 1 The quantity shown in .

[0039] Figure 2 It is a diagram showing a peer-to-peer blockchain network 100 ( Figure 1 ) in node 102( Figure 1 ). The example electronic device 200 may also be referred to as a processing device. The electronic device may take various forms, including, for example, a desktop computer, a laptop computer, a tablet computer, a server, a mobile device such as a smart phone, a wearable computer such as a smart watch, or another type of form.

[0040] The electronic device 200 includes a processor 210, a memory 220, and an interface device 230. These components may be directly or indirectly connected to each other and may communicate with each other. For example, the processor 210, the memory 220, and the interface device 230 may communicate with each other via a bus 240. The memory 220 stores a computer software program including machine-readable instructions and data for performing the functions described herein. For example, the memory may include processor-executable instructions that, when executed by the processor 210, cause the electronic device to perform the method described herein. The processor-executable instructions may include instructions that, when executed by the processor 210, cause the electronic device to implement communication with the blockchain network 100 ( Figure 1 ) associated with the protocol.

[0041] The memory 220 can store the blockchain network 100 ( Figure 1 )'s global ledger or a portion thereof. That is, the memory 220 may store all blocks of the blockchain or a portion of the blocks, such as a portion of the information in the most recent block or some blocks.

[0042] Although in Figure 2200 is shown as a single box, but in fact the electronic device 200 may include multiple memory components. The memory components may be of various types, including, for example, random access memory (RAM), hard disk drive (HDD), solid state drive (SSD), flash drives (flash drives), etc. Different types of memory may be suitable for different purposes. In addition, although the memory 220 is shown as being separated from the processor 210, the processor 210 may include an embedded memory.

[0043] The present invention may provide a method (and corresponding system) for modifying a cryptographic public key embedded in a locking script of a blockchain transaction (Tx) using undetermined data provided in an unlocking script of another transaction. When used in conjunction with a signature checking opcode in a protocol (e.g., OP_CHECKSIG) that uses transaction bytecode as a message, both the transaction and the data require approval or authorization from the public key owner. This may prevent both the transaction and the data from being altered. Thus, the present invention provides benefits related to security, cryptography, authorization, and transmission control.

[0044] Now refer to Figure 3 , showing a method 300 for locking a digital asset on a blockchain network. The method 300 may be performed by the blockchain network 100 ( Figure 1 ) is executed by a node 102 of a lock to lock a digital asset based on secure undetermined data. The data is undetermined because the data does not need to be known to the node configuring the lock when the lock is configured, and the data is secure because the lock is configured so that any modification of the data by an unauthorized party will result in the invalidation of the transaction. For ease of reference, the node 102 executing the method 300 may be referred to as a locking node in this article. The locking node may be configured with processor executable instructions that perform the method 300 when executed by a processor of the locking node.

[0045] Therefore, the undetermined data used to lock the digital asset can be data that is not yet known to the locking node at the time of locking. The data can be data that has not yet been created (e.g., data that is expected to be created in the future but has not yet been created) or data that is known to another node but is not yet available to the locking node. However, the data is data that is expected to be available (currently or in the future) from a certain data source. The data source is determined because the identity of the data source is known when the locking script is generated. In some embodiments where the locking script is configured to rely on data from a single data source (this is contrary to the embodiment where the locking script will accept data from multiple data sources and determine which data sources to rely on), the data source can be referred to as a trusted data source.

[0046] Method 300 includes: at operation 302, preparing a locking script to lock a digital asset based on undetermined data. A locking script is an encumbrance in the form of computer executable code or instructions placed on an output of a transaction that specifies conditions that must be met in order to spend the output in the future. More specifically, the locking script is configured to accept data from an unlocking script and perform certain operations based on the data so that a verification node can determine whether the unlocking script successfully unlocks the locking script.

[0047] The locking script may define one or more data constraints. A data constraint is a requirement that the data provided in the unlocking script must meet in order to successfully evaluate the locking script (e.g., evaluate to TRUE). Therefore, the locking script may, at operation 302, be configured to have instructions that cause the verification node executing the locking script to evaluate the data provided in the unlocking script for the data constraint. The data constraint of the locking script may define a threshold or value and a necessary relationship between the data and the defined value or threshold. The comparison function may be used to cause the verification node executing the locking script based on the data provided in the unlocking script to perform a comparison based on the data and one or more values. As an example, the data constraint may require that the data is equal to the value specified in the locking script, greater than the value specified in the locking script, less than the value specified in the locking script, not equal to the value specified in the locking script, etc. Many other possible data constraints may also be defined.

[0048] As an example, the following are some possible example operation codes that can be included in the data constraint section of the locking script to check whether the data meets certain conditions. It should be noted that other operations are also possible, and the script can modify the data in some way (e.g., by multiplication, subtraction, division, addition or other operations) before using one of the following comparison functions.

[0049] OP_GREATERTHAN returns a true (TRUE) value if the second item in the stack is greater than the top item in the stack.

[0050] OP_LESSTHANOREQUAL returns a true value if the second item in the stack is less than or equal to the top item.

[0051] OP_GREATERTHANOREQUAL returns a true value if the second item in the stack is greater than or equal to the top item.

[0052] OP_WITHIN returns a TRUE value if the third item in the stack is between the second and first items.

[0053] OP_NUMEQUAL returns a TRUE value if the top items in the stack are equal in number.

[0054] OP_NUMNOTEQUAL returns a true value if the first two terms are not equal numbers.

[0055] OP_LESSTHAN returns a true (TRUE) value if the second item in the stack is less than the top item.

[0056] The locking script may also include instructions such as a verification function that invalidates a transaction containing an unlocking script intended to unlock the locking script if the data does not satisfy the data constraints. As an example, an OP_VERIFY operation code may be included after the comparison function. The OP_VERIFY code checks the top of the stack and halts and invalidates the transaction if the value of the top of the stack is not TRUE.

[0057] Thus, in at least some implementations, the data constraints portion of a locking script may take the following format:

[0058] <Script to Check Constraints>OP_VERIFY,

[0059] Here, <Script to Check Constraints> is any script that evaluates whether the data in the unlocking script satisfies one or more defined constraints and returns TRUE or FALSE based on such evaluation.

[0060] The locking script may also include computer executable instructions that cause a verification node executing the locking script to evaluate the source of the data. For example, the locking script may require that the data be provided by a certain data source, such as a certain node, and not tampered with by other nodes. That is, the locking script is configured so that any such tampering will invalidate the transaction intended to unlock the locking script.

[0061] The locking script can cause the verification node executing the locking script to use elliptic curve finite field operations to verify the source of the data (provided by the unlocking script intended to unlock the locking script). More specifically, the locking script can be configured to cause the node to perform elliptic curve finite field operations based on the data and the public key of the determined data source included in the locking script by the locking node when it is executed. That is, the locking script can be configured to cause the node executing the locking script to generate a modified public key for determining the data source based on the public key for determining the data source defined in the locking script and based on the data defined in the unlocking script. The modified public key is determined by performing elliptic curve finite field arithmetic operations based on the public key for determining the data source embedded in the locking script and based on the data provided in the unlocking script. A variety of operations (e.g., data×data×public key, etc.) can also be used to determine the modified public key.

[0062] In order to unlock the locking script, the determined data source must obtain a modified private key by performing finite field arithmetic operations based on the private key and data of the data source. More specifically, the operations performed on the private key correspond to the operations that the locking script is configured to perform on the public key. As with the public key, a variety of operations can be performed on the private key to obtain a modified private key (e.g., data×data×private key, etc.). The determined data source uses the modified private key to generate a signature that can be included in the unlocking script. This signature may be referred to herein as a signature from the modified private key.

[0063] In order to understand how data modification private and public keys can be similarly utilized to allow verification of data origin, it is useful to consider the relationship between private and public keys. More specifically, the elliptic curve public key is calculated as follows:

[0064] D = d × G,

[0065] Where d is the private key, D is the corresponding public key, and G is the elliptic curve finite field generator element.

[0066] Because of the relationship between the private key and the public key, when the public key is changed with data, the private key needs to be changed accordingly. Any number of methods can be used to modify the private and public keys, as long as the operation can be decomposed into finite field addition.

[0067] As an example, if d is the original private key, d' is the modified private key, D is the original public key, and D' is the modified public key, then the modified public key and the modified private key may be determined as:

[0068] d'=d×data

[0069] D'=d'×G=d×data×G=data×D

[0070] Alternatively, the modified public key and the modified private key may be determined as:

[0071] d'=d+data

[0072] D'=d'×G=(d+data)×G=D+DATA,

[0073] Where DATA is an elliptic curve point.

[0074] Although some existing blockchain networks may not include specific operation codes for performing elliptic curve finite field arithmetic operations, it is possible to control the blockchain network 100 ( Figure 1 ) provides an operation code in the protocol for the operation of elliptic curve multiplication to provide such an operation. As an example, an operation code OP_ECPMULT can be defined that takes an encoded elliptic curve point and a number and performs elliptic curve multiplication with a scalar. The operation code outputs the result as an encoded elliptic curve point.

[0075] To perform elliptic curve finite field arithmetic, two specific elliptic curve operations can be used:

[0076] Point addition (P+Q) is used to compute a new point on the elliptic curve as the negation of the intersection of the curves. This can be described as R=P+Q.

[0077] Point doubling (P+P) uses point addition to calculate the point double of P. This can be described as R=P+P=2P.

[0078] These operations can be expressed as follows.

[0079] x3=s 2 -x1-x2mod p

[0080] y3=s(x1-x3)-y1mod p

[0081] in,

[0082]

[0083] These operations can be used on arbitrary numbers to derive elliptic curve arithmetic, such as elliptic curve point multiplication with scalars.

[0084] Therefore, the locking script prepared at operation 302 of method 300 can be configured to cause the verification node executing the locking script to check whether the data provided in the corresponding unlocking script has been provided by the determined data source by obtaining the modified public key for the data source using the above-mentioned technology. The locking script can be configured so that the verification node subsequently evaluates the signature from the modified private key (i.e., the signature generated from the private key based on the data has been modified). More specifically, a signature check operation code can be included in the locking script, which checks whether the signature from the modified private key corresponds to the modified public key and is therefore a valid signature. As an example, the OP_CHECKSIG operation code can be used. OP_CHECKSIG pops the public key and signature from the stack and verifies the signature of the hash data for the transaction. If the values ​​match, OP_CHECKSIG returns TRUE. Therefore, the instruction in the locking script that configures the verification node to evaluate the signature in the unlocking script based on the modified public key can be configured so that the verification node invalidates the transaction including the unlocking script when the signature included in the unlocking script has not been generated using the modified private key associated with the determined data source. That is, if the signature is not generated using a modified private key generated by the determined data source based on the private key used to determine the data source and based on the data, then the transaction containing the intended unlocking script is invalidated by the validating node.

[0085] As an example, OP_CHECKSIG can be used in conjunction with elliptic curve finite field arithmetic in a locking script as follows:

[0086] <PubKey D> OP_ECPMULT OP_CHECKSIG

[0087] Among them, PubKey D is the public key of the determined data source to provide data.

[0088] The corresponding portion of the unlocking script that would successfully verify this portion of the locking script would be:

[0089] <Sig’> <data>

[0090] in, <data>is data, and<Sig'> is a signature generated by a modified private key (ie, by a private key that has been modified based on the data).

[0091] The order of the data constraint part of the locking script and the data source check part of the locking script can be reversed. For example, the locking script can first make the verification node confirm that the data is provided by a certain data source before considering whether the data satisfies the data constraint.

[0092] In addition to those mentioned above, the locking script may also include other locking features. For example, the locking script may also require the addition of another node's signature. For example, the locking script may require the recipient of the transaction (i.e., the party that is to receive the digital asset associated with the transaction) to submit a valid signature to unlock the locking script. For example, the locking script may include:

[0093] <PubKey B> OP_CHECKSIG,

[0094] Among them, PubKey B is the public key of the node that is the recipient of the digital asset blocked by the locking script.

[0095] The locking script can also be configured to require the addition of a signature associated with the locking node itself before the locking script can be verified as TRUE, so that the digital asset is no longer blocked by the locking script. For example, the locking script can include:

[0096] <PubKey A> OP_CHECKSIGVERIFY

[0097] Where PubKey A is the public key of the node that is the recipient of the digital asset blocked by the locking script. OP_CHECKSIGVERIFY operates similarly to OP_CHECKSIG, but if OP_CHECKSIG does not evaluate to TRUE, OP_CHECKSIGVERIFY will use OP_VERIFY to pause.

[0098] In addition, the locking script prepared at operation 302 can be configured to include instructions for removing the block placed on the digital asset by the locking script after a defined time period. That is, the locking script can be configured with one or more conditions that allow the locking party to reclaim the digital asset under certain conditions. For example, if the data, after being determined, fails to satisfy the data constraints required by the locking script, the locking script can allow the locking node to reclaim the digital asset. For example, if the digital asset is not otherwise acquired during the time period specified in the locking script, the locking script can be configured to allow the locking node (or any other party specified by its public key) to acquire the digital asset after the time period.

[0099] As an example, a locking script may include a conditional branch that includes:

[0100] <time limit>OP_CHECKSEQUENCEVERIFY

[0101] <PubKey A>OP_CHECKSIG

[0102] Among them, <time limit>is a time period embedded in the locking script, and OP_CHECKSEQUENCEVERIFY is an opcode that allows a specific path to be executed only if the outputs spent are at least as long as the specified time period. For example, if <time limit>Set to ten (10) days, the locked node (which has the same public key<PubKey A> The corresponding private key) can reclaim the output after 10 days by providing a signature signed with the private key used to lock the node.

[0103] Therefore, a locking script can include many conditions that must be met in order to unlock. While a locking script may take many forms, the following are examples of possible scripts that might be used:

[0104] OP_IF

[0105] <PubKey A> OP_CHECKSIGVERIFY

[0106] OP_DUP <90> OP_GREATERTHAN OP_VERIFY

[0107] <PubKey C> OP_ECPMULT OP_CHECKSIGVERIFY

[0108] <PubKey B> OP_CHECKSIG

[0109] OP_ELSE

[0110] <10Days>OP_CHECKSEQUENCEVERIFY

[0111] <PubKey A> OP_CHECKSIG

[0112] The locking script of the OP_ENDIF example allows the locking node A to require that the data from the determined data source C is greater than 90. In addition, the locking script requires the determined data source to prove the data source by providing a signature generated from a modified private key (i.e., from a private key modified based on the data). The example locking script also requires that both the locking node A and another node B (which may be the recipient of the digital asset in transit) provide valid signatures in the unlocking script.

[0113] The example locking script includes multiple branches, one of which allows locking node A to reclaim the digital assets encumbered by the locking script if not stated otherwise within 10 days.

[0114] For example, the example locking script may be used by a locking node A associated with one party to reward another node B associated with another party, thereby rewarding the node B when determining that the data source C provides data exceeding 90. The data may be, for example, test results in the form of marks or grades, and the determining data source may be a teacher. In this case, node B may be associated with the party that received the mark or grade in question, and node A may be associated with the party that wishes to reward the party that received the mark or grade if satisfied with the mark or grade.

[0115] The locking script prepared at operation 302 is included in the blockchain transaction by the locking node. That is, the locking node can embed the locking script into the output of the blockchain transaction (at operation 304 of method 300) to block (i.e., lock) the digital assets associated with the transaction. The locking node sends the transaction to the blockchain network 100 ( Figure 1 That is, the transaction including the locking script can be broadcast to the blockchain network 100 ( Figure 1 Assuming certain criteria are met, such as including sufficient mining fees, the transaction (which may be referred to as a first transaction or a first blockchain transaction) is added to the blockchain network 100 ( Figure 1 ) by network node 104 ( Figure 1 ) generated by the blockchain. The locked node can wait until the block is mined and confirmed on the blockchain.

[0116] At operation 306, the locking node may prepare a transaction input for another blockchain transaction (which may be referred to as a second transaction or a second blockchain transaction) that spends the digital asset included as an output in the first transaction. That is, the transaction may include the UTXO associated with the first transaction as an input to the second transaction. The locking node may generate a signature based on the private key of the locking node, and may include the signature in the unlocking script of the second transaction. The locking node may also include a branch trigger as an input to the transaction, the branch trigger being used to trigger the operation of a specific one of the conditional branches in the locking script. For example, the above example locking script includes two conditional branches: the first conditional branch allows the other party B to obtain the digital assets involved in the first transaction, and the second conditional branch allows the locking node to reclaim these digital assets if they are not otherwise obtained by B within a specified time period. In order for the unlocking script of the second transaction to trigger the first branch instead of the second branch, the locking node may include "1" as an input to the transaction, so that OP_IF evaluates to TRUE, thereby causing the first branch to be executed.

[0117] The signature used for the locking node is added in a way that allows other nodes to add to the transaction without the approval of the locking node. For example, the signature can be added as SIGHASH_NONE|SIGHASH_ANYONECANPAY. SIGHASH_ANYONECANPAY is a signature hash type that only signs the current input, while SIGHASH_NONE is a signature hash type that only signs the input to allow anyone to change the output without the permission of the locking node.

[0118] Thus, at operation 306, the locking node may generate and add a signature to the transaction, configure the transaction to allow another party to add inputs and outputs, and add a branch trigger to the transaction to trigger the operation of a specific conditional branch of the locking script.

[0119] The locking node may provide (at operation 308 ) the second transaction prepared at operation 306 to another node of another party, such as party B, or to a determined data source C.

[0120] Now refer to Figure 4 , showing a method 400 for facilitating unlocking digital assets on a blockchain network. The method 400 may be performed by the blockchain network 100 ( Figure 1 ) is executed by a node 102 of the blockchain network 100, or by another electronic device that may not participate in the blockchain network 100. The node 102 executing the method 400 may be referred to as determining a data source. The determining data source may be configured with processor executable instructions that perform the method 400 when executed by a processor of the determining data source.

[0121] At operation 402, a determination data source may receive a proposed transaction, which may be a transaction prepared by a locking node at operation 306 of method 300. That is, the transaction is a transaction that references one or more digital assets blocked (ie, locked) by a locking script.

[0122] At operation 404, the determined data source generates a modified private key based on the private key used to determine the data source and the data to be provided by the determined data source in the blockchain transaction. The modified private key is generated using the above-mentioned techniques. For example, the modified private key is generated by modifying the private key with data using an operation corresponding to the operation defined in the locking script to generate the modified private key. Therefore, operation 404 can be the above referenced Figure 3 The type described. For example, the modified private key can be determined by performing a finite field arithmetic operation on the private key and the data. For example, the finite field arithmetic operation can perform a multiplication.

[0123] At operation 406, a signature for the proposed transaction is generated using the modified private key. In operation 408, the signature is added to the transaction along with the data itself. The signature may be added in a manner that allows other nodes to add to the transaction without requiring approval from a determined data source. For example, the signature may be added as SIGHASH_NONE|SIGHASH_ANYONECANPAY.

[0124] At operation 410, the determined data source passes the transaction to another node. For example, the determined data source may pass the proposed transaction to another node B associated with the public key specified in the locking script that the unlocking script of the transaction attempts to unlock. The other node may add another signature generated based on the private key for the other node, and may also add an output specifying how to spend the digital asset associated with the transaction. The other node may broadcast the transaction (which may be referred to as a second transaction) to the blockchain network 100 ( Figure 1 ).

[0125] For a blockchain transaction (which may be referred to as a second transaction) to be added to a block received into the blockchain, the inputs of the transaction including the unlocking script of the transaction must successfully unlock the locking script of the first transaction (i.e., the transaction prepared at operation 304 of method 300).

[0126] Now refer to Figure 5 , Figure 5 An example method 500 that can be performed by a node 102 of a blockchain network 100 is shown in the form of a flow chart. A node that performs the method may be referred to as a validating node because the node validates a blockchain transaction (i.e., a second transaction that is a transaction containing an unlocking script intended to unlock the locking script of the first transaction) to determine whether the transaction should be added to the blockchain distributed ledger. The validating node may be a network node 104, or the validating node may be a validating node that does not mine but only validates blocks proposed by the network node 104 or transactions that have not yet been mined into a block.

[0127] The validating node executes the unlocking script (defined in the second transaction) together with the corresponding locking script (defined in the first transaction) to determine whether the blockchain transaction (i.e., the second transaction) is valid. More specifically, the unlocking script in each input of the transaction can be executed together with the locking script to determine whether the unlocking script satisfies the spending conditions defined by the locking script.

[0128] For example, the stack execution engine may be used to first execute an unlocking script. When the unlocking script executes successfully without errors, the main stack may be replicated by the validating nodes, and then the locking script may be executed. If the unlocking script evaluates to TRUE, then the unlocking script has satisfied the spending conditions defined by the locking script. The blockchain transaction is then determined to be valid, and if certain other conditions are met (such as a mining fee sufficient to cause a network node to include the transaction in a new block), the transaction may be written to the blockchain.

[0129] Thus, the operations of method 500 are defined by computer executable instructions in a lock script. Thus, method 500 may include any of the features of the lock script described above.

[0130] At operation 502, the verification node evaluates the data provided in the unlocking script to determine whether the data satisfies one or more constraints defined in the locking script. Figure 3 Describes example data constraints.

[0131] If the verification node determines that the data does not satisfy the necessary data constraints, then at operation 504, the verification node determines that the unlocking script is not a valid solution to the locking script. The verification node is then used to prevent the blockchain transaction containing the unlocking script (i.e., the second transaction) from being added to the blockchain. For example, if the node is network node 104 ( Figure 1 ), the node excludes the transaction from the next block prepared by the network node 104.

[0132] At operation 506, the verification node evaluates the source of the data. More specifically, the locking script executed by the verification node enables the node to determine a modified public key for determining the data source. The modified public key is determined by performing elliptic curve finite field arithmetic operations on the public key that determines the data source embedded in the locking script and also based on the data provided in the unlocking script. Then, a signature check function is called to determine whether the modified public key corresponds to a signature generated based on the modified private key. This operation is described in more detail above in the description of the locking script. The signature is provided in the unlocking script. If it is determined that the signature is invalid, then at operation 504, the verification node determines that the unlocking script is not a valid solution for the locking script.

[0133] If the data is determined to satisfy the data constraints and if the data is determined to be valid (i.e., if the data is determined to be generated by the determined data source or provided by the determined data source without subsequent tampering), the transaction may be determined to be valid at operation 508 (assuming any other possible requirements of the locking script are also satisfied). The transaction may then be mined onto the blockchain.

[0134] although Figure 5 Method 500 illustrates a verification method that generally confirms that data satisfies one or more defined constraints and that the data has not been tampered with, but the verification method may include other criteria that are evaluated before the locking script evaluates to TRUE (ie, before determining that the transaction is valid).

[0135] Other operations may be performed, such as those described in the example locking script discussed above. For example, a validating node may determine whether other nodes associated with the public key specified in the locking script have validly signed a locking transaction including the unlocking script. Figure 4 As noted in the discussion of , these other nodes may be, for example, a locking node (i.e., a node that generates a locking script), a receiving node (i.e., a node that is intended to be the recipient of a digital asset referenced in a transaction that includes a locking script), or other nodes. Any failure of any of these verification operations results in a verification failure.

[0136] Method 500 may also include, before performing operations 502 and 506, determining that a branch trigger has been included in the unlocking script, the branch trigger triggering a branch of the locking script defining operations 502 and 506. Operations 502 and 506 may be performed only when triggered by the branch trigger.

[0137] It may also be noted that the order of operations 502 and 506 may be reversed. That is, the source of the data may be confirmed by the verification node before confirming that the data satisfies the defined constraints.

[0138] It should be noted that the above embodiments illustrate rather than limit the invention, and that those 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 signs in brackets shall not be construed as limiting the claims. The words "comprising" and "comprises" and the like do not exclude the presence of elements or steps other than those listed in any claim or in the specification as a whole. In this specification, "comprises" means "includes or consists of", and "comprising" means "including or consists of". The singular reference of an element does not exclude the plural reference of these elements and vice versa. The invention may be implemented by hardware comprising several different elements and by a suitably programmed computer. In a device claim enumerating several means, several of these means may be implemented by the same hardware. The fact that certain measures are cited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.< / time> < / time> < / time> < / data> < / data>

Claims

1. A computer-implemented method for locking a digital asset to a blockchain network, comprising: Preparing a locking script to lock digital assets based on undetermined data; Including the locking script in an output of a first blockchain transaction and sending the first blockchain transaction to the blockchain network; Prepare a transaction input for a second blockchain transaction, wherein the second blockchain transaction spends the digital asset included as an output in the first blockchain transaction by generating a signature based on the private key of the locking node, including the signature in an unlocking script of the second blockchain transaction, and including a branch trigger as an input of the transaction, wherein the branch trigger is used to trigger an operation of a specific one of multiple conditional branches in the locking script; as well as The second blockchain transaction is provided to the other party.

2. The computer-implemented method of claim 1 , wherein: The locking script is configured to accept data from the unlocking script and perform certain operations based on the data so that the verification node can determine whether the unlocking script successfully unlocks the locking script.

3. The computer-implemented method of claim 1 or 2, wherein: The locking script defines one or more data constraints that cause a validating node executing the locking script to evaluate data provided in an unlocking script against the data constraints.

4. The computer-implemented method of claim 3, wherein: The data constraints of the locking script define thresholds or values ​​and the required relationship between the data and the defined values ​​or thresholds.

5. A computer-implemented method according to any one of claims 1 to 4, wherein: The locking script includes instructions, such as a validation function, which invalidates a transaction containing an unlocking script that is intended to unlock the locking script if the data does not satisfy the data constraints.

6. A computer-implemented method according to any one of claims 1 to 5, wherein: The locking script includes computer-executable instructions that cause a validating node executing the locking script to evaluate a source of data.

7. The computer-implemented method of claim 6, wherein: The locking script is configured so that a node executing the locking script performs elliptic curve finite field operations based on data and a public key of the determined data source included in the locking script by the locking node, so as to generate a modified public key for the determined data source based on the public key for the determined data source defined in the locking script and based on the data defined in the unlocking script.

8. The computer-implemented method of claim 7, wherein: The locking script is configured such that a verification node executing the locking script checks whether data provided in a corresponding unlocking script has been provided by a determined data source by obtaining a modified public key for the data source.

9. The computer-implemented method of claim 8, wherein: The locking script is configured to cause the validating node to evaluate the signature from the modified private key.

10. The computer-implemented method of claim 9, wherein: A signature check operation code is included in the locking script, which checks whether the signature from the modified private key corresponds to the modified public key and is therefore a valid signature.

11. The computer-implemented method of claim 10, wherein: A transaction containing an intended unlocking script is invalidated by a validating node if the signature is not generated using a modified private key generated by the determined data source based on the private key used to determine the data source and based on the data.

12. A computer-implemented method according to any one of claims 1 to 11, wherein: The locking script includes two conditional branches: the first conditional branch allows the other party B to obtain the digital assets involved in the first blockchain transaction, and the second conditional branch allows the locking node to reclaim these digital assets if these digital assets are not obtained by B in other ways within a specified time period.

13. The computer-implemented method of claim 12, wherein: The lock node includes "1" as an input to the transaction, causing OP_IF to evaluate to true, resulting in the first conditional branch being executed.

14. A computer-readable storage medium comprising computer-executable instructions which, when executed, configure a processor to perform the method according to any one of claims 1 to 13.

15. An electronic device, comprising: Interface devices; a processor connected to the interface device; as well as A memory connected to the processor, wherein computer executable instructions are stored on the memory, and when the computer executable instructions are executed, the processor is configured to perform the method according to any one of claims 1 to 13.