Coordinating Peer-to-Peer Data Transmission Using Blockchain
Blockchain technology is used to enhance trust and security in P2P networks by recording data transfers and encrypting packets, addressing trust and security issues and improving data transmission efficiency.
Patent Information
- Application Number
- JP2024509439
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-08-18
- Filing Date
- 2022-07-19
- Publication Date
- 2024-09-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Peer-to-peer (P2P) networks face challenges with trust and security issues between nodes, leading to difficulties in scaling up data transmission.
Utilizing blockchain technology to coordinate data transmission by recording each transfer on the blockchain, ensuring immutability and trust through hash values and public keys, and encrypting data packets for secure transmission.
Enhances trust and security in P2P networks by providing a transparent and secure data transmission process, ensuring the integrity and identity of each node involved in the data transfer.
Smart Images

Figure 2024532839000001
Abstract
Description
[Technical field]
[0001] The present disclosure relates to a method of using blockchain to coordinate the transmission of data between nodes of a peer-to-peer (P2P) network, the method enabling proof of data transmission. [Background technology]
[0002] Blockchain refers to a form of distributed data structure, where duplicate copies of the blockchain are maintained and publicly published at each of multiple nodes in a distributed peer-to-peer (P2P) network (hereafter referred to as the "blockchain network"). The blockchain comprises a chain of blocks of data, where each block comprises one or more transactions. Each transaction, other than a so-called "coinbase transaction," points to a preceding transaction in a sequence, which may span one or more blocks and go back to one or more coinbase transactions. Coinbase transactions are discussed further below. Transactions submitted to the blockchain network are included in new blocks. New blocks are created by a process often referred to as "mining," which involves multiple nodes each competing to perform a "proof of work," i.e., solving a cryptographic puzzle based on a representation of a defined set of ordered, validated, outstanding 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 achieved through publication of only the block headers.
[0003] Transactions in a blockchain may be used for one or more of the following purposes: moving digital assets (i.e., a number of digital tokens), ordering a set of entries in a virtualized ledger or registry, receiving and processing timestamp entries, and / or ordering index pointers in time. 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 for data in a transaction. Since there is no pre-specified limit on the maximum amount of data that can be stored in a single transaction, increasingly more complex data can be incorporated. For example, this may be used to store electronic documents or audio or video data on the blockchain.
[0004] Nodes of a blockchain network (often called "miners") perform a distributed transaction registration and validation process, which is described in more detail below. In summary, during this process, nodes validate transactions and insert them into a block template for which they attempt to identify a valid proof-of-work solution. Once a valid solution is found, the new block is disseminated to other nodes in the network, allowing each node to record the 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 disseminated. Nodes receiving the transaction may compete to find a proof-of-work solution that will incorporate the validated transaction into the 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 disseminated and are not included in blocks. Assuming the transaction is validated and therefore accepted on 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 rewarded with a new transaction, usually called a "coinbase transaction", distributing an amount of digital assets, i.e. a number of tokens. Detection and rejection of fraudulent transactions is performed by the actions of competing nodes, who are incentivized to act on behalf of the network and report and prevent fraudulent activity. Widespread publication of information allows users to continuously audit node behavior. The mere publication of block headers allows participants to guarantee 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 comprises one or more inputs and one or more outputs. Every consumable output comprises an element that specifies an amount of a digital asset derivable from a preceding sequence of transactions. A consumable output may be called a UTXO (an “unspent transaction output”). An output may further comprise a locking script that specifies a condition for future redemption of the output. A locking script is a predicate that defines the conditions necessary to validate and transmit a digital token or asset. Each input of a transaction (other than a coinbase transaction) may comprise a pointer (i.e., a reference) to such output in a preceding transaction and further comprise an unlocking script to unlock the locking script of the pointed-to output. Thus, consider a pair of transactions, which we call a first transaction and a second transaction (or a “target” transaction). The first transaction comprises at least one output that specifies an amount of a digital asset and comprises a locking script that defines one or more conditions for unlocking the output. The second target transaction has at least one input, which comprises a pointer to the output of the first transaction and an unlocking 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 disseminated and recorded in the blockchain, one criterion of correctness applied at each node is that the unlocking script satisfies all of one or more conditions defined in the locking script of the first transaction. Another criterion is that the output of the first transaction has not yet been redeemed by another, earlier, legitimate transaction. Any node that finds the target transaction to be fraudulent according to any of these conditions will not disseminate the target transaction (not disseminate it as a legitimate transaction, but possibly disseminate it to register the fraudulent transaction) and will not include the target transaction in a new block to be recorded in the blockchain.
[0008] An alternative type of transaction model is the account-based model, where each transaction defines the amount to be transferred not by referencing back to the UTXO of the preceding transaction in the sequence of past transactions, but by referencing the absolute account balance. The current state of every account is stored in the blockchain separately by multiple nodes and is constantly updated. Summary of the Invention [Problem to be solved by the invention]
[0009] Peer-to-peer (P2P) networks have become one of the driving forces in the development of Internet communication and information sharing. Especially since 2009, blockchain networks have become a cryptographic breakthrough in P2P network services. Major file sharing services such as the BitTorrent network, Kazaa or Gnutella are other examples of well-known P2P networks.
[0010] Some P2P networks suffer from a lack of trust and security between nodes, meaning people are reluctant to participate in transferring data between the nodes of the network, which can make it difficult for the P2P network to scale. [Means for solving the problem]
[0011] According to one aspect disclosed herein, there is provided a computer-implemented method of using blockchain to coordinate data transmission over a peer-to-peer (P2P) network, the P2P network comprising a plurality of P2P nodes, each P2P node being connected to at least one other P2P node and associated with a respective public key, a target node among the P2P nodes having access to a target data item, the method being performed by a requesting P2P node, the method comprising the steps of obtaining a second hash value, the second hash value being generated by hashing at least the data request with a first hash function to generate a first hash value, and then hashing at least the first hash value with a second hash function to obtain a second hash value, the data request being associated with the target data item; and submitting a master request transaction to the blockchain network, the master request transaction being generated by hashing at least the data request with a first hash function to generate a first hash value, and then hashing at least the first hash value with a second hash function to obtain a second hash value, the data request being associated with the target data item. and one or more first outputs, each first output being locked to a respective public key associated with a respective P2P node connected to the requesting P2P node; each respective P2P node being configured to submit a respective sub-request transaction to the blockchain network, each sub-request transaction including the second hash value and the one or more first outputs, each first output being locked to a respective public key associated with a respective P2P node connected to the respective P2P node; the process of each P2P node submitting each sub-request transaction to the blockchain network continues at least until each first output of each sub-request transaction submitted to the blockchain network is locked to a respective public key of the target P2P node; and the method further includes the step of obtaining the target data item from the target P2P node.
[0012] According to another aspect disclosed herein, there is provided a computer-implemented method of using a blockchain to coordinate data transmission over a peer-to-peer (P2P) network, the P2P network comprising a plurality of P2P nodes, each P2P node being connected to at least one other P2P node and associated with a respective public key, a target node among the P2P nodes having access to a target data item requested by a requesting P2P node, the method being executed by the target P2P node and including the steps of: obtaining a request transaction from the blockchain, the request transaction including a second hash value and one or more first outputs, one of the first outputs being locked to a respective public key associated with the target P2P node; determining that the second hash value is based on a data request associated with the target data item; and making the target data item available to the requesting P2P node.
[0013] According to another aspect disclosed herein, there is provided a computer-implemented method of using blockchain to coordinate data transmission over a peer-to-peer (P2P) network, the P2P network comprising a plurality of P2P nodes, each P2P node being connected to at least one other P2P node and associated with a respective public key, a target node among the P2P nodes having access to a target data item requested by a requesting P2P node, the method being executed by the target P2P node, the method comprising the steps of obtaining a second hash value and one or more public keys, each public key being associated with a respective P2P node, one of the one or more public keys being a public key of the requesting P2P node, each of the other one or more public keys being associated with a respective P2P node belonging to a path of P2P nodes between the requesting P2P node and the target P2P node, each P2P node in the path being connected to a preceding P2P node in the path and / or a next P2P node in the path; the first hash value is based on a data request associated with the target data item; splitting the target data item into one or more respective data packets; encrypting each of the one or more respective data packets with the first hash value using a public key of the requesting P2P node to generate one or more respective first encrypted messages; encrypting the one or more respective first encrypted messages with each of the respective public keys associated with the respective P2P nodes in the path to generate one or more respective final encrypted messages; and transmitting the one or more respective final encrypted messages to a P2P node in the path connected to the target P2P node, wherein one or more respective attestation transactions are submitted to a blockchain network to attest to the transmission of the one or more respective final encrypted messages.
[0014] The present disclosure utilizes blockchain to improve trust and security of P2P networks, especially during data distribution. Blockchain is used to improve the coordination between P2P nodes to increase the efficiency of data transmission. A request for data is sent from the requesting node to the target node through one or more intermediate nodes, and each transfer of the request is recorded in the blockchain via a blockchain transaction. This facilitates data transmission, since the target node can easily determine that the requesting node has submitted a request for data held by the target node. In effect, the blockchain is flooded with request transactions until the request (in the form of a second hash value) reaches the target node, i.e., until the request transaction is sent to the target node's public key. Also, each transfer of the request (in the form of a request transaction) is recorded in the blockchain, improving the security of the data transmission process, since the identity of each node involved is immutably recorded in the blockchain. In other words, there is a clear and permanent record of where the request started and how it traveled to the target node. The transmission of data from the target node to the requesting node may also be recorded in the blockchain (or at least attested on the blockchain).
[0015] In some embodiments, upon being notified of a data request, the target node transmits the data to the requesting node. The data may be sent via the blockchain or off-chain (e.g., via a secure communication channel).
[0016] In another embodiment, the data is transmitted through a chain of P2P nodes connecting the target node to the requesting node, with each node in the chain sending a respective request transaction to another node in the chain, starting with the requesting node. For example, the requesting node sends a main request transaction to a first P2P node, which sends a secondary request transaction to a second P2P node, which sends the secondary request transaction to the target node. The target node then sends the data (in encrypted form) to the requesting node via the second P2P node and then via the first P2P node.
[0017] It should be noted that in this specification, any reference to a "P2P network" should be understood to mean a P2P network other than a blockchain network, such as a P2P computer network in general, and any reference to a P2P node should be understood to mean a node of a P2P network.
[0018] To facilitate an understanding of embodiments of the present disclosure and to show how such embodiments may be embodied, reference will now be made, by way of example only, to the accompanying drawings, in which: [Brief description of the drawings]
[0019] [Figure 1] FIG. 1 is a schematic block diagram of a system for implementing a blockchain. [Diagram 2] FIG. 1 illustrates generally some examples of transactions that may be recorded on a blockchain. [Figure 3A] FIG. 2 is a schematic block diagram of a client application. [Figure 3B] 3B is a schematic mock-up of an exemplary user interface that may be presented by the client application of FIG. 3A. [Figure 4] FIG. 2 is a schematic block diagram of some node software for processing transactions. [Diagram 5] FIG. 1 illustrates a schematic diagram of an example of a P2P network interacting with a blockchain network. [Figure 6] FIG. 2 illustrates a schematic diagram of an exemplary transaction used to alert a second node of an available connection for a first node. [Figure 7] FIG. 13 illustrates generally an exemplary transaction used to alert a second node of an available connection for a first node and detail the specialization of the first node. [Figure 8] FIG. 13 illustrates generally another exemplary transaction used to alert a second node of an available connection for a first node. [Figure 9] FIG. 2 illustrates generally an exemplary transaction used to alert a second node that a connection with a first node is unavailable. [Figure 10] FIG. 2 illustrates generally an exemplary transaction used by a second node to terminate a connection with a first node. [Figure 11] FIG. 2 illustrates a schematic diagram of an exemplary transaction used to update a first node's specialization. [Figure 12] FIG. 13 is a schematic diagram illustrating another example of a P2P network interacting with a blockchain network. [Figure 13] FIG. 1 is a diagram showing an example of a directed acyclic graph with six nodes. [Figure 14] FIG. 1 illustrates a schematic of an exemplary P2P network with seven nodes, where edges represent direct network connections. [Figure 15] FIG. 2 illustrates a schematic diagram of an exemplary flow of protocol messages and data transmission according to the Gnutella protocol. [Figure 16] 1 is a flow diagram illustrating an example of an onion routing protocol involving three nodes. [Figure 17]A diagram illustrating generally how a P2P node receives a data transmission and broadcasts a proof transaction to a blockchain network. [Figure 18] FIG. 2 illustrates a schematic diagram of an exemplary flow of a request transaction for forwarding a data request from a requesting node. [Figure 19] A diagram illustrating generally how P2P nodes receive rewards for forwarding data requests and target nodes transmit data to the requesting node. [Figure 20] FIG. 2 illustrates an exemplary main request transaction. [Figure 21] FIG. 2 illustrates an example secondary request transaction. [Figure 22] FIG. 2 illustrates an example response transaction. [Diagram 23] FIG. 2 illustrates a schematic diagram of an exemplary flow of a data request and a public key starting from a requesting node. [Figure 24] FIG. 2 illustrates a schematic diagram of an exemplary routing protocol for transmitting data to a requesting node. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0020] 1. Exemplary System Overview FIG. 1 illustrates an exemplary 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 that may be adapted 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 near-complete graph. Thus, each blockchain node 104 is highly connected to the other blockchain nodes 104.
[0021] Each blockchain node 104 comprises a peer computer device, with different nodes of the nodes 104 belonging to different peers. Each blockchain node 104 comprises one or more processors, e.g., processing devices comprising one or more central processing units (CPUs), accelerator processors, application specific processors, and / or field programmable gate arrays (FPGAs), as well as other devices 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. The memory may comprise one or more memory units utilizing one or more memory media, e.g., magnetic media such as hard disks, electronic media such as solid state drives (SSDs), flash memory, or EEPROMs, and / or optical media such as optical disk drives.
[0022] The blockchain 150 comprises a chain of blocks 151 of data, a respective copy of which is maintained at each of a number of blockchain nodes 104 in a distributed network 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 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, a transaction in this context referring to a certain 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 comprises at least one input and at least one output. Each output specifies as a property an amount that represents an amount of digital assets, such as a user 103 to which the output is cryptographically locked (requiring that user's signature or other solution in order to be unlocked and thereby redeemed or spent). Each input points to the output of a preceding transaction 152, thereby chaining transactions together.
[0023] Each block 151 also has a block pointer 155 that points to a previously created block 151 in the chain to define a sequential order for the blocks 151. Each transaction 152 (other than a coinbase transaction) has a pointer to a previous transaction to define an order for the sequence of transactions (note that the sequence of transactions 152 is allowed to diverge). 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.
[0024] Each of the blockchain nodes 104 is configured to forward transactions 152 to other blockchain nodes 104, thereby allowing the transactions 152 to be disseminated throughout the network 106. Each blockchain node 104 is configured to create blocks 151 and store respective copies of the same blockchain 150 in its memory. 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." As used herein, this term is not limited to a particular blockchain, protocol, or model. It refers to an ordered set of transactions that the node 104 has accepted as valid and for which the node 104 is not obligated to accept other transactions that attempt to consume the same output.
[0025] For a given current transaction 152j, its (or each) input comprises a pointer that references the output of a preceding transaction 152i in the sequence of transactions, which specifies that this output should be redeemed or "consumed" in the current transaction 152j. In general, the preceding transaction can be any transaction in the ordered set 154 or any block 151. The preceding transaction 152i does not necessarily have to exist at the time the current transaction 152j is created or even sent to the network 106, but the preceding transaction 152i must exist and be validated for the current transaction to be valid. Thus, "preceding" in this specification refers to something that precedes in the logical sequence connected by pointers, and not necessarily to the time of creation or transmission in the chronological order, and does not necessarily exclude transactions 152i, 152j from being created or transmitted in a different order (see the discussion below on orphan transactions). The preceding transaction 152i may be equivalently referred to as an ancestor transaction or a predecessor transaction.
[0026] The input of the current transaction 152j also comprises the authorization of the input, e.g., the signature of the user 103a to which 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 divide the input amount among multiple users or entities (one of which can be the original user or entity 103a to provide the change). In some cases, the transaction can also have multiple inputs to gather together amounts from multiple outputs of one or more preceding transactions and redistribute them to one or more outputs of the current transaction.
[0027] According to an output-based transaction protocol such as Bitcoin, when a participant 103, such as an individual user or an organization, wants to enact a new transaction 152j (either manually or by an automated process used by the participant), the enacting participant transmits the new transaction from its computer terminal 102 to a recipient. The enacting participant or recipient eventually transmits this transaction to one or more of the blockchain nodes 104 of the network 106 (which today are usually servers or data centers, but in principle could be other user terminals). It is not excluded that the participant 103 who enacts the new transaction 152j may transmit the transaction directly to one or more of the blockchain nodes 104, and in some instances not to a recipient. The blockchain nodes 104 that receive the transaction verify whether the transaction is legitimate according to a blockchain node protocol applied in each of the blockchain nodes 104. The blockchain node protocol usually requires the blockchain node 104 to verify that the cryptographic signature in the new transaction 152j matches the expected signature, which depends on the previous transaction 152i in the ordered sequence of transactions 152. In such an output-based transaction protocol, this may comprise verifying that a cryptographic signature or other authorization of a participant 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 assigns, which condition typically comprises at least verifying that the cryptographic signature or other authorization in the input of the new transaction 152j unlocks the output of the previous transaction 152i to which the input of the new transaction is linked. This condition may be defined at least in part by a script included in the output of the preceding transaction 152i.Alternatively, it may be determined solely by the blockchain node protocol, or by a combination of these. In any case, 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 forward the new transaction 152j to one or more further nodes 104, and so on. In this way, the new transaction is disseminated throughout the network of blockchain nodes 104.
[0028] In the output-based model, the definition of whether a given output (e.g., UTXO) is allocated (e.g., spent) is whether it has not yet been validly redeemed by the input of another forward 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 disseminated (unless it is flagged as fraudulent and disseminated for a warning) or recorded in the blockchain 150. This protects against double spending, where a transactor tries to allocate the same transaction output more than once. On the other hand, the account-based model protects against double spending by maintaining an account balance. Again, there is no defined order to transactions, so the account balance has a single defined state at any one time.
[0029] 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 aided by "proof of work." At the blockchain nodes 104, new transactions that have not yet appeared in a block 151 recorded in the blockchain 150 are added to an ordered pool 154 of legitimate transactions. The blockchain nodes then compete to assemble a new legitimate block 151 of transactions 152 from the ordered set of transactions 154 by attempting to solve a cryptographic puzzle. Typically, this comprises looking for a nonce value such that when the "nonce" is concatenated with a representation of the ordered pool of outstanding transactions 154 and hashed, the output of the hash satisfies a predefined condition. For example, the predefined condition may be that the output of the hash has a certain defined number of leading zeros. Note that this is just one particular type of proof of work puzzle, other types are not excluded. The nature of a hash function is that it has an unpredictable output with respect to its input. Therefore, this search can only be performed by brute force, which consumes a large amount of processing resources at each blockchain node 104 attempting to solve the puzzle.
[0030] The first blockchain node 104 that will solve the puzzle will announce this to the network 106 and provide the solution as a proof, which can then be easily verified by other blockchain nodes 104 in the network (given the solution to the hash, it is easy to verify that the solution makes the output of the hash satisfy the condition). The first blockchain node 104 will then disseminate the block to a threshold consensus of other nodes that will accept the block and enforce the protocol rules. The ordered set of transactions 154 will then be 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 large amount of effort, e.g. in the form of hashing, required to produce the proof-of-work solution indicates the willingness of the first node 104 to follow the rules of the blockchain protocol. Such rules include not accepting a transaction as valid if it allocates the same output as a previously validated transaction (also known as double spend). Once created, blocks 151 cannot be altered because they are recognized and maintained at each of the blockchain nodes 104 in the blockchain network 106. Block pointers 155 also impose a sequential order on blocks 151. As transactions 152 are recorded in ordered blocks at each blockchain node 104 in the network 106, this becomes an immutable public ledger of transactions.
[0031] Note that different blockchain nodes 104 competing to solve the puzzle at any given time may do so based on different snapshots of the pool of transactions 154 that are not yet published at any given time, depending on when they started searching for a solution or the order in which the transactions were received. The first to solve each puzzle defines which transactions 152 will be included in the next new block 151n and in what order, and the current pool of unpublished transactions 154 is updated. The blockchain nodes 104 then continue competing to create blocks from the newly defined ordered pool of unpublished transactions 154, and so on. There is also a protocol to resolve any "forks" that may occur, which is a situation in which two blockchain nodes 104 solve the puzzle within a very short time of each other, causing conflicting views of the blockchain to be propagated between the nodes 104. That is, the fork with the longest branch will be the final blockchain 150. Note that this should not affect users or agents of the network, since the same transactions appear in both forks.
[0032] According to the Bitcoin blockchain (and most other blockchains), a node that succeeds in constructing a new block 104 is given the ability to newly allocate an additional acceptable amount of digital assets in a new special type of transaction (rather than an agent-to-agent or user-to-user transaction that transfers an amount of digital assets from one agent or user to another) that distributes an additional defined amount of digital assets. This special type of transaction is usually called a "coinbase transaction", but can also be named an "initial transaction" or "generating transaction". It usually forms the first transaction of a new block 151n. The proof of work indicates the willingness of the node constructing the new block to follow the protocol rules that allow this special transaction to be redeemed later. The blockchain protocol rules may require a maturation period, e.g., 100 blocks, before this special transaction can be redeemed. Often, an ordinary (non-generating) 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 is published. This fee is usually called a "transaction fee" and is discussed below.
[0033] Depending on the resources involved in validating and publishing transactions, at least each of the blockchain nodes 104 typically takes the form of a server with one or more physical server units, or even an entire data center. However, in principle, any given blockchain node 104 may take the form of a user terminal, or a group of user terminals networked together.
[0034] 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 role and handle transactions 152 according to 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.
[0035] Also connected to the network 101 are computer devices 102 of each of a number of participants 103 acting as 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 in transactions. Other users may interact with the blockchain 150 without necessarily acting as senders or receivers. For example, some participants may act as storage entities that store a copy of the blockchain 150 (e.g., have obtained a copy of the blockchain from a blockchain node 104).
[0036] Some or all of the participants 103 may be connected as part of a different network, for example a network superimposed on 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 perform the roles required of a blockchain node. Instead, each participant 103 may interact with the blockchain network 106 and thereby utilize the blockchain 150 by connecting to (i.e., communicating with) the blockchain node 106. Two participants 103 and their respective devices 102 are shown for illustrative purposes: a first participant 103a and its respective computer device 102a, and a second participant 103b and its respective computer device 102b. It will be understood that more such participants 103 and their respective computer devices 102 may be present and participating in the system 100, but are not shown for convenience. Each participant 103 may be an individual or an organization. By way of example only, the first party 103a is referred to herein as Alice and the second party 103b is referred to as Bob, but it will be understood that this is not intended to be limiting and that any reference herein to Alice or Bob may be replaced with "first party" and "second party," respectively.
[0037] The computing equipment 102 of each participant 103 comprises a respective processing device comprising one or more processors, e.g., one or more CPUs, GPUs, other accelerator processors, application specific processors, and / or FPGAs. The computing equipment 102 of each participant 103 further comprises a memory, i.e., computer readable storage in the form of a non-transitory computer readable medium. This memory may comprise one or more memory units utilizing 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 of the computing equipment 102 of each participant 103 stores software comprising a respective instance of at least one client application 105 adapted to be executed on the processing device. It will be understood that any action attributed herein to a given participant 103 may be performed using software executed on the processing device of the respective computing equipment 102. The computing equipment 102 of each participant 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 participant 103 may also include one or more other network-connected resources, such as cloud computing resources accessed via a user terminal.
[0038] The client application 105 is initially provided to the computing equipment 102 of any given participant 103 on a suitable computer-readable storage medium, which may, for example, be downloaded from a server and 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.
[0039] 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, authorise (e.g. sign) and send transactions 152 to one or more Bitcoin nodes 104 so that they are disseminated throughout the network of blockchain nodes 104 and thus included 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, the second function comprises reconciling amounts defined in the outputs of various transactions 152 scattered throughout the blockchain 150 that belong to the party in question.
[0040] NOTE: While various client functions may be described as being integrated into a given client application 105, this is not necessarily limiting, and any client function described herein may instead 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, at a lower layer such as an operating system, or any combination of these. The following is described with respect to a client application 105, but it will be understood that this is not limiting.
[0041] 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 ask the blockchain 150 about any transactions of which the respective party 103 is the recipient (or, in an embodiment, to actually look into the transactions of other parties in the blockchain 150, since the blockchain 150 is a public entity that lends credibility to transactions in part by being publicly visible). The wallet function of each computing device 102 is configured to organize and send the transactions 152 according to a transaction protocol. As mentioned above, each blockchain node 104 executes software configured to validate the transactions 152 according to the blockchain node protocol and forward the transactions 152 to disseminate the transactions 152 throughout the blockchain network 106. The transaction protocol and the node protocol correspond to each other, and a given transaction protocol is attached to 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.
[0042] When a given party 103, for example Alice, wants to submit a new transaction 152j to be included in the blockchain 150, Alice organizes the new transaction (using the wallet functionality of Alice's client application 105) according to the relevant transaction protocol. Alice then transmits the transaction 152 from the 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 a new transaction 152j, it handles the transaction 152j according to the blockchain node protocol and its respective role. This comprises first checking whether the newly received transaction 152j satisfies certain conditions to be "valid", an example of which will be discussed in detail shortly. In some transaction protocols, the conditions for validity checking 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.
[0043] Provided that the newly received transaction 152j passes the tests for it to be considered valid (i.e., for what it is "validated"), every blockchain node 104 that receives the transaction 152j adds the newly validated transaction 152 to the ordered set of transactions 154 maintained at that blockchain node 104. Additionally, every blockchain node 104 that receives the transaction 152j propagates the validated transaction 152 onward 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, the transaction 152j will soon be propagated throughout the network 106.
[0044] Once admitted into the ordered pool of outstanding transactions 154 maintained at a given blockchain node 104, that blockchain node 104 begins competing to solve a 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 trying to solve the puzzle based on different pools of transactions 154, but whoever solves first defines the set of transactions contained in the latest block 151. Eventually, the blockchain node 104 solves the puzzle for the portion 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 becomes immutably part of one of the blocks 151 in the blockchain 150. The order of transactions is also immutably recorded, since each transaction 152 has a pointer to an earlier transaction.
[0045] Because different blockchain nodes 104 initially receive different instances of a given transaction, they may have conflicting views of which instance is "valid" before an 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 an instance as valid and discovers that a second instance has been recorded in the blockchain 150, it must accept it and discard (i.e., treat as fraudulent) the instance it originally accepted (i.e., the one not published in block 151).
[0046] An alternative type of transaction protocol operated by some blockchain networks may be called an "account-based" protocol, as part of an 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 a preceding transaction in the sequence of past transactions. The current state of every account is stored separately in the blockchain by the nodes of the network and is constantly updated. In such a system, transactions are ordered using the transaction execution record (also called "position") of the account. This value is signed by the sender as part of the sender's cryptographic signature and hashed as part of the transaction reference calculation. In addition, an optional data field may also be a signed transaction. This data field may point to a previous transaction, for example if a previous transaction ID is included in this data field.
[0047] 2. UTXO-Based Model FIG. 2 shows an exemplary transaction protocol. This 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 comprises one or more transactions 152). The following is described with reference to an output-based or "UTXO"-based protocol. However, this is not a limitation on all possible embodiments. It should be noted that although the exemplary UTXO-based protocol is described with reference to Bitcoin, it can equally be implemented on other exemplary blockchain networks.
[0048] In the 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 may be used as a source for an input 202 of another new transaction (if the UTXO has not yet been redeemed). The UTXO comprises 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 comprise, among other information, a transaction ID of the transaction from which it originates. The transaction data structure may also comprise a header 201, which may comprise an indication of the sizes of the input fields 202 and the output fields 203. The header 201 may also comprise an ID of the transaction. In an embodiment, the transaction ID is a hash of the transaction data (minus the transaction ID itself) and is stored in the header 201 of the raw transaction 152 submitted to the node 104.
[0049] Suppose Alice 103a wants to create a transaction 152j that transfers an amount of a target digital asset to Bob 103b. In FIG. 2, Alice's new transaction 152j is labeled "Tx1". It has 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 this to Bob. The previous transaction 152i is labeled "Tx0" in FIG. 2. Tx0 and Tx1 are merely arbitrary labels. They do not necessarily imply that Tx0 is the first transaction in the blockchain 151, nor that Tx1 is the immediately following transaction in the pool 154. Tx1 may point to any previous (i.e., ancestor) transaction that still has unspent outputs 203 locked to Alice.
[0050] When Alice creates the new transaction Tx1, or at least by the time she sends it to the network 106, the currently preceding transaction Tx0 may already have been validated and included in a block 151 of the blockchain 150. 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 soon be included in the new block 151. Alternatively, Tx0 and Tx1 may be created and sent together to the network 106, or even Tx0 may be sent after Tx1 if the node protocol allows for buffering of "orphan" transactions. The terms "preceding" and "successor" as used herein in the context of a sequence of transactions refer to the order of transactions in the sequence as defined by transaction pointers specified in the transactions (such as which transaction points to which other transaction). They may be equally replaced with "predecessor" and "successor", or "ancestor" and "descendant", "parent" and "child", etc. It does not necessarily imply the order in which they are created, sent to the network 106, or arrive at any given blockchain node 104. Nevertheless, a subsequent transaction (descendant transaction or "child") that points to a preceding transaction (ancestor transaction or "parent") is not 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 period of time to wait for the parent, depending on the node protocol and / or node behavior.
[0051] One of the one or more outputs 203 of the preceding transaction Tx0 comprises a particular UTXO, here labelled UTXO0. Each UTXO comprises a value specifying the amount of the digital asset represented by the UTXO, and a locking script that defines a condition that must be met by an unlocking script in the input 202 of the following transaction for the following transaction to be validated and thus for the UTXO to be successfully redeemed. Typically, the locking script locks the amount to a particular party (the recipient of the transaction in which the locking script is included). That is, the locking script defines the unlocking condition, which typically comprises a condition that the unlocking script in the input of the following transaction comprises a cryptographic signature of the party to which the preceding transaction is locked.
[0052] A locking script (also known as scriptPubKey) is 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 locking script specifies what information is needed to consume a transaction output 203, e.g., requirements for Alice's signature. An unlocking script appears in the output of a transaction. An unlocking script (also known as scriptSig) is code written in a domain-specific language that provides the information needed to satisfy the locking script criteria. For example, it may include Bob's signature. An unlocking script appears in the input 202 of a transaction.
[0053] Thus, in the example shown, UTXO0 in output 203 of Tx0 is the UTXO A ], which means that Alice's signature Sig P must exist in order for UTXO0 to be redeemed (or, more precisely, for any subsequent transaction that attempts to redeem UTXO0 to be valid). A[Checksig P A ] is the public key P from Alice's public-private key pair. A The input 202 for Tx1 comprises a pointer to Tx1 (e.g., pointed to by transaction ID TxID0, where in an embodiment TxID0 is a hash of the entire transaction Tx0). The input 202 for Tx1 comprises an index that identifies UTXO0 within Tx0, in order to identify UTXO0 among all other possible outputs of Tx0. The input 202 for Tx1 further comprises an unlocking script <Sig P A >, which comprises Alice's cryptographic signature, created by Alice applying her private key from a key pair to a predetermined piece of data (sometimes called a "message" in cryptography). The data (or "message") that needs to be signed by Alice to provide a valid signature may be defined by a locking script, or by a node protocol, or by a combination of these.
[0054] When the new transaction Tx1 arrives at a blockchain node 104, the node applies the node protocol, which comprises running the locking script and the unlocking script together to see if the unlocking script satisfies the conditions defined in the locking script (where the conditions may comprise one or more criteria). In an embodiment, this involves concatenating the two scripts. <Sig P A > <P A >||[Checksig P A ] Here, "||" denotes concatenation, "<...>" means putting data on the stack, and "[...]" are the functions the locking script contains (a stack-based language in this example). Equivalently, the scripts may be executed one after the other using a common stack rather than concatenating the scripts. Either way, when executed together, these scripts will create a locking script that contains Alice's public key P A , to authenticate that the unlocking script in Tx1's input contains Alice's signature signing the expected portion of data. The expected portion of data itself (the "message") must also be included in order to perform this authentication. In an embodiment, the signed data comprises the entirety of Tx1 (thus a separate element specifying the signed portion of data in plaintext need not be included, since that is essentially already present).
[0055] The details of public-private cryptographic authentication are familiar to those skilled in the art. Essentially, if Alice signs a message using her private key, then with Alice's public key, the plaintext, 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, thereby allowing any holder of the public key to authenticate the signature. Thus, it should be noted that any reference herein to signing a particular piece of data or transaction, etc., may, in embodiments, mean signing a hash of that piece of data or transaction.
[0056] If the unlocking script in Tx1 satisfies one or more conditions specified in the locking script of Tx0 (so in the illustrated example, Alice's signature is provided and authenticated in Tx1), the blockchain node 104 considers Tx1 valid. This means that the blockchain node 104 adds Tx1 to the ordered pool of outstanding transactions 154. The blockchain node 104 also forwards the transaction Tx1 to one or more other blockchain nodes 104 in the network 106, so that the transaction Tx1 is disseminated throughout the network 106. Once Tx1 is validated and included in the blockchain 150, this defines the UTXO0 from Tx0 as having been spent. Note that Tx1 can only be valid if it consumes an unspent transaction output 203. If Tx1 attempts to consume an output that has already been consumed by another transaction 152, Tx1 is fraudulent even if all other conditions are met. Therefore, a blockchain node 104 also needs to check whether the referenced UTXO in the preceding transaction Tx0 has already been spent (i.e., whether it has already formed a legitimate input to another legitimate transaction). This is one reason why imposing a prescribed order on transactions 152 is important for the blockchain 150. In practice, a given blockchain node 104 may maintain a separate database that marks which UTXOs 203 a transaction 152 has spent, but what ultimately defines whether a UTXO has been spent is whether it has already formed a legitimate input to another legitimate transaction in the blockchain 150.
[0057] If the total amount specified in all outputs 203 of a given transaction 152 is greater than the total amount indicated by all its inputs 202, this is another ground of invalidity in most transaction models. Therefore, such a transaction is neither propagated nor included in block 151.
[0058] Note that in the UTXO-based transaction model, a given UTXO must be spent in its entirety. Part of the amount defined in the UTXO is "left behind" as unspent, while another part is not spent. However, the amount from the UTXO may be split among multiple outputs of a subsequent transaction. For example, the amount defined in UTXO0 in Tx0 may be split among multiple UTXOs in Tx1. Thus, if Alice does not want to give Bob the entire amount defined in UTXO0, she can use a reminder to give herself the change in the second output of Tx1, or to pay another party.
[0059] In practice, Alice is usually also required to include a fee for Bitcoin nodes 104 that succeed in including her transaction 104 in block 151. If Alice does not include such a fee, Tx0 may not be propagated and included in the blockchain 150 even if it is technically valid, since it may be rejected by the blockchain nodes 104 (the node protocol does not force blockchain nodes 104 to accept the transaction 152 if they do not want to). In some protocols, the transaction fee does not require a unique separate output 203 (i.e., does not require a separate UTXO). Instead, any difference between the total amount pointed to by the input 202 of a given transaction 152 and the total amount specified in the output 203 is automatically given to the blockchain node 104 that issues 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 by the node 104 that wins the proof-of-work race to create the block containing UTXO1. However, it is not necessarily excluded that a transaction fee may alternatively or additionally be explicitly specified in a unique one of the UTXOs 203 of transaction 152.
[0060] Alice and Bob's digital assets consist of the UTXOs locked to them in any transaction 152 anywhere in the blockchain 150. Thus, typically, the assets of a given party 103 are scattered across the UTXOs of various transactions 152 throughout the blockchain 150. There is no one number that defines the entire balance of a given party 103 stored anywhere in the blockchain 150. It is the role of the wallet function of the client application 105 to collate together the values of all the various UTXOs locked to each party and that have not yet been spent in another onward transaction. The wallet function can do this by querying a copy of the blockchain 150 as stored in any of the Bitcoin nodes 104.
[0061] Note that script code is often represented generally (i.e., without using a strict language). For example, operation codes (opcodes) may be used to represent specific functions. "OP_..." refers to a specific opcode in the Script language. As an example, OP_RETURN is an opcode in the Script language that, when preceded by OP_FALSE at the beginning of the locking script, creates a non-consumable output of the transaction that can store data within the transaction, thereby recording the data immutably in the blockchain 150. For example, the data may comprise a document that is desired to be stored in the blockchain.
[0062] 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 specific 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 parts of the outputs that the digital signature signs depend on the SIGHASH flag. The SIGHASH flag is typically a 4-byte code included at the end of the signature that selects which outputs are signed (and is therefore fixed at the time of signing).
[0063] A locking script may be referred to as a "scriptPubKey", referring to the fact that the locking script typically comprises the public key of the party to whom the respective transaction is locked. An unlocking script may be referred to as a "scriptSig", referring to the fact that the unlocking script typically provides a 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, a scripting language may be used to define any condition or conditions. Thus, the more general terms "locking script" and "unlocking script" may be preferred.
[0064] 3. Side Channels As shown in FIG. 1, the client applications of each of Alice's computing device 102a and Bob's computing device 102b may include additional communication capabilities. This additional functionality allows Alice 103a to establish (either at the instigation of a related party or a third party) a separate side channel 107 with Bob 103b. The side channel 107 allows for the exchange of data separately from the blockchain network. Such communication may be referred to as "off-chain" communication. For example, this may be used to exchange transactions 152 without the transactions 152 being registered in the blockchain network 106 or entering the chain 150 (yet) until one of Alice and Bob chooses to broadcast the transaction 152 between Alice and Bob to the network 106. Sharing transactions in this manner may be referred to as sharing a "transaction template." The 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.
[0065] 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 even over a direct wired or wireless link between Alice's device 102a and Bob's device 102b, or the like. In general, the side channel 107 referred to anywhere in this specification may comprise any one or more links over one or more networking technologies or communication media for exchanging data "off-chain", i.e., separately from the blockchain network 106. If more than one link is used, the bundle or collection of off-chain links may be referred to as a side channel 107 as a whole. Thus, it should be noted that when Alice and Bob are said to exchange some information or data, etc., over the side channel 107, this does not necessarily imply that all such data must be transmitted over exactly the same links, or even the same type of network.
[0066] 4. Client Software 3A illustrates an exemplary implementation of a client application 105 for implementing embodiments of the techniques disclosed herein. The client application 105 comprises a transaction engine 401 and a user interface (UI) layer 402. The transaction engine 401 is configured to implement the transaction-related functions of the client 105 infrastructure, such as orchestrating transactions 152, receiving and / or sending transactions and / or other data via a side channel 301, and / or sending transactions to one or more nodes 104 for dissemination through the blockchain network 106, in accordance with the techniques discussed above and as will be discussed in more detail shortly.
[0067] The UI layer 402 is configured to render a user interface via user input / output (I / O) means of the computing device 102 of each user, including outputting information to the respective user 103 via the user output means of the device 102 and receiving input from the respective user 103 via the user input means of the device 102. For example, the user output means may comprise one or more display screens (touch screen or non-touch screen) for providing visual output, one or more speakers for providing audio output, and / or one or more haptic output devices for providing haptic output, etc. The user input means may comprise, for example, one or more touch screen input arrays (same or different as those used for the output means), one or more cursor-based devices such as a mouse, trackpad, or trackball, one or more microphones and speech or voice recognition algorithms for receiving speech or audio input, one or more gesture-based input devices for receiving input in the form of hand or body gestures, or one or more mechanical buttons, switches, or joysticks, etc.
[0068] Note: although various functions herein may be described as being integrated into the same client application 105, this is not necessarily limiting, and instead they may be implemented as a suite of two or more separate applications, e.g. one plugging into the other or interfacing via an API (Application Programming Interface). For example, the functionality of the transaction engine 401 may be implemented in a separate application from the UI layer 402, or the functionality of a given module, such as the transaction engine 401, may be split between more than one application. It is not excluded that some or all of the described functionality may be implemented, for example, in the operating system layer. Where reference is made anywhere in this specification to a single or given application 105, etc., it will be understood that this is by way of example only, and more generally, the described functionality may be implemented in any form of software.
[0069] 3B provides a mock-up of an example of a UI 500 that may be rendered by a user interface (UI) layer 402 of a client application 105a on Alice's device 102a. It will be understood that a similar UI may be rendered by a client 105b on Bob's device 102b or on any other participant's device.
[0070] 3B illustrates a UI 500 from Alice's perspective. The UI 500 may comprise one or more UI elements 501, 502, 503 that are rendered as separate UI elements via user output means.
[0071] For example, the UI elements may comprise one or more user selectable elements 501, which may be different on-screen buttons, or different options in a menu, etc. User input means are adapted to allow the user 103 (in this case Alice 103a) to select or otherwise act on one of the options, such as by clicking or touching the UI element on the screen, or by speaking the name of the desired option (note that the term "manual" as used herein is intended only to contrast with automatic and is not necessarily limited to use of the hand).
[0072] Alternatively or additionally, the UI element may comprise one or more data entry fields 502. These data entry fields may be rendered via user output means, e.g., on a screen, and data may be entered into the fields via user input means, e.g., a keyboard or a touch screen. Alternatively, data may be received orally, e.g., based on speech recognition.
[0073] Alternatively or additionally, the UI element may comprise one or more output information elements 503 to output information to the user. For example, this / these may be rendered on a screen or audio.
[0074] It will be understood that the particular means of rendering the various UI elements, selecting options, and inputting data are not essential. The functionality of these UI elements will be discussed in more detail shortly. It will also be understood that the UI 500 shown in FIG. 3 is only a schematic mockup, and may in fact comprise one or more additional UI elements that are not shown for the sake of brevity.
[0075] 5. Node Software FIG. 4 illustrates an example of node software 450 executed on each blockchain node 104 of the network 106 in the example of the UTXO-based model or the output-based model. Note that another entity may execute the node software 450 without being classified as a node 104 on the network 106, i.e., without performing the actions required for a node 104. The node software 450 may include, but is not limited to, a protocol engine 451, a script engine 452, a stack 453, an application-level decision engine 454, and a set of one or more blockchain-related function modules 455. Each node 104 may execute node software including, but is not limited to, all three of the following: an agreement module 455C (e.g., proof of work), a propagation module 455P, and a storage module 455S (e.g., a database). The protocol engine 401 is typically configured to recognize different fields of a transaction 152 and process them according to the node protocol. Another preceding transaction 152i (Tx m-1 ) j ) is received, the protocol engine 451 j The protocol engine 451 also identifies the unlocking script in Tx j Based on the pointer at the input of Tx i Identify and extract. Tx i may be published on the blockchain 150, in which case the protocol engine derives Tx i Alternatively, Tx i , may not yet have been published on the blockchain 150. In that case, the protocol engine 451 selects Tx from the ordered set of unpublished transactions 154 maintained by the node 104. iIn any case, the script engine 451 may extract Tx i locates the locking script in the referenced output of and passes it to the script engine 452.
[0076] Therefore, the script engine 452 executes the Tx i Locking script and Tx j 2. For example, transactions labeled Tx0 and Tx1 are shown in FIG. 2, but the same can apply to any pair of any transactions. The script engine 452 executes the two scripts together as previously discussed, which includes putting data on and taking data off the stack 453 according to the stack-based scripting language being used (e.g., Script).
[0077] By executing the scripts together, the script engine 452 determines whether the unlocking script satisfies one or more criteria defined in the locking script, i.e., whether the locking script "unlocks" the output it is included in. The script engine 452 returns the result of this determination to the protocol engine 451. If the script engine 452 determines that the unlocking script satisfies one or more criteria specified in the corresponding locking script, the script engine 452 returns the result "true". Otherwise, it returns the result "false".
[0078] In the output-based model, the result "true" from the script engine 452 is one of the conditions for the validity of the transaction. Typically, there are also one or more further protocol-level conditions evaluated by the protocol engine 451 that must also be satisfied, such as Tx j the aggregate value of the Digital Assets specified in the output of Tx will not exceed the aggregate value indicated by its input; jThe protocol engine 451 evaluates the result from the script engine 452 together with one or more protocol level conditions, and accepts the transaction Tx only if they are all true. j The protocol engine 451 outputs an indication of whether the transaction is valid to the application level decision engine 454. j is actually validated, the decision engine 454 will j , which may choose to control both the consensus module 455C and the propagation module 455P to perform their respective blockchain-related functions with respect to the nodes of the transaction 154 for inclusion in the block 151. j and a consensus module 455C that adds Tx j and a propagation module 455P that forwards the transaction to the application level decision engine 454. Optionally, in an embodiment, the application level decision engine 454 may apply one or more additional conditions before triggering either or both of these functions. For example, the decision engine may choose to publish a transaction only under the condition that the transaction is legitimate and has sufficient transaction fees remaining.
[0079] It should also be noted that the terms "true" and "false" herein are not necessarily limited to returning a result expressed only in the form of a single binary digit (bit), although that is certainly one possible implementation. More generally, "true" can refer to any state that indicates a successful or positive outcome, and "false" can refer to any state that indicates an unsuccessful or negative outcome. For example, in an account-based model, a "true" outcome may be indicated by a combination of an implicit protocol-level validation of the signature and an additional positive output of the smart contract (if both individual outcomes are true, the overall outcome is considered to indicate true).
[0080] 6. P2P Network Connection FIG. 5 illustrates an exemplary system that may be used to form connections between P2P nodes. The system comprises a peer-to-peer (P2P) network 500 and a blockchain network 106. The P2P network 500 comprises a plurality of nodes, which are referred to herein as P2P nodes. For example, the P2P network comprises a first P2P node 501a, a second P2P node 501b, etc. Although only five P2P nodes 501 are shown in FIG. 5, it will be understood that in general, the P2P network 500 may have any number of P2P nodes 501. Note that, in this specification, "first," "second," etc. are used only as arbitrary labels and do not necessarily imply an order, unless the context requires otherwise. Those skilled in the art will be familiar with the concept of a P2P network, i.e., a decentralized network in which peers are equally prioritized and participants have equal power in the network, so the P2P network 500 itself will not be described in detail, other than that it has a network address. The network address may take any suitable form. For example, the network address may be an IP address or a domain name. The network address may be an address (or identifier) of the P2P network as a whole, or each P2P node may have an address on the network. The P2P network 500 may have one or more purposes or uses. For example, the P2P network may be a content or file sharing network, or a communications (e.g., video calling) network, a cloud computing network, a remote desktop network, etc.
[0081] Each P2P node 501 includes (or is contained by) or is implemented in software executing on a respective computing device configured to perform the actions described below as being performed by the P2P node 501. In some embodiments, each P2P node 501 may be configured to perform some or all of the actions described with respect to Figures 1-3B as being performed by Alice 103a and / or Bob 103b. Each P2P node 501 has a respective public key, i.e., has access to a corresponding private key.
[0082] As shown in FIG. 5, some of the P2P nodes 501 have existing connections, which are indicated by solid lines connecting the P2P nodes 501. For example, a third P2P node 501c is shown connected to a fourth P2P node 501d and a fifth P2P node 501e. A second P2P node 501b is connected to the fourth P2P node 501d. Further connections are shown. Connections that the first P2P node would like to make are also shown in the figure, which are indicated by dashed lines connecting the first P2P node 501a to other P2P nodes. For example, the first P2P node 501a would like to connect to the second P2P node 501b and the third P2P node 501c, for example because these nodes are closest to the first P2P node 501a. Here, "closest" can be a geographical or other term.
[0083] To connect with the second P2P node 501b, the first P2P node 501a obtains a public key associated with the second P2P node 501b. The first P2P node 501a may obtain the public key from memory, from a publicly accessible resource, such as a web page or a blockchain, from a trusted authority, or from another of the P2P nodes 501. As another example, the first P2P node 501a may obtain the public key of the second P2P node by querying a Domain Name System (DNS) service, for example using the P2P network address.
[0084] The first P2P node 501a is configured to generate a blockchain transaction (referred to as the first transaction). The first transaction comprises a first output that is locked to the public key of the second node. For example, the output may be a P2PKH output. The first output is used to alert the second P2P node 501b to the fact that P2P is about to form a connection. For example, the second P2P node 501b may run a wallet application that monitors the blockchain for outputs that are locked to the public key of the second P2P node. Those skilled in the art will be familiar with other methods of identifying a "payment" to be sent to a public key. The first transaction also comprises a P2P network address, which is used to identify the P2P network that the first P2P node 501a wishes to use when connecting to the second P2P node 501b. The network address may be included as part of the first output, or the second output, of the first transaction. The second output may be a non-consumable output and / or an OP_RETURN output. The first transaction is signed with a signature that can be verified using the public key of the first P2P node, which allows the second P2P node 501b to determine which P2P node 501 is attempting to form a connection with.
[0085] The first P2P node 501a submits the first transaction to the blockchain network 106, or alternatively, submits the first transaction to an intermediary, which then submits the first transaction to the blockchain network 106.
[0086] The second P2P node 501b is configured to determine that a first blockchain transaction has been submitted to (or recorded in) the blockchain 150. As mentioned above, this may be performed by a wallet application operated by the second P2P node 501b. Or, the second P2P node 501 may manually scan the blockchain 150 for transactions having outputs locked to the public key of the second P2P node. As another example, a service provider may monitor the blockchain 150 on behalf of the second P2P node 501b and inform the second P2P node 501b when the first transaction is identified. In response to detecting or otherwise identifying the presence of the first transaction, the second P2P node 501b is configured to connect with the first P2P node 501a. Connecting with the first P2P node 501a may involve the second P2P node 501b adding the first P2P node 501a to a list of nodes with which the second P2P node 501b communicates on the P2P network 500. Here, communicating with the first P2P node 501a is interpreted to mean accepting incoming data from the first P2P node 501a and sending outgoing data to the first P2P node 501a. Additionally or alternatively, connecting with the first P2P node 501a may involve actively communicating with the first P2P node 501a, i.e., sending data to the first P2P node 501a.
[0087] The first transaction is not only beneficial to the first P2P node 501a and the second P2P node 501b, but also to the P2P network 500 as a whole. The first transaction allows other nodes 501 to determine that the first P2P node 501a and the second P2P node 501b are connected. In other words, upon seeing the first transaction recorded in the blockchain 150, other nodes in the P2P network 500 know that they can communicate with the first P2P node or the second P2P node through the second P2P node or the first P2P node, respectively. This improves connectivity in the P2P network 500, as the node 501 becomes aware of further connections and further routes to other nodes 501.
[0088] FIG. 6 shows an example of a first transaction used to indicate a connection between a first P2P node 501a and a second P2P node 501b. The signature and public key of the first P2P node 501a are shown in the unlocking script of the transaction. In this example, a first output is locked to the public key of the second P2P node 501b, and a second, different output comprises the network address of the P2P network 500. As shown in this example, the first transaction may comprise an identifier of the first P2P node 501a. The identifier uniquely identifies the first P2P node 501a on the P2P network and may be certified by a certification authority (or another form of authority trusted by the P2P network 500). The identifier may be associated with the public key of the first P2P node, so that the second P2P node 501b can be confident that it is indeed the first P2P node 501a that generated the first transaction. This mapping may be known in advance or may be stored in a publicly accessible resource, e.g., a web page or a blockchain. The identifier is used to establish trust in the identity of the first P2P node. It may be a proof that includes the first P2P node's public key (and possibly information about its owner). Preferably, the proof does not include the first P2P node's IP address, as this would be publicly available on the blockchain and could expose the first P2P node's computer to attacks.
[0089] As mentioned above, the public key of the second P2P node may be obtained from a DNS service. In response to querying the DNS service, the first P2P node 501a may receive the public key and an Internet Protocol (IP) address of the second P2P node 501b. The first P2P node 501a may choose to connect to the second P2P node 501b based on the IP address. It should be noted that the IP address of the second P2P node may be obtained in alternative ways, for example, it may be provided by a different node 501 that has already established a connection with the first P2P node 501a and the second P2P node 501b.
[0090] Prior to generating the first transaction, the first P2P node 501a may perform an Internet handshake (e.g., a TCP 3-way handshake) with the second P2P node 501b using the IP address of the second P2P node 501b. This allows the first P2P node 501a to establish trust in the identity of the second P2P node. The second P2P node 501b may send its IP address to the first P2P node 501a, signed with a signature corresponding to the second P2P node's public key. The first P2P node 501a may then verify the signature using the second P2P node's public key. In these examples, the first P2P node 501a submits the first transaction to the blockchain network 106 only if the signature is verified.
[0091] The first P2P node 501a may use the first transaction to indicate its expertise, e.g., capabilities, features, characteristics, etc., to the second P2P node 501b. That is, the first P2P node 501a may be able to perform some action on the P2P network 500 that not all nodes can perform, or the first P2P node 501a may be able to perform some operation better than others or perform some action better than other nodes. Examples of expertise include capabilities in grid computing, mining, being a DNS node, being a trusted authority node, file sharing, etc. In some examples, expertise may be characteristics such as good bandwidth, connectivity, Internet connection, storage, etc. Here, "good" may be interpreted to mean better than the average of the P2P network nodes 501. There may be one or more subsets of the P2P nodes 501, each subset having at least one expertise in common. The first transaction may include one or more flags, each of which indicates a respective expertise. This improves the efficiency of the P2P network 500 because the second P2P node 501b knows whether to send any type of data or request to the first P2P node 501a based on the expertise of the first P2P node.
[0092] 7 shows an example of a first transaction including an expertise flag. The expertise flag may be included in the first output or the second output.
[0093] Optionally, the first transaction may include another consumable output that includes at least two alternative locking conditions in addition to the first output locked to the public key of the second P2P node. This output is called the third output, but it does not have to appear third in the list of outputs. As a first locking condition, the third output may be locked to the public key of the first P2P node 501a. As a second locking condition, the third output may be locked to the public key of the second P2P node 501b. The public key may be the same as or different from the public key discussed above. In other words, the first P2P node 501a and / or the second P2P node 501b may have more than one public key. In these examples, the unconsumed third output is interpreted by the second P2P node 501b as the connection between the first P2P node 501a and the second P2P node 501b being available (i.e., not terminated). When the third output is consumed, the connection is interpreted as being terminated, for example because the first node 501a has gone offline. Upon seeing that the third output has been consumed, the second P2P node 501b may disconnect from the first P2P node 501a.
[0094] The first P2P node 501a may generate a second transaction that consumes the third output, for example, if the first P2P node 501a can no longer maintain a connection with the second P2P node 501b. The second transaction includes an input that references the third output of the first transaction and includes a signature corresponding to the public key of the first P2P node to which the third output is locked. Figure 9 shows an example of the second transaction.
[0095] Alternatively, the second P2P node 501b may generate a second transaction consuming the third output, for example, when the second P2P node 501b can no longer maintain a connection with the first P2P node 501a, or when the first P2P node 501a acts maliciously or against the policy of the P2P network, or is hacked, etc. The first P2P node 501a may be offline, at least from the perspective of the second P2P node 501b, and in some examples may maintain an active connection with another node, for example the third P2P node 501c. The consumption of the third output of the second transaction signal indicates to other nodes of the network that it is not recommended to communicate with the first P2P node 501a via the second P2P node 501b because the first P2P node 501a is not following the network protocol correctly, or that it is not recommended to communicate with the first P2P node 501a at all. The second transaction includes an input that references the third output of the first transaction and includes a signature corresponding to the public key of the first P2P node to which the third output is locked.
[0096] In some examples, as shown in FIG. 8, the second locking condition of the third output (which appears second in the list of outputs in FIG. 8) may include a hash value, and an input consuming the third output must include a preimage of the hash value for the third output to be unlocked. The preimage may be a challenge that the second P2P node 501b must obtain to unlock the third output. For example, the challenge may be obtained from a trusted authority. An example of a second transaction generated by the second P2P node 501b including the challenge data is shown in FIG. 10.
[0097] FIG. 11 shows an example of a transaction that may be used to update the expertise of a first P2P node, rather than informing a second P2P node about the updated expertise.
[0098] While the above description has focused on interactions between a first P2P node 501a and a second P2P node 501b, the first P2P node 501a may perform equivalent actions on behalf of one or more additional P2P nodes 501. For example, in Figure 5, the first P2P node 501a connects with a third P2P node 501c by obtaining the third P2P node's public key and generating a transaction with an output locked to that public key. The transaction also includes the P2P network address.
[0099] The first P2P node 501a is also configured to determine (i.e., identify) connections between other P2P nodes, e.g., a connection between the fourth P2P node 501d and the fifth P2P node 501e based on transactions recorded in the blockchain 150, e.g., a transaction having an input signed by the fourth P2P node 501d and an output locked to the public key of the fifth P2P node 501e. The first P2P node 501a may use the identified connection to route data, etc., to the particular P2P node 501. For example, using the example of FIG. 5, when connected to the second P2P node 501b, data may be routed to the fifth P2P node 501e via the second P2P node 501b and the fourth P2P node 501d.
[0100] In some examples, a P2P node may use a first type of private key (e.g., RSA) to sign messages on the P2P network 500 that cannot be used to sign transactions on the blockchain network 106, and requires a second type of private key (e.g., ECDSA) to sign transactions on the blockchain network 106. The P2P node 501 may convert each private key of the first type to each private key of the second type by hashing the respective private key of the first type (with one or more hash functions, which may or may not be the same, e.g., double SHA256).
[0101] 7. P2P Overlay Model A specific example of the described embodiment is now given. This section discloses an incentive mechanism for P2P network topology proof. To add incentives to the P2P network, nodes can prove data on the blockchain through associated transaction payments on the blockchain network. These payments are received by the nodes involved in the communication process. Throughout this section, we will detail how nodes can prove their participation, update their specifications on the P2P network, and keep their neighboring nodes' proofs on the blockchain.
[0102] This approach adds economic incentives for all types of data transmission between nodes. Moreover, it is flexible in the sense that P2P network nodes can preserve the original P2P protocol communication to which they add another communication layer that transmits rewards. i where i is a positive integer or an index set depending on the context.
[0103] 7.1 Network Setup In this section, we show how to provide enough incentives for node N1 to safely join and be accepted into the P2P network. Moreover, whenever node N1 wants to connect to any other node from the P2P network, node N1 should follow the same procedure described below. This ensures that the blockchain stores the full network topology of the P2P network.
[0104] The join process is as follows: Suppose a new node N1 wants to join the network with address NETADDR. To find available peers, N1 can connect to the network and it can query the DNS service by sending a GET-like request to a link of the form: protocol: / / mesh.network / chosen_network
[0105] The data retrieved is in JSON format and contains a list of the nodes' internet addresses and their elliptic curve public keys (encoded, for example, in Bitcoin format). An example entry is: { Address: "192.168.0.1" pkey: "0x02f54ba86dc1ccb5bed0224d23f01ed87e4a443c47fc690d7797a13d41d2340e1a" }
[0106] Based on the received list of available peers, N1 chooses a peer N2 to connect to, using its Internet address as seen in the example entry above. At this moment, the two nodes N1 and N2 follow the protocol described below. 1. N1 gets the internet address of N2 from the JSON entry. 2. N1 initiates an Internet handshake with N2. Such handshake is network dependent. For example, the two nodes may choose the TCP three-way handshake as described in RFC793. 3. N2 sends a JSON entry of its own internet address signed with its public key. 4. N1 validates N2's identity by verifying the signature against N2's internet address using the public key from the JSON entry. 5. N1 creates a transaction on the blockchain, which has two outputs as seen in Figure 6. The first output, the P2PKH locking script, is redeemable by N2. The second output, the locking script, is the P2PKH token along with the network address NETADDR it is joining.
[0107]
number
[0108] The identifier is issued by a certification authority and its purpose is to determine the identity of the network node N1 in a trusted manner. 6. N2 receives the transaction TxID net-add Once N2 sees that N1 has been confirmed on the blockchain, it adds N1 to its list of neighboring peers.
[0109] Steps 3 and 4 prevent other nodes from performing spoofing attacks and deceiving by using the internet address of N2. N1 is communicating with a node using the internet address of N2 by step 2. N1 can be sure that the node is N2 because N2 is the only node that can sign its internet address with the public key available in the JSON entry. Thus, steps 3 and 4 enable the public key infrastructure.
[0110] One problem to be addressed is whether N2 is a rogue node and does not add N1 to its own list of neighbors. We show how N1 can safely join the network and be sure that it has not been scammed by N2. Each node has an assigned identity certificate CA that reflects its identity, issued by a trusted authority. Node N1 can contact the authority that issued the certificate to prove that it has been scammed. At this moment, the trusted authority can issue a flag that makes other P2P nodes collaborating with node N2 aware that N2 is not a trusted node.
[0111] 7.2 Network Fairness Architecture In addition to providing node N1 with the possibility to cross-check with a trusted authority and report node N2 if it is being deceived, we can implement an agreement that can further protect the P2P network from malicious actors. This agreement relies on the majority of nodes acting legitimately and being incentivized to do so at all times.
[0112] Node N2 is Node N 2,1 , … N 2,n It is in the interest of each of N2's neighbors to keep N2 valid. 2,1 , … N 2,n We detail two scenarios that may be of interest to us. If N2 is dishonest and has not added the new node N1 to its connections, the nodes that disseminate the request to N2 may have lost rewards by sending the request to the dishonest node. If N2 does not update the network correctly when N1 goes offline, node N 2,1 , … N 2,n You can see on the blockchain that N2 is spreading the request to node N1, which means that neighboring nodes are paying N2 for the additional nodes.
[0113] In each of the above two scenarios, neighboring nodes can punish N2 by offering a lower reward in the next request propagation, or they can take N2 offline from the network entirely.
[0114] This agreement offloads N1's process of verifying whether N2 is legitimate, and also gives existing nodes in the network an incentive to ensure that their neighbors are behaving legitimately. We also emphasize that if it were up to node N1 to perform additional verifications on the nodes connected to N2, node N2 could create a false identity and thus fool node N1, enabling a Sybil attack.
[0115] 7.3 Identity Binding In a P2P network using RSA keys, one way to establish identity is to use the RSA private key k RSA Let k be the ECDSA private key used on the Bitcoin network to sign transactions. ECDSA This can be done through the following formula: k ECDSA =H1(H0(k RSA )) where H1 and H0 are two hash functions, not necessarily distinct, then the ECDSA public key is defined as: P ECDSA =k ECDSA G
[0116] If node N1 holds several RSA private keys used within the network, the key index can simply be included in the generation of the ECDSA private key. k ECDSA =H1(H0(k RSA ||index)) To prove the link between the RSA and ECDSA keys, a P2P node can sign its ECDSA public key with its RSA private key using the RSA digital signature cryptosystem.
[0117] 7.4 Node Specialty One area of network optimization is adding node specialization, where each node may specialize in performing a particular function. Several such specializations can come to mind, such as grid computing, mining, being a DNS node, being a trusted authority node, file sharing, etc. Naturally, a node can participate in a P2P network and accept any kind of request, which would be classified as a general purpose node. When specialization is present, it can lead to a network structure that modularizes the P2P network, as will be shown further below.
[0118] FIG. 7 shows how such specialization works in step 5 of the network setup, where the transaction TxID net-add Here we show how this can be done during the network setup phase with a simple modification of the above.
[0119] The expertise flag may be expressed in a standard format, for example: SPEC:={ "role":["data", "dns"] }
[0120] A node using the above SPEC entry communicates to the network that the node's expertise is that of a data sharing node and may be part of a DNS service providing node. Such standardization may be issued, for example, by an existing DNS service that helped node N1 to initially find the desired network.
[0121] 7.5 Network Updates In the previous section, we described the procedure through which node N1 can participate in the network and provide incentives, ensuring some degree of fairness. Here we show how to maintain network integrity, where blockchain transactions must ensure economic incentives while reflecting changes in the network structure, such as nodes going offline and changing expertise.
[0122] This section develops an update procedure through which nodes can update the network structure to maintain its integrity. One way to accomplish this process is through the TxID net-add The solution is to modify the network setup protocol described in the previous section so that the second transaction output of is available for consumption. If the output is consumed, we interpret this as the node disconnecting from the P2P network. For simplicity, we say that the node goes offline in this case.
[0123] Therefore, the focus is on TxID net-add The key to success is understanding how the second output of the network can be consumed. This is important because we don’t want to give the network the wrong incentives and jeopardize its integrity.
[0124] To do so, proof
[0125]
number
[0126] We need the data that produced the challenge C (for example, a random integer). C is known only to node N1 and the issuing trusted authority. In the diagram below, we fix the hash function H to correspond to the function computed by the opcode OP_SHA256.
[0127] The TxID given in FIG. 6 and used in step 5 of the network step procedure detailed above. net-add A node may employ the transaction format shown in Figure 8 in the setup protocol to enable the functionality presented in this section.
[0128] The locking script given in the second output allows N1 to indicate to the P2P network that it is going offline. To do so, N1 performs the following steps: 1. N1 creates a transaction as given in Figure 9, provides its signature, and sends the TxID' net-add The second output of the 2. N1 can safely disconnect from the P2P network.
[0129] If N1 is dishonest and does not follow the above protocol to go offline, N2 follows the following protocol: 1. N2 obtains a challenge C from a trusted authority. 2. N2 broadcasts the transaction in Figure 10, provides its signature, and sends the TxID' net-add The second output of the
[0130] Possible scenarios that may arise when updating the network are as follows, highlighting the incentives and security of this approach. N1 is a legitimate node that consumes the second output of the transaction through its signature when it goes offline and gets the money back. This is the primary scenario, since N1 also has an economic incentive to get the money back. TxID' to indicate to the network that N1 is an unauthorized node and will be taken offline. net-add In this case, node N2 can contact a trusted party who attests that N1 did not comply with the update agreement.
[0131]
number
[0132] When the CA that issued the TxID comes online, N2 will net-add Then, we obtain a challenge C that can be used to unlock the second output of N1, thereby indicating to the network that N1 has gone offline.
[0133] If N1 repeats the behavior of not updating the network when it goes offline, N2 can flag N1 as untrusted and reject further join requests from node N1. Furthermore, it is also possible to have an authentication authority flag node N1 as untrusted and invalidate the issued identity. For example, flagging can be done through a transaction. Finally, we show how N1 can change its expertise, SPEC. To do so, N1 creates a new transaction as given in Figure 11, with TxID' net-add It is only necessary to consume the second output of the
[0134] In conclusion, the proposed update procedure ensures the integrity of the network by keeping its structure up to date and providing the needed economic incentives.
[0135] An exemplary P2P overlay model according to the described embodiment is shown in Figure 12. As explained above, a P2P network can perform several services through specialization of nodes. This leads to modularization of the network, whereby nodes take on certain roles to make P2P network communication more efficient.
[0136] Each node N1 participating in the P2P network needs to define its own SPEC flags in order to implement the following services: Figure 12 provides a visual representation of the modularization of P2P, nodes provide the following services: DNS service: SPEC:={"role":"dns"} · Certificate Authority Service: SPEC:={"role":"CA"} · Multi-party computation (MPC) service: SPEC:={"role":"MPC"}
[0137] Since the P2P network keeps a proof of its structure on the blockchain, the DNS service can provide a service (also called a crawler service) that can make the network searchable. By monitoring the network structure, the crawler can maintain a graph of the current network that can support search applications.
[0138] 8. Coordination of Data Transmission 8.1 Graph Theory The connections between nodes on any P2P network form a graph, recalling some basic ideas in graph theory. A graph is a collection of objects (nodes) such that some pairs of objects are related (represented as edges). An example graph is shown in Figure 13, where the nodes of the graph are N i where i is a positive integer or an index set depending on the context. A directed graph is a special kind of graph in which the edges between nodes have a direction (also called directed edges).
[0139] In the following, nodes N1 to N k If N1 is an information request node, then N1 is called a source node or a request node. k is called the sink node or target node, and N k is the last node in the information flow.
[0140] Note that in real-world implementations, P2P networks are not fixed and nodes can connect and disconnect from peers arbitrarily.
[0141] 8.2 Gnutella As an example application context, Gnutella is an example of a distributed P2P network file sharing service. To show how the protocol works, assume a network structure as in Figure 14. A node N1 requests data D over the network, and the Gnutella protocol forwards the request to node N1 that holds the data. 1,1,2 N1 can discover the 1,1,2 Upon reaching,, it transmits the data directly to,N,outside the P2P network structure, which is also called,off-network transmission.,Figure 15 shows a visualization of this protocol.
[0142] The steps of the data transmission protocol are as follows: 1. Node N1 receives a peer 1,1 and N 1,2 , by sending a query message Query for data D to 2. Each node N 1,i sends the message Query to its neighbor peer N 1,i,j Transfer to. 3. N 1,1,2 receives a message Query and returns a reply message QueryHit containing its identification information. 1,1 Send to. 4. N 1,1 forwards the message QueryHit to N1. 5. N1 is N 1,1,2 Contact N 1,1,2 Receive data D from
[0143] 8.3 Onion Routing As an example implementation, the Onion Routing Protocol is an example routing protocol that ensures communication privacy between nodes on a network, such as that used as part of the Tor network. To illustrate the routing protocol, assume that node N1 is connected to N2, which is connected to node N3. The protocol allows node N1 to send data D to N3, as shown in FIG. i The public key of
[0144]
number
[0145] It is written as follows.
[0146] The steps of the protocol are as follows: 1. N1 receives his public key
[0147]
number
[0148] to N2 and sends a request to create a shared key S2 through Diffie-Hellman key exchange. 2. N2 sends its public key
[0149]
number
[0150] N2 replies with "N2 has created a shared key S2" to tell N1 that it has created a shared key S2. N1 then calculates key S2 itself. 3. N1 requests N2's public key for N3. N1 attaches its own public key to the request. N1 does not know N3's IP address. 4. N2 forwards the request to N3, requesting the creation of shared key S3. 5. N3 sends its public key to N2 and acknowledges the creation of key S3, which is shared between N1 and N3. 6. N2 further relays the public key to N1 along with confirmation of the creation of key S3, which it computes itself. 7. N1 first uses key S3, then S2:
[0151]
number
[0152] N1 encrypts data D using N1. N1 transmits the encrypted data to N2. 8. N2 decrypts the encrypted data using S2,
[0153]
number
[0154] N2 is the encrypted data.
[0155]
number
[0156] to N3. 9. N3
[0157]
number
[0158] and receives data D.
[0159] 8.4 Data Transmission An embodiment of the present invention enables a blockchain network to act as an arbiter of the transmission of data between P2P nodes of a P2P network. An exemplary system for implementing the described embodiments is shown in FIG. 17. The system comprises a P2P network comprising a plurality of P2P nodes and a blockchain network 106. The system comprises a P2P node 501 of the P2P network shown in FIG. 5. In some embodiments, the P2P nodes may go through a process of forming connections as described with respect to FIGS. 5-12.
[0160] A P2P network comprises target nodes that have access to target data, and requesting nodes that request the target data. The target data may comprise media data, such as, for example, one or more images, one or more videos, one or more audio files, etc. The target data may comprise one or more documents. In general, the target data may take any form. A P2P network also comprises a number of intermediate nodes. The requesting nodes and the target nodes are connected via the intermediate nodes. That is, the requesting node is connected to one or more intermediate nodes, one or more of which are connected to one or more further intermediate nodes, until the intermediate nodes are connected to the target node. For example, as shown in FIG. 17, a requesting node N1 requests a node N2. 1,1 and N 1,2 connected to node N 1,1 is the target node N k It will be appreciated that Figure 17 is merely an example, and that in practice there may be many more intermediate nodes connecting the requesting node to the target node. Each node in the P2P network is associated with a respective public key.
[0161] The requesting node obtains a hash value based on the request for the target data. More specifically, the request for the target data ("target request") is hashed with a first hash function to obtain a first hash value, and the result is hashed with a second hash function to obtain a second hash value. The first hash function and the second hash function may be the same, or they may be different. The first and / or second hash functions may be cryptographic functions (e.g., from the SHA family of hash functions, such as SHA256). Alternatively, non-cryptographic hash functions may be used. In some examples, the requesting node generates the first and second hash values. In other examples, the requesting node may receive the first and / or second hash values from a different node or from a trusted third party, such as a centralized service that matches requests with data.
[0162] The target request may be based on the target data or an identifier thereof, for example, the target request may be a hash of the target data. The target request may be associated with the target data (e.g., by an optional centralized service) so that the target node can determine what data is being requested. For example, the target node may store a database of data requests associated with the target data. The target node may inform the centralized service of the association. For example, the target node may inform the centralized service that it has media file A associated with request number 123. In some examples, such a centralized service may be provided by a collection of network nodes. The requesting node may contact the centralized service to inform the service that it wishes to obtain media file A. In response, the centralized service may provide request number 123 to the requesting node. The manner in which the requesting node obtains the target request is not necessary to implement the described embodiments.
[0163] In some examples, the first hash value may be obtained by hashing the target request and additional data, such as a timestamp or a secret value known to the requesting node and the target node. For example, as one option, a centralized service may send a secret value to the requesting node and / or the target node.
[0164] It should be noted that any reference to a centralized service is optional, and it is envisioned that in at least some embodiments, no such centralized service exists.
[0165] 8.4.1 Flooding Requests Some embodiments described herein involve flooding a P2P network with requests for targeted data.
[0166] The requesting node generates a master request transaction, which is a blockchain transaction. The master request transaction includes the second hash value and one or more outputs. Each output is locked to a public key of a respective one of the intermediate nodes to which the requesting node is connected on the P2P network. For example, if the requesting node is connected to two nodes (as shown in FIG. 17), the master request transaction includes an output that is locked to a first of the two nodes and a separate output that is locked to a second of the two nodes. The second hash value may be included in the output that is locked to the respective public key of the respective node. For example, each output may include a locking script configured to implement a hash puzzle, the hash puzzle comprising the second hash value. The hash puzzle may require an unlocking script of a consuming transaction (i.e., a transaction that seeks to unlock a locking script that includes the hash puzzle) to include the first hash value or the target request. Additionally or alternatively, in some examples, the second hash value may be included in the OP_RETURN output. The master request transaction may also comprise the requesting node's network identifier (e.g., the requesting node's IP address) and / or the requesting node's certified identifier (e.g., an identifier certified by a certification authority that attests to the requesting node's identity). The requesting node submits the master request transaction to the blockchain network 106. The requesting node may also send the master request transaction directly to the associated intermediate node, i.e., the node to whose public key the output of the transaction is locked. This is beneficial for the intermediate node, since it is expensive for the node to listen to the blockchain to find new request transactions. FIG. 20 shows an example of a master request transaction in which two outputs are locked to the respective public keys of the intermediate nodes connected to the requesting node. In this example, the transaction also includes the requesting node's network address and identifier.
[0167] As shown in FIG. 20, a master request transaction may include a lock time. The lock time specifies the earliest time from which the master request transaction may be included in a block, i.e., recorded in the blockchain. The lock time may be specified using UNIX time or block height. The lock time gives an incentive to intermediate nodes to respond to the request within the specified time.
[0168] Each of the intermediate nodes that receive the master request then generates a respective secondary request transaction. Here, "receiving" a transaction means determining that the transaction comprises an output that is locked to the respective public key of the respective node. Each secondary request transaction generated by each intermediate node is similar to the master request transaction in that it includes a second hash value and one or more outputs, each output locked to the respective public key of the respective node to which the respective intermediate node is connected. For example, a first one of the intermediate nodes may be connected to three other intermediate nodes, and thus the secondary request transaction generated by that node includes three outputs (one key per output) that are locked to the respective public keys of the three other intermediate nodes. As with the master request transaction, the second hash value may be included in the hash puzzle. The secondary request transaction is submitted to the blockchain network 106. FIG. 21 shows an example of a secondary request transaction.
[0169] Like the main request transaction, each sub-request transaction may also include a lock time that specifies the earliest time from which the respective sub-request transaction may be included in a block, i.e., recorded in the blockchain.
[0170] In some examples, one of the secondary request transactions submitted by the first set of intermediate nodes (i.e., the nodes directly connected to the request node) is locked to the public key of the target node. In other examples, the first set of intermediate nodes each generate a respective request transaction with one or more outputs locked to a respective public key of the second set of intermediate nodes. This process continues until the target node receives a secondary request transaction. In this manner, a path of nodes is formed from the request node to the target node via one or more intermediate nodes. With the exception of the target node, each node in the path is connected to the next node via the transmission of a request transaction (primary request transaction in the case of the request node, secondary request transaction in the case of the intermediate node) to the public key of the next node. For example, in FIG. 17, one intermediate node N 1,1 From the request node N1 to the target node N k 18 illustrates the transmission of a primary transaction and a secondary transaction from a requesting node and an intermediate node, respectively.
[0171] Thus, the target node is alerted to the request for the target data, and the target data is transmitted to the requesting node. There are several options for transmitting the target data to the requesting node, which are discussed below. In response to receiving the sub-transaction, the target node may submit a response (or answer) transaction to the blockchain that consumes the output of the sub-transaction locked to the public key of the target node to indicate that the target node has the requested data and that the request has been received. In an example where the sub-transaction includes a hash puzzle based on a second hash value, the input of the response transaction includes the first hash value. This then allows the intermediate nodes to submit respective response transactions that consume the respective outputs of the respective request transactions locked to their respective public keys. Note that "consuming an output" is interpreted as meaning "assigning the digital currency locked by the output to the output of the transaction that unlocks that output." FIG. 19 illustrates the consumption of a request transaction using a response (or answer) transaction, and FIG. 22 illustrates an example of a response transaction issued by a target node.
[0172] In some examples, the target node may determine that it has the target data by identifying a second hash value included in the request transaction. That is, the target node may recognize that a second hash value is associated with the target data item (or target request), e.g., the second hash value may be included in a database associated with the request. In other examples, the target node may have access to the first hash value (e.g., stored in a database associated with the target request), identify the second hash value from the request transaction, and verify that the first hash value hashes to the second hash value. If so, the target node has the corresponding target request. In some examples, the second hash value may be obtained by hashing the first hash value with a timestamp. In these examples, the target node may attempt to hash the first value with a range of different timestamps to verify that the second hash is based on the known first hash value.
[0173] As an option for transmitting the target data, the target node may transmit the data directly to the requesting node, as shown in FIG. 19. The target data may be sent off-chain, e.g., via a (secure) communication channel between the target node and the requesting node. In these examples, the transmission of the target data may be attested on the blockchain. For example, a hash of the target data may be recorded on the blockchain as part of an attestation transaction. The attestation transaction may be generated by the requesting node and / or the target node. Alternatively, the target data may be transmitted on-chain, i.e., included in a blockchain transaction submitted by the target node to the blockchain network 106. In some examples, the transmission of the target data is possible only (or at least conditional on) the requesting node paying the target node the amount of the underlying digital assets, e.g., via an attestation transaction.
[0174] The target node may already have access to the requesting node's public key for sending data on-chain and / or the requesting node's network address (e.g., IP address) for sending data off-chain. In some examples, the requesting node may transmit the public key and / or network address to the target node. For example, in response to receiving the secondary request transaction, the target node may publish a message including the target node's network identifier (e.g., IP address) and the first hash value. Publishing the message may comprise broadcasting the message to the P2P network. By including the first hash value, the requesting node may determine that the target node has received the request. The requesting node may then use the target node's network identifier to connect with the target node, and the target node may transmit the target data to the requesting node. In some examples, prior to connecting to the target node, the requesting node may verify that the first hash value included in the message is correct.
[0175] As an alternative option for sending the target data to the requesting node, the target node may transmit the target data to the requesting node via an intermediate node that forms a path connecting the requesting node to the target node. The target node may obtain the public keys of each of the other nodes in the path, i.e., the requesting node and one or more intermediate nodes. The target node may already have access to the public keys, e.g., stored in a memory, or the public keys may be obtained from a blockchain, e.g., from a request transaction, or from a centralized service. The target node encrypts the target data using the obtained public keys. That is, the target data is encrypted with each of the public keys, first with the public key of the requesting node, then with the public key of the first intermediate node in the path, then with the public key of the second intermediate node in the path, etc., until the target data is encrypted with each public key. In some examples, the target data may first be split into one or more data packets, and each data packet may be encrypted with a set of public keys.
[0176] A data packet encrypted using the set of public keys is called a "final encrypted message". A data packet encrypted using only the public key of the requesting node is called a "first encrypted message". That is, a data packet is each encrypted using the public key of the requesting node to obtain a first encrypted message, and the first encrypted messages are each encrypted using the remaining public keys to obtain a final encrypted message.
[0177] The target node sends the final encrypted message to the last intermediate node in the path, i.e., the intermediate node that submitted the secondary request transaction with an output locked to the target node's public key. The final intermediate node decrypts the final encrypted message using a private key corresponding to its public key to obtain a set of encrypted messages. That set of encrypted messages is encrypted using the public keys of the other intermediate nodes and the requesting node. The final intermediate node sends the set of encrypted messages to the next intermediate node in the path (in the direction of the requesting node), or to the requesting node if there is only one intermediate node in the path. Each intermediate node that receives the set of encrypted messages decrypts the messages using their respective private keys and sends the resulting set of encrypted messages to the next node in the path. Finally, the requesting node receives the one or more initial encrypted messages. The requesting node may then decrypt the one or more initial encrypted messages using its private key to obtain one or more data packets. The target data is then obtained by combining the data packets.
[0178] In some instances, the encrypted messages are submitted from node to node in a single batch, while in other instances, the encrypted messages are submitted from node to node all at once.
[0179] The encrypted messages may be transmitted between nodes via off-chain channels. Alternatively, the encrypted messages may be transmitted via the blockchain. For example, each node may transmit one or more data transactions to the blockchain, each data transaction comprising one or more encrypted messages.
[0180] Optionally, the requesting node may submit a proof transaction to the blockchain to prove receipt of the data packet. For example, the proof transaction may include a hash of the target data. The requesting node may submit a single proof transaction to the blockchain, or a respective proof transaction may be issued for each data packet, for example, each transaction may include a hash of the respective data packet. Similarly, each intermediate node may submit one or more respective proof transactions to the blockchain to prove that it received one or more encrypted messages from a previous node in the path. In some examples, transmission of each encrypted data packet is possible only (or at least conditional on) the node receiving the encrypted data packet paying an amount of an underlying digital asset to the node transmitting the encrypted data packet, for example via a proof transaction.
[0181] 8.4.2 Chained Requests Some embodiments described herein involve sending a request for target data through a chain of intermediate nodes to the target node.
[0182] The requesting node sends the second hash value (based on the request for the target data) to one or more intermediate nodes connected to the requesting node. The requesting node also sends its public key. For example, as shown in FIG. 23, the requesting node N1 sends the second hash value H1 (H0(R)) and its public key PK N1 Then, for each node to which it is connected, in this example the intermediate node N 1,1 and intermediate node N 1,2 Each intermediate node that receives the second hash value transmits the second hash value and the public key PK N1 The intermediate node then forwards the public key of the intermediate node to one or more intermediate nodes connected to the intermediate node. The intermediate node also forwards the public key of the intermediate node to one or more intermediate nodes connected to the intermediate node, together with the second hash value and the public key PK N1For example, the intermediate node N 1,2 is the second hash value, the public key PK of the requesting node N1 , and your own public key PK N1,2 , the intermediate node N 1,2,1 and intermediate node N 1,2,2 This process continues until the second hash value reaches the target node. For example, as shown in FIG. 23, intermediate node N 1,1 is the second hash value, the public key PK of the requesting node N1 , and your own public key PK N1,1 , the intermediate node N 1,1,1 and target node N k It will be appreciated that in practice there may be more nodes in the P2P network and there may be more rounds of intermediate nodes forwarding the second hash value, the received public key, and their own public key to other intermediate nodes until finally the target node receives the second hash value.
[0183] A chain of nodes is formed from the requesting node to the target node. The chain is formed by the transfer of the second hash value and the public key from the requesting node to the target node. The chain may be represented by the public key received by the target node. For example, in FIG. 23, the chain is formed from the requesting node N1, the intermediate node N 1,1 , and the target node N k The public key PK is formed by N1 and P.K. N1,1 A request node is always at one end of the chain and a target node at the other end.
[0184] The requesting node may transmit the second hash value and its public key to the intermediate node over an off-chain channel, for example as part of a P2P network protocol. In another example, the requesting node may transmit the second hash value and its public key on-chain to the intermediate node. That is, the requesting node may submit a request transaction to the blockchain, where the request transaction includes the second hash value and the requesting node's public key. The requesting node may also transmit the request transaction to the intermediate node over an off-chain channel. This improves performance because the node does not have to monitor the blockchain. The request transaction may include one or more outputs, where each output is locked to a respective public key of a respective intermediate node to which the requesting node is connected. For example, if the requesting node is connected to three intermediate nodes, the request transaction may include three outputs, each locked to a respective intermediate node's public key.
[0185] Similarly, the intermediate node may transfer the second hash value and the public key through an off-chain channel by submitting a request transaction to the blockchain. Depending on how the second hash value and the public key are transmitted by the intermediate node, the target node obtains the second hash value and the public key either directly from the intermediate node (through the off-chain channel) or from the blockchain.
[0186] In some examples, the target node may recognize that a second hash value is associated with the target data item (or target request), e.g., the second hash value may be included in a database associated with the request. In other examples, the target node may have access to the first hash value (e.g., stored in a database associated with the target request), receive the second hash value from the intermediate node, and verify that the first hash value hashes to the second hash value. If so, the target node has the corresponding target request. In some examples, the second hash value may be obtained by hashing the first hash value with a timestamp. In these examples, the target node may attempt to hash the first value with a range of different timestamps to verify that the second hash is based on the known first hash value.
[0187] The target node encrypts the target data using the obtained public keys (i.e., the public key of the requesting node and the respective public keys of each other node in the chain). That is, the target data is encrypted with each of the public keys, first with the public key of the requesting node, then with the public key of the first intermediate node in the path, then with the public key of the second intermediate node in the path, etc., until the target data has been encrypted with each public key. In some examples, the target data may first be split into one or more data packets, and each data packet may be encrypted with a set of public keys.
[0188] A data packet encrypted using the set of public keys is called a "final encrypted message". A data packet encrypted using only the public key of the requesting node is called a "first encrypted message". That is, a data packet is each encrypted using the public key of the requesting node to obtain a first encrypted message, and the first encrypted messages are each encrypted using the remaining public keys to obtain a final encrypted message.
[0189] The target node sends the final encrypted message to the last intermediate node in the path, i.e., the intermediate node that submitted the secondary request transaction with an output locked to the public key of the target node. The final intermediate node decrypts the final encrypted message using a private key corresponding to its public key to obtain a set of encrypted messages. Each of the encrypted messages in the set of encrypted messages is encrypted using the public keys of the other intermediate nodes and the requesting node. The final intermediate node sends the set of encrypted messages to the next intermediate node in the path (in the direction of the requesting node), or to the requesting node if there is only one intermediate node in the path. Each intermediate node that receives the set of encrypted messages decrypts the messages using their respective private keys and sends the resulting set of encrypted messages to the next node in the path. Finally, the requesting node receives the one or more initial encrypted messages. The requesting node may then decrypt the one or more initial encrypted messages using its private key to obtain one or more data packets. The target data is then obtained by combining the data packets.
[0190] In some instances, the encrypted messages are submitted from node to node in a single batch, while in other instances, the encrypted messages are submitted from node to node all at once.
[0191] The encrypted messages may be transmitted between nodes via off-chain channels. Alternatively, the encrypted messages may be transmitted via the blockchain. For example, each node may transmit one or more data transactions to the blockchain, each data transaction comprising one or more encrypted messages.
[0192] The requesting node submits one or more attestation transactions to the blockchain to attest to the acquisition of the data packets. For example, the attestation transaction may include a hash of the target data. The attestation transaction may comprise an output locked to the public key of the node in the chain that sent the first encrypted message to the requesting node. The requesting node may submit a single attestation transaction to the blockchain, or a respective attestation transaction may be issued for each data packet, e.g., each transaction may include a hash of the respective data packet. Similarly, each intermediate node may submit one or more respective attestation transactions to the blockchain to attest to the receipt of one or more encrypted messages from the previous node in the path. Additionally or alternatively, the target node may submit one or more attestation transactions to the blockchain to attest to the transmission of the last encrypted message to a node in the chain connected to the target node.
[0193] FIG. 24 illustrates the process of sending an encrypted message to a requesting node via an intermediate node. As shown, the target node encrypts multiple data packets to obtain multiple encrypted messages. The encrypted messages are sent to the intermediate node one at a time. The intermediate node submits a proof transaction to the blockchain network in response to or in response to receiving the encrypted messages. The encrypted messages are decrypted using the intermediate node's public key to reveal the first encrypted message. The first encrypted message is then sent to the requesting node, which attests to receipt of the first encrypted message. The first encrypted message is decrypted to reveal the target data.
[0194] In some examples, the target node may encrypt the target data (or each chunk of the target data) with the first hash value to generate an initial encrypted message. That is, each data packet (whether it is the entire target data or a chunk thereof) is combined with the first hash value before being encrypted with the requesting node's public key. When decrypting the initial encrypted message, the requesting node may verify that the decrypted first hash value is the correct first hash value that was the basis for the second hash value. In this way, the requesting node can be confident that the data packet is provided by the target node, because the target node had access to the first hash value, e.g., by hashing the data request.
[0195] 9. Exemplary Implementations The following provides example implementations of a flooding request embodiment and a chaining request embodiment.
[0196] To add incentives for P2P data transmission, nodes may prove each transmission on the blockchain using a transaction that is later received by the nodes involved in the transmission process. By using a blockchain network, an auditable trail of communication is created so that dishonest nodes can be held accountable. Figure 17 shows a block diagram of nodes N1 and N 1,1 Consider a source node N1 requesting data D from a P2P network, and a sink node N k =N 1,1,2 Assume that N owns the data. The requested data could be, for example, a file, a network query, or proof of identity. k To transmit it from N1 to N2, there are two layers to the implementation. · Incentivize flooding the P2P network with data requests. · Provides incentives for data distribution to nodes that request it.
[0197] Depending on the network, nodes can combine the two layers into a protocol that incentivizes both request flooding and data distribution. Each node is assumed to have an associated public key through which the node becomes uniquely identifiable in the P2P network.
[0198] 9.1 Flooding Reward N1 sends a request R for data D in the P2P network and attaches a payment reward for forwarding the request. k When it reaches N k N1 transmits data D directly to N1 for payment reward. k The protocol is divided into a peer discovery phase (Figure 18) for finding peers and a settlement phase (Figure 19) for payment and data transmission.
[0199] 9.1.1 Peer Discovery Phase: 1. N1 hashes its challenge R, H1(H0(R)), where H1 and H0 are hash functions, not necessarily distinct. 2. N1 sends a transaction with lock time T1 containing the hashed request H1 (H0(R)) to its neighbor node N 1,1 , N 1,2 (Figure 20) N1 sends UTXO
[0200]
number
[0201] is consumed.
[0202] If N1 does not receive a response to its request before lock time T1, N1 broadcasts a transaction with no lock time returning the funds to itself. 3. Each node N 1,i But, Lock Time T2,i A request is forwarded through the network by creating a transaction with (Figure 21). 1,i UTXO
[0203]
number
[0204] is consumed.
[0205] N 1,i Lock Time T 2,i If no response to that request is received before N 1,i broadcasts a transaction returning the funds to itself, with no locktime. 4. Sink node N k receives H1(H0(R)) and recognizes request R (e.g., from a locally stored database). k broadcasts a message containing its identity and H0(R) to the P2P network.
[0206] 9.1.2 Payment Stage: 5. When all nodes receive the broadcast message containing H0(R), node N 1,i In Fig. 20, node N consumes the i-th output of the transaction. 1,I,j consumes the j-th output of a transaction in Figure 21. For example, N k , the transaction TxID as given in FIG. ans -N k Broadcast to the Bitcoin network. 6. Node N1 receives H0(R) and N k N1 receives the identification information of N k Contact us. 7. N k sends data D to N1 and receives a payment of y BSV in return, e.g., using the payment channel protocol.
[0207] Script [Hash-puzzle ]teeth,<h1> OP_SHA256 OP_EQUALVERIFY<h1> and fixes H1 as the hash function corresponding to opcode OP_SHA256. The hash puzzle is<H0(R)> It can be unlocked using
[0208] Node N1 is connected to its neighboring node N 1,1 and N 1,2 Fund transaction requests that pay 2x BSV for each of N k Considering only one hop to reach N, the amount of 2x BSV should be chosen based on how quickly the request should be answered and how many hops are expected. 1,1 and N 1,2 Since H0(R) is the only way to receive payment, N 1,1 and N 1,2 are incentivized to forward H1(H0(R)) to their neighbors for a reward of x BSV.
[0209] N k is incentivized to publish H0(R) and broadcast it in the P2P network, because in doing so, his identity becomes known to N1 and he receives payment for data transmission. In total, N k receives payment of y BSV for data transmission and TxID ans -N k Then, each node N 1,1 and N 1,2 teeth 2x-x-ε=x-εBSV benefit from.
[0210] Similarly, N 1,1,1 , N1,2,1 , N 1,2,2 will earn x-ε BSV profits from step 5. The following table summarizes the incentives:
[0211] [Table 1]
[0212] N 1,2 cheats and H0(R) is N k It is possible that a user might receive 2x BSV without forwarding a request, waiting for it to be broadcast by N1. This scenario should be avoided by N1, which increases the probability of discovering data D by N 1,2 Therefore, N1 is incentivized to always confirm on the blockchain if its neighbors forward the request by relaying the transaction. If none of them forward the request, N1 can reduce the reward for the dishonest peer or disconnect it from the network by contacting the authenticator, as explained above in Sections 6 and 7.
[0213] Similarly, N 1,2 can pay less than x BSV to its peers, reducing its incentive to forward requests. As in the above case, N1 is the sum of N 1,2 payments are constantly verified on the blockchain, reducing future rewards and 1,2 can be disconnected from the network.
[0214] An additional issue concerns the request R. If a node misbehaves and kIf a node wants to obtain the claim reward without waiting for H1(H0(R)) to be discovered, it must brute force H1(H0(R)) to find H0(R). If R is long, such an approach may be too expensive. The careful reader can also notice that there is a vulnerability in this protocol as written here: a claim R may be sent multiple times through the network, not necessarily by the same source node N1. In this case, a node may misbehave. Knowing H0(R) from the first claim, a node can consume the transaction in step 2. One mitigation to this problem is for N1 to append a time variable, such as the Unix time value unixtime, to H0(R) as follows: H0(R)||unixtime The goal is to create a transaction using hash H1(H0(R)||unixtime). k When receives a request, N k must check for a value close to the current Unix time to match the request. This means that it takes N k Add a small load to the
[0215] 9.2 Chain Rewards In the flooding reward section, N1 must pay N k However, in this section, data D is k The rewards are distributed through network paths that connect N to N1, and such paths are called winning chains. Only nodes on the winning chain receive rewards, and N k To securely transmit data D through the chain from N1 to N1, the data needs to be encrypted. Figures 23 and 24 provide a visualization of the communication.
[0216] 9.2.1 Peer Discovery Phase: 1. N1 acquires H1 (H0(R)) and its public key
[0217]
number
[0218] For each adjacent node N 1,i Send to. 2. H1(H0(R)) and
[0219]
number
[0220] 3. N 1,i,j is H1(H0(R)) and
[0221]
number
[0222] Receive.
[0223] By performing peer discovery steps 1-3, k Let H1(H0(R)) be the public key N1 and N 1,1 Since it receives with k , N 1,1 , N1 is formed. The protocol for settling payments on the chain is as follows:
[0224] 9.2.2 Payment Stage: 4. N k sends data D to m data packets D i For example, if the data D has a size of 128 kb, then N k splits it into m=4 packets D i can be divided into Each data packet D i For , execute the following: 5. N k is data packet D i Encrypt.
[0225]
number
[0226] 6. N k E i N 1,1 Send to N 1,1 receives a reward of x BSV through Bitcoin transactions k pay to. 7. N 1,1 E i N k When receiving from N 1,1 teeth
[0227]
number
[0228] Data E encrypted using a private key associated with i Decrypt the
[0229]
number
[0230] Get the.
[0231] N 1,1 verifies the validity of the request by hashing H0(R):H1(H0(R)). If the validation fails, the process stops. 8. N 1,1 extracts the encrypted data intended for N1.
[0232]
number
[0233] 9. N 1,1 but
[0234]
number
[0235] N1 receives a reward of x+y BSV via a Bitcoin transaction. 1,1 pay to. 10. N1
[0236]
number
[0237] H0(R)||D i Get the.
[0238] N1 validates the request by hashing H0(R):H1(H0(R)) and verifying the request. If the validation fails, the process stops. 11. Go back to step 5 and retrieve the next data packet.
[0239] The table below summarizes the incentives for each node.
[0240] [Table 2]
[0241] N 1,1 The rationale for this incentive is as follows: 1,1 In step 6, x BSV is converted to N k Pay to N 1,1 receives y+x BSV from N1 in step 9. Therefore, N 1,1 The margin is y BSV for each data packet.
[0242] The following explains how the encryption format prevents fraud. Prepended hash: When N1 makes multiple requests for data in the P2P network, each encrypted data E i and
[0243]
number
[0244] contains H0(R). Thus, N 1,1 and N1 know which request the encrypted data is associated with. Encryption layers: N k In step 5,
[0245]
number
[0246] For each packet D i This means that N1 is N 1,1 This prevents the user from being deceived as follows: k but
[0247]
number
[0248] Only the data packet D i If you encrypt
[0249]
number
[0250] N1 is N k and N 1,1 By eavesdropping on the connection between 1,1 In this case, N 1,1 pays for an encrypted data packet, but when it sends it to N1, N1 already has packet D i , so refuse to pay.
[0251] N k but
[0252]
number
[0253] For each packet D i If you encrypt the data, even if N1 is eavesdropped, the encrypted data
[0254]
number
[0255] I can't get any information from.
[0256] Check the data quality and ensure that the quality required by N1 is N k Matching the quality of received data from N is a difficult problem [7]. 1,1 and N1. k If the data quality is not adequate, N k contains at most one invalid data packet D i Only pay for N 1,1 and N1 could not be deceived, and N k Subsequent data packets and payments to will be rejected.
[0257] In case of data quality discrepancy, N k N neighbors of 1,1 is N k If the fraud continues, N 1,1 is N k Report to the certification body and k can be disconnected from the network.
[0258] A node is said to have duplicate identities if it uses multiple IP addresses and associated identity proofs across the network, thereby appearing to be different entities. Through a Sybil attack, a node can duplicate its own identity in an attempt to earn more rewards. The impact of such an attack on the chain rewards protocol is that a rogue node can increase fees by sending data to a false identity. This can be prevented by requiring authenticators not to issue different identities to the same node during the network setup phase.
[0259] Honest nodes have no incentive to accept connections from nodes without proof, since this may lead to an increase in the reward they pay. A dishonest node can only replicate its presence in the network by appending a copy to itself. In our P2P network, N 1,1 The cheating wins chain N k , N 1,1 , N 1,1 , N1. By performing this attack, N 1,1 increases the reward it receives from N1 by convincing N1 that the winning chain was longer.
[0260] Since all transactions are recorded on the blockchain, N1 is equal to N 1,1 can check if node N has replicated itself along the winning chain and reject the payment. k However, it is easy to check the public keys received in step 3 for duplicates. The sink node may be held liable for fraudulent behavior if it does not check for duplicate identities and therefore participates in a fraudulent scheme.
[0261] 9.3 Flooding and Chain Rewards The protocols of Sections 9.1 and 9.2 can be combined into an incentive mechanism for request and data propagation in P2P networks. Peer Discovery: Starting from N1, perform steps 1-4 given in Section 9.1. Payment: N requests k When it reaches, perform steps 4-11 given in Section 9.2.
[0262] This protocol improves upon the protocols in Sections 9.1 and 9.2 in the following ways: In Section 9.1, data D is distributed to N outside the P2P network structure. k Since it was transmitted from N to N1, N k N1 and N2 must use different infrastructures that may have data transmission delays. However, in the existing P2P network structure, N1 can estimate the delay by adding a lock time to its request transaction. Therefore, we add control over the transmission delay by transmitting data using the settlement phase of the protocol in Section 9.2. In the protocol of Section 9.2, node N 1,2 is not part of the winning chain and can stop further claims from being forwarded. Since claims are not proven to the blockchain, N1 is 1,2 Therefore, by providing a flooding reward, we can provide N 1,2 Provide incentives to.
[0263] 10. Further observations Other variations or uses of the disclosed techniques may become apparent to those of ordinary skill in the art given the disclosure herein, and the scope of the disclosure is limited only by the appended claims, and not by the described embodiments.
[0264] 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 in no way limited to the Bitcoin blockchain. More generally, any reference above to the Bitcoin network 106, the Bitcoin blockchain 150, and the Bitcoin nodes 104 may be replaced with a reference 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.
[0265] 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, publishing, disseminating and storing blocks 151 of 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 functions of disseminating and / or storing blocks without creating and publishing them (recall that these entities are not considered to be nodes of the preferred Bitcoin network 106).
[0266] 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, disseminating, 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 publish blocks 151, but not store and / or disseminate those blocks 151 to other nodes.
[0267] 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, publishing, disseminating, and storing blocks. The functionality of such network entities / elements may be implemented in hardware in the same manner as described above with reference to the blockchain node 104.
[0268] It will be appreciated that the above embodiments are 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.
[0269] Statement 1. A computer-implemented method of using a blockchain to coordinate data transmission over a peer-to-peer (P2P) network, the P2P network comprising a plurality of P2P nodes, each P2P node connected to at least one other P2P node and associated with a respective public key, a target node among the P2P nodes having access rights to a target data item, the method being performed by a requesting P2P node; obtaining a second hash value, the second hash value being generated by hashing at least the data request with a first hash function to generate a first hash value and then hashing at least the first hash value with a second hash function to obtain a second hash value, the data request being associated with the target data item; submitting a master request transaction to the blockchain network, the master request transaction including the second hash value and one or more first outputs, each first output being locked to a respective public key associated with a respective P2P node connected to the requesting P2P node; Including, each respective P2P node is configured to submit a respective sub-request transaction to the blockchain network, each respective sub-request transaction including the second hash value and one or more first outputs, each first output being locked to a respective public key associated with a respective P2P node connected to the respective P2P node, the process of each P2P node submitting each respective sub-request transaction to the blockchain network continues at least until each first output of each respective sub-request transaction submitted to the blockchain network is locked to a respective public key of the target P2P node, and the method further comprises: Retrieving the target data item from the target P2P node. The computer-implemented method further comprising:
[0270] Statement 2. The method of statement 1, wherein the obtaining of the target data item from the target P2P node includes receiving the target data item directly from the target P2P node, and a hash of the target data item is recorded on the blockchain as part of the attestation transaction.
[0271] Statement 3. The method of statement 2, wherein the method includes submitting the attestation transaction to a blockchain network.
[0272] Alternatively, the target P2P node may submit a proof transaction to the blockchain network.
[0273] Statement 4. The method of statement 1, wherein the target P2P node is configured to submit a data transaction to the blockchain network, the data transaction including the target data item, and said obtaining the target data item from the target P2P node includes obtaining the target data item from the data transaction.
[0274] Statement 5. A step of obtaining a message sent by a target node, the message including a first hash value and a network identifier associated with the target P2P node; connecting to a target P2P node using a network identifier associated with the target P2P node, said obtaining of a target data item being in response to said connecting to the target P2P node; The method according to any of the preceding statements, including
[0275] The network identifier may be an IP address.
[0276] Statement 6. The method of statement 5, comprising verifying a first hash value included in the message, and wherein the connection to the target P2P node is conditional on the first hash value being verified.
[0277] Statement 7. The method of statement 5 or statement 6, wherein the message is broadcast to the P2P network by the target P2P node.
[0278] Statement 8. A path of P2P nodes is formed between the requesting P2P node and the target P2P node, the target P2P node is configured to obtain a respective public key of each P2P node in the path, the target P2P node is configured to split the target data item into one or more respective data packets, encrypt each of the one or more respective data packets with a first hash value using the public key of the requesting P2P node to generate one or more respective first encrypted messages, and generate one or more respective final encrypted messages by encrypting each of the one or more respective first encrypted messages with each of the received one or more respective public keys, said obtaining of the target data item from the target P2P node comprising: obtaining one or more initial encrypted messages from respective P2P nodes in a path connected to the requesting P2P node, wherein each respective P2P node in the path other than the requesting P2P node obtains one or more encrypted messages from a respective next P2P node in the path, decrypts the one or more encrypted messages using a respective public key associated with the respective P2P node, and transmits the one or more encrypted messages to a respective preceding P2P node in the path, such that one or more final encrypted messages are successfully decrypted as they are transmitted along the path from the target P2P node to the requesting P2P node; decrypting the one or more respective first encrypted messages to obtain one or more respective data packets and constructing a target data item thereon; 5. The method according to any one of claims 1 to 4, comprising:
[0279] submitting one or more respective attestation transactions to the blockchain network to attest to receipt of the one or more initial encrypted messages from respective P2P nodes in a path connected to the requesting P2P node. 9. The method of claim 8, comprising:
[0280] Statement 10. The method of statement 9, wherein each P2P node in a path that obtains one or more encrypted messages from a respective next P2P node in the path is configured to submit one or more respective attestation transactions to the blockchain network to attest to having obtained the one or more encrypted messages from the respective next P2P node in the path.
[0281] Statement 11. Decrypting each respective first encrypted message reveals a first candidate hash value and a respective data packet, and the method further comprises: hashing the first candidate hash value using a second hash function to generate a second candidate hash value; and verifying that the second hash value candidate matches the second hash value.
[0282] Statement 12. The method of any of statements 8 to 11, wherein the target data item is split into multiple data packets.
[0283] Statement 13. The method of any of statements 8 to 12, wherein said obtaining the one or more initial encrypted messages from each P2P node includes obtaining the one or more initial encrypted messages directly from each P2P node.
[0284] Statement 14. The method of any of statements 8 to 13, wherein the blockchain includes one or more respective data transactions, each respective data transaction including a respective initial encrypted message, and wherein obtaining the one or more initial encrypted messages from the respective P2P nodes includes obtaining the one or more initial encrypted messages from the blockchain.
[0285] Statement 15. The method of any preceding statement, wherein the obtaining of a second hash value includes generating a second hash value.
[0286] Alternatively, the second hash function may be obtained from a different P2P node or a trusted third party.
[0287] Statement 16. The method of any preceding statement, wherein the first hash function and the second hash function are the same hash function.
[0288] Statement 17. The method of any of statements 1 to 15, wherein the first hash function and the second hash function are different hash functions.
[0289] Statement 18. The method of any preceding statement, wherein the first hash function is a cryptographic hash function and / or the second hash function is a cryptographic hash function.
[0290] Statement 19. The method of any preceding statement, wherein the data request is based on a hash of the target data item.
[0291] Statement 20. The method of any preceding statement, wherein a first output of each of the primary request transaction and each secondary request transaction includes a hash puzzle, the hash puzzle includes a second hash value, and the first hash value requires being provided as a solution to the hash puzzle to unlock the output.
[0292] Statement 21. The method of any preceding statement, wherein the primary request transaction includes a second output, the second output including a respective identifier associated with the requesting P2P node.
[0293] Statement 22. The method of any of the preceding statements, wherein the second hash value is generated by hashing at least the first hash value and a timestamp with a second hash function.
[0294] Statement 23. The method of any preceding statement, wherein the master request transaction includes a respective lock time configured to set the earliest time that the master request transaction may be recorded in a blockchain block.
[0295] The time may be set as a UNIX time or a block height.
[0296] Statement 24. The method of any preceding statement, wherein each respective sub-request transaction includes a respective lock time configured to set a respective earliest time that the respective sub-request transaction may be recorded in a blockchain block.
[0297] Statement 25. A computer-implemented method of using blockchain to coordinate data transmission over a peer-to-peer (P2P) network is provided, the P2P network comprising a plurality of P2P nodes, each P2P node connected to at least one other P2P node and associated with a respective public key, a target node among the P2P nodes having access rights to a target data item requested by a requesting P2P node, the method being performed by the target P2P node; Retrieving a request transaction from the blockchain, the request transaction including the second hash value and one or more first outputs, one of the first outputs being locked to a respective public key associated with the target P2P node; determining that the second hash value is based on a data request associated with the target data item; making the target data item available to the requesting P2P node; 4. A computer-implemented method comprising:
[0298] Statement 26. Broadcasting a message to a P2P network, the message including a first hash value associated with the target P2P node and a P2P network identifier, the first hash value being generated by hashing at least the data request with a first hash function; obtaining a connection request from a requesting P2P node, said making the target data item available to the requesting P2P node being in response to said obtaining of the connection request; 26. The method of claim 25, comprising:
[0299] Statement 27. The method of statement 25 or statement 26, wherein the step of making the target data item available to a requesting P2P node includes sending the target data item directly to the P2P node.
[0300] Statement 28. The method of statement 27, comprising submitting a proof transaction to a blockchain network, the proof transaction including a hash of the target data item.
[0301] Statement 29. The method of statement 25 or statement 26, wherein the step of making the target data item available to requesting P2P nodes includes submitting a data transaction to a blockchain network, the data transaction including the target data item.
[0302] Statement 30. The method of any of statements 25 to 29, comprising submitting a response transaction to a blockchain network, the response transaction comprising an input configured to unlock a first output of the request transaction that is locked to a respective public key of the request transaction.
[0303] Statement 31. The method of statement 30, wherein a first output of each of the request transactions includes a hash puzzle, the hash puzzle includes a second hash value, the first hash value must be provided as a solution to the hash puzzle to unlock the output, and the input of the response transaction includes the first hash value.
[0304] Statement 32. The method of any of statements 25 to 31, wherein the request transaction is a primary request transaction submitted to the blockchain network by a requesting P2P node.
[0305] Statement 33. The method of any of statements 25 to 31, wherein the blockchain includes a master request transaction submitted to the blockchain network by a requesting P2P node, the master request transaction including a second hash value and one or more first outputs, each of the first outputs being locked to a respective public key associated with a respective P2P node connected to the requesting P2P node, the blockchain includes one or more respective sub-request transactions submitted to the blockchain by the respective P2P nodes, and the request transaction is one of the respective sub-request transactions.
[0306] Statement 34. The method of any of statements 25 to 33, wherein the second hash value is generated by hashing at least the first hash value and a timestamp with a second hash function, and wherein the step of determining that the second hash value is based on a data request associated with the target data item includes performing one or more respective operations of hashing the first hash value and each distinct timestamp with the second hash function until the resulting hash value is the second hash value.
[0307] Statement 35. A computer-implemented method of using a blockchain to coordinate data transmission over a peer-to-peer (P2P) network, the P2P network comprising a plurality of P2P nodes, each P2P node connected to at least one other P2P node and associated with a respective public key, a target node among the P2P nodes having access rights to a target data item requested by a requesting P2P node, the method being performed by the target P2P node; obtaining a second hash value and one or more public keys, each public key associated with a respective P2P node, one of the one or more public keys being a public key of the requesting P2P node and each of the other one or more public keys being associated with a respective P2P node belonging to a path of P2P nodes between the requesting P2P node and the target P2P node, each P2P node in the path being connected to a preceding P2P node in the path and / or a next P2P node in the path; determining a second hash value based on the first hash value, the first hash value being based on a data request associated with the target data item; splitting the target data item into one or more respective data packets; encrypting each of the one or more respective data packets with the first hash value using a public key of the requesting P2P node to generate one or more respective first encrypted messages; encrypting the one or more respective initial encrypted messages with each of the respective public keys associated with each P2P node in the path to generate one or more respective final encrypted messages; sending the one or more respective final encrypted messages to P2P nodes in a path connected to the target P2P node, where one or more respective attestation transactions are submitted to a blockchain network to attest to the sending of the one or more respective final encrypted messages; 4. A computer-implemented method comprising:
[0308] Statement 36. The method of statement 35, wherein the one or more respective attestation transactions are submitted to the blockchain network by the target P2P node.
[0309] Statement 37. 1. A computer device comprising: a memory comprising one or more memory units; A computing device comprising: a processing device having one or more processing units; and a memory storing code adapted to be executed on the processing device, the code being configured, when executed on the processing device, to perform a method according to any one of statements 1 to 36.
[0310] Statement 38. A computer program embodied on a computer readable storage and configured to, when executed on one or more processors, perform the method according to any of statements 1 to 36.
[0311] According to another aspect disclosed herein, a method may be provided that comprises actions of a requesting P2P node and a target P2P node.
[0312] According to another aspect disclosed herein, a system may be provided that includes computer devices of a requesting P2P node and a target P2P node. [Explanation of symbols]
[0313] 101 Internet, packet-switched networks 102 Computer terminals, equipment 103 users 104 Blockchain nodes 105 Client Applications 106 P2P Networks 107 Side Channel 150 Blockchain 151 Blocks 152 Transactions 153 Genesis Block 154 Pool 155 Block Pointer 201 Header 202 Input 203 Output 401 Transaction Engine 402 UI Layer 451 Protocol Engine 452 Script Engine 454 Application Level Decision Engine 455 Blockchain-related functional modules 500 UI 501 P2P nodes 502 Data Entry Fields 503 Information elements, UI elements
Claims
1. 1. A computer-implemented method of using a blockchain to coordinate data transmission over a peer-to-peer (P2P) network, the P2P network comprising a plurality of P2P nodes, each P2P node connected to at least one other P2P node and associated with a respective public key, a target P2P node among the P2P nodes having access rights to a target data item, the computer-implemented method being executed by a requesting P2P node; obtaining a second hash value, the second hash value being generated by hashing at least the data request with a first hash function to generate a first hash value, and then hashing at least the first hash value with a second hash function to obtain the second hash value, the data request being associated with the target data item; submitting a master request transaction to a blockchain network, the master request transaction including the second hash value and one or more first outputs, each first output being locked to a respective public key associated with a respective P2P node connected to the requesting P2P node; Including, each respective P2P node is configured to submit a respective sub-request transaction to the blockchain network, the respective sub-request transaction including the second hash value and one or more first outputs, each first output being locked to a respective public key associated with a respective P2P node connected to the respective P2P node, the process of each P2P node submitting each sub-request transaction to the blockchain network continues at least until each first output of each sub-request transaction submitted to the blockchain network is locked to the respective public key of the target P2P node, the computer-implemented method further comprising: obtaining the target data item from the target P2P node; The computer-implemented method further comprising:
2. 2. The method of claim 1, wherein the obtaining of the target data item from the target P2P node includes receiving the target data item directly from the target P2P node, and a hash of the target data item is recorded on the blockchain as part of a proof transaction.
3. The method of claim 2 , further comprising submitting the attestation transaction to the blockchain network.
4. 2. The method of claim 1, wherein the target P2P node is configured to submit a data transaction to the blockchain network, the data transaction including the target data item, and wherein obtaining the target data item from the target P2P node includes obtaining the target data item from the data transaction.
5. obtaining a message sent by a target node, the message including the first hash value and a network identifier associated with the target P2P node; connecting to the target P2P node using the network identifier associated with the target P2P node, wherein the obtaining of the target data item is in response to connecting to the target P2P node; 5. The method according to claim 1 , comprising:
6. 6. The method of claim 5, further comprising the step of verifying the first hash value included in the message, and wherein connecting to the target P2P node is conditional on the first hash value being verified.
7. The method according to claim 5 or 6, wherein the message is broadcast by the target P2P node to the P2P network.
8. a path of P2P nodes is formed between the requesting P2P node and the target P2P node, the target P2P node is configured to obtain the respective public keys of the respective P2P nodes in the path, the target P2P node is configured to split the target data item into one or more respective data packets, encrypt each of the one or more respective data packets together with the first hash value using the public key of the requesting P2P node to generate one or more respective first encrypted messages, and generate one or more respective final encrypted messages by encrypting the one or more respective first encrypted messages with each of the received one or more respective public keys, obtaining the one or more initial encrypted messages from the respective P2P nodes in the path connected to the requesting P2P node, wherein each respective P2P node in the path other than the requesting P2P node obtains one or more encrypted messages from a next respective P2P node in the path, decrypts the one or more encrypted messages using the respective public keys associated with the respective P2P node, and transmits the one or more encrypted messages to a respective preceding P2P node in the path, such that the one or more final encrypted messages are successfully decrypted as they are transmitted along the path from the target P2P node to the requesting P2P node; decrypting said one or more respective first encrypted messages to obtain said one or more respective data packets and constructing said target data item thereon; 5. The method according to claim 1 , comprising:
9. submitting one or more respective attestation transactions to the blockchain network to attest to having obtained the one or more initial encrypted messages from the respective P2P nodes in the path connected to the requesting P2P node; 9. The method of claim 8, comprising:
10. 10. The method of claim 9, wherein each P2P node in the path that obtains one or more encrypted messages from the respective next P2P node in the path is configured to submit one or more respective attestation transactions to the blockchain network to attest to having obtained the one or more encrypted messages from the respective next P2P node in the path.
11. Decrypting each respective first encrypted message reveals a first candidate hash value and said respective data packet, said method comprising: hashing the first hash value candidate using the second hash function to generate a second hash value candidate; verifying that the second hash value candidate matches the second hash value; 11. The method according to any one of claims 8 to 10, comprising:
12. 12. A method according to any one of claims 8 to 11, wherein the target data item is split into a number of data packets.
13. 13. The method of claim 8, wherein the obtaining of the one or more initial encrypted messages from the respective P2P nodes comprises obtaining the one or more initial encrypted messages directly from the respective P2P nodes.
14. 14. The method of any one of claims 8 to 13, wherein the blockchain includes one or more respective data transactions, each respective data transaction including a respective initial encrypted message, and wherein obtaining the one or more initial encrypted messages from the respective P2P nodes includes obtaining the one or more initial encrypted messages from the blockchain.
15. 15. The method of claim 1, wherein the obtaining of the second hash value comprises generating the second hash value.
16. 16. The method of claim 1, wherein the first hash function and the second hash function are the same hash function.
17. 16. The method of claim 1, wherein the first hash function and the second hash function are different hash functions.
18. 18. The method of claim 1, wherein the first hash function is a cryptographic hash function and / or the second hash function is a cryptographic hash function.
19. 19. The method of claim 1, wherein the data request is based on a hash of the target data item.
20. 20. The method of claim 1, wherein a first output of each of the primary request transaction and each of the respective secondary request transactions comprises a hash puzzle, the hash puzzle comprising the second hash value, and requiring the first hash value to be provided as a solution to the hash puzzle to unlock the output.
21. 21. The method of claim 1, wherein the primary request transaction includes a second output, the second output including a respective identifier associated with the requesting P2P node.
22. 22. The method of claim 1, wherein the second hash value is generated by hashing at least the first hash value and a timestamp with the second hash function.
23. 23. The method of any one of claims 1 to 22, wherein the master request transaction includes a respective lock time configured to set the earliest time that the master request transaction may be recorded in a blockchain block.
24. 24. The method of any one of claims 1 to 23, wherein each respective sub-request transaction includes a respective lock time configured to set a respective earliest time that the respective sub-request transaction may be recorded in a blockchain block.
25. 1. A computer-implemented method of using a blockchain to coordinate data transmission over a peer-to-peer (P2P) network, the P2P network comprising a plurality of P2P nodes, each P2P node connected to at least one other P2P node and associated with a respective public key, a target P2P node among the P2P nodes having access to a target data item requested by a requesting P2P node, the computer-implemented method being executed by the target P2P node; obtaining a request transaction from the blockchain, the request transaction including a second hash value and one or more first outputs, one of the first outputs being locked to the respective public key associated with the target P2P node; determining that the second hash value is based on a data request associated with the target data item; making the target data item available to the requesting P2P node; 4. A computer-implemented method comprising:
26. broadcasting a message to the P2P network, the message including a first hash value associated with the target P2P node and a P2P network identifier, the first hash value being generated by hashing at least the data request with a first hash function; obtaining a connection request from the requesting P2P node, the step of making the target data item available to the requesting P2P node being in response to obtaining the connection request; 26. The method of claim 25, comprising:
27. 27. A method according to claim 25 or 26, wherein the step of making the target data item available to the requesting P2P node comprises sending the target data item directly to the P2P node.
28. 28. The method of claim 27, comprising submitting an attestation transaction to a blockchain network, the attestation transaction including a hash of the target data item.
29. 27. The method of claim 25 or 26, wherein the step of making the target data item available to the requesting P2P node comprises submitting a data transaction to a blockchain network, the data transaction including the target data item.
30. 30. The method of any one of claims 25 to 29, comprising submitting a response transaction to a blockchain network, the response transaction comprising an input configured to unlock the first output of the request transaction that is locked to the respective public key of the request transaction.
31. 31. The method of claim 30, wherein a first output of each of the request transactions includes a hash puzzle, the hash puzzle including the second hash value, requires the first hash value to be provided as a solution to the hash puzzle to unlock the output, and the input of the response transaction includes the first hash value.
32. 32. The method of any one of claims 25 to 31, wherein the request transaction is a primary request transaction submitted to a blockchain network by the request P2P node.
33. 32. The method of claim 25, wherein the blockchain includes a master request transaction submitted to a blockchain network by the requesting P2P node, the master request transaction including the second hash value and one or more first outputs, each first output locked to a respective public key associated with a respective P2P node connected to the requesting P2P node, and the blockchain includes one or more respective sub-request transactions submitted to the blockchain by respective P2P nodes, the request transaction being one of the respective sub-request transactions.
34. 34. A method according to any one of claims 25 to 33, wherein the second hash value is generated by hashing at least the first hash value and a timestamp with a second hash function, and wherein the step of determining that the second hash value is based on a data request relating to the target data item comprises performing one or more respective operations of hashing the first hash value and each different timestamp with the second hash function until a resulting hash value is the second hash value.
35. 1. A computer-implemented method of using a blockchain to coordinate data transmission over a peer-to-peer (P2P) network, the P2P network comprising a plurality of P2P nodes, each P2P node connected to at least one other P2P node and associated with a respective public key, a target P2P node among the P2P nodes having access to a target data item requested by a requesting P2P node, the computer-implemented method being executed by the target P2P node; obtaining a second hash value and one or more public keys, each public key associated with a respective P2P node, one of the one or more public keys being a public key of the requesting P2P node and each of the other one or more public keys being associated with a respective P2P node belonging to a path of P2P nodes between the requesting P2P node and the target P2P node, each P2P node in the path being connected to a previous P2P node in the path and / or a next P2P node in the path; determining that the second hash value is based on a first hash value, the first hash value being based on a data request associated with the target data item; splitting the target data item into one or more respective data packets; encrypting each of the one or more respective data packets together with the first hash value using a public key of the requesting P2P node to generate one or more respective first encrypted messages; encrypting the one or more respective initial encrypted messages with each of the respective public keys associated with the respective P2P nodes in the path to generate one or more respective final encrypted messages; sending the one or more respective final encrypted messages to the P2P nodes in the path connected to the target P2P node, wherein one or more respective attestation transactions are submitted to a blockchain network to attest to the sending of the one or more respective final encrypted messages; 4. A computer-implemented method comprising:
36. 36. The method of claim 35, wherein the one or more respective attestation transactions are submitted to the blockchain network by the target P2P node.
37. 1. A computer device comprising: a memory comprising one or more memory units; 37. A computing apparatus comprising: a processing device having one or more processing units; and wherein the memory stores code adapted to be executed on the processing device, the code being configured, when executed on the processing device, to perform the method of any one of claims 1 to 36.
38. A computer program embodied on a computer readable storage and configured to, when executed on one or more processors, perform the method of any one of claims 1 to 36.
