Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
FORMING PEER-TO-PEER CONNECTIONS USING BLOCKCHAIN
Document Type and Number:
WIPO Patent Application WO/2023/006573
Kind Code:
A1
Abstract:
A computer-implemented method of using a blockchain to form connections between P2P nodes of a P2P network, wherein each P2P node is associated with a respective public key, and wherein the method comprises: obtaining a respective public key associated with a second one of the P2P nodes; generating a first blockchain transaction comprising a first input signed with a signature corresponding to the respective public key of the first P2P node, a first output locked to the respective public key of the second P2P node, and wherein the first blockchain transaction comprises the network address of the P2P network; and causing the first blockchain transaction to be submitted to a blockchain network to be recorded on the blockchain, wherein the second P2P node is configured to connect with the first P2P node on the P2P network in response to the first blockchain transaction being recorded on the blockchain.

Inventors:
PAUNOIU ALEXANDRU (GB)
WRIGHT CRAIG STEVEN (GB)
Application Number:
PCT/EP2022/070495
Publication Date:
February 02, 2023
Filing Date:
July 21, 2022
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
NCHAIN LICENSING AG (CH)
International Classes:
G06F21/64; H04L9/00; H04L9/32
Domestic Patent References:
WO2021130557A12021-07-01
Foreign References:
GB2588659A2021-05-05
Other References:
ANONYMOUS: "The Metanet Technical summary A Blockchain-based Internet", 9 December 2019 (2019-12-09), XP055739955, Retrieved from the Internet [retrieved on 20201014]
Attorney, Agent or Firm:
TOWNSEND, Martyn James (GB)
Download PDF:
Claims:
CLAIMS

1. A computer-implemented method of using a blockchain to form connections between peer-to-peer, P2P, nodes of a P2P network, wherein the P2P network is associated with a network address and comprises a plurality of P2P nodes, wherein each of the plurality of P2P nodes is associated with a respective public key, and wherein the method is performed by a first one of the P2P nodes and comprises: obtaining a respective public key associated with a second one of the P2P nodes; generating a first blockchain transaction, wherein the first blockchain transaction comprises i) a first input signed with a signature corresponding to the respective public key of the first P2P node, ii) a first output locked to the respective public key of the second P2P node, and wherein the first blockchain transaction comprises the network address of the P2P network; and causing the first blockchain transaction to be submitted to one or more blockchain nodes of a blockchain network to be recorded on the blockchain, wherein the second P2P node is configured to connect with the first P2P node on the P2P network in response to the first blockchain transaction being recorded on the blockchain.

2. The method of claim 1, wherein each of the plurality of P2P nodes is associated with a respective identifier, and wherein the first blockchain transaction comprises the respective identifier of the first P2P node.

3. The method of claim 2, wherein the respective identifier associated with each respective P2P node is certified by a certification authority.

4. The method of any preceding claim, wherein said obtaining of the respective public key associated with the second P2P node comprises querying a resource comprising the respective public key of each respective P2P node.

5. The method of claim 4, wherein the resource comprises a Domain Name System, DNS, service.

6. The method of claim 4 or claim 5, wherein the resource comprises, for each respective P2P node, a respective Internet Protocol, IP, address associated with the respective P2P node, and wherein said obtaining of the respective public key associated with the second P2P node comprises obtaining the respective IP address associated with the second P2P node.

7. The method of claim 6, wherein the method comprises: initiating an internet handshake with the second P2P node using the respective IP address of the second P2P node; obtaining, from the second P2P node, the respective IP address of the second P2P node signed with a digital signature; verifying the digital signature using the respective public key of the second P2P node, wherein said generating of the first blockchain transaction is conditional on the digital signature being verified.

8. The method of any preceding claim, wherein the first P2P node has a respective RSA key, and wherein a respective private key of the first P2P node used to generate the signature corresponding to the respective public key of the first P2P node is generated by hashing at least the respective RSA key of the first P2P node with one or more hash functions.

9. The method of claim 8, wherein the respective private key of the first P2P node is generated by hashing at least the respective RSA key of the first P2P node with at least two hash functions.

10. The method of any preceding claim, wherein the first blockchain transaction comprises one or more respective specialisation flags indicating respective specialisations associated with the first P2P node.

11. The method of any preceding claim, wherein the first blockchain comprises iii) a second output, and wherein the second output comprises the network address of the P2P network and the respective identifier of the first P2P node.

12. The method of claim 10 and claim 11, wherein the second output of the first blockchain transaction comprises the one or more respective specialisation flags.

13. The method of any of claims 1 to 10, wherein the first output of the first blockchain transaction comprises the network address of the P2P network and the respective identifier of the first P2P node.

14. The method of claim 10 and claim 13, wherein the first output of the first blockchain transaction comprises the one or more respective specialisation flags.

15. The method of any preceding claim, wherein the first blockchain comprises iv) a third output, wherein when executed alongside an input of a blockchain transaction, the third output is configured to require the input of the blockchain transaction to comprise either a) a signature corresponding to a respective public key associated with the first P2P node, or b) a respective signature corresponding to a respective public key associated with the second P2P node, and wherein the second P2P node is configured to disconnect with the first P2P node in response to the third output of the first blockchain transaction being successfully spent.

16. The method of claim 15, wherein the third output comprises a hash of challenge data, and wherein the third output is configured to require the input of the blockchain transaction to comprise either a) the signature corresponding to a respective public key associated with the first P2P node, or b) the respective signature corresponding to a respective public key associated with the second P2P node, and the challenge data.

17. The method of claim 15 or claim 16, comprising: generating a second blockchain transaction, wherein the second blockchain transaction comprises an input that references the third output of the first blockchain transaction and comprises the signature corresponding to the respective public key associated with the first P2P node; and causing the second blockchain transaction to be submitted to one or more blockchain nodes of a blockchain network to be recorded on the blockchain, wherein the second blockchain transaction is for signalling to the second P2P node to disconnect with the first P2P node.

18. The method of any preceding claim, comprising: obtaining one or more respective public keys each associated with a different respective one of the P2P nodes; for each of the one or more respective public keys, generating a respective blockchain transaction, wherein the respective blockchain transaction comprises i) a first input signed with a signature corresponding to the respective public key of the first P2P node, and ii) a first output locked to the respective public key of the different respective P2P node, and wherein the respective blockchain transaction comprises the network address of the P2P network; and causing each of the respective blockchain transactions to be submitted to one or more blockchain nodes of the blockchain network to be recorded on the blockchain, wherein each different respective P2P node is configured to connect with the first P2P node in response to the respective blockchain transaction being recorded on the blockchain.

19. The method of any preceding claim, wherein the blockchain comprises a third blockchain transaction comprising i) an input signed with a signature corresponding to the respective public key of a third P2P node, and ii) a first output locked to the respective public key of a fourth P2P node, and wherein the third blockchain transaction comprises the network address of the P2P network, and wherein the method comprises: determining that the third P2P node is connected to the fourth P2P node based on the third blockchain transaction.

20. The method of any preceding claim, comprising: obtaining a plurality of respective request transactions, each respective request transaction comprising a respective first output locked to the respective public key of a respective P2P node, wherein the respective first output locks a respective amount of a digital asset, wherein each respective request transaction comprises the network address of the P2P network, and wherein each respective request transaction is associated with a respective timestamp; computing a regression model based on the respective amount and respective timestamp of each respective request transaction; using the regression model to determine a target amount given a target timestamp, wherein the first output of the first transaction locks the target amount of the digital asset.

21. The method of claim 20, wherein said obtaining comprises obtaining at least some of the plurality of respective request transactions from the blockchain.

22. The method of claim 20 or claim 21, wherein said obtaining comprises receiving at least some of the plurality of respective request transactions from a service provider.

23. The method of any of claims 20 to 22, wherein the regression model is a linear regression model.

24. A computer-implemented method of using a blockchain to form connections between peer-to-peer, P2P, nodes of a P2P network, wherein the P2P network is associated with a network address and comprises a plurality of P2P nodes, wherein each of the plurality of P2P nodes is associated with a respective public key, wherein the blockchain comprises a first blockchain transaction, wherein the first blockchain transaction comprises i) a first input signed with a signature corresponding to the respective public key of a first P2P node, ii) a first output locked to the respective public key of a second P2P node, and wherein the first blockchain transaction comprises the network address of the P2P network, and wherein the method is performed by a second one of the P2P nodes and comprises: determining that the blockchain comprises the first blockchain transaction; and in response to said determining, connecting with the first P2P node on the P2P network.

25. The method of claim 24, wherein said connecting with the first P2P node on the P2P network comprises adding the first P2P node to a list of P2P nodes that the second P2P can communicate with on the P2P network.

26. The method of claim 24 or claim 25, comprising: receiving an internet handshake from the first P2P node; and sending, to the first P2P node, a respective IP address of the second P2P node signed with a digital signature corresponding to the respective public key of the second P2P node.

27. The method of claim 26, wherein the second P2P node has a respective RSA key, and wherein a respective private key of the second P2P node used to generate the signature corresponding to the respective public key of the second P2P node is generated by hashing at least the respective RSA key of the second P2P node with one or more hash functions.

28. The method of claim 24 or any claim dependent thereon, wherein the first blockchain transaction comprises one or more respective specialisation flags indicating respective specialisations associated with the first P2P node, and wherein the method comprises: communicating with first P2P node based on the respective specialisations associated with the first P2P node as indicated by the one or more respective specialisation flags.

29. The method of claim 24 or any claim dependent thereon, wherein the first blockchain comprises a third output, wherein when executed alongside an input of a blockchain transaction, the third output is configured to require the input of the blockchain transaction to comprise either a) a signature corresponding to a respective public key associated with the first P2P node, or b) a respective signature corresponding to a respective public key associated with the second P2P node, and wherein the method comprises: determining that the third output has been successfully spent; and in response to said determining, disconnecting with the first P2P node on the P2P network.

30. The method of claim 29, wherein said determining that the third output has been successfully spent comprises: generating a second blockchain transaction, wherein the second blockchain transaction comprises an input that references the third output of the first blockchain transaction and comprises the signature corresponding to the respective public key associated with the second P2P node; and causing the second blockchain transaction to be submitted to one or more blockchain nodes of a blockchain network to be recorded on the blockchain.

31. The method of claim 30, wherein the third output comprises a hash of challenge data, and wherein the third output is configured to require the input of the blockchain transaction to comprise either a) the signature corresponding to a respective public key associated with the first P2P node, or b) the respective signature corresponding to a respective public key associated with the second P2P node, and the challenge data, and wherein the method comprises: obtaining the challenge data, wherein the input of the second blockchain transaction comprises the challenge data.

32. The method of claim 31, wherein the challenge data is obtained from a certificate authority.

33. The method of claim 30 or any claim dependent thereon, wherein said generating of the second blockchain transaction is in response to determining that the first P2P node has gone offline on the P2P network and/or has acted dishonestly.

34. Computer equipment comprising: memory comprising one or more memory units; and processing apparatus comprising one or more processing units, wherein the memory stores code arranged to run on the processing apparatus, the code being configured so as when on the processing apparatus to perform the method of any of claims 1 to 33. 35 A computer program embodied on computer-readable storage and configured so as, when run on one or more processors, to perform the method of any of claims 1 to 33.

Description:
FORMING PEER-TO-PEER CONNECTIONS USING BLOCKCHAIN

TECHNICAL FIELD

The present disclosure relates to methods of using a blockchain to form connections between peer-to-peer (P2P) nodes of a P2P network. The methods enable the attestation of connections between the P2P nodes.

BACKGROUND

A blockchain refers to a form of distributed data structure, wherein a duplicate copy of the blockchain is maintained at each of a plurality of nodes in a distributed peer-to-peer (P2P) network (referred to below as a "blockchain network") and widely publicised. The blockchain comprises a chain of blocks of data, wherein each block comprises one or more transactions. Each transaction, other than so-called "coinbase transactions", points back to a preceding transaction in a sequence which may span one or more blocks going back to one or more coinbase transactions. Coinbase transactions are discussed further below. Transactions that are submitted to the blockchain network are included in new blocks. New blocks are created by a process often referred to as "mining", which involves each of a plurality of the nodes competing to perform "proof-of-work", i.e. solving a cryptographic puzzle based on a representation of a defined set of ordered and validated pending transactions waiting to be included in a new block of the blockchain. It should be noted that the blockchain may be pruned at some nodes, and the publication of blocks can be achieved through the publication of mere block headers.

The transactions in the blockchain may be used for one or more of the following purposes: to convey a digital asset (i.e. a number of digital tokens), to order a set of entries in a virtualised ledger or registry, to receive and process timestamp entries, and/or to time- order index pointers. A blockchain can also be exploited in order to layer additional functionality on top of the blockchain. For example blockchain protocols may allow for storage of additional user data or indexes to data in a transaction. There is no pre-specified limit to the maximum data capacity that can be stored within a single transaction, and therefore increasingly more complex data can be incorporated. For instance this may be used to store an electronic document in the blockchain, or audio or video data.

Nodes of the blockchain network (which are often referred to as "miners") perform a distributed transaction registration and verification process, which will be described in more detail later. In summary, during this process a node validates transactions and inserts them into a block template for which they attempt to identify a valid proof-of-work solution. Once a valid solution is found, a new block is propagated to other nodes of the network, thus enabling each node to record the new block on the blockchain. In order to have a transaction recorded in the blockchain, a user (e.g. a blockchain client application) sends the transaction to one of the nodes of the network to be propagated. Nodes which receive the transaction may race to find a proof-of-work solution incorporating the validated transaction into a new block. Each node is configured to enforce the same node protocol, which will include one or more conditions for a transaction to be valid. Invalid transactions will not be propagated nor incorporated into blocks. Assuming the transaction is validated and thereby accepted onto the blockchain, then the transaction (including any user data) will thus remain registered and indexed at each of the nodes in the blockchain network as an immutable public record.

The node who successfully solved the proof-of-work puzzle to create the latest block is typically rewarded with a new transaction called the "coinbase transaction" which distributes an amount of the digital asset, i.e. a number of tokens. The detection and rejection of invalid transactions is enforced by the actions of competing nodes who act as agents of the network and are incentivised to report and block malfeasance. The widespread publication of information allows users to continuously audit the performance of nodes. The publication of the mere block headers allows participants to ensure the ongoing integrity of the blockchain.

In an "output-based" model (sometimes referred to as a UTXO-based model), the data structure of a given transaction comprises one or more inputs and one or more outputs. Any spendable output comprises an element specifying an amount of the digital asset that is derivable from the proceeding sequence of transactions. The spendable output is sometimes referred to as a UTXO ("unspent transaction output"). The output may further comprise a locking script specifying a condition for the future redemption of the output. A locking script is a predicate defining the conditions necessary to validate and transfer digital tokens or assets. Each input of a transaction (other than a coinbase transaction) comprises a pointer (i.e. a reference) to such an output in a preceding transaction, and may further comprise an unlocking script for unlocking the locking script of the pointed-to output. So consider a pair of transactions, call them a first and a second transaction (or "target" transaction). The first transaction comprises at least one output specifying an amount of the digital asset, and comprising a locking script defining one or more conditions of unlocking the output. The second, target transaction comprises at least one input, comprising a pointer to the output of the first transaction, and an unlocking script for unlocking the output of the first transaction.

In such a model, when the second, target transaction is sent to the blockchain network to be propagated and recorded in the blockchain, one of the criteria for validity applied at each node will be that the unlocking script meets all of the one or more conditions defined in the locking script of the first transaction. Another will be that the output of the first transaction has not already been redeemed by another, earlier valid transaction. Any node that finds the target transaction invalid according to any of these conditions will not propagate it (as a valid transaction, but possibly to register an invalid transaction) nor include it in a new block to be recorded in the blockchain.

An alternative type of transaction model is an account-based model. In this case each transaction does not define the amount to be transferred by referring back to the UTXO of a preceding transaction in a sequence of past transactions, but rather by reference to an absolute account balance. The current state of all accounts is stored by the nodes separate to the blockchain and is updated constantly.

SUMMARY

Peer-to-Peer (P2P) networks have been one of the driving forces in the development of internet communication and information sharing. In particular, since 2009 blockchain networks have been the cryptographic breakthrough in P2P network services. Leading file sharing services, such as the BitTorrent networks, Kazaa or Gnutella are other examples of well-known P2P networks.

There are often times when nodes of a P2P network ("P2P nodes") may struggle to join a P2P network, i.e. form connections with other P2P nodes of the P2P network. For example, a P2P node joining the P2P network for the first time may struggle to form connections as other P2P nodes are unaware of the newly joined P2P node. This means that the existing P2P nodes may not communicate with (e.g. share data with) the newly joined P2P node. This may cause inefficiencies as the newly joined P2P node may offer a more efficient route to transmit data to other P2P nodes. It would therefore be desirable to enable P2P nodes to identify themselves to other P2P nodes so that connections between the P2P nodes can be formed, and similarly, to enable P2P nodes to identify other P2P nodes of the network.

According to one aspect disclosed herein, there is provided a computer-implemented method of using a blockchain to form connections between peer-to-peer, P2P, nodes of a P2P network, wherein the P2P network is associated with a network address and comprises a plurality of P2P nodes, wherein each of the plurality of P2P nodes is associated with a respective public key, and wherein the method is performed by a first one of the P2P nodes and comprises: obtaining a respective public key associated with a second one of the P2P nodes; generating a first blockchain transaction, wherein the first blockchain transaction comprises i) a first input signed with a signature corresponding to the respective public key of the first P2P node, ii) a first output locked to the respective public key of the second P2P node, and wherein the first blockchain transaction comprises the network address of the P2P network; and causing the first blockchain transaction to be submitted to one or more blockchain nodes of a blockchain network to be recorded on the blockchain, wherein the second P2P node is configured to connect with the first P2P node on the P2P network in response to the first blockchain transaction being recorded on the blockchain.

According to another aspect disclosed herein, there is provided a computer-implemented method of using a blockchain to form connections between peer-to-peer, P2P, nodes of a P2P network, wherein the P2P network is associated with a network address and comprises a plurality of P2P nodes, wherein each of the plurality of P2P nodes is associated with a respective public key, wherein the blockchain comprises a first blockchain transaction, wherein the first blockchain transaction comprises i) a first input signed with a signature corresponding to the respective public key of a first P2P node, ii) a first output locked to the respective public key of a second P2P node, and wherein the first blockchain transaction comprises the network address of the P2P network, and wherein the method is performed by a second one of the P2P nodes and comprises: determining that the blockchain comprises the first blockchain transaction; and in response to said determining, connecting with the first P2P node on the P2P network.

The present disclosure utilizes the blockchain to enable P2P nodes to identify themselves to other P2P nodes, and signal that a connection between the P2P nodes can be made, or has been made. Each P2P node has a public key (e.g. a certified public key). A first P2P node (e.g. a node joining the P2P network for the first time) sends a blockchain transaction to a second P2P node (e.g. an existing node of the P2P network), or rather, locks an output of the transaction to the second node's public key, e.g. using a pay-to-public-key-hash (P2PKH) output. The transaction, which is signed with a signature corresponding to (i.e. verifiable using) the first P2P node's public key, includes a network address of the P2P network. The transaction alerts the second P2P node that the first P2P node is available as a peer (i.e. to form a connection with) on the P2P network having the network address included in the transaction. The second P2P node may then form a connection with the first P2P node on the P2P network. In some examples, forming a connection with a node may comprise adding the node to a list of peers that are available for communicating with, e.g. routing data to or via.

The use of the blockchain enables the first P2P node to connect to any other P2P node that has a public key, by sending a transaction to that public key. The connectivity and scalability of the P2P network is improved as the P2P nodes are able to connect to more nodes. This is particularly useful if data is to be transmitted from one P2P node to another, as more P2P nodes of the network means there are more available routes between the nodes. Moreover, the connections between nodes on the P2P network are made publicly available as a consequence of being recorded on the blockchain, meaning that other P2P nodes can determine which nodes are connected to which other nodes, and therefore route data to an end node using a particular route. In other words, the topology of the P2P network is placed on the blockchain, attested to by the P2P nodes by virtue of being digitally signed.

Note that as used herein, any reference to a "P2P network" shall be understood as meaning a P2P network other than the blockchain network, e.g. general P2P computer networks. Any reference to a P2P node shall be understood as meaning a node of the P2P network.

BRIEF DESCRIPTION OF THE DRAWINGS

To assist understanding of embodiments of the present disclosure and to show how such embodiments may be put into effect, reference is made, by way of example only, to the accompanying drawings in which:

Figure 1 is a schematic block diagram of a system for implementing a blockchain.

Figure 2 schematically illustrates some examples of transactions which may be recorded in a blockchain,

Figure 3A is a schematic block diagram of a client application,

Figure 3B is a schematic mock-up of an example user interface that may be presented by the client application of Figure 3A,

Figure 4 is a schematic block diagram of some node software for processing transactions,

Figure 5 schematically illustrates an example of a P2P network interacting with a blockchain network,

Figure 6 schematically illustrates an example transaction used to alert a second node to a connection available with a first node, Figure 7 schematically illustrates an example transaction used to alert a second node to a connection available with a first node and detail the first node's specialisms,

Figure 8 schematically illustrates another example transaction used to alert a second node to a connection available with a first node,

Figure 9 schematically illustrates an example transaction used to alert a second node that the connection with the first node is unavailable,

Figure 10 schematically illustrates an example transaction used by a second node to terminate a connection with the first node,

Figure 11 schematically illustrates an example transaction used to update the first node's specialisms,

Figure 12 schematically illustrates another example of a P2P network interacting with a blockchain network.

Figure 13 is a graph showing the output of a linear regression model which is approximating the set of points,

Figure 14 is an example historical transaction incentivising a node to accept a connection from another node, and

Figure 15 is an example transaction incentivising a second node to accept a connection from a first node.

DETAILED DESCRIPTION OF EMBODIMENTS

1. EXAMPLE SYSTEM OVERVIEW Figure 1 shows an example system 100 for implementing a blockchain 150. The system 100 may comprise a packet-switched network 101, typically a wide-area internetwork such as the Internet. The packet-switched network 101 comprises a plurality of blockchain nodes 104 that may be arranged to form a peer-to-peer (P2P) network 106 within the packet- switched network 101. Whilst not illustrated, the blockchain nodes 104 may be arranged as a near-complete graph. Each blockchain node 104 is therefore highly connected to other blockchain nodes 104.

Each blockchain node 104 comprises computer equipment of a peer, with different ones of the nodes 104 belonging to different peers. Each blockchain node 104 comprises processing apparatus comprising one or more processors, e.g. one or more central processing units (CPUs), accelerator processors, application specific processors and/or field programmable gate arrays (FPGAs), and other equipment such as application specific integrated circuits (ASICs). Each node also comprises memory, i.e. computer-readable storage in the form of a non-transitory computer-readable medium or media. The memory may comprise one or more memory units employing one or more memory media, e.g. a magnetic medium such as a hard disk; an electronic medium such as a solid-state drive (SSD), flash memory or EEPROM; and/or an optical medium such as an optical disk drive.

The blockchain 150 comprises a chain of blocks of data 151, wherein a respective copy of the blockchain 150 is maintained at each of a plurality of blockchain nodes 104 in the distributed or blockchain network 106. As mentioned above, maintaining a copy of the blockchain 150 does not necessarily mean storing the blockchain 150 in full. Instead, the blockchain 150 may be pruned of data so long as each blockchain node 150 stores the block header (discussed below) of each block 151. Each block 151 in the chain comprises one or more transactions 152, wherein a transaction in this context refers to a kind of data structure. The nature of the data structure will depend on the type of transaction protocol used as part of a transaction model or scheme. A given blockchain will use one particular transaction protocol throughout. 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 an amount representing a quantity of a digital asset as property, an example of which is a user 103 to whom the output is cryptographically locked (requiring a signature or other solution of that user in order to be unlocked and thereby redeemed or spent). Each input points back to the output of a preceding transaction 152, thereby linking the transactions.

Each block 151 also comprises a block pointer 155 pointing back to the previously created block 151 in the chain so as to define a sequential order to the blocks 151. Each transaction

152 (other than a coinbase transaction) comprises a pointer back to a previous transaction so as to define an order to sequences of transactions (N.B. sequences of transactions 152 are allowed to branch). The chain of blocks 151 goes all the way back to a genesis block (Gb)

153 which was the first block in the chain. One or more original transactions 152 early on in the chain 150 pointed to the genesis block 153 rather than a preceding transaction.

Each of the blockchain nodes 104 is configured to forward transactions 152 to other blockchain nodes 104, and thereby cause transactions 152 to be propagated throughout the network 106. Each blockchain node 104 is configured to create blocks 151 and to store a respective copy of the same blockchain 150 in their respective memory. Each blockchain node 104 also maintains an ordered set (or "pool") 154 of transactions 152 waiting to be incorporated into blocks 151. The ordered pool 154 is often referred to as a "mempool". This term herein is not intended to limit to any particular blockchain, protocol or model. It refers to the ordered set of transactions which a node 104 has accepted as valid and for which the node 104 is obliged not to accept any other transactions attempting to spend the same output.

In a given present transaction 152j, the (or each) input comprises a pointer referencing the output of a preceding transaction 152i in the sequence of transactions, specifying that this output is to be redeemed or "spent" in the present transaction 152j. In general, the preceding transaction could be any transaction in the ordered set 154 or any block 151. The preceding transaction 152i need not necessarily exist at the time the present transaction 152j is created or even sent to the network 106, though the preceding transaction 152i will need to exist and be validated in order for the present transaction to be valid. Hence "preceding" herein refers to a predecessor in a logical sequence linked by pointers, not necessarily the time of creation or sending in a temporal sequence, and hence it does not necessarily exclude that the transactions 152i, 152j be created or sent out-of-order (see discussion below on orphan transactions). The preceding transaction 152i could equally be called the antecedent or predecessor transaction.

The input of the present transaction 152j also comprises the input authorisation, for example the signature of the user 103a to whom the output of the preceding transaction 152i is locked. In turn, the output of the present transaction 152j can be cryptographically locked to a new user or entity 103b. The present transaction 152j can thus 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 present transaction 152j. In some cases a transaction 152 may have multiple outputs to split the input amount between multiple users or entities (one of whom could be the original user or entity 103a in order to give change). In some cases a transaction can also have multiple inputs to gather together the amounts from multiple outputs of one or more preceding transactions, and redistribute to one or more outputs of the current transaction.

According to an output-based transaction protocol such as bitcoin, when a party 103, such as an individual user or an organization, wishes to enact a new transaction 152j (either manually or by an automated process employed by the party), then the enacting party sends the new transaction from its computer terminal 102 to a recipient. The enacting party or the recipient will eventually send this transaction to one or more of the blockchain nodes 104 of the network 106 (which nowadays are typically servers or data centres, but could in principle be other user terminals). It is also not excluded that the party 103 enacting the new transaction 152j could send the transaction directly to one or more of the blockchain nodes 104 and, in some examples, not to the recipient. A blockchain node 104 that receives a transaction checks whether the transaction is valid according to a blockchain node protocol which is applied at each of the blockchain nodes 104. The blockchain node protocol typically requires the blockchain node 104 to check that a cryptographic signature in the new transaction 152j matches the expected signature, which depends on the previous transaction 152i in an ordered sequence of transactions 152. In such an output-based transaction protocol, this may comprise checking that the cryptographic signature or other authorisation of the party 103 included in the input of the new transaction 152j matches a condition defined in the output of the preceding transaction 152i which the new transaction assigns, wherein this condition typically comprises at least checking that the cryptographic signature or other authorisation 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 to. The condition may be at least partially defined by a script included in the output of the preceding transaction 152i. Alternatively it could simply be fixed by the blockchain node protocol alone, or it could be due to a combination of these. Either way, 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 test according to the same blockchain node protocol, and so forward the new transaction 152j on to one or more further nodes 104, and so forth. In this way the new transaction is propagated throughout the network of blockchain nodes 104.

In an output-based model, the definition of whether a given output (e.g. UTXO) is assigned (e.g. spent) is whether it has yet been validly redeemed by the input of another, onward 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 which it attempts to redeem has not already been redeemed by another transaction. Again if not valid, the transaction 152j will not be propagated (unless flagged as invalid and propagated for alerting) or recorded in the blockchain 150. This guards against double-spending whereby the transactor tries to assign the output of the same transaction more than once. An account-based model on the other hand guards against double-spending by maintaining an account balance. Because again there is a defined order of transactions, the account balance has a single defined state at any one time.

In addition to validating transactions, blockchain nodes 104 also race to be the first to create blocks of transactions in a process commonly referred to as mining, which is supported by "proof-of-work". At a blockchain node 104, new transactions are added to an ordered pool 154 of valid transactions that have not yet appeared in a block 151 recorded on the blockchain 150. The blockchain nodes then race to assemble a new valid block 151 of transactions 152 from the ordered set of transactions 154 by attempting to solve a cryptographic puzzle. Typically this comprises searching for a "nonce" value such that when the nonce is concatenated with a representation of the ordered pool of pending transactions 154 and hashed, then the output of the hash meets a predetermined condition. E.g. the predetermined condition may be that the output of the hash has a certain predefined number of leading zeros. Note that this is just one particular type of proof-of- work puzzle, and other types are not excluded. A property 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, thus consuming a substantive amount of processing resource at each blockchain node 104 that is trying to solve the puzzle.

The first blockchain node 104 to solve the puzzle announces this to the network 106, providing the solution as proof which can then be easily checked by the other blockchain nodes 104 in the network (once given the solution to a hash it is straightforward to check that it causes the output of the hash to meet the condition). The first blockchain node 104 propagates a block to a threshold consensus of other nodes that accept the block and thus enforce the protocol rules. The ordered set of transactions 154 then becomes recorded as a new block 151 in the blockchain 150 by each of the blockchain nodes 104. A block pointer 155 is also assigned to the new block 151n pointing back to the previously created block 151n-l in the chain. The significant amount of effort, for example in the form of hash, required to create a proof-of-work solution signals the intent of the first node 104 to follow the rules of the blockchain protocol. Such rules include not accepting a transaction as valid if it assigns the same output as a previously validated transaction, otherwise known as double-spending. Once created, the block 151 cannot be modified since it is recognized and maintained at each of the blockchain nodes 104 in the blockchain network 106. The block pointer 155 also imposes a sequential order to the blocks 151. Since the transactions 152 are recorded in the ordered blocks at each blockchain node 104 in a network 106, this therefore provides an immutable public ledger of the transactions.

Note that different blockchain nodes 104 racing to solve the puzzle at any given time may be doing so based on different snapshots of the pool of yet-to-be published transactions 154 at any given time, depending on when they started searching for a solution or the order in which the transactions were received. Whoever solves their respective puzzle first defines which transactions 152 are included in the next new block 151n and in which order, and the current pool 154 of unpublished transactions is updated. The blockchain nodes 104 then continue to race to create a block from the newly-defined ordered pool of unpublished transactions 154, and so forth. A protocol also exists for resolving any "fork" that may arise, which is where two blockchain nodesl04 solve their puzzle within a very short time of one another such that a conflicting view of the blockchain gets propagated between nodes 104. In short, whichever prong of the fork grows the longest becomes the definitive blockchain 150. Note this should not affect the users or agents of the network as the same transactions will appear in both forks.

According to the bitcoin blockchain (and most other blockchains) a node that successfully constructs a new block 104 is granted the ability to newly assign an additional, accepted amount of the digital asset in a new special kind of transaction which distributes an additional defined quantity of the digital asset (as opposed to an inter-agent, or inter-user transaction which transfers an amount of the digital asset from one agent or user to another). This special type of transaction is usually referred to as a "coinbase transaction", but may also be termed an "initiation transaction" or "generation transaction". It typically forms the first transaction of the new block 151n. The proof-of-work signals the intent of the node that constructs the new block to follow the protocol rules allowing this special transaction to be redeemed later. The blockchain protocol rules may require a maturity period, for example 100 blocks, before this special transaction may be redeemed. Often a regular (non-generation) transaction 152 will also specify an additional transaction fee in one of its outputs, to further reward the blockchain node 104 that created the block 151n in which that transaction was published. This fee is normally referred to as the "transaction fee", and is discussed blow.

Due to the resources involved in transaction validation and publication, typically at least each of the blockchain nodes 104 takes the form of a server comprising one or more physical server units, or even whole a data centre. However in principle any given blockchain node 104 could take the form of a user terminal or a group of user terminals networked together. The memory of each blockchain node 104 stores software configured to run on the processing apparatus of the blockchain node 104 in order to perform its respective role or roles and handle transactions 152 in accordance with the blockchain node protocol. It will be understood that any action attributed herein to a blockchain node 104 may be performed by the software run on the processing apparatus of the respective computer equipment. The node software may be implemented in one or more applications at the application layer, or a lower layer such as the operating system layer or a protocol layer, or any combination of these.

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

Some or all of the parties 103 may be connected as part of a different network, e.g. a network overlaid on top of the blockchain network 106. Users of the blockchain network (often referred to as "clients") may be said to be part of a system that includes the blockchain network 106; however, these users are not blockchain nodes 104 as they do not perform the roles required of the blockchain nodes. Instead, each party 103 may interact with the blockchain network 106 and thereby utilize the blockchain 150 by connecting to (i.e. communicating with) a blockchain node 106. Two parties 103 and their respective equipment 102 are shown for illustrative purposes: a first party 103a and his/her respective computer equipment 102a, and a second party 103b and his/her respective computer equipment 102b. It will be understood that many more such parties 103 and their respective computer equipment 102 may be present and participating in the system 100, but for convenience they are not illustrated. Each party 103 may be an individual or an organization. Purely by way of illustration the first party 103a is referred to herein as Alice and the second party 103b is referred to as Bob, but it will be appreciated that this is not limiting and any reference herein to Alice or Bob may be replaced with "first party" and "second "party" respectively.

The computer equipment 102 of each party 103 comprises respective processing apparatus comprising one or more processors, e.g. one or more CPUs, GPUs, other accelerator processors, application specific processors, and/or FPGAs. The computer equipment 102 of each party 103 further comprises memory, i.e. computer-readable storage in the form of a non-transitory computer-readable medium or media. This memory may comprise one or more memory units employing one or more memory media, e.g. a magnetic medium such as hard disk; an electronic medium such as an SSD, flash memory or EEPROM; and/or an optical medium such as an optical disc drive. The memory on the computer equipment 102 of each party 103 stores software comprising a respective instance of at least one client application 105 arranged to run on the processing apparatus. It will be understood that any action attributed herein to a given party 103 may be performed using the software run on the processing apparatus of the respective computer equipment 102. The computer equipment 102 of each party 103 comprises at least one user terminal, e.g. a desktop or laptop computer, a tablet, a smartphone, or a wearable device such as a smartwatch. The computer equipment 102 of a given party 103 may also comprise one or more other networked resources, such as cloud computing resources accessed via the user terminal.

The client application 105 may be initially provided to the computer equipment 102 of any given party 103 on suitable computer-readable storage medium or media, e.g. downloaded from a server, or provided on a removable storage device such as a removable SSD, flash memory key, removable EEPROM, removable magnetic disk drive, magnetic floppy disk or tape, optical disk such as a CD or DVD ROM, or a removable optical drive, etc.

The client application 105 comprises at least a "wallet" function. This has two main functionalities. One of these is to enable the respective party 103 to create, authorise (for example sign) and send transactions 152 to one or more bitcoin nodes 104 to then be propagated throughout the network of blockchain nodes 104 and thereby included in the blockchain 150. The other is to report back to the respective party the amount of the digital asset that he or she currently owns. In an output-based system, this second functionality comprises collating the amounts defined in the outputs of the various 152 transactions scattered throughout the blockchain 150 that belong to the party in question.

Note: whilst the various client functionality may be described as being integrated into a given client application 105, this is not necessarily limiting and instead any client functionality described herein may instead be implemented in a suite of two or more distinct applications, e.g. interfacing via an API, or one being a plug-in to the other. More generally the client functionality could be implemented at the application layer or a lower layer such as the operating system, or any combination of these. The following will be described in terms of a client application 105 but it will be appreciated that this is not limiting.

The instance of the client application or software 105 on each computer equipment 102 is operatively coupled to at least one of the blockchain nodes 104 of the network 106. This enables the wallet function of the client 105 to send transactions 152 to the network 106. The client 105 is also able to contact blockchain nodes 104 in order to query the blockchain 150 for any transactions of which the respective party 103 is the recipient (or indeed inspect other parties' transactions in the blockchain 150, since in embodiments the blockchain 150 is a public facility which provides trust in transactions in part through its public visibility).

The wallet function on each computer equipment 102 is configured to formulate and send transactions 152 according to a transaction protocol. As set out above, each blockchain node 104 runs software configured to validate transactions 152 according to the blockchain node protocol, and to forward transactions 152 in order to propagate them throughout the blockchain network 106. The transaction protocol and the node protocol correspond to one another, and a given transaction protocol goes with a given node protocol, together implementing a given transaction model. The same transaction protocol is used for all transactions 152 in the blockchain 150. The same node protocol is used by all the nodes 104 in the network 106.

When a given party 103, say Alice, wishes to send a new transaction 152j to be included in the blockchain 150, then she formulates the new transaction in accordance with the relevant transaction protocol (using the wallet function in her client application 105). She then sends the transaction 152 from the client application 105 to one or more blockchain nodes 104 to which she is connected. E.g. this could 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 it in accordance with the blockchain node protocol and its respective role. This comprises first checking whether the newly received transaction 152j meets a certain condition for being "valid", examples of which will be discussed in more detail shortly. In some transaction protocols, the condition for validation may be configurable on a per-transaction basis by scripts included in the transactions 152. Alternatively the condition could simply be a built-in feature of the node protocol, or be defined by a combination of the script and the node protocol.

On condition that the newly received transaction 152j passes the test for being deemed valid (i.e. on condition that it is "validated"), any blockchain node 104 that receives the transaction 152j will add the new validated transaction 152 to the ordered set of transactions 154 maintained at that blockchain node 104. Further, any blockchain node 104 that receives the transaction 152j will propagate the validated transaction 152 onward to one or more other blockchain nodes 104 in the network 106. Since each blockchain node 104 applies the same protocol, then assuming the transaction 152j is valid, this means it will soon be propagated throughout the whole network 106.

Once admitted to the ordered pool of pending transactions 154 maintained at a given blockchain node 104, that blockchain node 104 will start competing to solve the proof-of- work puzzle on the latest version of their respective pool of 154 including the new transaction 152 (recall that other blockchain nodes 104 may be trying to solve the puzzle based on a different pool of transactionsl54, but whoever gets there first will define the set of transactions that are included in the latest block 151. Eventually a blockchain node 104 will solve the puzzle for a part of the ordered pool 154 which includes Alice's transaction 152j). Once the proof-of-work has been done for the pool 154 including the new transaction 152j, it immutably becomes part of one of the blocks 151 in the blockchain 150. Each transaction 152 comprises a pointer back to an earlier transaction, so the order of the transactions is also immutably recorded. Different blockchain nodes 104 may receive different instances of a given transaction first and therefore have conflicting views of which instance is 'valid' before one instance is published in a new block 151, at which point all blockchain nodes 104 agree that the published instance is the only valid instance. If a blockchain node 104 accepts one instance as valid, and then discovers that a second instance has been recorded in the blockchain 150 then that blockchain node 104 must accept this and will discard (i.e. treat as invalid) the instance which it had initially accepted (i.e. the one that has not been published in a block 151).

An alternative type of transaction protocol operated by some blockchain networks may be referred to as an "account-based" protocol, as part of an account-based transaction model. In the account-based case, each transaction does not define the amount to be transferred by referring back to the UTXO of a preceding transaction in a sequence of past transactions, but rather by reference to an absolute account balance. The current state of all accounts is stored, by the nodes of that network, separate to the blockchain and is updated constantly. In such a system, transactions are ordered using a running transaction tally of the account (also called the "position"). This value is signed by the sender as part of their cryptographic signature and is hashed as part of the transaction reference calculation. In addition, an optional data field may also be signed the transaction. This data field may point back to a previous transaction, for example if the previous transaction ID is included in the data field.

2. UTXO-BASED MODEL

Figure 2 illustrates an example transaction protocol. This is an example of a UTXO-based protocol. A transaction 152 (abbreviated "Tx") is the fundamental data structure of the blockchain 150 (each block 151 comprising one or more transactions 152). The following will be described by reference to an output-based or "UTXO" based protocol. However, this is not limiting to all possible embodiments. Note that while the example UTXO-based protocol is described with reference to bitcoin, it may equally be implemented on other example blockchain networks. In a UTXO-based model, each transaction ("Tx") 152 comprises a data structure comprising one or more inputs 202, and one or more outputs 203. Each output 203 may comprise an unspent transaction output (UTXO), which can be used as the source for the input 202 of another new transaction (if the UTXO has not already been redeemed). The UTXO includes a value specifying an amount of a digital asset. This represents a set number of tokens on the distributed ledger. The UTXO may also contain the transaction ID of the transaction from which it came, amongst other information. The transaction data structure may also comprise a header 201, which may comprise an indicator of the size of the input field(s) 202 and output field(s) 203. The header 201 may also include an ID of the transaction. In embodiments the transaction ID is the hash of the transaction data (excluding the transaction ID itself) and stored in the header 201 of the raw transaction 152 submitted to the nodes 104.

Say Alice 103a wishes to create a transaction 152j transferring an amount of the digital asset in question to Bob 103b. In Figure 2 Alice's new transaction 152j is labelled “Tx" . It takes an amount of the digital asset that is locked to Alice in the output 203 of a preceding transaction 152i in the sequence, and transfers at least some of this to Bob. The preceding transaction 152i is labelled "Tcό' in Figure 2. 7¾and Txi are just arbitrary labels. They do not necessarily mean that 7¾?is the first transaction in the blockchain 151, nor that Txi is the immediate next transaction in the pool 154. Txi could point back to any preceding (i.e. antecedent) transaction that still has an unspent output 203 locked to Alice.

The preceding transaction Txo may already have been validated and included in a block 151 of the blockchain 150 at the time when Alice creates her new transaction Txi, or at least by the time she sends it to the network 106. It may already have been included in one of the blocks 151 at that time, or it may be still waiting in the ordered set 154 in which case it will soon be included in a new block 151. Alternatively Txo and Txi could be created and sent to the network 106 together, or Txo could even be sent after Txi if the node protocol allows for buffering "orphan" transactions. The terms "preceding" and "subsequent" as used herein in the context of the sequence of transactions refer to the order of the transactions in the sequence as defined by the transaction pointers specified in the transactions (which transaction points back to which other transaction, and so forth). They could equally be replaced with "predecessor" and "successor", or "antecedent" and "descendant", "parent" and "child", or such like. It does not necessarily imply an order in which they are created, sent to the network 106, or arrive at any given blockchain node 104. Nevertheless, a subsequent transaction (the descendent transaction or "child") which points to a preceding transaction (the antecedent transaction or "parent") will not be validated until and unless the parent transaction is validated. A child that arrives at a blockchain node 104 before its parent is considered an orphan. It may be discarded or buffered for a certain time to wait for the parent, depending on the node protocol and/or node behaviour.

One of the one or more outputs 203 of the preceding transaction Txo comprises a particular UTXO, labelled here UTXOo. Each UTXO comprises a value specifying an amount of the digital asset represented by the UTXO, and a locking script which defines a condition which must be met by an unlocking script in the input 202 of a subsequent transaction in order for the subsequent transaction to be validated, and therefore for the UTXO to be successfully redeemed. Typically the locking script locks the amount to a particular party (the beneficiary of the transaction in which it is included). I.e. the locking script defines an unlocking condition, typically comprising a condition that the unlocking script in the input of the subsequent transaction comprises the cryptographic signature of the party to whom the preceding transaction is locked.

The locking script (aka scriptPubKey) is a piece of code written in the domain specific language recognized by the node protocol. A particular example of such a language is called "Script" (capital S) which is used by the blockchain network. The locking script specifies what information is required to spend a transaction output 203, for example the requirement of Alice's signature. Unlocking scripts appear in the outputs of transactions. The unlocking script (aka scriptSig) is a piece of code written the domain specific language that provides the information required to satisfy the locking script criteria. For example, it may contain Bob's signature. Unlocking scripts appear in the input 202 of transactions.

So in the example illustrated, UTXOo ' m the output 203 of Zfocomprises a locking script [Checksig PA] which requires a signature Sig PA of Alice in order for UTXOo to be redeemed (strictly, in order for a subsequent transaction attempting to redeem UTXOo to be valid). [Checksig PA\ contains a representation (i.e. a hash) of the public key PA from a public- private key pair of Alice. The input 202 of Txi comprises a pointer pointing back to Txi (e.g. by means of its transaction ID, TxIDo, which in embodiments is the hash of the whole transaction Txo). The input 202 of Txi comprises an index identifying UTXOo within Txo, to identify it amongst any other possible outputs of Txo. The input 202 of Txi further comprises an unlocking script <Sig PA> which comprises a cryptographic signature of Alice, created by Alice applying her private key from the key pair to a predefined portion of data (sometimes called the "message" in cryptography). The data (or "message") that needs to be signed by Alice to provide a valid signature may be defined by the locking script, or by the node protocol, or by a combination of these.

When the new transaction Txi arrives at a blockchain node 104, the node applies the node protocol. This comprises running the locking script and unlocking script together to check whether the unlocking script meets the condition defined in the locking script (where this condition may comprise one or more criteria). In embodiments this involves concatenating the two scripts:

<Sig PA> <PA> I I [Checksig PA] where "| |" represents a concatenation and "<...>" means place the data on the stack, and "[...]" is a function comprised by the locking script (in this example a stack-based language). Equivalently the scripts may be run one after the other, with a common stack, rather than concatenating the scripts. Either way, when run together, the scripts use the public key PA of Alice, as included in the locking script in the output of Txo, to authenticate that the unlocking script in the input of Txi contains the signature of Alice signing the expected portion of data. The expected portion of data itself (the "message") also needs to be included in order to perform this authentication. In embodiments the signed data comprises the whole of Txi (so a separate element does not need to be included specifying the signed portion of data in the clear, as it is already inherently present).

The details of authentication by public-private cryptography will be familiar to a person skilled in the art. Basically, if Alice has signed a message using her private key, then given Alice’s public key and the message in the clear, another entity such as a node 104 is able to authenticate that the message must have been signed by Alice. Signing typically comprises hashing the message, signing the hash, and tagging this onto the message as a signature, thus enabling any holder of the public key to authenticate the signature. Note therefore that any reference herein to signing a particular piece of data or part of a transaction, or such like, can in embodiments mean signing a hash of that piece of data or part of the transaction. If the unlocking script in Tx1 meets the one or more conditions specified in the locking script of Tx0 (so in the example shown, if Alice’s signature is provided in Tx1 and authenticated), then the blockchain node 104 deems Tx1 valid. This means that the blockchain node 104 will add Tx1 to the ordered pool of pending transactions 154. The blockchain node 104 will also forward the transaction Tx1 to one or more other blockchain nodes 104 in the network 106, so that it will be propagated throughout the network 106. Once Tx1 has been validated and included in the blockchain 150, this defines UTXO0 from Tx0 as spent. Note that Tx1 can only be valid if it spends an unspent transaction output 203. If it attempts to spend an output that has already been spent by another transaction 152, then Tx1 will be invalid even if all the other conditions are met. Hence the blockchain node 104 also needs to check whether the referenced UTXO in the preceding transaction Tx0 is already spent (i.e. whether it has already formed a valid input to another valid transaction). This is one reason why it is important for the blockchain 150 to impose a defined order on the transactions 152. In practice a given blockchain node 104 may maintain a separate database marking which UTXOs 203 in which transactions 152 have been spent, but ultimately what defines whether a UTXO has been spent is whether it has already formed a valid input to another valid transaction in the blockchain 150. If the total amount specified in all the outputs 203 of a given transaction 152 is greater than the total amount pointed to by all its inputs 202, this is another basis for invalidity in most transaction models. Therefore such transactions will not be propagated nor included in a block 151. Note that in UTXO-based transaction models, a given UTXO needs to be spent as a whole. It cannot "leave behind" a fraction of the amount defined in the UTXO as spent while another fraction is spent. However the amount from the UTXO can be split between multiple outputs of the next transaction. E.g. the amount defined in UTXOo\ n 7¾?can be split between multiple UTXOs in Txi. Hence if Alice does not want to give Bob all of the amount defined in UTXOo, she can use the remainder to give herself change in a second output of Txi, or pay another party.

In practice Alice will also usually need to include a fee for the bitcoin node 104 that successfully includes her transaction 104 in a block 151. If Alice does not include such a fee, 7¾7iriay be rejected by the blockchain nodes 104, and hence although technically valid, may not be propagated and included in the blockchain 150 (the node protocol does not force blockchain nodes 104 to accept transactions 152 if they don't want). In some protocols, the transaction fee does not require its own separate output 203 (i.e. does not need a separate UTXO). Instead any difference between the total amount pointed to by the input(s) 202 and the total amount of specified in the output(s) 203 of a given transaction 152 is automatically given to the blockchain node 104 publishing the transaction. E.g. say a pointer to UTXOo is the only input to Txi, and Txi has only one output UTXOi. If the amount of the digital asset specified in UTXOo is greater than the amount specified in UTXOi, then the difference may be assigned by the node 104 that wins the proof-of-work race to create the block containing UTXOi. Alternatively or additionally however, it is not necessarily excluded that a transaction fee could be specified explicitly in its own one of the UTXOs 203 of the transaction 152.

Alice and Bob's digital assets consist of the UTXOs locked to them in any transactions 152 anywhere in the blockchain 150. Hence typically, the assets of a given party 103 are scattered throughout the UTXOs of various transactions 152 throughout the blockchain 150. There is no one number stored anywhere in the blockchain 150 that defines the total balance of a given party 103. It is the role of the wallet function in the client application 105 to collate together the values of all the various UTXOs which are locked to the respective party and have not yet been spent in another onward transaction. It can do this by querying the copy of the blockchain 150 as stored at any of the bitcoin nodes 104. Note that the script code is often represented schematically (i.e. not using the exact language). For example, one may use operation codes (opcodes) to represent a particular function. "OP_..." refers to a particular opcode of the Script language. As an example, OP_RETURN is an opcode of the Script language that when preceded by OP_FALSE at the beginning of a locking script creates an unspendable output of a transaction that can store data within the transaction, and thereby record the data immutably in the blockchain 150. E.g. the data could comprise a document which it is desired to store in the blockchain.

Typically an input of a transaction contains a digital signature corresponding to a public key PA. In embodiments this is based on the ECDSA using the elliptic curve secp256kl. A digital signature signs a particular piece of data. In some embodiments, for a given transaction the signature will sign part of the transaction input, and some or all of the transaction outputs. The particular parts of the outputs it signs depends on the SIGHASH flag. The SIGHASH flag is usually a 4-byte code included at the end of a signature to select which outputs are signed (and thus fixed at the time of signing).

The locking script is sometimes called "scriptPubKey" referring to the fact that it typically comprises the public key of the party to whom the respective transaction is locked. The unlocking script is sometimes called "scriptSig" referring to the fact that it typically supplies the corresponding signature. However, more generally it is not essential in all applications of a blockchain 150 that the condition for a UTXO to be redeemed comprises authenticating a signature. More generally the scripting language could be used to define any one or more conditions. Hence the more general terms "locking script" and "unlocking script" may be preferred.

3. SIDE CHANNEL

As shown in Figure 1, the client application on each of Alice and Bob's computer equipment 102a, 120b, respectively, may comprise additional communication functionality. This additional functionality enables Alice 103a to establish a separate side channel 107 with Bob 103b (at the instigation of either party or a third party). The side channel 107 enables exchange of data separately from the blockchain network. Such communication is sometimes referred to as "off-chain" communication. For instance this may be used to exchange a transaction 152 between Alice and Bob without the transaction (yet) being registered onto the blockchain network 106 or making its way onto the chain 150, until one of the parties chooses to broadcast it to the network 106. Sharing a transaction in this way is sometimes referred to as sharing a "transaction template". A transaction template may lack one or more inputs and/or outputs that are required in order 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.

The side channel 107 may be established via the same packet-switched network 101 as the blockchain network 106. Alternatively or additionally, the side channel 301 may be established via a different network such as a mobile cellular network, or a local area network such as a local wireless network, or even a direct wired or wireless link between Alice and Bob's devices 102a, 102b. Generally, the side channel 107 as referred to anywhere herein may comprise any one or more links via one or more networking technologies or communication media for exchanging data "off-chain", i.e. separately from the blockchain network 106. Where more than one link is used, then the bundle or collection of off-chain links as a whole may be referred to as the side channel 107. Note therefore that if it is said that Alice and Bob exchange certain pieces of information or data, or such like, over the side channel 107, then this does not necessarily imply all these pieces of data have to be send over exactly the same link or even the same type of network.

4. CLIENT SOFTWARE

Figure 3A illustrates an example implementation of the client application 105 for implementing embodiments of the presently disclosed scheme. The client application 105 comprises a transaction engine 401 and a user interface (Ul) layer 402. The transaction engine 401 is configured to implement the underlying transaction-related functionality of the client 105, such as to formulate transactions 152, receive and/or send transactions and/or other data over the side channel 301, and/or send transactions to one or more nodes 104 to be propagated through the blockchain network 106, in accordance with the schemes discussed above and as discussed in further detail shortly.

The Ul layer 402 is configured to render a user interface via a user input/output (I/O) means of the respective user's computer equipment 102, including outputting information to the respective user 103 via a user output means of the equipment 102, and receiving inputs back from the respective user 103 via a user input means of the equipment 102. For example the user output means could comprise one or more display screens (touch or non touch screen) for providing a visual output, one or more speakers for providing an audio output, and/or one or more haptic output devices for providing a tactile output, etc. The user input means could comprise for example the input array of one or more touch screens (the same or different as that/those used for the output means); one or more cursor-based devices such as mouse, trackpad or trackball; one or more microphones and speech or voice recognition algorithms for receiving a speech or vocal input; one or more gesture-based input devices for receiving the input in the form of manual or bodily gestures; or one or more mechanical buttons, switches or joysticks, etc.

Note: whilst the various functionality herein may be described as being integrated into the same client application 105, this is not necessarily limiting and instead they could be implemented in a suite of two or more distinct applications, e.g. one being a plug-in to the other or interfacing via an API (application programming interface). For instance, the functionality of the transaction engine 401 may be implemented in a separate application than the Ul layer 402, or the functionality of a given module such as the transaction engine 401 could be split between more than one application. Nor is it excluded that some or all of the described functionality could be implemented at, say, the operating system layer.

Where reference is made anywhere herein to a single or given application 105, or such like, it will be appreciated that this is just by way of example, and more generally the described functionality could be implemented in any form of software.

Figure 3B gives a mock-up of an example of the user interface (Ul) 500 which may be rendered by the Ul layer 402 of the client application 105a on Alice's equipment 102a. It will be appreciated that a similar Ul may be rendered by the client 105b on Bob's equipment 102b, or that of any other party.

By way of illustration Figure 3B shows the Ul 500 from Alice's perspective. The Ul 500 may comprise one or more Ul elements 501, 502, 502 rendered as distinct Ul elements via the user output means.

For example, the Ul elements may comprise one or more user-selectable elements 501 which may be, such as different on-screen buttons, or different options in a menu, or such like. The user input means is arranged to enable the user 103 (in this case Alice 103a) to select or otherwise operate one of the options, such as by clicking or touching the Ul element on-screen, or speaking a name of the desired option (N.B. the term "manual" as used herein is meant only to contrast against automatic, and does not necessarily limit to the use of the hand or hands).

Alternatively or additionally, the Ul elements may comprise one or more data entry fields 502. These data entry fields are rendered via the user output means, e.g. on-screen, and the data can be entered into the fields through the user input means, e.g. a keyboard or touchscreen. Alternatively the data could be received orally for example based on speech recognition.

Alternatively or additionally, the Ul elements may comprise one or more information elements 503 output to output information to the user. E.g. this/these could be rendered on screen or audibly.

It will be appreciated that the particular means of rendering the various Ul elements, selecting the options and entering data is not material. The functionality of these Ul elements will be discussed in more detail shortly. It will also be appreciated that the Ul 500 shown in Figure 3 is only a schematized mock-up and in practice it may comprise one or more further Ul elements, which for conciseness are not illustrated.

5. NODE SOFTWARE Figure 4 illustrates an example of the node software 450 that is run on each blockchain node 104 of the network 106, in the example of a UTXO- or output-based model. Note that another entity may run node software 450 without being classed as a node 104 on the network 106, i.e. without performing the actions required of a node 104. The node software 450 may contain, 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 functional modules 455. Each node 104 may run node software that contains, but is not limited to, all three of: a consensus module 455C (for example, proof-of-work), a propagation module 455P and a storage module 455S (for example, a database). The protocol engine 401 is typically configured to recognize the different fields of a transaction 152 and process them in accordance with the node protocol. When a transaction 152j (Tx j ) is received having an input pointing to an output (e.g. UTXO) of another, preceding transaction 152i (7’ m-1 ), then the protocol engine 451 identifies the unlocking script in Tx j and passes it to the script engine 452. The protocol engine 451 also identifies and retrieves Txi based on the pointer in the input of Tx j . Tx t may be published on the blockchain 150, in which case the protocol engine may retrieve Tx t from a copy of a block 151 of the blockchain 150 stored at the node 104. Alternatively, Tx may yet to have been published on the blockchain 150. In that case, the protocol engine 451 may retrieve Tx t from the ordered set 154 of unpublished transactions maintained by the nodel04. Either way, the script engine 451 identifies the locking script in the referenced output of Tx t and passes this to the script engine 452.

The script engine 452 thus has the locking script of G ; and the unlocking script from the corresponding input of Tx j . For example, transactions labelled Tx 0 and Tx 1 are illustrated in Figure 2, but the same could apply for any pair of transactions. The script engine 452 runs the two scripts together as discussed previously, which will include placing data onto and retrieving data from the stack 453 in accordance with the stack-based scripting language being used (e.g. Script). By running the scripts together, the script engine 452 determines whether or not the unlocking script meets the one or more criteria defined in the locking script - i.e. does it "unlock" the output in which the locking script is included? The script engine 452 returns a result of this determination to the protocol engine 451. If the script engine 452 determines that the unlocking script does meet the one or more criteria specified in the corresponding locking script, then it returns the result "true". Otherwise it returns the result "false".

In an output-based model, the result "true" from the script engine 452 is one of the conditions for validity of the transaction. Typically there are also one or more further, protocol-level conditions evaluated by the protocol engine 451 that must be met as well; such as that the total amount of digital asset specified in the output(s) of Tx j does not exceed the total amount pointed to by its inputs, and that the pointed-to output of Tx t has not already been spent by another valid transaction. The protocol engine 451 evaluates the result from the script engine 452 together with the one or more protocol-level conditions, and only if they are all true does it validate the transaction Tx j . The protocol engine 451 outputs an indication of whether the transaction is valid to the application-level decision engine 454. Only on condition that Tx j is indeed validated, the decision engine 454 may select to control both of the consensus module 455C and the propagation module 455P to perform their respective blockchain-related function in respect of Tx j . This comprises the consensus module 455C adding Tx j to the node's respective ordered set of transactions 154 for incorporating in a block 151, and the propagation module 455P forwarding Tx j to another blockchain node 104 in the network 106. Optionally, in embodiments the application-level decision engine 454 may apply one or more additional conditions before triggering either or both of these functions. E.g. the decision engine may only select to publish the transaction on condition that the transaction is both valid and leaves enough of a transaction fee.

Note also that the terms "true" and "false" herein do not necessarily limit to returning a result represented in the form of only a single binary digit (bit), though that is certainly one possible implementation. More generally, "true" can refer to any state indicative of a successful or affirmative outcome, and "false" can refer to any state indicative of an unsuccessful or non-affirmative outcome. For instance in an account-based model, a result of "true" could be indicated by a combination of an implicit, protocol-level validation of a signature and an additional affirmative output of a smart contract (the overall result being deemed to signal true if both individual outcomes are true).

6. P2P NETWORK CONNECTIONS

Figure 5 illustrates an example system that may be used to implement embodiments of the present invention. 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 instance, the P2P network comprises a first P2P node 501a, a second P2P node 501b, and so on. Whilst only five P2P nodes 501 are shown in Figure 5, it will be appreciated that in general the P2P network 500 may have any number of P2P nodes 501. Note that as used herein, "first", "second", etc., are used merely as arbitrary labels and do not necessarily imply an order, unless the context requires otherwise. The skilled person will be familiar with the concept of a P2P network - i.e. a distributed network where peers are equally privileged, equipotent participants in the network - and so the P2P network 500 per se will not be described in detail, other than to say that the P2P network 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 applications. For instance, the P2P network may be a content or file sharing network, or a communication (e.g. video calling) network, a cloud computing network, a remote desktop network, etc.

Each P2P node 501 operates respective computing equipment configured to perform the actions described below as being performed by the P2P nodes 501. In some embodiments, each P2P node 501 may be configured to perform some or all of the actions described as being performed by Alice 103a and/or Bob 103b with reference to Figures 1 to 3B. Each P2P node 501 has a respective public key, i.e. has access to the corresponding private key. As shown in Figure 5, several of the P2P nodes 501 have existing connections, which are shown by solid lines connecting the P2P nodes 501. For instance, a third P2P node 501c is shown connected to a fourth P2P node 501d and a fifth P2P node 501e. The second P2P node 501b is connected to the fourth P2P node 501d. Further connections are shown. Also shown in the diagram are connections that the first P2P node would like to form, which are shown by broken lines connecting the first P2P node 501a to other P2P nodes. For instance, the first P2P node 501a would like to connect to the second P2P node 501b and the third P2P node 501c, e.g. because these nodes are closest to the first P2P node 501a. Here, "closest" may be in geographical terms or otherwise.

In order 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 publicly accessible resource, e.g. a webpage or the blockchain, from a trusted authority, or from another one of the P2P nodes 501. As another example, the first P2P node 501a may obtain the second P2P node's public key by querying a Domain Name System (DNS) service, e.g. using the P2P network address.

The first P2P node 501a is configured to generate a blockchain transaction (which will be referred to as a first transaction). The first transaction comprises a first output locked to the second node's public key. E.g. the output may be a P2PKH output. The first output is used to alert the second P2P node 501b to the fact that a P2P is attempting to form a connection. For instance, the second P2P node 501b may operate a wallet application that monitors the blockchain for outputs that are locked to the second P2P node's public key. The skilled person will be familiar with other ways of identifying "payments" sent to a public key. The first transaction also comprises the P2P network address, which is used to identify the P2P network which the first P2P node 501a would like to connect to the second P2P node 501b on. The network address may be included as part of the first output of the first transaction, or a second output. The second output may be an unspendable output and/or an OP_RETURN output. The first transaction is signed with a signature that can be verified using the first P2P node's public key. This enables the second P2P node 501b to determine which P2P node 501 is attempting to form a connection. The first P2P node 501a submits the first transaction to the blockchain network 106, or alternatively to an intermediary who then submits the first transaction to the blockchain network 106.

The second P2P node 501b is configured to determine that the first blockchain transaction has been submitted to (or recorded on) 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 second P2P node's public key. 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 that the second P2P node 501b will communicate with on the P2P network 500. Here, communicating with the first P2P node 501a is taken to mean accepting incoming data from and sending outgoing data to the first P2P node 501b. Additionally or alternatively, connecting with the first P2P node 501 may involve actively communicating with the first P2P node 501a, i.e. sending data to the first P2P node 501a.

The first transaction is not only beneficial for the first and second P2P nodes 501a, 501b but also for the P2P network 500 as a whole. The first transaction allows other nodes 501 to determine that the first and second P2P nodes 501a, 501b are connected. In other words, upon seeing the first transaction recorded on the blockchain 150, other nodes of the P2P network 500 know that they can communicate with the first or second P2P node via the second or first P2P node, respectively. This improves the connectivity of the P2P network 500 as nodes 501 become aware of more connections and more routes to other nodes 501.

Figure 6 illustrates an example of a first transaction used to signal a connection between the first P2P node 501a and the 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, the 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 network, and may be certified by a certificate authority (or another form of authority trusted by the P2P network 500). The identifier may be mapped to the first P2P node's public key, allowing the second P2P node 501b to be sure that it is indeed the first P2P node 501a that has generated the first transaction. The mapping may be known in advance, or stored at a publicly accessible resource, e.g. a webpage or blockchain. The identifier is used to establish trust in the first P2P node's identity. It may be a certificate that includes the first P2P node's public key (and possibly information about its owner). Preferably, the certificate does not include the first P2P node's IP address as this may expose the first P2P node's computer to attacks, since the IP address will be public on the blockchain.

As mentioned above, the second P2P node's public key may be obtained from the 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. Note that the second P2P node's IP address may be obtained in alternative ways, e.g. it may be provided by a different node 501 that already has an established connection with the first and second P2P nodes 501a, 501b.

Prior to generating the first transaction, the first P2P node 501a may use the IP address of the second P2P node 501b to perform an internet handshake (e.g. a TCP three-way handshake) with the first P2P node 501b. This enables the first P2P node 501a to establish trust in the second P2P node's identity. The second P2P node 501b may send its IP address, signed with a signature corresponding to the second P2P node's public key, to the first P2P node 501a. The first P2P node 501a may then verify the signature using the second P2P node's public key. In these examples, if, and only if, the signature is verified, will the first P2P node 501a submit the first transaction to the blockchain network 106.

The first P2P node 501a may use the first transaction to signal to the second P2P node 501b its specialisms, e.g. capabilities, functions, attributes, etc. That is, the first P2P node 501a may be able to perform certain actions on the P2P network 500 that not all nodes can, or the first P2P node 501b may be able to perform some actions better than others, or better than other nodes can. Examples of specialisms include capabilities such as grid computing, mining, DNS node, trusted authority node, file sharing, etc. In some examples, a specialism may be an attribute such as good bandwidth, connectivity, internet connection, storage, etc. Here, "good" may be taken to mean better than the average of the network nodes 501. There may be one or more subsets of the P2P nodes 501, each subset having at least one specialism in common. The first transaction may include one or more flags, each of which indicate a respective specialism. This improves the efficiency of the P2P network 500 as the second P2P node 501b knows whether or not to send certain types of data or requests to the first P2P node 501a based on the first P2P node's specialisms.

Figure 7 illustrates an example of a first transaction that includes a specialism flag. The specialism flag(s) may be included in the first output or the second output.

Optionally, the first transaction may include, in addition to the first output that is locked to the second P2P node's public key, another spendable output that include at least two alternative locking conditions. This output is referred to as the third output, but it need not appear third in the list of outputs. As a first locking condition, the third output may be locked to a public key of the first P2P node 501a. As a second locking condition, the third output may be locked to a public key of the second P2P node 501b. The public keys may be the same as or different to the public keys discussed above. In other words, the first and/or second P2P nodes 501a, 501b may have more than one public key. In these examples, the third output being unspent is interpreted by the second P2P node 501b as the connection between the first and second P2P nodes 501a, 501b being available (i.e. not terminated). When the third output is spent, the connection is interpreted as the connection being terminated, e.g. because the first node 501a has gone offline. Upon seeing that the third output has been spent, the second P2P node 501b may disconnect from the first P2P node 501a.

The first P2P node 501a may generate a second transaction that spends the third output, e.g. in the case that 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 first P2P node's public key to which the third output is locked. Figure 9 illustrates an example of a second transaction.

Alternatively, the second P2P node 501b may generate a second transaction that spends the third output, e.g. in the case that the second P2P node 501b can no longer maintain the connection with the first P2P node 501a, or the first P2P node 501a has acted maliciously or against the policy of the P2P network, or has been hacked, etc. The first P2P node 501a is offline at least from the perspective of the second P2P node 501b, but in some example may maintain an active connection with other nodes, e.g. the third P2P node 501c. Spending of the third output of the second transaction signals 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 since the first P2P node 501a has not followed 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 first P2P node's public key to which the third output is locked.

In some examples, as shown in Figure 8, the second locking condition of the third output (which appears second in the list of outputs in Figure 8) may include a hash value and in order for the third output to be unlocked, the input that spends the third output must include the preimage of the hash value. The preimage may be a challenge which the second P2P node 501b must obtain in order 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 that includes the challenge data is shown in Figure 10.

Figure 11 illustrates an example of a transaction that can be used to update the first P2P node's specialisms, or rather inform the second P2P node of the updated specialisms.

Whilst the above description has focused on the interaction between the first and second P2P nodes 501a, 501b, the first P2P node 501a may perform equivalent actions for 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 that comprises an output locked to that public key. The transaction also includes the P2P network address.

The first P2P node 501a is also configured to determine (i.e. identify) connections between other P2P nodes, e.g. the fourth and fifth P2P nodes 501d, 501e based on transactions recorded on 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 connections to route data, etc. to a particular P2P node 501. For instance, taking the example of Figure 5, having connected to the second P2P node 501b, data may be routed to the fifth P2P node 501e via the second and fourth P2P nodes 501b, 501d.

In some examples, the P2P nodes 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, which requires a second type of private key (e.g. ECDSA). The P2P nodes 501 may convert from a respective private key of the first type to a respective private key of the second type by hashing (with one or more hash functions, which may or may not be the same, e.g. double SHA256) the respective private key of the first type.

7. P2P OVERLAY MODEL

A specific example of the described embodiments will now be provided. This section discloses an incentive mechanism for P2P network topology attestation. To add incentive for the P2P network, nodes may attest data on the blockchain through associated transaction payments on the blockchain network. These payments are received by nodes involved in the communication process. Throughout this section we will detail how the nodes can attest to joining, update their specifications on the P2P network and keep a proof of their adjacent nodes on the blockchain. This solution adds economic incentives for all types of data transfers between the nodes. Furthermore, it is flexible, in the sense that P2P network nodes can keep their original P2P protocol communications to which they add another communication layer that transfers the rewards. We will label the nodes of the P2P network by N t where i is a positive integer or an index set - depending on the context.

7.1 Network setup

In this section we show how a node can safely join a P2P network, offering enough incentives to be accepted. Moreover, each time the node wants to connect to any other node from the P2P network, it should follow the same procedure we describe below. This ensures the blockchain will store the full network topology of the P2P network.

The joining process is as follows: assume a new node N x wants to join the network with address NETADDR. To find available peers can connect to on the network, it can query the DNS service by sending a GET-like request to a link of the form: protocol ://mesh.networks/chosen_network

The retrieved data is JSON formatted, containing a list of nodes' internet address and elliptic curve public key (for example encoded in Bitcoin format). An entry example is:

{ address: "192.168.0.1" pkey:

"0x02f54ba86dclccb5bed0224d23f01ed87e4a443c47fc690d7797al 3d41d2340ela"

}

Based on the received list of available peers, iV j picks a peer N 2 to connect to using the internet address as seen in the entry example above. At this moment, the two nodes N 1 and N 2 follow the protocol described below:

1. obtains the internet address of N 2 from the JSON entry. 2. ^^ ^ starts an internet handshake with ^^ . Such a handshake is network- dependent. For example the two nodes can opt for a TCP three-way handshake as described in RFC 793. 3. ^^ sends its internet address signed with the JSON entry public key. 4. ^^ ^ validates the identity of ^^ by using the public key from the JSON entry and checking the signature against the internet address of ^^ . 5. ^^ ^ creates a transaction on the blockchain, with two outputs as seen in Figure 6. The first output, a P2PKH locking script redeemable by ^^ . The second output, a locking script including the unique identifier ^^ ^^ ேభ , together with the network address ^^ ^^ ^^ ^^ ^^ ^^ ^^ it is joining. The ^^ ^^ ேభ identifier is issued by a Certificate Authority and its purpose is to identify in a trusted manner the identity of the network node ^^ ^ . 6. Once ^ sees the transaction ^^ ^^ ^^ ^^ confirmed on the blockchain, it adds ^^ ^ to its list of adjacent peers Steps 3 and 4 prevent other nodes from cheating by executing a spoofing attack and using the internet address of ^^ . ^^ ^ is communicating with the node that uses the internet address of ^^ by step 2. It can be sure the node is ^^ , because ^^ 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 a public key infrastructure. One issue that we need to take care of is whether ^^ is a dishonest node and does not add ^^ ^ to its list of adjacent nodes. We show how ^^ ^ can safely join the network and be sure it isn’t being defrauded by ^^ . Each node has an assigned identity certificate ^^ ^^ which reflects their identity issued by a trusted authority. Node ^^ ^ can contact the authority that issued the certificate, proving it has been defrauded. At this moment the trusted authority can issue a flag, which will make the other P2P nodes collaborating with the node ^^ aware that this is not a trusted node. 7.2 Network fairness architecture In addition to offering node ^^ ^ the possibility to cross-check with the trusted authority and report node ^^ in case it is being defrauded, we can implement a consensus that can further protect the P2P network from bad actors. This consensus is reliant on the majority of nodes acting honestly and being constantly incentivised.

Let's assume node N 2 is connected to nodes JV 2 1 , ... , iV 2 n . It is in the interest of each of adjacent nodes of N 2 to keep it honest. We detail two such scenarios in which it is in the interest of nodes N 2 1 , ... , N 2 n . to keep N 2 honest:

• If N 2 is dishonest and not adding new nodes to its connections, then the nodes propagating requests to N 2 might be losing rewards from sending requests to a dishonest node.

• If N 2 is not updating the network correctly when node N ± goes offline, then nodes N 2 1 , ..., JV 2 n can see on the blockchain that N 2 is propagating requests to node This means they are paying N 2 for an extra node.

In each of the two above scenarios, the adjacent nodes can either penalise N 2 by offering lower rewards in the next request propagation, or they can take N 2 completely offline from the network.

We remark that this consensus is offloading the process of N t checking whether N 2 is honest and moreover, it provides an incentive for the existing nodes in the network to ensure that their adjacent nodes are behaving honestly. We also highlight that if the burden would have been on node /n c to do further checks on the nodes connected to N 2 , node N 2 could have created fake identities and hence trick node N lt enabling a Sybil attack.

7.3 Identity linkage

In the case of P2P networks that use RSA keys, one way to establish their identity is to link their RSA private key k RSA to the ECDSA private key k ECDSA that will be used on the Bitcoin network to sign transactions. This can be done through the following equation: where H j _ and H 0 are two hash functions, not necessarily different. Then the ECDSA public key is defined as: If node holds several RSA private keys that are used within the network, then the index of the keys can be included in the generation of the ECDSA private key as such:

To prove the link between their RSA key and ECDSA key, the P2P node can sign their ECDSA public key with their RSA private key using the RSA digital signature cryptosystem.

7.4 Node specialisation

One area of optimisation for the network is adding node specialisation, where each node may specialise to perform a specific function. There are several such specialisations we can think about such as: grid computing, mining, DNS node, trusted authority node, file sharing etc. Certainly a node can join a P2P network and accept any kind of request, which would be classified as a general purpose node. If specialisation exists, it can lead to a network structure which modularises the P2P network as shown further below.

Figure 7 shows how such specialisations can be done in the network setup phase with a simple modification of the transaction TxlD net-add in step 5 of the network setup.

The specialisation flag may be expressed in a standard format, e.g.:

A node using the SPEC entry above tells the network that its specialisation is that of a data sharing node and can be part of the DNS service-providing nodes. Such a standardisation may be issued, for example, by the existing DNS service which helped the node N t initially find the desired network.

7.5 Network update

In the previous section we described a procedure through which a node JV j can join the network and offer incentives, ensuring a degree of fairness. We now show how to preserve network integrity, where the blockchain transactions should reflect changes of the network structure such as nodes going offline or changing their specialisation, whilst guaranteeing economic incentives.

This section builds an update procedure through which nodes can update the network structure in order to preserve its integrity. One way to achieve this process is to modify the network setup protocol described in the previous section such that the second transaction output of TxID net-add is spendable. If the output is being spent, then we interpret this as a node disconnecting from the P2P network. For brevity, we will say in this case that the node goes offline.

Thus, the focus lies on understanding how the second output of TxID net-add can be spent. This is important since we do not want to provide the wrong incentives to the network and risk its integrity.

In order to do so, we need the data that produced the certification CA N . We will call this data a challenge C (e.g. a random integer). C is known only to node N l and the issuing trusted authority. In the figures below we fix the hash function H to correspond to the function computed by the opcode OP_SHA256.

We modify 7x/D ne£-aiid given in Figure 6, and used in step 5 of the network setup procedure detailed above. Nodes may adopt the transaction format shown in Figure 8 in the setup protocol to enable the functionalities presented in this section.

The locking script given in the second output enables N j _ to signal to the P2P network that it is going offline. To do so, N ± performs the following steps:

1. N t creates a transaction as given in Figure 9, providing its signature and spending the second output of TxID' net-add given in Figure 8.

2. N 1 can safely disconnect from the P2P network.

If /Vi is dishonest and doesn't perform the protocol above to go offline, then N 2 follows the protocol below:

1. N 2 acquires the challenge C from the trusted authority. 2. N 2 broadcasts the transaction in Figure 10, providing its signature and spending the second output of TxID' net-add given in Figure 8.

The scenarios that can occur when updating the network are as follows, emphasizing the incentives and security of this scheme:

• N x is an honest node and when going offline spends the second output of the transaction through its signature, recovering the money. This is the primary scenario, since N x also has the economic incentive to recover its money.

• is a dishonest node and does not spend the second output of TxID' net-add to signal to the network that it is going offline. In this case, node JV 2 can contact the trusted party proving that did not follow the update consensus. Once the Certificate Authority that issued CA NI is online, N 2 can obtain the challenge C with which it unlocks the second output of Txl D' net-add and consequently signalling to the network that went offline.

IfiVi repeats the behaviour of not updating the network when going offline, then N 2 can flag N ± as being untrustworthy and refusing further joining requests from node L^. Moreover, we could also have the Certificate Authority flag node N 1 as untrustworthy and invalidating the issued identity. For example, flagging can be done through a transaction. Finally, we show how N ± can change its specialisation SPEC. To do so, N t need only create a new transaction as given in Figure 11, spending the second output of TxID' net-add .

In conclusion, the update procedure we proposed ensures network integrity by keeping its structure up-to-date and offering the required economic incentives.

An example P2P overlay model according to the described embodiments is shown in Figure 12. The P2P network can implement several services through node specialisation, as described above. This leads to network modularisation, whereby nodes assume certain roles in order to make the P2P network communication more efficient. In order to implement the following services each node N 1 joining the P2P network needs to define their SPEC flag. Figure 12 offers a visual representation of the P2P modularisation, with the nodes offering the following services:

• DNS service: SPEC := { "role": "dns" }

• Certificate Authority service: SPEC ■= { "role": "CA" }

• Multiparty computation (MPC) service: SPEC ■= { "role": "MPC" }

Since the P2P network holds the attestation of its structure on the blockchain, the DNS service can offer a service that can make the network searchable (also called a crawler service). By monitoring the network structure, the crawler can hold a graph of the current network which can facilitate search applications.

8. INCENTIVIZING CONNECTIONS

As described above, in order to connect to a node of the P2P network, the first node 501a generates a transaction having an output locked to the public key of the P2P node to which the connected is to be made. That is, the first node 501a generates a first transaction having a first output locked to the public key associated with a second node 501b. In some embodiments, the first node 501a may determine an amount of digital asset to be locked by the first output so as to incentivise the second node 501b to form the connection. The amount of digital asset may be determined based on previous connection requests. The previous connection requests may be requests from the first node 501a to other nodes of the P2P network. Additionally or alternatively, the previous connection requests may be requests from a different node 501 (i.e. a node other than the first node 501a) to other nodes of the P2P network, e.g. the second node 501b.

The first node 501a may gather a plurality of previous request transactions recorded on the blockchain 150. The transactions are "requests" in the sense that one node is requesting another node to add a connection between said nodes. The first node 501a may obtain one or more of the transactions directly from the blockchain 150, e.g. by querying a blockchain node 104. The first node 501a may additionally or alternatively obtain one or more of the transactions from a different entity, such as a dedicated service provider.

Each request transaction was submitted to the blockchain by a respective P2P node 501 and has an output locked to a respective public key of a respective P2P node 501. Each output locks an amount of the underlying digital asset of the blockchain, e.g. bitcoin. Each request transaction comprises the network address of the P2P network. Each previous request transaction is associated with a respective timestamp. The timestamp may take any suitable form. The timestamp indicates the time that the transaction was submitted to the blockchain network 106, or recorded on the blockchain. For example, the timestamp may be Unixtime.

Having obtained the plurality of previous request transactions, the first node 501a computes a regression model based on the respective digital asset amounts locked by the respective outputs, and the respective timestamps. That is, from each transaction is extracted a data pair comprising a respective amount and a respective timestamp, and those data pairs are used to compute a regression model. The model may be a linear regression model. An example model is shown in Figure 13. The first node 501a then uses the regression model to determine a target amount to be locked by the first output of the first transaction, for a given timestamp, e.g. a timestamp corresponding to the time at which the first node 501a will submit the first transaction to the blockchain network 106.

Figure 14 illustrates an example of a previous transaction locking an amount p t .. Figure 15 illustrates an example first transaction with the target amount locked to the public key of the second node 501. As can be seen, the first transaction shown in Figure 15 is similar to that shown in Figure 6, with the exception that the target amount p t ' locked by the first output is determined according to a regression model, whereas the amount x locked by the first output may be determined arbitrarily.

8.1 Network setup pricing This section describes a specific implementation of the described embodiments for incentivising connections. Consider the P2P network setup described with reference to Figure 5. For node to join the network, the node estimates the value to send to node N 2 by following the steps below:

1. Node N 1 searches blockchain transactions for the prices that nodes iV; have paid for network setup. Such transactions are identifiable by the transaction structure in Tx^t-a dd -Ni (Figure 14).

2. Node N 1 builds a set of prices p t . that nodes iV; have paid. Each price p t . is time- dependent where t t is the timestamp of the block in which the network setup transaction Tx net-add -Ni of node Ni was mined.

3. Given the set of prices, node builds a linear regression model as shown in Section 2.1 (with y t set to be p t ).

4. N 1 computes the best price p tr at the current time t' as:

P t ' = b - t’ + a.

5. Node N 1 uses the price p t> to create and broadcast transaction T x net-add -N± in Figure 15.

Note that instead of node N ± searching through transactions, a service may be offered in the future that can process this information on behalf of the nodes.

9. CONCLUSION

Other variants or use cases of the disclosed techniques may become apparent to the person skilled in the art once given the disclosure herein. The scope of the disclosure is not limited by the described embodiments but only by the accompanying claims.

For instance, some embodiments above have been described in terms of a bitcoin network 106, bitcoin blockchain 150 and bitcoin nodes 104. However it will be appreciated that the bitcoin blockchain is one particular example of a blockchain 150 and the above description may apply generally to any blockchain. That is, the present invention is in by no way limited to the bitcoin blockchain. More generally, any reference above to bitcoin network 106, bitcoin blockchain 150 and bitcoin nodes 104 may be replaced with reference to a blockchain network 106, blockchain 150 and blockchain node 104 respectively. The blockchain, blockchain network and/or blockchain nodes may share some or all of the described properties of the bitcoin blockchain 150, bitcoin network 106 and bitcoin nodes 104 as described above.

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

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

Even more generally, any reference to the term "bitcoin node" 104 above may be replaced with the term "network entity" or "network element", wherein such an entity/element is configured to perform some or all of the roles of creating, publishing, propagating and storing blocks. The functions of such a network entity/element may be implemented in hardware in the same way described above with reference to a blockchain node 104.

It will be appreciated that the above embodiments have been described by way of example only. More generally there may be provided a method, apparatus or program in accordance with any one or more of the following Statements.

Statement 1. A computer-implemented method of using a blockchain to form connections between peer-to-peer, P2P, nodes of a P2P network, wherein the P2P network is associated with a network address and comprises a plurality of P2P nodes, wherein each of the plurality of P2P nodes is associated with a respective public key, and wherein the method is performed by a first one of the P2P nodes and comprises: obtaining a respective public key associated with a second one of the P2P nodes; generating a first blockchain transaction, wherein the first blockchain transaction comprises i) a first input signed with a signature corresponding to the respective public key of the first P2P node, ii) a first output locked to the respective public key of the second P2P node, and wherein the first blockchain transaction comprises the network address of the P2P network; and causing the first blockchain transaction to be submitted to one or more blockchain nodes of a blockchain network to be recorded on the blockchain, wherein the second P2P node is configured to connect with the first P2P node on the P2P network in response to the first blockchain transaction being recorded on the blockchain.

Statement 2. The method of statement 1, wherein each of the plurality of P2P nodes is associated with a respective identifier, and wherein the first blockchain transaction comprises the respective identifier of the first P2P node.

Statement 3. The method of statement 2, wherein the respective identifier associated with each respective P2P node is certified by a certification authority.

Statement 4. The method of any preceding statement, wherein said obtaining of the respective public key associated with the second P2P node comprises querying a resource comprising the respective public key of each respective P2P node.

The resource may be a database, which may be publicly accessible.

Statement 5. The method of statement 4, wherein the resource comprises a Domain Name System, DNS, service.

Statement 6. The method of statement 4 or statement 5, wherein the resource comprises, for each respective P2P node, a respective Internet Protocol, IP, address associated with the respective P2P node, and wherein said obtaining of the respective public key associated with the second P2P node comprises obtaining the respective IP address associated with the second P2P node.

Statement 7. The method of statement 6, wherein the method comprises: initiating an internet handshake with the second P2P node using the respective IP address of the second P2P node; obtaining, from the second P2P node, the respective IP address of the second P2P node signed with a digital signature; verifying the digital signature using the respective public key of the second P2P node, wherein said generating of the first blockchain transaction is conditional on the digital signature being verified.

Statement 8. The method of any preceding statement, wherein the first P2P node has a respective RSA key, and wherein a respective private key of the first P2P node used to generate the signature corresponding to the respective public key of the first P2P node is generated by hashing at least the respective RSA key of the first P2P node with one or more hash functions.

The hash functions may be different or the same.

Statement 9. The method of statement 8, wherein the respective private key of the first P2P node is generated by hashing at least the respective RSA key of the first P2P node with at least two hash functions.

Statement 10. The method of any preceding statement, wherein the first blockchain transaction comprises one or more respective specialisation flags indicating respective specialisations associated with the first P2P node.

The specialisations may be e.g. capabilities, functions, attributes associated with the first P2P node. Statement 11. The method of any preceding statement, wherein the first blockchain comprises iii) a second output, and wherein the second output comprises the network address of the P2P network and the respective identifier of the first P2P node.

Statement 12. The method of statement 10 and statement 11, wherein the second output of the first blockchain transaction comprises the one or more respective specialisation flags.

Statement 13. The method of any of statements 1 to 10, wherein the first output of the first blockchain transaction comprises the network address of the P2P network and the respective identifier of the first P2P node.

Statement 14. The method of statement 10 and statement 13, wherein the first output of the first blockchain transaction comprises the one or more respective specialisation flags.

Statement 15. The method of any preceding statement, wherein the first blockchain comprises iv) a third output, wherein when executed alongside an input of a blockchain transaction, the third output is configured to require the input of the blockchain transaction to comprise either a) a signature corresponding to a respective public key associated with the first P2P node, or b) a respective signature corresponding to a respective public key associated with the second P2P node, and wherein the second P2P node is configured to disconnect with the first P2P node in response to the third output of the first blockchain transaction being successfully spent.

Statement 16. The method of statement 15, wherein the third output comprises a hash of challenge data, and wherein the third output is configured to require the input of the blockchain transaction to comprise either a) the signature corresponding to a respective public key associated with the first P2P node, or b) the respective signature corresponding to a respective public key associated with the second P2P node, and the challenge data.

Statement 17. The method of statement 15 or statement 16, comprising: generating a second blockchain transaction, wherein the second blockchain transaction comprises an input that references the third output of the first blockchain transaction and comprises the signature corresponding to the respective public key associated with the first P2P node; and causing the second blockchain transaction to be submitted to one or more blockchain nodes of a blockchain network to be recorded on the blockchain, wherein the second blockchain transaction is for signalling to the second P2P node to disconnect with the first P2P node.

Statement 18. The method of any preceding statement, comprising: obtaining one or more respective public keys each associated with a different respective one of the P2P nodes; for each of the one or more respective public keys, generating a respective blockchain transaction, wherein the respective blockchain transaction comprises i) a first input signed with a signature corresponding to the respective public key of the first P2P node, and ii) a first output locked to the respective public key of the different respective P2P node, and wherein the respective blockchain transaction comprises the network address of the P2P network; and causing each of the respective blockchain transactions to be submitted to one or more blockchain nodes of the blockchain network to be recorded on the blockchain, wherein each different respective P2P node is configured to connect with the first P2P node in response to the respective blockchain transaction being recorded on the blockchain.

Statement 19. The method of any preceding statement, wherein the blockchain comprises a third blockchain transaction comprising i) an input signed with a signature corresponding to the respective public key of a third P2P node, and ii) a first output locked to the respective public key of a fourth P2P node, and wherein the third blockchain transaction comprises the network address of the P2P network, and wherein the method comprises: determining that the third P2P node is connected to the fourth P2P node based on the third blockchain transaction.

Statement 20. The method of any preceding statement, comprising: obtaining a plurality of respective request transactions, each respective request transaction comprising a respective first output locked to the respective public key of a respective P2P node, wherein the respective first output locks a respective amount of a digital asset, wherein each respective request transaction comprises the network address of the P2P network, and wherein each respective request transaction is associated with a respective timestamp; computing a regression model based on the respective amount and respective timestamp of each respective request transaction; using the regression model to determine a target amount given a target timestamp, wherein the first output of the first transaction locks the target amount of the digital asset.

Statement 21. The method of statement 20, wherein said obtaining comprises obtaining at least some of the plurality of respective request transactions from the blockchain.

Statement 22. The method of statement 20 or statement 21, wherein said obtaining comprises receiving at least some of the plurality of respective request transactions from a service provider.

Statement 23. The method of any of statements 20 to 22, wherein the regression model is a linear regression model.

Statement 24. A computer-implemented method of using a blockchain to form connections between peer-to-peer, P2P, nodes of a P2P network, wherein the P2P network is associated with a network address and comprises a plurality of P2P nodes, wherein each of the plurality of P2P nodes is associated with a respective public key, wherein the blockchain comprises a first blockchain transaction, wherein the first blockchain transaction comprises i) a first input signed with a signature corresponding to the respective public key of a first P2P node, ii) a first output locked to the respective public key of a second P2P node, and wherein the first blockchain transaction comprises the network address of the P2P network, and wherein the method is performed by a second one of the P2P nodes and comprises: determining that the blockchain comprises the first blockchain transaction; and in response to said determining, connecting with the first P2P node on the P2P network.

Statement 25. The method of statement 24, wherein said connecting with the first P2P node on the P2P network comprises adding the first P2P node to a list of P2P nodes that the second P2P can communicate with on the P2P network.

Statement 26. The method of statement 24 or statement 25, comprising: receiving an internet handshake from the first P2P node; and sending, to the first P2P node, a respective IP address of the second P2P node signed with a digital signature corresponding to the respective public key of the second P2P node.

Statement 27. The method of statement 26, wherein the second P2P node has a respective RSA key, and wherein a respective private key of the second P2P node used to generate the signature corresponding to the respective public key of the second P2P node is generated by hashing at least the respective RSA key of the second P2P node with one or more hash functions.

Statement 28. The method of statement 24 or any statement dependent thereon, wherein the first blockchain transaction comprises one or more respective specialisation flags indicating respective specialisations associated with the first P2P node, and wherein the method comprises: communicating with first P2P node based on the respective specialisations associated with the first P2P node as indicated by the one or more respective specialisation flags.

Statement 29. The method of statement 24 or any statement dependent thereon, wherein the first blockchain comprises a third output, wherein when executed alongside an input of a blockchain transaction, the third output is configured to require the input of the blockchain transaction to comprise either a) a signature corresponding to a respective public key associated with the first P2P node, or b) a respective signature corresponding to a respective public key associated with the second P2P node, and wherein the method comprises: determining that the third output has been successfully spent; and in response to said determining, disconnecting with the first P2P node on the P2P network.

Statement 30. The method of statement 29, wherein said determining that the third output has been successfully spent comprises: generating a second blockchain transaction, wherein the second blockchain transaction comprises an input that references the third output of the first blockchain transaction and comprises the signature corresponding to the respective public key associated with the second P2P node; and causing the second blockchain transaction to be submitted to one or more blockchain nodes of a blockchain network to be recorded on the blockchain.

Statement 31. The method of statement 30, wherein the third output comprises a hash of challenge data, and wherein the third output is configured to require the input of the blockchain transaction to comprise either a) the signature corresponding to a respective public key associated with the first P2P node, or b) the respective signature corresponding to a respective public key associated with the second P2P node, and the challenge data, and wherein the method comprises: obtaining the challenge data, wherein the input of the second blockchain transaction comprises the challenge data.

Statement 32. The method of statement 31, wherein the challenge data is obtained from a certificate authority.

Statement 33. The method of statement 30 or any statement dependent thereon, wherein said generating of the second blockchain transaction is in response to determining that the first P2P node has gone offline on the P2P network and/or has acted dishonestly.

Statement 34. Computer equipment comprising: memory comprising one or more memory units; and processing apparatus comprising one or more processing units, wherein the memory stores code arranged to run on the processing apparatus, the code being configured so as when on the processing apparatus to perform the method of any of statements 1 to 33.

Statement 35. A computer program embodied on computer-readable storage and configured so as, when run on one or more processors, to perform the method of any of statements 1 to 33. According to another aspect disclosed herein, there may be provided a method comprising the actions of the first P2P node and the second P2P node.

According to another aspect disclosed herein, there may be provided a system comprising the computer equipment of the first P2P node and the second P2P node.