Layer 2 Token Protocol

A Merkle tree-based method partitions token data within blockchain transactions, enabling token issuers and holders to prove their involvement without disclosing the entire transaction, addressing privacy and compliance issues in token-related operations.

JP2024536272APending Publication Date: 2024-10-04NCHAIN LICENSING AG
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2024519818
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-10-06
Filing Date
2022-09-06
Publication Date
2024-10-04

AI Technical Summary

Technical Problem

Existing blockchain systems face challenges in protecting sensitive or confidential data within transactions, particularly when token-related data is involved, as altering other parts of a transaction can implicate the token issuer, necessitating a way to prove token-related operations without revealing other transaction data.

Method used

Implementing a Merkle tree-based approach where token-related data is partitioned across leaves, generating signatures based on the Merkle root, allowing token issuers and holders to prove their involvement in token operations without disclosing the entire transaction data.

Benefits of technology

This method ensures privacy for token holders and issuers by allowing them to authenticate token-related transactions without revealing non-token data, even if other parts of the transaction are edited or deemed illegal, thus maintaining privacy and compliance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024536272000001_ABST
    Figure 2024536272000001_ABST
Patent Text Reader

Abstract

A computer-implemented method for implementing a token protocol using blockchain is provided, the method being executed by a first party and including the steps of obtaining a first blockchain transaction, the first blockchain transaction including a first output including a first locking script, the first locking script including token data; constructing a Merkle tree based on the first locking script, the token data being partitioned across one or more leaves of the Merkle tree; generating a first signature based on a first message including the Merkle root of the Merkle tree; and making the first signature available for inclusion in a second output of the first blockchain transaction.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to a method for implementing a layer-2 token protocol using a layer-1 blockchain. [Background technology]

[0002] Blockchain refers to a form of distributed data structure in which a duplicate copy of the blockchain is maintained at each of multiple nodes in a distributed peer-to-peer (P2P) network (hereafter referred to as the "blockchain network") and made publicly available. The blockchain includes a chain of data blocks, with each block including one or more transactions. Each transaction, other than the so-called "coinbase transaction," points to a preceding transaction in the sequence, which may span one or more blocks, back to one or more coinbase transactions. Coinbase transactions are further described below. Transactions submitted to the blockchain network are included in new blocks. New blocks are created by a process often called "mining," which involves multiple nodes each competing to perform a "proof-of-work," i.e., solving a cryptographic puzzle based on an ordered and validated representation of pending transactions waiting to be included in a new block of the blockchain. Note that the blockchain may be pruned at some nodes, and publication of blocks may be accomplished through mere publication of block headers.

[0003] Transactions in a blockchain may be used for one or more of the following purposes: to transfer digital assets (i.e., some digital tokens), to order a set of entries in a virtual ledger or registry, to receive and process timestamp entries, and / or to chronologically order index pointers. A blockchain may also be leveraged to layer additional functionality on top of the blockchain. For example, a blockchain protocol may allow for the storage of additional user data or indexes to data in a transaction. There is no pre-specified limit on the maximum amount of data that can be stored within a single transaction, and therefore more complex data can be incorporated. For example, this may be used to store electronic documents on the blockchain, or to store audio or video data.

[0004] Nodes in a blockchain network (often called "miners") perform a distributed transaction registration and validation process, which is described in more detail below. Briefly, during this process, nodes validate transactions and insert them into a block template that attempts to identify a valid proof-of-work solution. Once a valid solution is found, a new block is propagated to other nodes in the network, allowing each node to record a new block in the blockchain. To have a transaction recorded in the blockchain, a user (e.g., a blockchain client application) sends the transaction to one of the nodes in the network to be propagated. Nodes that receive a transaction may compete to find a proof-of-work solution that will incorporate the validated transaction into a new block. Each node is configured to enforce the same node protocol, which includes one or more conditions for a transaction to be valid. Invalid transactions are not propagated or incorporated into a block. Assuming the transaction is validated and thereby accepted onto the blockchain, the transaction (including any user data) remains registered and indexed at each of the nodes in the blockchain network as an immutable public record.

[0005] Nodes that successfully solve the proof-of-work puzzle and create the latest block are typically rewarded with a new transaction called a "coinbase transaction" that distributes an amount of digital assets, i.e., some number of tokens. Detection and rejection of invalid transactions is enforced by the actions of competing nodes, who act as agents of the network and are incentivized to report and thwart fraud. Widespread publication of information allows users to continuously audit node performance. By mere publication of block headers, participants can ensure the ongoing integrity of the blockchain.

[0006] In an “output-based” model (sometimes called a UTXO-based model), the data structure of a given transaction includes one or more inputs and one or more outputs. Any usable output includes an element that specifies an amount of a digital asset derivable from the preceding sequence of transactions. A usable output is sometimes called a UTXO (an “unspent transaction output”). An output may further include a locking script that specifies a condition for future redemption of the output. A locking script is a predicate that defines the condition required to validate and transfer a digital token or asset. Each input of a transaction (other than a coinbase transaction) includes a pointer (i.e., a reference) to such output in a preceding transaction and may further include an unlocking script to unlock the locking script of the pointed-to output. Thus, considering a pair of transactions, we refer to them as a first transaction and a second transaction (or “target” transaction). The first transaction includes at least one output that specifies an amount of a digital asset and includes a locking script that defines one or more conditions for unlocking the output. The second target transaction includes at least one input that includes a pointer to the output of the first transaction and an unlock script for unlocking the output of the first transaction.

[0007] In such a model, when the second target transaction is sent to the blockchain network to be propagated and recorded in the blockchain, one of the validity criteria applied at each node is that the unlocking script meets all of the one or more conditions defined in the locking script of the first transaction, and another is that the output of the first transaction has not yet been redeemed by another prior valid transaction. A node that finds the target transaction invalid according to any of these conditions will neither propagate it (as a valid transaction, although it may propagate to register the invalid transaction) nor include it in a new block to be recorded in the blockchain.

[0008] Another type of transaction model is the account-based model. In this case, each transaction defines the amount to be transferred by referencing absolute account balances, not by referencing the UTXO of the preceding transaction in the sequence of past transactions. The current state of every account is stored and constantly updated by nodes separately from the blockchain. Summary of the Invention

[0009] Blockchains are designed to be immutable, meaning that once a transaction is written to the blockchain, it is considered impossible to change. However, transaction data may contain private or confidential information that may need to be protected from unauthorized access. As another example, transaction data may contain content that is illegal in at least some jurisdictions. Data that may be considered private, confidential, or illegal is referred to herein as "secret data" and is referred to as "secret" data because dissemination or granting access to such data must be avoided.

[0010] There are many existing token protocols that utilize blockchain. In general, token protocols allow, among other things, the issuance, transfer, and redemption of tokens, where a token is a digital asset that represents ownership of a real-world asset, e.g., a car, a house, a movie ticket, an access card, etc. Problems may arise if a transaction that includes token-related data is deemed to include an example of the secret data mentioned above. In that case, it may be necessary to prove that a transaction included token-related data without revealing other parts of the transaction, e.g., the secret data. In addition, a token issuer may need to be able to prove the issuance of a token in a way that does not make the token issuer (at the time of issuance or thereafter) liable for other parts of the transaction that may be deemed to be secret data.

[0011] According to one aspect disclosed herein, a computer-implemented method of implementing a token protocol using blockchain is provided, the method being executed by a first party and including the steps of obtaining a first blockchain transaction, the first blockchain transaction including a first output including a first locking script, the first locking script including token data; constructing a Merkle tree based on the first locking script, the token data being partitioned across one or more leaves of the Merkle tree; generating a first signature based on a first message including the Merkle root of the Merkle tree; and making the first signature available for inclusion in a second output of the first blockchain transaction.

[0012] The first party can be a token issuer (e.g., Alice) responsible for operating the token scheme and issuing tokens to token holders. The first message signed by the token issuer contains the Merkle root of a Merkle tree generated based on the token script (a script containing token-related data). This means that Alice, as the token issuer, can only deal with data related to the token operation itself. This gives the token holder (e.g., Bob) the freedom to structure the rest of the transaction as he likes, while Alice benefits from Bob's increased privacy by only being responsible for the token-specific aspects of the transaction. This also makes sense from the perspective of blocking transaction content. For example, even if the rest of the transaction data other than the token script is determined to be illegitimate and is edited by a node in the blockchain network, the token issuer would still be able to attest and prove its role in authorizing the token operation without needing access to the edited data. This can be achieved by Alice providing Merkle leaves corresponding to the token script data, Merkle proofs of those leaves with respect to the Merkle root of the token script, and a first signature signing the Merkle root.

[0013] The Merkle tree is constructed based on, or using, a script. Different parts of the script are used as different leaves of the Merkle tree. At least one leaf of the Merkle tree contains a portion of the token data. In some examples, a single leaf node contains the entire token data. In other examples, the token data is split across multiple leaves. As known in the art, the leaves of the Merkle tree are hashed to form leaf hashes, and pairs of leaf hashes are concatenated and hashed to form respective inner hashes. The process of concatenating and hashing pairs of inner hashes is repeated until a single hash (the Merkle root) remains.

[0014] According to one aspect disclosed herein, a computer-implemented method for implementing a token protocol using blockchain is provided, the method being executed by a second party and including the steps of obtaining a first blockchain transaction, the first blockchain transaction including a first output including a first locking script, the first locking script including token data; constructing a transaction Merkle tree, a plurality of respective leaves of the transaction Merkle tree formed from one or more fields of the first blockchain transaction; and generating a first signature based on a first message including the Merkle root of the transaction Merkle tree.

[0015] The second party may be a token holder (e.g., Bob) who is a user of the token scheme and who may own and transfer the issued token. The first transaction is a token transaction in the sense that it includes token-related data as part of the token script. The second transaction conveys the signature of the token holder, who signs a message based on the token data. Specifically, the signature signs a message that includes the Merkle root of a transaction-level Merkle tree. The transaction-level Merkle tree is a Merkle tree that is generated using the fields of the token transaction, thus encoding the token data. The message may also include the Merkle root of a script Merkle tree built based only on the token script. This is beneficial for Bob, since not only can he now prove that he signed and participated in the token operation, but he can do so with a high level of granularity. Merklizing the complete transaction in a signed message gives Bob more control in revealing only the part of the token script he wants to reveal, or the rest of the transaction. For example, if it is later determined that the token transaction contained fraudulent data, Bob can prove that he signed a message based on the token transaction and that the token transaction included the token data without having to reveal the fraudulent parts of the token transaction. [Brief description of the drawings]

[0016] To aid in understanding embodiments of the present disclosure and to show how such embodiments may be carried into effect, reference will now be made, by way of example only, to the accompanying drawings, in which: [Figure 1] FIG. 1 is a schematic block diagram of a system for implementing a blockchain. [Diagram 2] 1 illustrates generally some examples of transactions that may be recorded on a blockchain. [Diagram 3]1 illustrates a schematic diagram of an exemplary blockchain transaction structure that includes data embedded in an unusable output. [Figure 4] 1 shows a schematic example of Merklizing a pay-to-public-key hash (P2PKH) script. [Diagram 5] 13 shows a schematic example of Merkle rendering of an unusable output script; [Figure 6] 1 illustrates a schematic diagram of an example of generating a secondary identifier for a transaction; [Figure 7] 1 illustrates a schematic of a token transaction in which the token issuer signs only token-related transaction data. [Figure 8A] 1 illustrates diagrammatically a pair of transactions representing a token transfer in which a token holder signs a Merkle-ized version of the token transaction and its script(s). [Figure 8B] 1 illustrates diagrammatically a pair of transactions representing a token transfer in which a token holder signs a Merkle-ized version of the token transaction and its script(s). DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0017] 1. Exemplary System Overview FIG. 1 illustrates an exemplary system 100 for implementing a blockchain 150. The system 100 may be comprised of a packet-switched network 101, which is typically a wide area internetwork such as the Internet. The packet-switched network 101 includes multiple blockchain nodes 104, which may be configured to form a peer-to-peer (P2P) network 106 within the packet-switched network 101. Although not shown, the blockchain nodes 104 may be configured as a nearly complete graph. Thus, each blockchain node 104 is highly connected to other blockchain nodes 104.

[0018] Each blockchain node 104 includes a peer computer device, with different ones of the nodes 104 belonging to different peers. Each blockchain node 104 includes one or more processors, e.g., processing devices including one or more central processing units (CPUs), accelerator processors, application specific processors and / or field programmable gate arrays (FPGAs), and other devices such as application specific integrated circuits (ASICs). Each node also includes memory, i.e., computer readable storage in the form of one or more non-transitory computer readable media. The memory may include one or more memory units employing one or more memory media, e.g., magnetic media such as hard disks, solid state drives (SSDs), electronic media such as flash memory or EEPROMs, and / or optical media such as optical disk drives.

[0019] The blockchain 150 includes a chain of data blocks 151, and a respective copy of the blockchain 150 is maintained at each of multiple blockchain nodes 104 in a decentralized or blockchain network 106. As mentioned above, maintaining a copy of the blockchain 150 does not necessarily mean storing the blockchain 150 in its entirety. Instead, the blockchain 150 can be pruned as long as each blockchain node 150 stores the block header (described below) of each block 151. Each block 151 in the chain includes one or more transactions 152, where a transaction in this context refers to a type of data structure. The nature of the data structure depends on the type of transaction protocol used as part of the transaction model or scheme. A given blockchain uses one particular transaction protocol throughout. In one common type of transaction protocol, the data structure of each transaction 152 includes at least one input and at least one output. Each output specifies an amount representing an amount of digital assets as a property, an example of which is a user 103 to whom the output is cryptographically locked (requiring that user's signature or other solution to be unlocked and thereby redeemed or used). Each input points to the output of a preceding transaction 152, thereby linking the transactions.

[0020] Each block 151 also contains a block pointer 155 that points to a previously created block 151 in the chain to define an order for the blocks 151. Each transaction 152 (other than a coinbase transaction) contains a pointer back to a previous transaction to define an order for the sequence of transactions (Note: a sequence of transactions 152 can branch). The chain of blocks 151 goes back to a genesis block (Gb) 153, which was the first block in the chain. One or more original transactions 152 earlier in the chain 150 pointed to the genesis block 153, not to a preceding transaction.

[0021] Each of the blockchain nodes 104 is configured to forward transactions 152 to other blockchain nodes 104, thereby propagating the transactions 152 throughout the network 106. Each blockchain node 104 is configured to create blocks 151 and store respective copies of the same blockchain 150 in their respective memories. Each blockchain node 104 also maintains an ordered set (or pool) 154 of transactions 152 waiting to be incorporated into a block 151. The ordered pool 154 is often referred to as a "mempool." This term in this specification is not intended to be limited to any particular blockchain, protocol, or model. This refers to an ordered set of transactions that the node 104 has accepted as valid, for which the node 104 is obligated not to accept other transactions that attempt to use the same output.

[0022] For a given current transaction 152j, its input (or each input) contains a pointer that references an output of a preceding transaction 152i in the sequence of transactions, specifying that this output should be redeemed or "used" in the current transaction 152j. Using or redeeming does not necessarily mean the transfer of a financial asset, although that is certainly one common use. More generally, using may be described as consuming an output or allocating it to one or more outputs in another onward transaction. In general, the preceding transaction may be any transaction in the ordered set 154 or any block 151. The preceding transaction 152i must exist and be validated for the current transaction to be valid, but the preceding transaction 152i does not necessarily need to exist when the current transaction 152j is created or sent to the network 106. Thus, "preceding" herein refers to something that precedes it in a logical sequence linked by a pointer, and not necessarily to a time of creation or transmission in a time sequence, and therefore does not necessarily preclude transactions 152i, 152j from being created or transmitted out of order (see the discussion below regarding orphan transactions). A preceding transaction 152i is also referred to as an antecedent transaction or a predecessor transaction.

[0023] The input of the current transaction 152j also includes an input authorization, e.g., the signature of the user 103a to whom the output of the preceding transaction 152i is locked. The output of the current transaction 152j can then be cryptographically locked to the new user or entity 103b. Thus, the current transaction 152j can transfer the amount defined in the input of the preceding transaction 152i to the new user or entity 103b, as defined in the output of the current transaction 152j. In some cases, the transaction 152j can have multiple outputs to split the input amount among multiple users or entities (one of which can be the original user or entity 103a to give the change). In some cases, the transaction can also have multiple inputs to pool amounts from multiple outputs of one or more preceding transactions and redistribute them to one or more outputs of the current transaction.

[0024] According to an output-based transaction protocol such as Bitcoin, when a party 103, such as an individual user or an organization, wants to enact a new transaction 152j (manually or by an automated process adopted by the party), the enacting party transmits the new transaction from its computer terminal 102 to a recipient. The enacting party or recipient eventually transmits this transaction to one or more of the blockchain nodes 104 of the network 106 (which is currently typically a server or a data center, but could in principle be other user terminals). It is not excluded that the party 103 enacting the new transaction 152j transmits the transaction directly to one or more of the blockchain nodes 104 and in some examples does not transmit it to a recipient. The blockchain nodes 104 receiving the transaction check whether the transaction is valid according to a blockchain node protocol applied at each of them. The blockchain node protocol typically requires the blockchain nodes 104 to check that the cryptographic signature in the new transaction 152j matches an expected signature that depends on the previous transaction 152i in the ordered sequence of transactions 152. In such an output-based transaction protocol, this may include checking that the cryptographic signature or other authorization of the party 103 included in the input of the new transaction 152j matches a condition defined in the output of the preceding transaction 152i that the new transaction uses (or "assigns"), which condition typically includes at least checking that the cryptographic signature or other authorization in the input of the new transaction 152j unlocks the output of the preceding transaction 152i to which the input of the new transaction is linked. The condition may be defined at least in part by a script included in the output of the preceding transaction 152i. Alternatively, it may be fixed solely by the blockchain node protocol or by a combination of these.In any event, if the new transaction 152j is valid, the blockchain node 104 forwards it to one or more other blockchain nodes 104 in the blockchain network 106. These other blockchain nodes 104 apply the same tests according to the same blockchain node protocol, and then forward the new transaction 152j to one or more further nodes 104, and so on. In this manner, the new transaction is propagated throughout the network of blockchain nodes 104.

[0025] In an output-based model, the definition of whether a given output (e.g., UTXO) is allocated (or "spent") is whether it has been validly redeemed by the input of another subsequent transaction 152j according to the blockchain node protocol. Another condition for a transaction to be valid is that the output of the preceding transaction 152i that it is trying to redeem has not yet been redeemed by another transaction. Again, if it is not valid, the transaction 152j is not propagated (unless it is flagged as invalid and propagated for a warning) or recorded in the blockchain 150. This prevents double-spending, where a transactor tries to allocate the output of the same transaction multiple times. On the other hand, an account-based model prevents double-spending by maintaining account balances. Again, since the transaction order is defined, the account balances are always in a single defined state.

[0026] In addition to validating transactions, blockchain nodes 104 also compete to be the first to create a block of transactions in a process commonly referred to as mining, which is supported by "proof of work." At the blockchain nodes 104, new transactions are added to an ordered pool 154 of valid transactions that have not yet appeared in a block 151 recorded on the blockchain 150. The blockchain nodes then compete to assemble a new valid block 151 of transactions 152 from the ordered set of transactions 154 by trying to solve a cryptographic puzzle. Typically, this involves searching for a "nonce" value such that when the nonce is concatenated and hashed with a representation of the ordered pool 154 of pending transactions, the output of the hash satisfies a predefined condition. For example, the predefined condition could be that the output of the hash has a certain predefined number of leading zeros. Note that this is just one particular type of proof of work puzzle, other types are not excluded. A property of a hash function is that it has an unpredictable output for its input. This search can therefore only be performed in a brute force manner, consuming a significant amount of processing resources at each blockchain node 104 attempting to solve the puzzle.

[0027] The first blockchain node 104 to solve the puzzle publishes this to the network 106 and provides its solution as a proof that can be easily checked later by other blockchain nodes 104 in the network (given the solution to the hash, it is easy to check that the output of the hash satisfies the conditions). This first blockchain node 104 propagates the block to threshold consensus of other nodes that accept this block and enforce the protocol rules. The ordered set of transactions 154 then becomes recorded as a new block 151 in the blockchain 150 by each of the blockchain nodes 104. A block pointer 155 is also assigned to the new block 151n that points to the previously created block 151n-1 in the chain. The significant amount of effort, e.g., in the form of a hash, required to create the proof-of-work solution indicates the intention of the first node 104 to follow the rules of the blockchain protocol. Such rules include not accepting a transaction as valid if it uses or assigns the same output as a previously validated transaction (also known as double spending). Once created, blocks 151 cannot be modified because they are known and maintained at each of the blockchain nodes 104 in the blockchain network 106. Block pointers 155 also impose an order on the blocks 151. As transactions 152 are recorded in ordered blocks at each blockchain node 104 in the network 106, this provides an immutable public ledger of transactions.

[0028] Note that different blockchain nodes 104 competing to solve the puzzle at any given time may be doing so based on different snapshots of the pool of not-yet-published transactions 154 at any given time, depending on when they started searching for a solution or the order in which transactions were received. Whoever solves their respective puzzle first defines which transactions 152 will be included in the next new block 151n, and in what order, the current pool of not-yet-published transactions 154 is updated. The blockchain nodes 104 then continue competing to create blocks from the newly defined, ordered pool of not-yet-published transactions 154, and so on. There are also protocols to resolve any "forks" that may occur if two blockchain nodes 104 solve the puzzle within a very short time of each other, causing conflicting views of the blockchain to propagate between the nodes 104. In essence, whichever prong of the fork grows the longest will be the deterministic blockchain 150. Note that this does not affect users or agents of the network, since the same transactions appear in both forks.

[0029] According to the Bitcoin blockchain (and most other blockchains), a node that successfully constructs a new block 104 is given the ability to allocate the additional amount of accepted digital assets in a new special type of transaction that distributes an additional defined amount of digital assets (as opposed to an agent-to-agent or user-to-user transaction that transfers an amount of digital assets from one agent or user to another). This special type of transaction is usually called a "coinbase transaction," but may also be referred to as an "initiation transaction" or "generation transaction." This typically forms the first transaction of a new block 151n. The proof of work indicates the intention of the node constructing the new block to follow protocol rules that allow this special transaction to be redeemed later. Blockchain protocol rules may require a maturity period, e.g., 100 blocks, before this special transaction can be redeemed. Often, a normal (non-generative) transaction 152 also specifies an additional transaction fee in one of its outputs to further reward the blockchain node 104 that created the block 151n in which the transaction was published. This fee is commonly referred to as the "transaction fee" and is explained below.

[0030] Due to the resources involved in transaction validation and publishing, typically at least each of the blockchain nodes 104 takes the form of a server made up of one or more physical server units, or even an entire data center. However, in principle, any given blockchain node 104 can take the form of a user terminal or a group of user terminals networked together.

[0031] The memory of each blockchain node 104 stores software configured to execute on the processing unit of the blockchain node 104 to perform its respective one or more roles and process transactions 152 in accordance with the blockchain node protocol. It will be understood that any action attributed to a blockchain node 104 herein may be performed by software executing on the processing unit of the respective computing device. The node software may be implemented in one or more applications at the application layer, or at a lower layer, such as the operating system layer or protocol layer, or any combination thereof.

[0032] Also connected to the network 101 are computer devices 102 of multiple parties 103 each acting in the role of consuming users. These users may interact with the blockchain network 106 but do not participate in validating transactions or constructing blocks. Some of these users or agents 103 may act as senders and receivers of transactions. Other users may interact with the blockchain 150 without necessarily acting as senders or receivers. For example, some parties may act as storage entities that store a copy of the blockchain 150 (e.g., having obtained a copy of the blockchain from a blockchain node 104).

[0033] Some or all of the parties 103 may be connected as part of a different network, for example, a network overlaid on top of the blockchain network 106. Users of the blockchain network (often referred to as "clients") may be said to be part of a system that includes the blockchain network 106, but these users are not blockchain nodes 104 because they do not fulfill the role required of a blockchain node. Instead, each party 103 may interact with the blockchain network 106, thereby utilizing the blockchain 150 by connecting (i.e., communicating) with the blockchain node 106. Two parties 103 and their respective devices 102 are shown for illustrative purposes, namely, a first party 103a and its respective computer device 102a, and a second party 103b and its respective computer device 102b. It will be understood that there may be many more such parties 103 and their respective computer devices 102 and they may participate in the system 100, but for convenience they are not shown. Each party 103 may be an individual or an organization. Purely by way of example, the first party 103a is referred to herein as Alice and the second party 103b is referred to as Bob, although it will be understood that this is not limiting and that any reference to Alice or Bob herein may be replaced with "first party" and "second party," respectively.

[0034] The computer equipment 102 of each party 103 comprises a respective processing device including one or more processors, e.g., one or more CPUs, GPUs, other accelerator processors, application specific processors, and / or FPGAs. The computer equipment 102 of each party 103 further comprises a memory, i.e., computer readable storage in the form of one or more non-transitory computer readable media. This memory may comprise one or more memory units employing one or more memory media, e.g., magnetic media such as hard disks, electronic media such as SSDs, flash memories or EEPROMs, and / or optical media such as optical disk drives. The memory on the computer equipment 102 of each party 103 stores software including a respective instance of at least one client application 105 configured to run on the processing device. It will be understood that any action attributed to a given party 103 herein may be performed using software running on the processing device of the respective computer equipment 102. The computer equipment 102 of each party 103 comprises at least one user terminal, e.g., a desktop or laptop computer, a tablet, a smartphone, or a wearable device such as a smart watch. The computing equipment 102 of a given party 103 may also include one or more other networked resources, such as cloud computing resources accessed via a user terminal.

[0035] The client application 105 may initially be provided to the computing equipment 102 of any given party 103 on one or more suitable computer-readable storage devices, for example downloaded from a server or provided on a removable storage device such as a removable SSD, a flash memory key, a removable EEPROM, a removable magnetic disk drive, a magnetic floppy disk or tape, an optical disk such as a CD or DVD ROM, or a removable optical drive.

[0036] The client application 105 comprises at least a "wallet" functionality. It has two main functions. One of these is to allow each party 103 to create, authorize (e.g., sign) and send transactions 152 to one or more Bitcoin nodes 104 for propagation across the network of blockchain nodes 104 and thereby inclusion in the blockchain 150. The other is to report to each party the amount of digital assets that it currently owns. In an output-based system, this second function involves reconciling the amounts defined in the outputs of the various transactions 152 scattered across the blockchain 150 that belong to that party.

[0037] It should be noted that various client functions may be described as being integrated into a given client application 105, but are not necessarily limited thereto; instead, any client functionality described herein may be implemented in a suite of two or more separate applications that interface, for example, via an API, or one that is a plug-in to the other. More generally, client functions may be implemented at the application layer or a lower layer, such as an operating system, or any combination thereof. The following description is given with respect to client application 105, but will be understood to be non-limiting.

[0038] An instance of a client application or software 105 on each computing device 102 is operatively coupled to at least one of the blockchain nodes 104 of the network 106. This allows the wallet function of the client 105 to send transactions 152 to the network 106. The client 105 can also contact the blockchain node 104 to query the blockchain 150 for any transactions in which the respective party 103 is a recipient (or, in an embodiment, actually inspect other parties' transactions in the blockchain 150, since the blockchain 150 is a public facility that provides trust in transactions in part through its public visibility). The wallet function on each computing device 102 is configured to formulate and send transactions 152 according to a transaction protocol. As described above, each blockchain node 104 executes software configured to validate transactions 152 according to the blockchain node protocol and forward the transactions 152 to propagate them across the blockchain network 106. The transaction protocol and the node protocol correspond to each other, and a given transaction protocol goes with a given node protocol, and together they implement a given transaction model. The same transaction protocol is used for all transactions 152 in the blockchain 150. The same node protocol is used by all nodes 104 in the network 106.

[0039] When a given party 103, for example Alice, wishes to send a new transaction 152j to be included in the blockchain 150, Alice formulates the new transaction (using a wallet function in Alice's client application 105) according to the associated transaction protocol. Alice then sends the transaction 152 from her client application 105 to one or more blockchain nodes 104 to which Alice is connected. For example, this may be the blockchain node 104 that is best connected to Alice's computer 102. When any given blockchain node 104 receives the new transaction 152j, it processes it according to the blockchain node protocol and its respective role. This includes first checking if the newly received transaction 152j meets certain conditions to be "valid", examples of which are described in more detail below. In some transaction protocols, the conditions for validation may be configurable per transaction by a script included in the transaction 152. Alternatively, the conditions may simply be a built-in feature of the node protocol or may be defined by a combination of the script and the node protocol.

[0040] Provided that the newly received transaction 152j passes the tests to be considered valid (i.e., it is "validated"), any blockchain node 104 that receives the transaction 152j adds the new validated transaction 152 to the ordered set of transactions 154 maintained at that blockchain node 104. Additionally, any blockchain node 104 that receives the transaction 152j propagates the validated transaction 152 to one or more other blockchain nodes 104 in the network 106. Because each blockchain node 104 applies the same protocol, this means that, assuming the transaction 152j is valid, it will be propagated immediately throughout the network 106.

[0041] Once accepted into the ordered pool 154 of pending transactions maintained at a given blockchain node 104, that blockchain node 104 begins competing to solve the proof-of-work puzzle for the latest version of each pool 154 that contains the new transaction 152. (Recall that other blockchain nodes 104 may be attempting to solve the puzzle based on different pools 154 of transactions, but whichever node solves it first defines the set of transactions contained in the latest block 151. Eventually, the blockchain node 104 will have solved the puzzle for the part of the ordered pool 154 that contains Alice's transaction 152j.) Once the proof-of-work has been done for the pool 154 that contains the new transaction 152j, it universally becomes part of one of the blocks 151 in the blockchain 150. Since each transaction 152 contains a pointer back to the previous transaction, the order of the transactions is also immutably recorded.

[0042] Different blockchain nodes 104 may initially receive different instances of a given transaction and therefore have conflicting views on which instance is "valid" until one instance is published in a new block 151 (at which point all blockchain nodes 104 agree that the published instance is the only valid instance). If a blockchain node 104 accepts one instance as valid and then discovers that another instance has been recorded in the blockchain 150, it must accept it and discard (i.e., treat as invalid) the instance it originally accepted (i.e., the one not published in block 151).

[0043] An alternative type of transaction protocol operated by some blockchain networks may be called an "account-based" protocol, as part of the account-based transaction model. In the account-based case, each transaction defines the amount to be transferred by referencing the absolute account balance, not by referencing the UTXO of the preceding transaction in the sequence of past transactions. The current state of every account is stored and constantly updated by the nodes of the network separately from the blockchain. In such a system, transactions are ordered using the running transaction tally (also called the "position") of the account. This value is signed by the sender as part of its cryptographic signature and hashed as part of the transaction reference calculation. In addition, an optional data field in the transaction may also be signed. This data field may point to a previous transaction, for example if a previous transaction ID is included in the data field.

[0044] 2. UTXO-based model FIG. 2 illustrates an exemplary transaction protocol. It is an example of a UTXO-based protocol. A transaction 152 (abbreviated as "Tx") is a fundamental data structure of a blockchain 150 (each block 151 contains one or more transactions 152). In the following, it is described with reference to an output-based or "UTXO"-based protocol. However, this is not limited to all possible embodiments. It should be noted that the exemplary UTXO-based protocol is described with reference to Bitcoin, but could equally be implemented on other exemplary blockchain networks.

[0045] In a UTXO-based model, each transaction ("Tx") 152 includes a data structure that includes one or more inputs 202 and one or more outputs 203. Each output 203 may include an unspent transaction output (UTXO), which may be used as a source of input 202 for another new transaction (if the UTXO has not yet been redeemed). The UTXO includes a value that specifies an amount of a digital asset. This represents a set number of tokens on the distributed ledger. The UTXO may also include a transaction ID of the underlying transaction, among other information. The transaction data structure may also include a header 201 that may include indicators indicating the size of the input field(s) 202 and output field(s) 203. The header 201 may also include an ID of the transaction. In an embodiment, the transaction ID is a hash of the transaction data (excluding the transaction ID itself) and is stored in the header 201 of the raw transaction 152 that is submitted to the node 104.

[0046] Suppose Alice 103a wants to create a transaction 152j that transfers an amount of the digital asset to Bob 103b. In FIG. 2, Alice's new transaction 152j is labeled "Tx1". It takes the amount of the digital asset locked to Alice in the output 203 of the previous transaction 152i in the sequence and transfers at least a portion of it to Bob. The previous transaction 152i is labeled "Tx0" in FIG. 2. Tx0 and Tx1 are just arbitrary labels. They do not necessarily mean that Tx0 is the first transaction in the blockchain 151 or that Tx1 is the immediate next transaction in the pool 154. Tx1 can point to any previous (i.e., earlier) transaction that still has an unspent output 203 locked to Alice.

[0047] The preceding transaction Tx0 may already be validated and included in a block 151 of the blockchain 150 by the time Alice creates the new transaction Tx1, or at least by the time Alice submits it to the network 106. It may already be included in one of the blocks 151 at that time, or it may still be waiting in the ordered set 154, in which case it will be included in the new block 151 immediately. Alternatively, Tx0 and Tx1 may be created and submitted to the network 106 together, or even Tx0 may be submitted after Tx1 if the node protocol allows for buffering of "orphan" transactions. The terms "preceding" and "subsequent" as used herein in the context of a sequence of transactions refer to the order of the transactions in a sequence defined by transaction pointers (e.g., which transactions point to which other transactions) specified in the transactions. They may similarly be replaced with "predecessor" and "successor," or "antecedent" and "descendant," "parent" and "child," etc. This does not necessarily imply the order of their creation, transmission to the network 106, or arrival at any given blockchain node 104. Nevertheless, a subsequent transaction (a later transaction or "child") that points to a preceding transaction (an earlier transaction or "parent") is not validated unless the parent transaction is validated. A child that arrives at a blockchain node 104 before its parent is considered an orphan. It may be buffered for a certain amount of time to wait for the parent or discarded, depending on the node protocol and / or node behavior.

[0048] One of the one or more outputs 203 of the preceding transaction Tx0 includes a particular UTXO, labeled herein as UTXO0. Each UTXO includes a value specifying the amount of the digital asset represented by the UTXO and a locking script that defines a condition that an unlocking script in the input 202 of the following transaction must satisfy in order for the following transaction to be validated and thus the UTXO to be successfully redeemed. Typically, the locking script locks the amount to a particular party (the beneficiary of the transaction in which it is included). That is, the locking script typically defines an unlocking condition that includes a condition that an unlocking script in the input of the following transaction includes a cryptographic signature of the party to whom the preceding transaction is locked.

[0049] A lock script (commonly called scriptPubKey) is a piece of code written in a domain-specific language recognized by the node protocol. A specific example of such a language is called "Script" (capital S) used by blockchain networks. A lock script specifies what information is needed to use the transaction output 203, e.g. the need for Alice's signature. An unlock script appears in the transaction's output. An unlock script (commonly called scriptSig) is a piece of code written in a domain-specific language that provides the information needed to satisfy the lock script criteria. For example, it may include Bob's signature. An unlock script appears in the transaction's input 202.

[0050] That is, in the illustrated example, UTXO0 in output 203 of Tx0 must have Alice’s signature Sig P in order for UTXO0 to be redeemed (or, more precisely, for a subsequent transaction that attempts to redeem UTXO0 to be valid). A Requires lock script [Checksig P A ]. [Checksig P A ] is the public key P of Alice's public-private key pair.A Tx1's input 202 includes a pointer to Tx1 (e.g., by its transaction ID, TxID0, which in an embodiment is a hash of the entire transaction Tx0). Tx1's input 202 includes an index that identifies UTXO0 within Tx0, to identify UTXO0 among any other possible outputs of Tx0. Tx1's input 202 includes an unlock script that includes Alice's cryptographic signature, created by Alice applying her private key of her key pair to a given portion of data (sometimes called a "message" in cryptography). <Sig P A The data (or "message") that needs to be signed by Alice to provide a valid signature may be defined by the lock script, or by the node protocol, or by a combination of these.

[0051] When a new transaction Tx1 arrives at a blockchain node 104, the node applies the node protocol, which involves running the lock script and the unlock script together to check if the unlock script satisfies the conditions defined in the lock script (which may include one or more criteria). In an embodiment, this involves concatenating the two scripts: <Sig P A > <P A > || [Checksig P A ] Here, "||" represents concatenation, "<...>" means to put data on the stack, and "[...]" are functions that are composed in the lock script (a stack-based language in this example). Equivalently, the scripts could be executed one after the other using a common stack rather than concatenating the scripts. Either way, when executed together, the scripts will create Alice's public key P as contained in the lock script in the output of Tx0. A, to authenticate that the unlock script in Tx1's input contains Alice's signature signing the expected portion of the data. In order to perform this authentication, the expected portion of the data itself (the "message") must also be included. In embodiments, the data to be signed includes the entirety of Tx1 (i.e., a separate element specifying the signed portion of the plaintext data does not need to be included, as that is already inherently present).

[0052] The details of public-private cryptographic authentication are well known to those skilled in the art. Essentially, if Alice signs a message using her private key, then given Alice's public key and the plaintext message, another entity, such as node 104, can authenticate that the message must have been signed by Alice. Signing typically involves hashing the message, signing the hash, and tagging this as the signature to the message, allowing any holder of the public key to authenticate the signature. Thus, it should be noted that any reference herein to signing a particular portion of data or part of a transaction, etc., may, in embodiments, mean signing a hash of that portion of data or part of a transaction.

[0053] If the unlock script in Tx1 satisfies one or more conditions specified in the lock script of Tx0 (i.e., in the illustrated example, Alice's signature is provided and authenticated in Tx1), the blockchain node 104 considers Tx1 to be valid. This means that the blockchain node 104 will add Tx1 to the ordered pool 154 of pending transactions. The blockchain node 104 will also forward the transaction Tx1 to one or more other blockchain nodes 104 in the network 106 so that the transaction Tx1 is propagated throughout the network 106. Once Tx1 is validated and included in the blockchain 150, this defines the UTXO0 from Tx0 as spent. Note that Tx1 can only be valid if it uses unspent transaction outputs 203. If it attempts to use an output that has already been used by another transaction 152, Tx1 will be invalid even if all other conditions are met. Therefore, the blockchain node 104 also needs to check whether the referenced UTXO in the preceding transaction Tx0 has already been spent (i.e., whether it already formed a valid input to another valid transaction). This is one of the reasons why it is important for the blockchain 150 to impose a defined order on transactions 152. In practice, a given blockchain node 104 may maintain a separate database that marks which UTXOs 203 in which transactions 152 have been spent, but ultimately, what defines whether a UTXO has been spent is whether it already formed a valid input to another valid transaction in the blockchain 150.

[0054] If the total amount specified in all outputs 203 of a given transaction 152 is greater than the total amount pointed to by all its inputs 202, this is another ground of invalidity in most transaction models, so such a transaction will not be propagated or included in block 151.

[0055] Note that in the UTXO-based transaction model, a given UTXO must be spent in its entirety. Part of the amount defined as spent in the UTXO cannot be "left" while another part is spent. However, it is possible to split the amount from the UTXO among multiple outputs of a subsequent transaction. For example, the amount defined in UTXO0 in Tx0 can be split among multiple UTXOs in Tx1. Thus, if Alice does not want to give Bob all of the amount defined in UTXO0, she can use a reminder to give the remainder to herself in the second output of Tx1 or to pay another party.

[0056] In practice, Alice would also typically need to include a fee for any Bitcoin node 104 that successfully includes Alice's transaction 104 in a block 151. If Alice does not include such a fee, Tx0 may be rejected by the blockchain node 104 and thus may not be propagated and included in the blockchain 150, even if it is technically valid (the node protocol does not force a blockchain node 104 to accept a transaction 152 if it does not want to). In some protocols, the transaction fee does not require its own separate output 203 (i.e., it does not require a separate UTXO). Instead, any difference between the total amount pointed to by the input(s) 202 of a given transaction 152 and the total amount specified in the output(s) 203 is automatically given to the blockchain node 104 that publishes the transaction. For example, suppose a pointer to UTXO0 is the only input to Tx1, and Tx1 has only one output UTXO1. If the amount of the digital asset specified in UTXO0 is greater than the amount specified in UTXO1, the difference may be allocated (or used) by the node 104 that wins the proof-of-work competition to create the block containing UTXO1. However, it is not necessarily excluded that a transaction fee may alternatively or additionally be explicitly specified in one of the UTXOs 203 of transaction 152 itself.

[0057] Alice and Bob's digital assets consist of the UTXOs locked to them in any transaction 152 anywhere in the blockchain 150. Thus, typically, a given party 103's assets are scattered across the UTXOs of various transactions 152 across the blockchain 150. No number is stored anywhere in the blockchain 150 that defines the total balance of a given party 103. The role of the wallet function in the client application 105 is to collate together all the values ​​of the various UTXOs that are locked to the respective parties and that have not yet been used in another subsequent transaction. This can be done by querying the copy of the blockchain 150 stored in any of the Bitcoin nodes 104.

[0058] Note that scripting code is often represented generally (i.e., without using a precise language). For example, an operation code (opcode) may be used to represent a particular function. "OP_..." refers to a particular opcode in the scripting language. As an example, OP_RETURN is an opcode in the scripting language that creates an unusable output of a transaction that can store data in the transaction when preceded by OP_FALSE at the beginning of the lock script, thereby immutably recording the data in the blockchain 150. For example, the data may include a document that is desired to be stored in the blockchain.

[0059] Typically, the input for a transaction is a public key P AIn an embodiment, this is based on ECDSA using the elliptic curve secp256k1. The digital signature signs a specific portion of the data. In some embodiments, for a given transaction, the signature signs some of the transaction inputs, and some or all of the transaction outputs. The specific portion of the outputs that are signed depends on the SIGHASH flag, which is a four-byte code that is typically included at the end of the signature (and is therefore fixed at the time of signing) to select which outputs are signed.

[0060] A lock script may typically be referred to as a "scriptPubKey", referring to the fact that each transaction contains the public key of the party being locked. An unlock script may typically be referred to as a "scriptSig", referring to the fact that it provides the corresponding signature. However, more generally, it is not required in all applications of blockchain 150 that the condition for a UTXO to be redeemed includes authenticating the signature. More generally, any condition or conditions may be defined using a scripting language. Thus, the more general terms "lock script" and "unlock script" may be preferred.

[0061] 3. Side Channels As shown in FIG. 1, the client applications on each of Alice's and Bob's computing devices 102a, 120b, respectively, may include additional communication capabilities. This additional functionality allows Alice 103a (at the instigation of either party or a third party) to establish a separate side channel 107 with Bob 103b. The side channel 107 allows for the exchange of data apart from the blockchain network. Such communication may be referred to as "off-chain" communication. For example, this may be used to exchange transactions 152 between Alice and Bob without the transaction (yet) being registered on the blockchain network 106 or progressing on the chain 150 until one of the parties chooses to broadcast the transaction to the network 106. Sharing transactions in this manner may be referred to as sharing a "transaction template." A transaction template may lack one or more inputs and / or outputs required to form a complete transaction. Alternatively or additionally, the side channel 107 may be used to exchange any other transaction-related data, such as keys, negotiated amounts or terms, data content, etc.

[0062] The side channel 107 may be established over the same packet-switched network 101 as the blockchain network 106. Alternatively or additionally, the side channel 301 may be established over a different network, such as a mobile cellular network, or a local area network, such as a local wireless network, or over a direct wired or wireless link between Alice's device 102a and Bob's device 102b. In general, anywhere in this specification, the side channel 107 referred to may include any link or links over one or more networking technologies or communication media for exchanging data "off-chain", i.e., apart from the blockchain network 106. When more than one link is used, the bundle or collection of off-chain links as a whole may be referred to as the side channel 107. Thus, it should be noted that when it is said that Alice and Bob exchange information or particular pieces of data, etc., over the side channel 107, this does not necessarily mean that all of these pieces of data must be transmitted over the exact same link or the same type of network.

[0063] 4. Token Protocol Using Merkle Script A blockchain transaction includes inputs and outputs, each of which includes a script. Using blockchain scripts (Pay-to-Public-Key (P2PK), Pay-to-Public-Key-Hash (P2PKH), multi-signature, OP_RETURN, etc.), arbitrary data can be stored in the transaction. In general terms, outputs include scripts that can encode complex locking conditions, plus store additional data items that may or may not be part of the locking conditions. In a specific example, arbitrary data can be added to a transaction using a disabled script pattern known as an OP_FALSE OP_RETURN output. The script opcode combination OP_FALSE OP_RETURN used to store arbitrary data on the ledger increases the size of the blockchain and consumes disk space for blockchain nodes 104 that wish to store the complete data of the blockchain. Some data stored on the blockchain can be fraudulent, illegal, confidential, private, etc. Some data can fall into one of these categories at the time it is recorded on the blockchain or at a later date. Some data may fall into one of these categories in some jurisdictions but not in others. Thus, it is necessary to be able to redact data from a transaction in order to reduce the size of the transaction and / or comply with (jurisdiction-dependent) rules and regulations, among other reasons. Figure 3 shows the structure of an example blockchain transaction with an OP_FALSE OP_RETURN payload.

[0064] Blockchain transactions may be used to convey token-related data, i.e., data related to a digital token. A digital token typically gives the holder of the token ownership of a real-world asset. For example, a real-world asset may be a physical object, such as a car, a house, a watch, a work of art, etc. A real-world asset may also be non-physical, such as a digital ticket to an event, or a vote in an election. If a token transaction, i.e., a blockchain transaction including token-related data, contains data that needs to be redacted, it is important that the token holder or token issuer, respectively, be able to prove that they actually hold the token or have actually issued the token.

[0065] Embodiments of the present disclosure allow token issuers and token holders to prove that they implemented the token protocol and were parties to a token transaction, even if other data in the token transaction is later redacted. The data that is redacted is referred to herein as "target data." Target data may be included as part of the input (unlock) script. For example, the transaction shown in FIG. 3 includes the data <Sig A > <P A > (signature and public key). The target data may be included as part of the output (lock) script. For example, the same transaction may contain two lock scripts, both of which contain data. The first lock script contains the data P B The second locking script contains the data <data>(Any data such as media content, personal details (e.g. name and address), billing information, etc.) Target data may be included as part of usable (i.e. transferable and allocable) output or non-usable (i.e. non-transferable and non-allocable) output.

[0066] Some embodiments of the present disclosure use a single transaction to perform a token operation. A token operation may be the issuance, transfer, redemption, or combination of a token, and involves a token issuer and a token holder. In general, a token issuer may be any entity, a user, a group of users, a machine, a smart contract, etc. For simplicity, a token issuer is referred to below as Alice 103a and may be configured to perform any of the operations described above as being performed by Alice 103a. Similarly, a token holder may be any entity, referred to below as Bob 103b and may be configured to perform any of the operations described above as being performed by Bob 103b.

[0067] Alice 103a obtains a token transaction including a token script, i.e., a lock script that includes token related data. For example, the token related data may include one or more of the following: token terms and conditions, token issue date, token issuer details, expiry date, etc. Alice 103 may have generated at least a portion of the token transaction, or Alice 103a may have received the token transaction from, for example, Bob 103b.

[0068] Alice 103a constructs a Merkle tree based on the token script, which includes the token data. The entire token script is used to generate the Merkle tree. The token data, in its raw form, forms one or more leaves of the Merkle tree. That is, one or more leaves of the Merkle tree include (or consist of) at least a portion of the token data. In some examples, a single leaf may include (or consist of) the token data, meaning that the entire token data is included as part of that leaf. Alternatively, the token data may be split across multiple leaves of the Merkle tree, meaning that different leaves include different portions of the token data. For example, the token data may be split into equal sized chunks, or the token data may be split into a predetermined number of chunks. Alternatively, the token data may be split arbitrarily.

[0069] In some examples, the token script may include only the token data. In that case, the Merkle tree may be based entirely on the token data. However, in practice, the token script is likely to include other components than just the token data. For example, the token script may include one or more functions configured to perform respective operations. On the Bitcoin blockchain, these functions are known as opcodes. Additionally or alternatively, the token script may include data that is not related to the token. For example, the token script may include a public key hash that may not necessarily be related to the token. In these examples, the token data forms only a part of the Merkle tree, i.e., one or more leaves of the Merkle tree. The function(s) and / or other data also form part of the Merkle tree. That is, one or more leaves of the Merkle tree may include (or consist of) one or more functions, and one or more leaves of the Merkle tree may include (or consist of) non-token data.

[0070] The different components of the script (e.g., functions, token data, other data, etc.) have an order, e.g., from left to right, that is respected when constructing the Merkle tree. The leaves of the Merkle tree are formed using the components of the script in the order in which they appear. For example, the script may include a first set of one or more functions followed by token data followed by a second set of one or more functions. The first set of Merkle tree leaves is formed from the first set of functions, the second set of Merkle tree leaves is formed from the token data, and the third set of Merkle tree leaves is formed from the second set of functions.

[0071] It should be noted that the term "Merkle tree" generally refers to a binary hash tree. In general, however, embodiments of the present disclosure may utilize any type of hash tree, for example, a tertiary hash tree. Thus, any reference to a "Merkle tree" may be replaced with the more general "hash tree" instead.

[0072] In some instances, one or more consecutive functions may be grouped together to form a single leaf of a Merkle tree, while in other instances, each function may form a single leaf of a Merkle tree.

[0073] In some examples, the script may include a data function (e.g., OP_PUSHDATA, OP_RETURN, etc.) configured to expose token data when executed. Exposing the token data may include outputting target data to memory (e.g., stack-based memory) when executed. In these examples, the data function may be separated from other functions such that it is the only function included in each leaf of the Merkle tree. The leaf that includes the data function may include other data, such as the length of the token data, for example in bytes. Alternatively, the length of the token data may be included as a different leaf of the Merkle tree. The length of the data may be used to determine the number of leaves of the Merkle tree.

[0074] 4 and 5, which are described in more detail below, illustrate the process of generating a Merkle tree based on a script that includes token data. As shown in FIG. 4, from left to right, a first group of functions (opcodes) form the first leaf, followed by data functions and token data ( <pubkeyhash>) forms the second leaf, the second group of functions forms the third leaf, and the fourth leaf is formed by duplicating the third leaf. In Figure 5, the first data function (OP_RETURN) forms part of the first leaf, the second data function (OP_PUSHDATAX) together with the data length ([X-bytes]) forms part of the second leaf, and the token data is split across the six leaf nodes.

[0075] Upon generating a Merkle tree based on the token script, Alice 103a signs a message including the Merkle root of the Merkle tree. Thus, the token data is encoded using the Merkle root and signed with Alice's signature. Alice 103a includes the signature in the output of the token transaction, e.g., the unspendable output. Alice 103a may then submit the token transaction to the blockchain network 106 or send the token transaction (including Alice's signature) to Bob 103b. Bob 103b may then submit the token transaction to the network 106. Alternatively, Alice 103a may send the signature to Bob 103b, who may include the signature in the token transaction and send the token transaction to the network 106.

[0076] The token transaction may be signed by Bob 103b. That is, Bob 103b may sign the entire token transaction. Bob's signature is used to unlock the output of the previous transaction so that Bob 103b can fund the token transaction. Therefore, Bob's signature must comply with the rules of the blockchain protocol.

[0077] Alice's signature may be of the same type as Bob's signature, e.g., both signatures may be ECSDA signatures. Alternatively, Alice may use a different type of signature. Alice's signature does not need to conform to the rules of the blockchain protocol, since it is included in the output of the token transaction. Thus, Alice's signature, called the token signature, is interpreted as a layer 2 signature, while Bob's signature is a layer 1 signature.

[0078] After being submitted to the blockchain 150, the token transaction may be deemed to include data that needs to be redacted, for example, for privacy or legal reasons. Because Alice 103a signed only the message based on the Merkle root of the token script and not the entire token transaction, Alice 103a can prove that she is not responsible for the compiled data. Alice 103a can also prove that the token transaction included token data that Alice signed. To do so, Alice 103a may provide a Merkle proof for the token data to prove that the token data formed one or more leaves of the Merkle tree that corresponds to the signed Merkle root.

[0079] An example token transaction is shown in Figure 7. The token transaction contains two outputs, one containing the token script [TokenScript] and one containing Alice's signature SigP A In this example, Alice's signature is included in the unspendable output. The token transaction includes Bob's signature Sig P, which signs the token transaction. B Also includes.

[0080] Some embodiments of the present disclosure use a pair of transactions to perform token operations. The first of these transactions is a token transaction, which is similar to the token transaction described above in that it includes a token script that contains token data. The token transaction may be signed by token issuer Alice 103a.

[0081] Bob 103b obtains the token transaction and builds a Merkle tree based on the token transaction. That is, a transaction-level Merkle tree is generated, and the leaves of the Merkle tree are formed from portions of the token transaction. An example is shown in FIG. 6 where at least one of the fields of the token transaction includes a Merkle root, e.g., the Merkle root of FIG. 3 or FIG. 4. The transaction Merkle tree has a Merkle root, referred to herein as the transaction Merkle root. The token transaction includes multiple fields, e.g., a version number, a lock time, one or more inputs, one or more outputs, etc. One or more leaves may include some or all of a single respective field. One or more leaves may include some or all of multiple respective fields.

[0082] Bob 103b signs a message that includes the transaction Merkle root. Bob 103b generates a second transaction, called a signature transaction, and includes Bob's signature in the signature transaction. Thus, the token data is encoded using the transaction Merkle root and signed with Bob's signature. Bob 103b includes the signature in the output of the signature transaction, e.g., an unspendable output. Bob 103b can then submit the signature transaction to the blockchain network 106 or send the signature transaction to Alice 103a. Alice 103a can then submit the signature transaction to the network 106.

[0083] In some examples, Bob 103b may construct a Merkle tree based on the token script included in the token transaction in the same manner as described above from Alice's perspective. The message signed by Bob 103b may include the Merkle root of this Merkle tree. Additionally or alternatively, Bob 103b may replace the token script with the Merkle root of the Merkle tree generated based on the token script and generate the transaction Merkle tree based on the Merkle root instead of the token script. That is, before generating the transaction Merkle tree, Bob 103b generates the Merkle root of the token script and replaces the token script with the Merkle root.

[0084] Bob 103b may sign the signature transaction before submitting it to the blockchain network 106. Thus, in these examples, Bob 103b generates two signatures: A signature that signs the Merkle root(s) is called a token signature. A signature that signs the signature transaction is called a blockchain signature. A blockchain signature must follow the rules of the blockchain protocol, but a token signature does not necessarily follow those rules. Alice's signature can also be a blockchain signature.

[0085] After being submitted to the blockchain 150, the token transaction may be deemed to include data that needs to be redacted, e.g., for privacy or legal reasons. Because Bob 103b signed the message based on the Merkle root of the token transaction, Bob 103b can prove that he signed and participated in the token transaction without having to reveal more than the token script or more than the token data. To do so, Bob 103b may provide a Merkle proof for the token data to prove that the token data formed one or more leaves of the transaction Merkle tree that corresponds to the signed Merkle root.

[0086] An example pair of transactions is shown in Figures 8A and 8B. Figure 8A shows a token transaction that includes an output that includes a token script [TokenScript]. The token transaction includes Alice's signature Sig P A FIG. 8B shows a signing transaction. In this example, Bob’s token signature Sig’ P B The signature transaction is a blockchain signature of Bob, Sig P, which signs the signature transaction. B Also includes.

[0087] Further details of transaction Merkle trees are now provided. As mentioned above, a Merkle tree can be generated using fields of a token transaction to generate a Merkle root for the token transaction. The Merkle root can be referred to as a secondary transaction identifier because in most blockchain protocols, each transaction is associated with a primary transaction identifier that is typically generated by hashing (or double hashing) the entire transaction.

[0088] An exemplary technique involves splitting a transaction by field into a set of data packets (or data fields) that can be used as leaves of a Merkle tree, with the root of the Merkle tree corresponding to a secondary transaction identifier. Here, splitting is equivalent to identifying the data fields of the transaction. In other words, the transaction does not actually need to be "split". Instead, different parts of the transaction can be identified (e.g., assigned) as different sets of data fields. The secondary transaction identifier is unique for a given transaction (e.g., a unique 256-bit numeric representation (hash value) of the given transaction). This hash value can be used to verify whether any individual field was a valid leaf of the Merkle tree without obtaining the entire set (i.e., the complete transaction).

[0089] Given a transaction Tx, one way to verify that it is included in a block of a blockchain is to verify that its corresponding TxID (primary transaction identifier) ​​appears in the block. This check can be done by performing a Merkle tree proof (e.g., a Merkle proof) to verify that the transaction corresponding to TxID is part of the transaction set represented by the hash root in the block header. However, this check requires the verifier to first obtain the complete transaction message m=Tx and verify that TxID=H(Tx) does indeed hold for the given Tx and the expected TxID, where H is a hash function. This can be problematic for some users of the blockchain, especially when users implement light clients and / or the message m is large.

[0090] In the example, a secondary transaction identifier MTxID may be generated according to the following definition:

number

number

number

[0091] The method for generating the secondary transaction identifier MTxID can be divided into three main stages, as summarized below. Input:Tx F(Tx): 1) TxID:=H 2 (Tx) (note that this is an optional step). 2) Tx, N=2 k A set D of ordered data packets,

number

[0092] Step 1: Calculate the TxID The method may include generating a primary transaction identifier by hashing the transaction. The first stage is a SHA-256 double hash calculation performed on Tx, which generates a primary transaction identifier, TxID. Other hash functions may be used, and in some instances, only a single hash calculation is performed. Typically, the Tx message itself does not explicitly include the TxID. Subsequent stages therefore require this explicit pre-computation of the TxID, so that a Merkle tree can be constructed that explicitly encodes this primary identifier.

[0093] Step 2: Separation of Tx into an ordered dataset D The transaction data, including the message Tx, is separated into individual packets that can be used as leaves of the Merkle tree T. The transaction may be split into its existing fields. Most of these fields contain simple numeric data that is generally very small in size, typically in the range of 1-32 bytes. Thus, most of the transaction is concerned with the sigScript and scriptPubKey fields, which are concerned with input (unlock) and output (lock), respectively. The fields of the transaction may be differentiated using three categories: input fields, output fields, and other fields. In some examples, the transaction is split into these three categories, e.g., one data field containing all input fields, one data field containing all output fields, and one data field containing other fields. The input and output fields may be separated into non-scripted and scripted fields, where the non-scripted fields contain numeric data and the scripted fields contain scripted data.

[0094] The following table shows how a transaction can be divided into a set of data fields. [Table 1]

[0095] The table shows that the Tx message can be divided into its constituent fields to form a set of packets D in a number of ways.

[0096] In some examples, a transaction may be divided into at least one data field containing input data of the transaction (e.g., txid_prev), at least one data field containing output data of the transaction (e.g., values), and at least one data field containing non-input and non-output data of the transaction (i.e., other data, e.g., version). Each data field may consist of only one type of data, e.g., only input data.

[0097] In other examples, a transaction may be divided into more data fields. For example, the set of data fields may include at least one data field containing script input data (e.g., scriptSig) of the transaction, at least one data field containing non-script input data (e.g., vout) of the transaction, at least one data field containing script output data (e.g., scriptPubKey) of the transaction, and at least one data field containing non-script output data (e.g., scriptPubKeyLen) of the transaction.

[0098] It should be noted that, according to this disclosure, each scriptSig and scriptPubKey may be replaced with the corresponding Merkle root of the Merkle tree generated based on the respective script.

[0099] A transaction Tx may be divided into the following set of ordered data packets: D1= <version>、 D2=<txin_count> 、 D3=<txout_count> 、 D4= <locktime>、 D5=<txid_prev>|| <vout> || <scriptsiglen> || <sequence> 、 D6= <scriptsig>Merkle root of D7= <value> || <scriptpubkeylen> 、 D8= <scriptpubkey>Merkle root.

[0100] The choice to split the data in this way, where each packet Di is a leaf of a binary Merkle tree, has several advantages. First, all non-scripted inputs are concatenated to form packet D5, and similarly, all non-scripted outputs are concatenated to form D7. This means that every input and output of a transaction is split into exactly two parts: a non-scripted component and a scripted component (or, more precisely, its Merkle root). This is advantageous because it means that every input and output can be paired as sibling leaves. Thus, inputs and outputs can be completely separated from other fields, and the scripted and non-scripted components of each input or output can also be separated.

[0101] In addition to these fields, the TxID may also be included as a leaf of the Merkle tree T. Following the above example, this means that the data field D9= <txid>In general, a transaction has many inputs and many outputs, each of which is split into two components by an algorithm F. Thus, the total number of data blocks in this tree T, N=|D|, is given by:

number

[0102] N=2 k Such as

number

[0103] Step 3: Generate a Merkle tree T using D and compute the root R The method includes using the set of data fields as leaves of a transaction Merkle tree. The transaction Merkle tree includes a leaf layer, one or more internal layers, and a root layer. The leaf layer includes multiple leaf nodes (also called leaf hashes because each node is a hash digest). Each leaf node is generated by hashing a respective data field of a transaction. At least one of the leaf hashes is based on a primary transaction identifier. In some examples, the one or more leaf hashes are generated by hashing the primary transaction identifier. In some examples, one or more fields of a transaction are concatenated with the primary transaction identifier and then hashed to generate a respective leaf hash. Each internal layer includes multiple internal nodes (or internal hashes). Each internal hash in a given internal layer is generated by hashing the concatenation of at least two hashes from lower layers. For example, the first or lowest internal layer (i.e., the internal layer directly connected to the leaf layer) includes an internal node generated by hashing the concatenation of at least two leaf hashes. The root layer includes the Merkle root of the transaction tree, i.e., the secondary transaction identifier. The secondary transaction identifier is generated by hashing the concatenation of the internal hashes of the highest internal layer (ie, the internal layer directly connected to the root layer) of the one or more internal layers.

[0104] Algorithm F takes an ordered set of data packets D and constructs a Merkle tree T by using these packets as leaves. Figure 8 shows an example construction of a binary Merkle tree. In this example, the first four data fields D1,...,D4 are the miscellaneous fields of the transaction, and the next 2×(n in +n out ) Data fields are input and output fields represented as pairs of scripted D5, D6 and non-scripted D7, D8 field data. The remaining data fields are at least one field D9, D10, D11, D12, D13, D14, D15, D16, D17, D18, D19, D20, D21, D22, D23, D24, D25, D26, D27, D28, D29, D30, D31, D32, D33, D34, D35, D36, D37, D38, D40, D41, D42, D43, D44, D45, D46, D47, D48, D49, D50, D51, D52, D53, D54, D55, D56, D57, D58, D60, D61, D62, D63, D6 10 and for some integer k, N=2 k Any padding required to reach D N Includes.

[0105] 5. Exemplary Privacy-Preserving Token Scheme This section provides examples of how the embodiments described above can be implemented to enable a privacy-preserving token protocol.

[0106] This exemplary scheme is a privacy-preserving token scheme in which tokens require a valid signature for standard token-related operations such as transfer, melt, mint, and combine. In this scheme, there are two classes of participants:

[0107] Token Issuer (Alice) - Responsible for operating the token scheme and issuing tokens to token holders.

[0108] Token Holder (Bob) - A typical user of a token scheme who owns and can transfer issued tokens.

[0109] It is expected that Alice 103a and Bob 103b may be involved in each token operation, and the notion of signing the Merkle-ized transaction script is applied to ensure that the scheme has privacy interests for at least one of the two participants.

[0110] In this section, we separately consider the cases where (I) the token issuer and (II) the token holder are the main beneficiaries of this privacy benefit. In both cases, however, the scheme is privacy-preserving in the sense that we construct these signatures such that the signed message is based on a Merkle-ized form of the transaction. This has the advantage that we can prove that the token-related data in the transaction was part of the signed message without revealing anything about the rest of the signed data in the transaction. This allows a third party to verify the chain of token signatures using only the token-related data, i.e., the data related to the token transfer in the blockchain transaction. This gives token users greater privacy by allowing transactors to keep a private record of the rest of the transaction data.

[0111] This is particularly useful under the assumption that many blockchain nodes 104 will prune blockchain data that is not needed to validate further transactions. Under this assumption, non-token data of token-related transactions may be pruned by blockchain nodes, meaning that only the parties to these token transactions may still have a copy of the complete transaction data. This protocol allows for proof of token chain consumption without disclosing all of this additional data.

[0112] The transactions used to communicate token operations contain two signatures, called the blockchain signature and the token signature, respectively.

[0113] The blockchain signature may be a typical ECDSA signature that is subject to the (layer 1) blockchain rule set (i.e., must be valid when checked by OP_CHECKSIG) and is used to ensure that the token transaction is valid for inclusion in the blockchain according to at least one of the two participants. This signature therefore signs the regular transaction data, which may include the token-specific data stored therein.

[0114] The token signature can be any type of digital signature chosen for a particular token system implementation. This signature is subject to the (Layer 2) rule set of the token system and is used to prove the other participant's authorization of the token transaction. Script Merkle technology is leveraged to allow this signature to sign a Merkle-ized form of the transaction and / or its script. This allows the token signature to be constructed such that the signature can be verified without full disclosure / knowledge of the signed message. The token signature is the mechanism for ensuring the privacy interests of the token scheme of the present invention.

[0115] 5.1 Token Issuer (Alice)'s Benefits In this case, the blockchain signature Sig P B is constructed by the token holder Bob and the token signature Sig P A is constructed by the token issuer Alice. A typical token transaction Tx Token is shown in Figure 7, where:

number

[0116] Tx Token The first output of includes a script, labeled [TokenScript], that contains token-specific data for the token transaction. The token holder can then send a message covering the entire transaction.

number

number

[0117] The advantage here is that Alice, as the token issuer, can only deal with the data related to the token operation itself. This gives Bob the freedom to structure the rest of the transaction however he likes, while Alice benefits from Bob's increased privacy by only being responsible for the token-specific aspects of the transaction. This also makes sense from the perspective of blocking transaction content. For example, even if the rest of the transaction data other than the token script were determined to be illegitimate and redacted by a network node, the token issuer would still be able to attest and prove her role in authorizing the token operation itself without needing access to the redacted data. This is possible if Alice only has access to the Merkle leaf corresponding to the token script data, and the R TokenScript Merkle proofs of those leaves and signatures Sig P A This can be easily achieved by providing:

[0118] 5.2 Benefits of Token Holder (Bob) Another scenario may provide Bob with an additional privacy benefit that allows him to create the token signature instead. This may be achieved by swapping the roles of the participants in generating the signature in the previous case. However, a more advanced option involves two transactions. The first transaction Tx Token The second transaction Tx is the same as before, but with the token signature removed to convey only the token script information. TokenSig is introduced to separately convey Bob's token signature. These two transactions are shown in Figures 8A and 8B, where:

number

[0119] In this case, Bob's token signature is Sig'P B and included in the second transaction as the OP_RETURN data payload. A message signed by Bob

number

[0120] 5.3 Token Signature Signaling Given that token signatures do not need to follow the blockchain rule set, a signaling mechanism can be used to distinguish these signatures from standard blockchain-compatible ECDSA signatures in the script. Two exemplary measures that can be taken are:

[0121] SIGHASH Flag - Because token signatures use a modified message serialization algorithm, a custom SIGHASH flag can be applied to token signatures in a manner similar to that already used for Layer 1 blockchain signatures. Note that this flag does not have to be recognized by the blockchain software, instead it signals to off-chain software that a token-specific message serialization was used.

[0122] Version Numbers - The built-in version numbers used in the blockchain can also be repurposed to signal that a transaction includes a token signature. For example, by including a token-specific version number in the version field of a token transaction, off-chain agents can apply a Layer 2 rule set specific to the token scheme when parsing and processing the token transaction.

[0123] 6. Further notes Other variations or use cases of the disclosed techniques may become apparent to one of ordinary skill in the art given the disclosure herein. The scope of the present disclosure is not limited by the described embodiments, but only by the appended claims.

[0124] For example, some embodiments above are described with respect to the Bitcoin network 106, the Bitcoin blockchain 150, and the Bitcoin nodes 104. However, it will be understood that the Bitcoin blockchain is one particular example of the blockchain 150, and the above description may generally apply to any blockchain. That is, the present invention is not limited to the Bitcoin blockchain. More generally, any references above to the Bitcoin network 106, the Bitcoin blockchain 150, and the Bitcoin nodes 104 may be replaced with references to the blockchain network 106, the blockchain 150, and the blockchain nodes 104, respectively. The blockchains, blockchain networks, and / or blockchain nodes may share some or all of the described characteristics of the Bitcoin blockchain 150, the Bitcoin network 106, and the Bitcoin nodes 104 as described above.

[0125] In a preferred embodiment of the present invention, the blockchain network 106 is the Bitcoin network, and the Bitcoin nodes 104 perform at least all of the described functions of creating, issuing, propagating, and storing blocks 151 in the blockchain 150. It is not excluded that there may be other network entities (or network elements) that perform only one or some, but not all, of these functions. That is, a network entity may perform the function of propagating and / or storing blocks without creating and issuing blocks (recall that these entities are not considered to be nodes of the preferred Bitcoin network 106).

[0126] In other embodiments of the present invention, the blockchain network 106 may not be the Bitcoin network. In these embodiments, it is not excluded that a node may perform at least one or some, but not all, of the functions of creating, issuing, propagating, and storing blocks 151 of the blockchain 150. For example, on those other blockchain networks, a "node" may be used to refer to a network entity that is configured to create and issue blocks 151 but not store and / or propagate those blocks 151 to other nodes.

[0127] Even more generally, any reference above to the term “Bitcoin node” 104 may be replaced with the term “network entity” or “network element”, where such entity / element is configured to perform some or all of the roles of creating, issuing, propagating, and storing blocks. The functionality of such network entity / element may be implemented in hardware in the same manner as described above with reference to blockchain node 104.

[0128] It will be understood that the above embodiments have been described by way of example only. More generally, a method, apparatus or program may be provided according to any one or more of the following statements:

[0129] <Statement 1> A computer-implemented method for implementing a token protocol using a blockchain, the method being performed by a first party, obtaining a first blockchain transaction, the first blockchain transaction including a first output including a first locking script, the first locking script including token data; constructing a Merkle tree based on a first lock script, the token data being split across one or more leaves of the Merkle tree; generating a first signature based on a first message that includes the Merkle root of the Merkle tree; making the first signature available for inclusion in a second output of the first blockchain transaction; The method includes:

[0130] <Statement 2> The method described in Statement 1, wherein the first lock script includes one or more functions, and the step of constructing the Merkle tree includes a step of grouping one or more respective sequences of consecutive functions as respective leaves of the Merkle tree.

[0131] <Statement 3> The method described in Statement 2, wherein the first lock script includes a data function configured to indicate executed token data, and the step of constructing a Merkle tree includes including the data function as part of each leaf of each Merkle tree.

[0132] <Statement 4> The method described in Statement 3, wherein the first lock script includes a data length of the token data, and the step of constructing the Merkle tree is based on the data length.

[0133] <Statement 5> The method of statement 4, wherein the step of constructing a Merkle tree includes including a data length as part of each leaf of the same Merkle tree as the data function.

[0134] <Statement 6> The method of any of the preceding statements, wherein the token data is split across a plurality of respective leaves of the Merkle tree.

[0135] <Statement 7> The method of any of the preceding statements, wherein the step of making the first signature available for inclusion in the second output of the first blockchain transaction includes including the first signature in the second output.

[0136] <Statement 8> A method according to any of the preceding statements, wherein the step of obtaining the first blockchain transaction includes generating the first blockchain transaction.

[0137] <Statement 9> A method according to any one of statements 1 to 7, wherein the step of obtaining the first blockchain transaction includes receiving the first blockchain transaction from the second party.

[0138] <Statement 10> The method of any of the preceding statements, wherein the first blockchain transaction includes a second signature generated by a second party, the second signature based on a second message, and the second message is based on the first blockchain transaction.

[0139] <Statement 11> A method according to any of the preceding statements, comprising a step of submitting a first blockchain transaction to one or more blockchain nodes of a blockchain network.

[0140] <Statement 12> A method according to any of statements 1 to 10, comprising sending a first blockchain transaction to a second party for submission to one or more blockchain nodes of a blockchain network.

[0141] <Statement 13> A method according to statement 11 or statement 12, comprising a step of sending a Merkle proof of the token data to the requesting party.

[0142] <Statement 14> The method of statement 10 or any statement subordinate thereto, wherein the first signature and the second signature are different types of signatures.

[0143] <Statement 15> A computer-implemented method for implementing a token protocol using a blockchain, the method being performed by a second party, obtaining a first blockchain transaction, the first blockchain transaction including a first output including a first locking script, the first locking script including token data; constructing a transaction Merkle tree, wherein a plurality of respective leaves of the transaction Merkle tree are formed from one or more fields of a first blockchain transaction; generating a first signature based on a first message that includes the Merkle root of the transaction Merkle tree; The method includes:

[0144] <Statement 16> The method of statement 15, comprising generating a second blockchain transaction, the second blockchain transaction including a first output including the first signature.

[0145] <Statement 17> The method of statement 15, comprising including the first signature as part of the first blockchain transaction.

[0146] <Statement 18> A step of constructing a script Merkle tree based on a first lock script, the token data being split across one or more leaves of the Merkle tree, and the first message including the Merkle root of the script Merkle tree. The method described in statement 16 or any statement subordinate thereto, including:

[0147] <Statement 19> The method described in statement 18, wherein the first lock script includes one or more functions, and the step of constructing the script Merkle tree includes grouping one or more respective sequences of consecutive functions as respective leaves of the script Merkle tree.

[0148] <Statement 20> The method of statement 19, wherein the first locking script includes a data function configured to indicate token data when executed, and wherein the step of constructing a script Merkle tree includes including the data function as part of each leaf of the respective script Merkle tree.

[0149] <Statement 21> The method according to statement 19, wherein the first lock script includes a data length of the token data, and the step of constructing the script Merkle tree is based on the data length.

[0150] <Statement 22> The method of statement 21, wherein the step of constructing a script Merkle tree includes including the data length as part of each leaf of the script Merkle tree as the data function.

[0151] <Statement 23> The method of statement 18 or any statement subordinate thereto, wherein the token data is split across a plurality of respective leaves of the script Merkle tree.

[0152] <Statement 24> The method of statement 18 or any statement dependent thereon, wherein a field of the first blockchain transaction includes the first output, and the first lock script is replaced with the Merkle root of the script Merkle tree when constructing the transaction Merkle tree.

[0153] <Statement 25> The method of statement 1276 or any statement subordinate thereto, comprising a step of submitting the second blockchain transaction to one or more blockchain nodes of the blockchain network.

[0154] <Statement 26> A step of generating a second signature based on a second message, the second message being based on a second blockchain transaction; including the second signature in the input of the second blockchain transaction; The method described in statement 27 or any statement subordinate thereto, including:

[0155] <Statement 27> The method of statement 16 or any statement subordinate thereto, wherein the first transaction includes a third signature based on the third message, the third message being based on the first blockchain transaction.

[0156] <Statement 28> The method according to statement 26 or statement 27, wherein the first signature and the second signature are different types of signatures.

[0157] <Statement 29> The method according to statement 27 or statement 28, wherein the first signature and the third signature are different types of signatures.

[0158] <Statement 30> The method of statement 17 or any statement subordinate thereto, wherein one or more leaves of the transaction Merkle tree are formed from a plurality of fields of the second blockchain transaction.

[0159] <Statement 31> The method of statement 17 or any statement subordinate thereto, wherein one or more leaves of the transaction Merkle tree are formed from a single field of the second blockchain transaction.

[0160] <Statement 32> The method of statement 17 or any statement dependent thereon, wherein one or more leaves of the transaction Merkle tree are formed from respective portions of respective fields of the second blockchain transaction but not from the entire respective fields.

[0161] <Statement 33> A computer device, a memory comprising one or more memory units; A processing device comprising one or more processing units, the memory storing code configured to be executed on the processing device, the code being configured, when on the processing device, to perform a method according to any of statements 1 to 32; 1. A computer device comprising:

[0162] <Statement 34> A computer program embodied in a computer-readable storage device and configured to execute the method according to any one of statements 1 to 32 when executed on one or more processors.< / txid> < / scriptpubkey> < / scriptpubkeylen> < / value> < / scriptsig> < / sequence> < / scriptsiglen> < / vout> < / locktime> < / version> < / pubkeyhash> < / data>

Claims

1. 1. A computer-implemented method for implementing a token protocol using a blockchain, the method being performed by a first party and comprising: obtaining a first blockchain transaction, the first blockchain transaction including a first output including a first locking script, the first locking script including token data; constructing a Merkle tree based on the first lock script, the token data being split across one or more leaves of the Merkle tree; generating a first signature based on a first message that includes the Merkle root of the Merkle tree; making the first signature available for inclusion in a second output of the first blockchain transaction; The method includes:

2. 2. The method of claim 1 , wherein the first lock script includes one or more functions, and wherein constructing the Merkle tree includes grouping one or more respective sequences of consecutive functions as respective leaves of the Merkle tree.

3. 3. The method of claim 2, wherein the first lock script includes a data function configured to indicate the token data that has been executed, and wherein the step of constructing the Merkle trees includes including the data function as part of each leaf of the respective Merkle tree.

4. 4. The method of claim 3, wherein the first lock script includes a data length of the token data, and the constructing the Merkle tree is based on the data length.

5. 5. The method of claim 4, wherein the step of constructing the Merkle tree includes including the data length as part of each leaf of the Merkle tree as the data function.

6. 2. The method of claim 1, wherein the token data is split across a plurality of the respective leaves of the Merkle tree.

7. 2. The method of claim 1 , wherein the step of making the first signature available for inclusion in the second output of the first blockchain transaction comprises including the first signature in the second output.

8. 2. The method of claim 1, wherein obtaining the first blockchain transaction comprises generating the first blockchain transaction.

9. 2. The method of claim 1, wherein obtaining the first blockchain transaction comprises receiving the first blockchain transaction from a second party.

10. 2. The method of claim 1 , wherein the first blockchain transaction includes a second signature generated by the second party, the second signature based on a second message, and the second message is based on the first blockchain transaction.

11. 2. The method of claim 1, comprising submitting the first blockchain transaction to one or more blockchain nodes of a blockchain network.

12. 2. The method of claim 1, comprising transmitting the first blockchain transaction to the second party for submission to one or more blockchain nodes of a blockchain network.

13. 12. The method of claim 11, comprising transmitting a Merkle proof of the token data to a requesting party.

14. The method of claim 10 , wherein the first signature and the second signature are different types of signatures.

15. 1. A computer-implemented method for implementing a token protocol using a blockchain, the method being performed by a second party, comprising: obtaining a first blockchain transaction, the first blockchain transaction including a first output including a first locking script, the first locking script including token data; constructing a transaction Merkle tree, wherein a plurality of respective leaves of the transaction Merkle tree are formed from one or more fields of the first blockchain transaction; generating a first signature based on a first message that includes the Merkle root of the transaction Merkle tree; The method includes:

16. 1. A computer device comprising: a memory comprising one or more memory units; A processing device comprising one or more processing units, the memory storing code configured to be executed on the processing device, the code being configured, when on the processing device, to execute the method according to any one of claims 1 to 15; 1. A computer device comprising:

17. A computer program embodied on a computer readable storage and configured to perform the method of any one of claims 1 to 15 when executed on one or more processors.

Citation Information

Patent Citations

  • Certification method for authenticity of electronic document and electronic document disclosure system

    JP2007129507A

  • Integrity verification of pseudonymized documents

    US20090070361A1

  • Verification of data fields of blockchain transactions

    WO2020240296A1

  • Single-use tokens

    WO2021140376A1