Data obfuscation
By segmenting data into parts and generating salt-based leaf hashes within Merkle trees, the method enhances privacy in blockchain systems, preventing eavesdroppers from guessing sensitive information and allowing selective data revelation, thus addressing privacy issues in Merkle trees.
Patent Information
- Application Number
- PCT/EP2024/060262
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-16
- Filing Date
- 2024-04-16
- Publication Date
- 2024-11-21
AI Technical Summary
Merkle trees in blockchain systems face privacy issues when data in leaves is restricted to a small number of values, making it easy for eavesdroppers to guess sensitive information, such as birth dates, especially when combined with Merkle proofs.
A method of obfuscating data by segmenting it into parts and generating leaf hashes as a function of each data segment and a salt value, derived from an initial salt value or other data segments, to create a root hash, which enhances privacy without requiring zero-knowledge proofs.
This approach effectively prevents knowledge of one data piece from revealing others, ensuring privacy and security by making it computationally expensive for eavesdroppers to derive additional data, even with Merkle proofs, and allows for selective data revelation without storing multiple salts.
Smart Images

Figure EP2024060262_21112024_PF_FP_ABST
Abstract
Description
[0001]DATA OBFUSCATION TECHNICAL FIELD The present disclosure relates to a method of obfuscating data which allows for parts of the data to be redacted. BACKGROUND Merkle Trees are hierarchical data structures that enable secure verification of collections of data. In a Merkle tree, each node in the tree has been given an index pair(^^, ^^)and is represented as ^^ The indices ^^, ^^ are simply numerical labels that are related to a specific position in the tree. A feature of the Merkle tree is that the construction of each of its nodes is governed by the following equations , where and ^^ is a cryptographic hash function. A binary Merkle tree constructed according to these equations is shown in Figure 3. As shown, we can see that the ^^ = ^^ case corresponds to a leaf node, which is simply the hash of the corresponding ^^௧^packet of data ^^^. The ^^ ≠ ^^ case corresponds to an internal or parent node, which is generated by recursively hashing and concatenating child nodes until one parent (the Merkle root) is found. For example, the node ^^(1,4)is constructed from the four data packets ^^^, … , ^^ସas^^ = ^ ^^൫ ^^( ^^^) ^^( ^^ଶ)൯ ^^൫ ^^( ^^ଷ) ^^( ^^ସ)൯൧. For Merkle trees in Bitcoin and some other blockchains, the hash function is double SHA256, which is to apply the standard hash function SHA-256 twice: ^^( ^^) = ^^ ^^ ^^256( ^^ ^^ ^^256( ^^)). The primary function of a Merkle tree is to verify that some data packet ^^^is a member of a list or set of ^^ data packets ^^ ∈^^^^, … , ^^ேି^^. The mechanism for verification is known as a Merkle proof and involves obtaining a set of hashes known as the Merkle path for a given data packet ^^^and Merkle root ^^. The Merkle proof for a data packet is simply the minimum list of hashes required to reconstruct the root ^^ by way of repeated hashing and concatenation, often referred to as the ‘authentication proof’. If the Merkle root is stored on a blockchain (or some other public resource) or digitally signed, any change to a leaf node results in a different Merkle root, and therefore will contradict the on-chain record or signature. SUMMARY The method of splitting data and encoding the data into a Merkle root is known. However, if the data in the leaves is restricted to a small number of possible values, it may be easy to guess. This also impacts privacy. For example, if an eavesdropper, Eve, knows a Merkle root where each leaf contains Alice’s day of birth, month of birth, and year of birth, respectively, it would be very easy for Eve to brute force a range of values to learn Alice’s date of birth. If Eve also has access to a Merkle proof for one or more of the leaves, Eve has even more information and only has to find a matching inner hash of the Merkle tree to determine a value for, e.g. Alice’s year of birth. The present disclosure provides a method that can be used to prevent this by further obfuscating the data. According to one aspect disclosed herein, there is provided a computer-implemented method of obfuscating data, wherein the data is segmented into a plurality of respective data segments, and wherein the method comprises: for each respective data segment, generating a respective leaf hash of a hash tree, wherein the respective leaf hash is a function of the respective data segment and a respective salt value, wherein each of the respective salt values is derived from: an initial salt value; and / or from one or more of the data segments; and generating a root hash of the hash tree, wherein the hash tree comprises each of the respective leaf hashes. Embodiments of the present disclosure provide a method to obfuscate the data, or equivalently the leaves of the hash tree (i.e. a hash based tree structure). In general any type of hash tree may be used. For instance, the hash tree may be a binary hash tree (i.e. a Merkle tree) in which each hash of a higher level of the tree is based on two hashes (or data items) of the previous level. In contrast to a conventional hash tree, the leaves (i.e. leaf hashes) of the tree are replaced with a function of the data and an obfuscation value, referred to herein as a “salt” (or “salt value”). Any suitable hash function may be used, such as SHA256. Note also that any reference to applying a hash function (i.e. hashing) may be taken to mean applying multiple hash functions, which may be the same or different, e.g. double SHA256. One option would be to just combine each leaf of data with a completely random salt each time, but then each salt must be kept track of and proven to be the correct salt without revealing the other salts. Other examples involve linking the salts and / or the data via a function such that only a single salt requires storing. In general, each of the respective salt values may be based on or derived from one or more of an initial salt value, and one or more of the data segments. For example, the salt value for a given data segment may be determined as a function of that data segment; as a function of another data segment; as a function of two or more data segments which may or may not include that data segment; as a function of another salt value, or combinations thereof. To summarise, embodiments involve obfuscating the data in a leaf such that knowledge of one piece of data does not reveal more leaves. Some embodiments involve creating links between the obfuscation values to avoid storing many salts. We take ^^ pieces of data ^^^for ^^ = 0, … , ^^ − 1. Each piece of data can be anything, such as a single bit, letter, or word. These are mapped to leaves in a hash with each leaf representing a single ^^^. We can then replace the leaves with ^^( ^^^, ^^^) where ^^^is the salt. Some examples assume a link between ^^^, or else each salt must be stored for each leaf ^^, which doubles the size of the data that must be stored. Examples of the function ^^ and the salt ^^^are described below. Embodiments described herein advantageously enable a user to redact data without needing zero-knowledge proofs (ZKPs) which can be complicated and resource intensive to execute. Similarly, a user can reveal partial data without the use of ZKPs. BRIEF DESCRIPTION OF THE DRAWINGS To assist understanding of embodiments of the present disclosure and to show how such embodiments may be put into effect, reference is made, by way of example only, to the accompanying drawings in which: Figure 1 is a schematic block diagram of a system for implementing a blockchain, Figure 2 schematically illustrates some examples of transactions which may be recorded in a blockchain, Figure 3 illustrates an example of a Merkle tree, and Figure 4 illustrates an example of a hash tree generated according to embodiments of the present disclosure. DETAILED DESCRIPTION OF EMBODIMENTS 1. OBFUSCATING / REDACTING DATA Embodiments of the present disclosure involve encoding data into a hash tree. For convenience, embodiments will be described as being performed by Alice 103a. However in general they may be performed by any entity (call it a “tree generator”) who need not necessarily be configured to perform some or all of the actions described below as being performed by Alice 103a with reference to Figures 1 and 2, though that is also an option. It is also not excluded that the tree generator maybe configured to perform any action described below as being performed by Bob 103b. The tree generator, Alice 103a, obtains data to be encoded into a hash tree. The data may be a single data item (e.g. a message, a document, an image, etc.) or comprise multiple data items, which may be the same type of data or different, or a combination. Alice 103a splits the data into a number of components (i.e. parts, segments, portions). Alternatively, the data may already have been split into the multiple components at the point Alice 103a obtains the data. Each component may be the same size, or one or more components may be different sizes. In the case that the data is made up of multiple data items, each component may contain a whole data item. Generally the data may be divided in any way. For example, the data may be Alice’s passport information. Each data component may comprise an individual field of the passport, e.g. name, nationality, date of birth, photograph, etc. A data component may comprise some but not all of an individual field, e.g. Alice’s year of birth. Alice 103a then generates a hash tree based on the data components. Conventionally, a leaf hash of a hash tree (e.g. a Merkle tree) is generated by hashing only the data component. In contrast, according to embodiments of the present disclosure, for each individual data component of the data, a leaf hash of the hash tree is generated as a function of the data component and a salt value. The salt values act to obfuscate the data components, such that without knowledge of the salt value it is not possible, or at least extremely difficult and computationally expensive, to derive other parts of the hash tree, even if an individual data component is known. Put another way, if there are n respective data components, then n respective leaf hashes of the hash tree are generated based on n respective data components and n respective salt values. One or more leaf hashes of the hash tree may not be based on a data component. For example, one or more leaf hashes may be based on padding, e.g. depending on the number of data components. As another example, a leaf hash may be based on one or more salt values. Alice 103a generates the remaining hashes of the hash tree, including the root hash. The remaining hashes may be generated in the conventional manner of concatenating pairs of leaf hashes (or more than two hashes in the case of a non-binary hash tree) and hashing the result to generate an inner hash, and repeating the process of concatenating hashes and hashing the result until only a single hash remains: the root hash. The hash tree may be a binary hash tree, such as a Merkle tree (although strictly the hash tree is not a Merkle tree as defined by the equation above for the ^^ = ^^ case since the leaf hashes are generated in a novel way). However the skilled person will understand that the structure of the hash tree may resemble a Merkle tree, with the exception that the leaf hashes are generated as a function of a salt value and not just a data component. Alice 103a may output the root hash. Alice 103a may output the root hash to memory, send the root hash to a different party (e.g. Bob 103b), and / or publish the root hash. For instance, Alice 103a may cause the root hash to be published on a blockchain 150, e.g. by submitting a transaction comprising the root hash to a blockchain node 104 or to a different party to be forwarded to a blockchain node 104. The root hash may be published elsewhere, such as on a blog post, a web page controlled by an authority, etc. Additionally or alternatively, Alice 103a may sign the root hash using her private key and output the resulting signature. For example, the signed hash may be output to memory, to a different party (e.g. Bob 103b), and / or published, e.g. to the blockchain 150. Alice 103a may send a data component and a corresponding salt value to a party (e.g. Bob 103b) to prove that the data component is represented by the root hash. Alice 103a may send multiple data components and corresponding salt values. In some examples, Alice 103a may send some but not all of the data components and corresponding salt values. This allows Alice 103a to selectively reveal one or more components of the data. Put another way, this allows Alice 103a to redact one or more components of the data. Turning now to the function for generating leaf hashes. In some examples, a leaf hash may be generated based on a hash of the data component. The leaf hash may also be based on a hash of the salt value. E.g. the leaf hash may be a concentration of the hash of the data component and the hash of the salt value. As another example, the function may compute an XOR operation (or a different operation) of the hash of the data component and the hash of the salt value. In some examples, a leaf hash may be generated based on a hash of the data component and the salt value, e.g. an addition of the data component and the salt value. The leaf hash may also be based on a separate integer, e.g. an addition of the data component and a multiplication of the salt value and the integer. Conditions may be placed on the integer, e.g. it may be required to be a certain value or be of a certain size. In some examples, the function for generating a leaf hash may be a Hash-based message authentication code (HMAC) function, wherein the data component is input to the HMAC function as the message and the salt value is input the HMAC function as the secret key. Turning now to the salt values. Preferably a different salt value is used for each data component. It is also preferable, but not essential, that each salt value can be derived from a single salt value, referred to herein as an “initial salt value”. As an example, a plurality of salt values may be generated by repeatedly hashing the initial salt value. For instance, if there are n data components, the initial salt value may be hashed n-1 times, resulting in n salt values. Or, the initial salt value may be hashed n times, with the initial salt value not being used as a salt value. The data components may have an order, i.e. a first data component, followed by a second data component, and so on. The salt values may also have an order, i.e. a first salt value (e.g. the initial salt value), followed by a second salt value, and so on. The first salt value may be used together with the first data component to generate the first leaf hash. Similarly, the second salt value may be used together with the second data component to generate the second leaf hash, and so on. Put another way, the ithsalt value is used with the ithdata component to generate the ithleaf hash of the hash tree. Alternatively, the salt value used for a given data component may not necessarily be the same salt value having the same corresponding position within the order of data components. A function may be used to determine which salt value is used for which data component. As another example for generating salt values, a salt value for a data component may be generated by hashing a different data component. For example, the ithsalt value may be generated by hashing the i-1thdata component. As an exception, the salt value for the first data component may be the initial salt value. As another example, a salt value for a data component may be generated by encrypting a different salt value with a private key controlled by Alice 103a. For example, the ithsalt value may be generated by encrypting the i-1thsalt value. As an exception, the salt value for the first data component may be the initial salt value. As mentioned above, the initial salt value may be stored as part of the hash tree, e.g. as a leaf hash. For instance, leaf 0 can be kept as a placeholder to record the salt and the leaf hash generated method being used. In examples where a hash function is used to generate a leaf hash and a hash function is used to generate a salt value, the hash functions may be the same or different. Using different hash functions improves privacy and security of the data component. In general the data may be split in any way, e.g. a data component may comprise a single bit, letter, word, image, etc. In some cases the number of leaves might give away information about the data. For example, if each leaf represents a letter in a word and one of the letters is known, along with a Merkle proof, then a malicious party might be able to guess the other letters or derive them. Alice can prevent this by using padding between words. Note that whilst the examples above have been described in terms of the hash tree being generated entirely by Alice 103a, it is not excluded that there may be multiple tree generators who contribute to generating the hash tree. For example, different tree generators may generate different parts of the hash tree, such that any given tree generator cannot gain information about parts of the hash tree which they have not contributed to. A first tree generator may generate a first part of the tree based on first data (e.g. data known only to the first tree generator), a second tree generator may generate a second part o the tree based on second data (e.g. data known only to the second tree generator), and so on. 1.1 Examples of obfuscation functions This section describes example functions for generating leaf hashes of the hash tree based on data segments ^^^and salt values ^^^: 1. ^^(^^^, ^^^)= ℎ ^^ ^^ℎ^(^^^)||ℎ ^^ ^^ℎ^(^^^). This is equivalent to adding another layer to thehash tree with ^^^between each leaf ^^^and ^^^ା^. 2. ^^(^^^, ^^^)= ℎ ^^ ^^ℎ^( ^^^+ ^^^∗ ^^), where ^^ is larger than the space of possible values for ^^^. The value ^^ may be standardised or fixed. 3. ^^(^^^, ^^^)= ^^ ^^ ^^ ^^(^^^, ^^^), where ^^^ is used as a key in the HMAC function.4. ^^(^^^, ^^^)= ℎ ^^ ^^ℎ^(^^^)^^ ^^ ^^ ℎ ^^ ^^ℎ^( ^^^), where the hash ensures both ^^^, ^^^ are thesame length. 5. ^^ which may be symmetric or asymmetric encryption. The value ℎ ^^ ^^ℎ^( ^^^) is translated to a public key for asymmetric encryption. Note there are other options for functions which exclude hash functions, but they typically offer lower security and / or privacy. 1.2 Examples of salt ^^^This section describes example functions for generating salt values for use in generating leaf hashes of the hash tree: 1. ^^^= ℎ ^^ ^^ℎଶ( ^^^ି^) and ^^^= ^^ ^^ ^^ ^^. 2. ^^^= ℎ ^^ ^^ℎଶ( ^^^ି^) and ^^^= ^^ ^^ ^^ ^^. 3. ^^^= ^^ ^^ ^^^^( ^^^ି^) and ^^^= ^^ ^^ ^^ ^^, where PK may be, for example, derived using Bitcoin improvement proposal (BIP32) or any other type of key derivation method that uses hash functions to derive the public key, PK.. 4. ^^^= ℎ ^^ ^^ℎଶ^( ^^ ^^ ^^ ^^) where ^^ = ℎ ^^ ^^ℎ( ^^^ି^) ^^ ^^ ^^ ^^, which effectively creates a hash chain as in (2) but with a randomized order. 1.3 Example Use Cases Example 1: Assume Alice 103a wants to use a copy of her passport to prove her age without revealing the place she was born, or other data contained in her passport. She requests an Authority with public key ^^ ^^ to generate a signature on a Merkle root, where the leaves contain each section of her passport, as shown in Figure 4. In order to prove to Bob 103b that she is over 18, she provides the leaves containing her date of birth and her photograph, the corresponding Merkle proof for those leaves, along with the signature on the Merkle root. Her date of birth may also be split so she can reveal only her year of birth and no other information if she chooses. Example 2: Assume Alice 103a wants to prove that she works for Block Company to Bob 103b without revealing her compensation package. She can request that Block Company signs a Merkle root containing her contract, with each leaf containing a page of the contract. She can then reveal the relevant page, Merkle proof, and the signature by Block Company to Bob 103b, who can verify the signature and Merkle root. Example 3: Assume Alice 103a and Bob 103b want to prove to Charlie that they had a formal contract starting on January 2020 without revealing all the details of the agreement. In January 2020, they stored the Merkle root of the Merklized contract (i.e. the contract encoded into a Merkle tree) on the blockchain 150. Alice 103a and Bob 103b can give the proof that the root was stored on the blockchain (i.e. transaction and Merkle proof of transaction) and the relevant leaves in the Merkle tree for Charlie to verify. Example 4: Assume Alice 103a has taken a photograph of a scene. However the scene contains people and she does not have permission to show their faces. Alice 103a encodes the photograph as a Merkle tree, where the data representing the faces are separated into leaves of the Merkle tree. Alice 103a can reveal to Bob 103b the rest of the photograph, but not the leaves including the faces, effectively blurring the faces. 2. EXAMPLE SYSTEM OVERVIEW A blockchain refers to a form of distributed data structure, wherein a duplicate copy of the blockchain is maintained at each of a plurality of nodes in a distributed peer-to-peer (P2P) network (referred to below as a “blockchain network”) and widely publicised. The blockchain comprises a chain of blocks of data, wherein each block comprises one or more transactions. Each transaction, other than so-called “coinbase transactions”, points back to a preceding transaction in a sequence which may span one or more blocks going back to one or more coinbase transactions. Coinbase transactions are discussed further below. Transactions that are submitted to the blockchain network are included in new blocks. New blocks are created by a process often referred to as “mining”, which involves each of a plurality of the nodes competing to perform “proof-of-work”, i.e. solving a cryptographic puzzle based on a representation of a defined set of ordered and validated pending transactions waiting to be included in a new block of the blockchain. It should be noted that the blockchain may be pruned at some nodes, and the publication of blocks can be achieved through the publication of mere block headers. The transactions in the blockchain may be used for one or more of the following purposes: to convey a digital asset (i.e. a number of digital tokens), to order a set of entries in a virtualised ledger or registry, to receive and process timestamp entries, and / or to time- order index pointers. A blockchain can also be exploited in order to layer additional functionality on top of the blockchain. For example, blockchain protocols may allow for storage of additional user data or indexes to data in a transaction. There is no pre-specified limit to the maximum data capacity that can be stored within a single transaction, and therefore increasingly more complex data can be incorporated. For instance this may be used to store an electronic document in the blockchain, or audio or video data. In an “output-based” model (sometimes referred to as a UTXO-based model), the data structure of a given transaction comprises one or more inputs and one or more outputs. Any spendable output comprises an element specifying an amount of the digital asset that is derivable from the proceeding sequence of transactions. The spendable output is sometimes referred to as a UTXO (“unspent transaction output”). The output may further comprise a locking script specifying a condition for the future redemption of the output. A locking script is a predicate defining the conditions necessary to validate and transfer digital tokens or assets. Each input of a transaction (other than a coinbase transaction) comprises a pointer (i.e. a reference) to such an output in a preceding transaction, and may further comprise an unlocking script for unlocking the locking script of the pointed-to output. So consider a pair of transactions, call them a first and a second transaction (or “target” transaction). The first transaction comprises at least one output specifying an amount of the digital asset, and comprising a locking script defining one or more conditions of unlocking the output. The second, target transaction comprises at least one input, comprising a pointer to the output of the first transaction, and an unlocking script for unlocking the output of the first transaction. 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 criteria for validity applied at each node will be that the unlocking script meets all of the one or more conditions defined in the locking script of the first transaction. Another will be that the output of the first transaction has not already been redeemed by another, earlier valid transaction. Any node that finds the target transaction invalid according to any of these conditions will not propagate it (as a valid transaction, but possibly to register an invalid transaction) nor include it in a new block to be recorded in the blockchain. An alternative type of transaction model is an account-based model. In this case each transaction does not define the amount to be transferred by referring back to the UTXO of a preceding transaction in a sequence of past transactions, but rather by reference to an absolute account balance. The current state of all accounts is stored by the nodes separate to the blockchain and is updated constantly. Figure 1 shows an example system 100 for implementing a blockchain 150. The system 100 may comprise a packet-switched network 101, typically a wide-area internetwork such as the Internet. The packet-switched network 101 comprises a plurality of blockchain nodes 104 (often referred to as “miners”) that may be arranged to form a peer-to-peer (P2P) network 106 within the packet-switched network 101. Whilst not illustrated, the blockchain nodes 104 may be arranged as a near-complete graph. Each blockchain node 104 is therefore highly connected to other blockchain nodes 104. Each blockchain node 104 comprises computer equipment of a peer, with different ones of the nodes 104 belonging to different peers. Each blockchain node 104 comprises processing apparatus comprising one or more processors, e.g. one or more central processing units (CPUs), accelerator processors, application specific processors and / or field programmable gate arrays (FPGAs), and other equipment such as application specific integrated circuits (ASICs). Each node also comprises memory, i.e. computer-readable storage in the form of a non-transitory computer-readable medium or media. The memory may comprise one or more memory units employing one or more memory media, e.g. a magnetic medium such as a hard disk; an electronic medium such as a solid-state drive (SSD), flash memory or EEPROM; and / or an optical medium such as an optical disk drive. The blockchain 150 comprises a chain of blocks of data 151, wherein a respective copy of the blockchain 150 is maintained at each of a plurality of blockchain nodes 104 in the distributed or blockchain network 106. As mentioned above, maintaining a copy of the blockchain 150 does not necessarily mean storing the blockchain 150 in full. Instead, the blockchain 150 may be pruned of data so long as each blockchain node 150 stores the block header (discussed below) of each block 151. Each block 151 in the chain comprises one or more transactions 152, wherein a transaction in this context refers to a kind of data structure. The nature of the data structure will depend on the type of transaction protocol used as part of a transaction model or scheme. A given blockchain will use one particular transaction protocol throughout. A blockchain node 104 may be configured to forward transactions 152 to other blockchain nodes 104, and thereby cause transactions 152 to be propagated throughout the network 106. A blockchain node 104 may be configured to create blocks 151 and to store a respective copy of the same blockchain 150 in their respective memory. A blockchain node 104 may also maintain an ordered set (or “pool”) 154 of transactions 152 waiting to be incorporated into blocks 151. The ordered pool 154 is often referred to as a “mempool”. This term herein is not intended to limit to any particular blockchain, protocol or model. It refers to the ordered set of transactions which a node 104 has accepted as valid and for which the node 104 is obliged not to accept any other transactions attempting to spend the same output. In a given present transaction 152j, the (or each) input comprises a pointer referencing the output of a preceding transaction 152i in the sequence of transactions, specifying that this output is to be redeemed or “spent” in the present transaction 152j. Spending or redeeming does not necessarily imply transfer of a financial asset, though that is certainly one common application. More generally spending could be described as consuming the output, or assigning it to one or more outputs in another, onward transaction. In general, the preceding transaction could be any transaction in the ordered set 154 or any block 151. The preceding transaction 152i need not necessarily exist at the time the present transaction 152j is created or even sent to the network 106, though the preceding transaction 152i will need to exist and be validated in order for the present transaction to be valid. Hence “preceding” herein refers to a predecessor in a logical sequence linked by pointers, not necessarily the time of creation or sending in a temporal sequence, and hence it does not necessarily exclude that the transactions 152i, 152j be created or sent out-of-order (see discussion below on orphan transactions). The preceding transaction 152i could equally be called the antecedent or predecessor transaction. Due to the resources involved in transaction validation and publication, typically at least each of the blockchain nodes 104 takes the form of a server comprising one or more physical server units, or even whole a data centre. However in principle any given blockchain node 104 could take the form of a user terminal or a group of user terminals networked together. The memory of each blockchain node 104 stores software configured to run on the processing apparatus of the blockchain node 104 in order to perform its respective role or roles and handle transactions 152 in accordance with the blockchain node protocol. It will be understood that any action attributed herein to a blockchain node 104 may be performed by the software run on the processing apparatus of the respective computer equipment. The node software may be implemented in one or more applications at the application layer, or a lower layer such as the operating system layer or a protocol layer, or any combination of these. Any given blockchain node may be configured to perform one or more of the following operations: validating transactions, storing transactions, propagating transactions to other peers, performing consensus (e.g. proof-of-work) / mining operations. In some examples, each type of operation is performed by a different node 104. That is, nodes may specialise in particular operation. For example, a nodes 104 may focus on transaction validation and propagation, or on block mining. In some examples, a blockchain node 104 may perform more than one of these operations in parallel. Any reference to a blockchain node 104 may refer to an entity that is configured to perform at least one of these operations. Also connected to the network 101 is the computer equipment 102 of each of a plurality of parties 103 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 recipients in transactions. Other users may interact with the blockchain 150 without necessarily acting as senders or recipients. For instance, 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). Some or all of the parties 103 may be connected as part of a different network, e.g. 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; however, these users are not blockchain nodes 104 as they do not perform the roles required of the blockchain nodes. Instead, each party 103 may interact with the blockchain network 106 and thereby utilize the blockchain 150 by connecting to (i.e. communicating with) a blockchain node 106. Two parties 103 and their respective equipment 102 are shown for illustrative purposes: a first party 103a and his / her respective computer equipment 102a, and a second party 103b and his / her respective computer equipment 102b. It will be understood that many more such parties 103 and their respective computer equipment 102 may be present and participating in the system 100, but for convenience they are not illustrated. Each party 103 may be an individual or an organization. Purely by way of illustration the first party 103a is referred to herein as Alice and the second party 103b is referred to as Bob, but it will be appreciated that this is not limiting and any reference herein to Alice or Bob may be replaced with “first party” and “second “party” respectively. The computer equipment 102 of each party 103 comprises respective processing apparatus comprising 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 memory, i.e. computer-readable storage in the form of a non-transitory computer-readable medium or media. This memory may comprise one or more memory units employing one or more memory media, e.g. a magnetic medium such as hard disk; an electronic medium such as an SSD, flash memory or EEPROM; and / or an optical medium such as an optical disc drive. The memory on the computer equipment 102 of each party 103 stores software comprising a respective instance of at least one client application 105 arranged to run on the processing apparatus. It will be understood that any action attributed herein to a given party 103 may be performed using the software run on the processing apparatus 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 smartwatch. The computer equipment 102 of a given party 103 may also comprise one or more other networked resources, such as cloud computing resources accessed via the user terminal. The client application 105 may be initially provided to the computer equipment 102 of any given party 103 on suitable computer-readable storage medium or media, e.g. downloaded from a server, or provided on a removable storage device such as a removable SSD, flash memory key, removable EEPROM, removable magnetic disk drive, magnetic floppy disk or tape, optical disk such as a CD or DVD ROM, or a removable optical drive, etc. The client application 105 comprises at least a “wallet” function. This has two main functionalities. One of these is to enable the respective party 103 to create, authorise (for example sign) and send transactions 152 to one or more bitcoin nodes 104 to then be propagated throughout the network of blockchain nodes 104 and thereby included in the blockchain 150. The other is to report back to the respective party the amount of the digital asset that he or she currently owns. In an output-based system, this second functionality comprises collating the amounts defined in the outputs of the various 152 transactions scattered throughout the blockchain 150 that belong to the party in question. Note: whilst the various client functionality may be described as being integrated into a given client application 105, this is not necessarily limiting and instead any client functionality described herein may instead be implemented in a suite of two or more distinct applications, e.g. interfacing via an API, or one being a plug-in to the other. More generally the client functionality could be implemented at the application layer or a lower layer such as the operating system, or any combination of these. The following will be described in terms of a client application 105 but it will be appreciated that this is not limiting. The instance of the client application or software 105 on each computer equipment 102 is operatively coupled to at least one of the blockchain nodes 104 of the network 106. This enables the wallet function of the client 105 to send transactions 152 to the network 106. The client 105 is also able to contact blockchain nodes 104 in order to query the blockchain 150 for any transactions of which the respective party 103 is the recipient (or indeed inspect other parties’ transactions in the blockchain 150, since in embodiments the blockchain 150 is a public facility which provides trust in transactions in part through its public visibility). The wallet function on each computer equipment 102 is configured to formulate and send transactions 152 according to a transaction protocol. As set out above, each blockchain node 104 runs software configured to validate transactions 152 according to the blockchain node protocol, and to forward transactions 152 in order to propagate them throughout the blockchain network 106. The transaction protocol and the node protocol correspond to one another, and a given transaction protocol goes with a given node protocol, together implementing 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 the nodes 104 in the network 106. An alternative type of transaction protocol operated by some blockchain networks may be referred to as an “account-based” protocol, as part of an account-based transaction model. In the account-based case, each transaction does not define the amount to be transferred by referring back to the UTXO of a preceding transaction in a sequence of past transactions, but rather by reference to an absolute account balance. The current state of all accounts is stored, by the nodes of that network, separate to the blockchain and is updated constantly. In such a system, transactions are ordered using a running transaction tally of the account (also called the “position” or “nonce”). This value is signed by the sender as part of their cryptographic signature and is hashed as part of the transaction reference calculation. In addition, an optional data field may also be signed the transaction. This data field may point back to a previous transaction, for example if the previous transaction ID is included in the data field. Some account-based transaction models share several similarities with the output-based transaction model described herein. For example, as mentioned above, the data field of an account-based transaction may point back to a previous transaction, which is equivalent to the input of an output-based transaction which references an outpoint a previous transaction. Thus both models enable linking between transactions. As another example, an account-based transaction contains a “recipient” field (in which a receiving address of an account is specified) and a “value” field (in which an amount of digital asset may be specified). Together the recipient and value fields are equivalent to the output of an output- based transaction which may be used to assign an amount of digital asset to a blockchain address. Similarly, an account-based transaction has a “signature” field which includes a signature for the transaction. The signature is generated using the sender's private key and confirms the sender has authorized this transaction. This is equivalent to an input / unlocking script of an output-based transaction which, typically, includes a signature for the transaction. When both types of transaction are submitted to their respective blockchain networks, the signatures are checked to determine whether the transaction is valid and can be recorded on the blockchain. On an account-based blockchain, a “smart contact” refers to a transaction that contains a script configured to perform one or more actions (e.g. send or “release” a digital asset to a recipient address) in response to one or more inputs (provided by a transaction) meeting one or more conditions defined by the smart contact’s script. The smart contract exists as a transaction on the blockchain, and can be called (or triggered) by subsequent transactions. Thus, in some examples, a smart contract may be considered equivalent to a locking script of an output-based transaction, which can be triggered by a subsequent transaction, and checks whether one or more conditions defined by the locking script are met by the input of the subsequent transaction. 3. UTXO-BASED MODEL Figure 2 illustrates an example transaction protocol. This is an example of a UTXO-based protocol. A transaction 152 (abbreviated “Tx”) is the fundamental data structure of the blockchain 150 (each block 151 comprising one or more transactions 152). The following will be described by reference to an output-based or “UTXO” based protocol. However, this is not limiting to all possible embodiments. Note that while the example UTXO-based protocol is described with reference to bitcoin, it may equally be implemented on other example blockchain networks. In a UTXO-based model, each transaction (“Tx”) 152 comprises a data structure comprising one or more inputs 202, and one or more outputs 203. Each output 203 may comprise an unspent transaction output (UTXO), which can be used as the source for the input 202 of another new transaction (if the UTXO has not already been redeemed). The UTXO includes a value specifying an amount of a digital asset. This represents a set number of tokens on the distributed ledger. The UTXO may also contain the transaction ID of the transaction from which it came, amongst other information. The transaction data structure may also comprise a header 201, which may comprise an indicator of 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 embodiments the transaction ID is the hash of the transaction data (excluding the transaction ID itself) and stored in the header 201 of the raw transaction 152 submitted to the nodes 104. Say Alice 103a wishes to create a transaction 152j transferring an amount of the digital asset in question to Bob 103b. In Figure 2 Alice’s new transaction 152j is labelled “Tx1”. It takes an amount of the digital asset that is locked to Alice in the output 203 of a preceding transaction 152i in the sequence, and transfers at least some of this to Bob. The preceding transaction 152i is labelled “Tx0” in Figure 2. Tx0and Tx1are just arbitrary labels. They do not necessarily mean that Tx0is the first transaction in the blockchain 151, nor that Tx1is the immediate next transaction in the pool 154. Tx1could point back to any preceding (i.e. antecedent) transaction that still has an unspent output 203 locked to Alice. The terms “preceding” and “subsequent” as used herein in the context of the sequence of transactions refer to the order of the transactions in the sequence as defined by the transaction pointers specified in the transactions (which transaction points back to which other transaction, and so forth). They could equally be replaced with “predecessor” and “successor”, or “antecedent” and “descendant”, “parent” and “child”, or such like. It does not necessarily imply an order in which they are created, sent to the network 106, or arrive at any given blockchain node 104. Nevertheless, a subsequent transaction (the descendent transaction or “child”) which points to a preceding transaction (the antecedent transaction or “parent”) will not be validated until and 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 discarded or buffered for a certain time to wait for the parent, depending on the node protocol and / or node behaviour. One of the one or more outputs 203 of the preceding transaction Tx0 comprises a particular UTXO, labelled here UTXO0. Each UTXO comprises a value specifying an amount of the digital asset represented by the UTXO, and a locking script which defines a condition which must be met by an unlocking script in the input 202 of a subsequent transaction in order for the subsequent transaction to be validated, and therefore for the UTXO to be successfully redeemed. The locking script (aka scriptPubKey) is a piece of code written in the domain specific language recognized by the node protocol. A particular example of such a language is called “Script” (capital S) which is used by the blockchain network. The locking script specifies what information is required to spend a transaction output 203, for example the requirement of Alice’s signature. Locking scripts appear in the outputs of transactions. The unlocking script (aka scriptSig) is a piece of code written the domain specific language that provides the information required to satisfy the locking script criteria. For example, it may contain Bob’s signature. Unlocking scripts appear in the input 202 of transactions. So in the example illustrated, UTXO0in the output 203 of Tx0comprises a locking script [Checksig PA] which requires a signature Sig PA of Alice in order for UTXO0to be redeemed (strictly, in order for a subsequent transaction attempting to redeem UTXO0to be valid). [Checksig PA] contains a representation (i.e. a hash) of the public key PA from a public- private key pair of Alice. The input 202 of Tx1 comprises a pointer pointing back to Tx1 (e.g. by means of its transaction ID, TxID0, which in embodiments is the hash of the whole transaction Tx0). The input 202 of Tx1 comprises an index identifying UTXO0 within Tx0, to identify it amongst any other possible outputs of Tx0. The input 202 of Tx1 further comprises an unlocking script <Sig PA> which comprises a cryptographic signature of Alice, created by Alice applying her private key from the key pair to a predefined portion of data (sometimes called the “message” in cryptography). The data (or “message”) that needs to be signed by Alice to provide a valid signature may be defined by the locking script, or by the node protocol, or by a combination of these. When the new transaction Tx1 arrives at a blockchain node 104, the node applies the node protocol. This comprises running the locking script and unlocking script together to check whether the unlocking script meets the condition defined in the locking script (where this condition may comprise one or more criteria). Note that the script code is often represented schematically (i.e. not using the exact language). For example, one may use operation codes (opcodes) to represent a particular function. “OP_...” refers to a particular opcode of the Script language. As an example, OP_RETURN is an opcode of the Script language that when preceded by OP_FALSE at the beginning of a locking script creates an unspendable output of a transaction that can store data within the transaction, and thereby record the data immutably in the blockchain 150. E.g. the data could comprise a document which it is desired to store in the blockchain. Typically an input of a transaction contains a digital signature corresponding to a public key PA. In embodiments this is based on the ECDSA using the elliptic curve secp256k1. A digital signature signs a particular piece of data. In some embodiments, for a given transaction the signature will sign part of the transaction input, and some or all of the transaction outputs. The particular parts of the outputs it signs depends on the SIGHASH flag. The SIGHASH flag is usually a 4-byte code included at the end of a signature to select which outputs are signed (and thus fixed at the time of signing). The locking script is sometimes called “scriptPubKey” referring to the fact that it typically comprises the public key of the party to whom the respective transaction is locked. The unlocking script is sometimes called “scriptSig” referring to the fact that it typically supplies the corresponding signature. However, more generally it is not essential in all applications of a blockchain 150 that the condition for a UTXO to be redeemed comprises authenticating a signature. More generally the scripting language could be used to define any one or more conditions. Hence the more general terms “locking script” and “unlocking script” may be preferred. 4. FURTHER REMARKS Other variants or use cases of the disclosed techniques may become apparent to the person skilled in the art once given the disclosure herein. The scope of the disclosure is not limited by the described embodiments but only by the accompanying claims. For instance, some embodiments above have been described in terms of a bitcoin network 106, bitcoin blockchain 150 and bitcoin nodes 104. However it will be appreciated that the bitcoin blockchain is one particular example of a blockchain 150 and the above description may apply generally to any blockchain. That is, the present invention is in by no way limited to the bitcoin blockchain. More generally, any reference above to bitcoin network 106, bitcoin blockchain 150 and bitcoin nodes 104 may be replaced with reference to a blockchain network 106, blockchain 150 and blockchain node 104 respectively. The blockchain, blockchain network and / or blockchain nodes may share some or all of the described properties of the bitcoin blockchain 150, bitcoin network 106 and bitcoin nodes 104 as described above. In preferred embodiments of the invention, the blockchain network 106 is the bitcoin network and bitcoin nodes 104 perform at least all of the described functions of creating, publishing, propagating and storing blocks 151 of the blockchain 150. It is not excluded that there may be other network entities (or network elements) that only perform 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 publishing blocks (recall that these entities are not considered nodes of the preferred bitcoin network 106). In other embodiments of the 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, publishing, propagating and storing blocks 151 of the blockchain 150. For instance, on those other blockchain networks a “node” may be used to refer to a network entity that is configured to create and publish blocks 151 but not store and / or propagate those blocks 151 to other nodes. Even more generally, any reference to the term “bitcoin node” 104 above may be replaced with the term “network entity” or “network element”, wherein such an entity / element is configured to perform some or all of the roles of creating, publishing, propagating and storing blocks. The functions of such a network entity / element may be implemented in hardware in the same way described above with reference to a blockchain node 104. Some embodiments have been described in terms of the blockchain network implementing a proof-of-work consensus mechanism to secure the underlying blockchain. However proof- of-work is just one type of consensus mechanism and in general embodiments may use any type of suitable consensus mechanism such as, for example, proof-of-stake, delegated proof-of-stake, proof-of-capacity, or proof-of-elapsed time. As a particular example, proof- of-stake uses a randomized process to determine which blockchain node 104 is given the opportunity to produce the next block 151. The chosen node is often referred to as a validator. Blockchain nodes can lock up their tokens for a certain time in order to have the chance of becoming a validator. Generally, the node who locks the biggest stake for the longest period of time has the best chance of becoming the next validator. It will be appreciated that the above embodiments have been described by way of example only. More generally there may be provided a method, apparatus or program in accordance with any one or more of the following Statements. Statement 1. A computer-implemented method of obfuscating data, wherein the data is segmented into a plurality of respective data segments, and wherein the method comprises: for each respective data segment, generating a respective leaf hash of a hash tree, wherein the respective leaf hash is a function of the respective data segment and a respective salt value; and generating a root hash of the hash tree, wherein the hash tree comprises each of the respective leaf hashes. Statement 2. The method of statement 1, comprising generating a signature based on the root hash. Statement 3. The method of statement 1 or statement 2, comprising outputting the root hash and / or the signature to a party and / or a storage resource. Statement 4. The method of statement 3, comprising: generating a blockchain transaction comprising the root hash and / or the signature; and submitting the blockchain transaction to one or more nodes of a blockchain network. Statement 5. The method of any preceding statement, wherein the respective leaf hash is based on a hash of at least the respective data segment Statement 6. The method of any preceding statement, wherein the respective leaf hash is based on a hash of at least the respective salt value. Statement 7. The method of statement 5 and statement 6, wherein the respective leaf hash is based on an XOR of the hash of at least the respective data segment and the hash of at least the respective salt value. Statement 8. The method of statement 6, wherein the respective leaf hash is generated by encrypting the respective data segment with the hash of the respective salt value. Statement 9. The method of any preceding statement, wherein the respective leaf hash is based on a hash of a combination of at least the respective data segment and the respective salt value. Statement 10. The method of statement 9, wherein the respective leaf hash is based on a hash of at least the respective data segment, the respective salt value and a value larger than the space of possible values for the respective data segment. Statement 11. The method of any preceding statement, wherein the respective leaf hash is based on a HMAC of the respective data segment and the respective salt value. Statement 12. The method of any preceding statement, comprising generating a plurality of respective salt values, wherein the respective salt value used to generate the respective leaf hash is a respective one of the plurality of respective salt values, and wherein each respective salt value is based on an initial salt value. Statement 13. The method of statement 12, wherein generating the plurality of respective salt values comprises generating a chain of respective salt values by repeatedly hashing the initial salt value. Statement 14. The method of statement 13, wherein each respective data segment has a respective index indicating a respective position within the data, wherein each respective salt value has a respective index indicating a respective position within the chain of respective salt values, and wherein for each respective data segment, the respective leaf hash is based on the respective salt value having the respective index matching the respective index of the respective data segment. Statement 15. The method of statement 14, wherein each respective data segment has a respective index indicating a respective position within the data, wherein each respective salt value has a respective index indicating a respective position within the chain of respective salt values, and wherein for each respective data segment, the method comprises randomly selecting an index of the respective salt value to use for generating the respective leaf hash. Statement 16. The method of any of statements 1 to 11, wherein each respective data segment is associated with a respective position within the data, starting with an initial data segment, and wherein the method comprises: for the initial data segment, selecting an initial salt value; for each respective data segment other than the initial data segment, generating the respective salt value used to generate the respective leaf hash by hashing the respective data segment associated with a respective previous position within the data. Statement 17. The method of any of statements 1 to 11, wherein each respective data segment is associated with a respective position within the data, starting with an initial data segment, and wherein the method comprises: for the initial data segment, selecting an initial salt value; and for each respective data segment other than the initial data segment, generating the respective salt value used to generate the respective leaf hash by encrypting a respective previous salt value with a private key. Statement 18. The method of any of statements 12 to 17, wherein a leaf hash of the hash tree comprises the initial salt value. Statement 19. The method of any preceding statement, comprising making available, to a party, one or more of the respective data segments and respective salt values. Statement 20. The method of statement 19, comprising making available, to the party, one or more but not all of the respective data segments and respective salt values. Statement 21. Computer equipment comprising: memory comprising one or more memory units; and processing apparatus comprising one or more processing units, wherein the memory stores code arranged to run on the processing apparatus, the code being configured so as when on the processing apparatus to perform the method of any of statements 1 to 20. Statement 22. A computer program embodied on computer-readable storage and configured so as, when run on one or more processors, to perform the method of any of statements 1 to 20.
Claims
CLAIMS 1. A computer-implemented method of obfuscating data, wherein the data is segmented into a plurality of respective data segments, and wherein the method comprises: for each respective data segment, generating a respective leaf hash of a hash tree, wherein the respective leaf hash is a function of the respective data segment and a respective salt value, wherein each of the respective salt values is derived from: an initial salt value; and / or from one or more of the data segments; and generating a root hash of the hash tree, wherein the hash tree comprises each of the respective leaf hashes.
2. The method of claim 1, comprising generating a signature based on the root hash.
3. The method of claim 1 or claim 2, comprising outputting the root hash and / or the signature to a party and / or a storage resource.
4. The method of claim 3, comprising: generating a blockchain transaction comprising the root hash and / or the signature; and submitting the blockchain transaction to one or more nodes of a blockchain network.
5. The method of any preceding claim, wherein the respective leaf hash is based on a hash of at least the respective data segment 6. The method of any preceding claim, wherein the respective leaf hash is based on a hash of at least the respective salt value.
7. The method of claim 5 and claim 6, wherein the respective leaf hash is based on an XOR of the hash of at least the respective data segment and the hash of at least the respective salt value.
8. The method of claim 6, wherein the respective leaf hash is generated by encrypting the respective data segment with the hash of the respective salt value.
9. The method of any preceding claim, wherein the respective leaf hash is based on a hash of a combination of at least the respective data segment and the respective salt value.
10. The method of claim 9, wherein the respective leaf hash is based on a hash of at least the respective data segment, the respective salt value and a value larger than the space of possible values for the respective data segment.
11. The method of any preceding claim, wherein the respective leaf hash is based on a HMAC of the respective data segment and the respective salt value.
12. The method of any preceding claim, comprising generating a plurality of respective salt values, wherein the respective salt value used to generate the respective leaf hash is a respective one of the plurality of respective salt values, and wherein each respective salt value is based on the initial salt value.
13. The method of claim 12, wherein generating the plurality of respective salt values comprises generating a chain of respective salt values by repeatedly hashing the initial salt value.
14. The method of claim 13, wherein each respective data segment has a respective index indicating a respective position within the data, wherein each respective salt value has a respective index indicating a respective position within the chain of respective salt values, and wherein for each respective data segment, the respective leaf hash is based on the respective salt value having the respective index matching the respective index of the respective data segment.
15. The method of claim 14, wherein each respective data segment has a respective index indicating a respective position within the data, wherein each respective salt value has a respective index indicating a respective position within the chain of respective salt values,and wherein for each respective data segment, the method comprises randomly selecting an index of the respective salt value to use for generating the respective leaf hash.
16. The method of any of claims 1 to 11, wherein each respective data segment is associated with a respective position within the data, starting with an initial data segment, and wherein the method comprises: for the initial data segment, selecting an initial salt value; and for each respective data segment other than the initial data segment, generating the respective salt value used to generate the respective leaf hash by hashing the respective data segment associated with a respective previous position within the data.
17. The method of any of claims 1 to 11, wherein each respective data segment is associated with a respective position within the data, starting with an initial data segment, and wherein the method comprises: for the initial data segment, selecting an initial salt value; for each respective data segment other than the initial data segment, generating the respective salt value used to generate the respective leaf hash by encrypting a respective previous salt value with a private key.
18. The method of any of claims 12 to 17, wherein a leaf hash of the hash tree comprises the initial salt value.
19. The method of any preceding claim, comprising making available, to a party, one or more of the respective data segments and respective salt values.
20. The method of claim 19, comprising making available, to the party, one or more but not all of the respective data segments and respective salt values.
21. Computer equipment comprising: memory comprising one or more memory units; andprocessing apparatus comprising one or more processing units, wherein the memory stores code arranged to run on the processing apparatus, the code being configured so as when on the processing apparatus to perform the method of any of claims 1 to 20.
22. A computer program embodied on computer-readable storage and configured so as, when run on one or more processors, to perform the method of any of claims 1 to 20.
Citation Information
Patent Citations
HASH-based digital signatures for hierarchical internet public key infrastructure
US20170272250A1
Hash subtrees for grouping components by component type
US20220278849A1
Eligibility for access to restricted goods and services using zero-knowledge proofs
WO2019217936A1
