Method and system for efficient transfer of entities in a peer-to-peer distributed ledger using a blockchain

The method and system facilitate secure, peer-to-peer asset transfers on blockchain by tokenization and metadata embedding, addressing limitations of existing technologies and enhancing transaction efficiency and security without third-party reliance.

JP2026004446APending Publication Date: 2026-01-14NCHAIN LICENSING AG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2025165611
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2016-03-16
Filing Date
2025-10-01
Publication Date
2026-01-14

AI Technical Summary

Technical Problem

Existing blockchain technologies are limited in their versatility and require trusted third parties for secure transactions, lacking efficiency and flexibility in handling diverse asset transfers beyond cryptocurrencies.

Method used

A method and system for secure asset transfer using blockchain that employs tokenization and cryptographic keys, embedding metadata in scripts, allowing peer-to-peer transactions without modifying the underlying protocol, ensuring data integrity and anonymity.

Benefits of technology

Enables efficient, secure, and anonymous transactions of various assets, eliminating the need for trusted intermediaries and optimizing memory usage, while maintaining transaction integrity through hash-based verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026004446000001_ABST
    Figure 2026004446000001_ABST
Patent Text Reader

Abstract

To provide a secure method for exchanging entities via a blockchain.SOLUTION: The method includes generating a first exchange transaction and broadcasting, in a first network, the first exchange transaction for inclusion in a P2P distributed ledger. Here, the first exchange transaction includes an indication of a first quantity of cryptocurrency to be transferred, a first input provided from an output of a first invitation transaction from a first user, wherein the first invitation transaction was previously included in the P2P distributed ledger, a first script, a first user private key associated with the first user, a first third party private key associated with a first third party, and a first output indicating a transfer of the first entity from the first user to a second user.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to distributed, peer-to-peer ledgers, and in particular to blockchain technology. The present invention also relates, in part, to tokenization and security technologies and secure mechanisms for transferring entities and / or ownership of entities via blockchains. The present invention may include methods for conducting secure transactions between different parties across blockchains. [Background technology]

[0002] A blockchain is a computer-based, decentralized, distributed system implemented as a peer-to-peer electronic ledger composed of blocks, which in turn comprise transactions. Each transaction is a data structure that encodes the transfer of control of digital assets between participants in the blockchain system and contains at least one input and at least one output. Each block contains a hash of the previous block, and blocks are chained together to create a permanent, immutable record of all transactions written to the blockchain since its inception. Transactions contain small programs known as scripts embedded within their inputs and outputs that specify how and by whom the transaction's outputs can be accessed. In the Bitcoin platform, these scripts are written using a stack-based scripting language.

[0003] For a transaction (Tx) to be written to the blockchain, it must be "validated." Network nodes (miners) perform work to ensure each transaction is valid; invalid transactions are rejected by the network. A software client installed on the node performs this validation work on unspent transactions (UTXOs) by executing locking and unlocking scripts. If the execution of the locking and unlocking scripts evaluates to TRUE, the transaction is valid and is written to the blockchain. Thus, for a transaction to be written to the blockchain, it must i) be validated by the first node that receives the transaction; if the transaction is validated, the node relays the transaction to other nodes in the network; ii) be added to a new block constructed by miners; and iii) be mined, i.e., added to the public ledger of past transactions.

[0004] While blockchain technology is most widely known for its use in implementing cryptocurrencies, digital entrepreneurs are beginning to explore the use of both the cryptographic security system on which Bitcoin is based and the data that can be stored on the blockchain to implement new systems. It would be highly advantageous if blockchain could be used for automated tasks and processes that are not limited to the cryptocurrency realm. Such solutions would be able to take advantage of the benefits of blockchain (e.g., permanent, tamper-proof recording of events, decentralized processing, etc.), while being more versatile in their applications.

[0005] One area of ​​current research is the use of blockchain for the implementation of "smart contracts." These are computer programs designed to automate the execution of machine-readable agreements or conditions of agreements. Unlike traditional contracts, which may be written in natural language, smart contracts are machine-executable programs containing rules that can process inputs to produce results, which can then cause actions to be taken depending on the results.

[0006] Another area of ​​interest related to blockchain is the use of "tokens" (or "colored coins") to represent and transfer real-world entities via the blockchain. Potentially sensitive or secret items can be represented by tokens that have no discernable meaning or value. The tokens thus act as identifiers, allowing the real-world items to be referenced from the blockchain. Tokenization techniques can be used for many different types of contexts where security, anonymity, and cross-platform compliance are important. One such area of ​​application is financial applications, although the invention is not limited to use with financial transactions.

[0007] In this document, we use the term "blockchain" to include all forms of electronic, computer-based, distributed ledgers. These include, but are not limited to, consensus-based blockchain and transaction chain technologies, permissioned and unpermissioned ledgers, shared ledgers, and variations thereof. The most widely known application of Bitcoin technology is the Bitcoin ledger, but other blockchain implementations have been offered and developed. While reference may be made to Bitcoin for convenience and illustrative purposes herein, it should be noted that the present invention is not limited to use with the Bitcoin blockchain, and alternative blockchain implementations and protocols are within the scope of the present invention. Summary of the Invention

[0008] The invention is defined in the appended claims.

[0009] The present invention may provide a solution for secure control and / or transfer or exchange of assets via blockchain. Herein, the term "entity" may be used interchangeably with "asset." Additionally or alternatively, the present invention may enable control and / or transfer of asset ownership. This may be a digital or virtual asset, such as a smart contract, or a real-world / physical asset. An asset may be a right or usage right, such as a license, or some kind of right related to a type of property. The present invention may use tokenization technology to facilitate this control or transfer. The present invention may incorporate the use of cryptographic keys to enable transfers / exchanges to be performed in a secure manner, while not requiring any modifications to the underlying blockchain protocol. The present invention may use technology for embedding metadata into scripts associated with blockchain transactions (Tx).

[0010] The present invention provides, among other things, enhanced optimization of memory usage for electronic transfers, improved security and data integrity through the use of hashing techniques, improved security through the elimination of the need for a trusted third party, and enhanced data anonymity. The present invention can also provide improved communication mechanisms that allow disparate or distinct parties to identify each other and / or exchange data via the novel methods and / or architectures provided by the present invention. This list of advantages is not intended to be limiting or exhaustive.

[0011] The present invention may require the interaction and inter-communication of various distinct and separate computer-based resources, such as one or more user devices and a distributed computer system (blockchain) including computing nodes configured to execute blockchain-related software and protocols.

[0012] The present invention may provide a computer-implemented method for efficient transfer of an entity in a peer-to-peer distributed ledger (blockchain), the method including generating a first exchange transaction and broadcasting the first exchange transaction over a first network for inclusion in the P2P distributed ledger, the first exchange transaction including: an indication of a first amount of virtual currency to be transferred; a first input provided from output of a first invitation transaction from a first user, the first invitation transaction having been previously included in the P2P distributed ledger; a first script; a first user private key (V1A) associated with the first user; a first third-party private key (V1T) associated with a first third party; and a first output indicating the transfer of the first entity from the first user to a second user. Here, the first script includes a first set of metadata providing instructions for the first entity to be transferred and a first set of conditions for the transfer; a first user public key associated with the first user, the first user public key being a cryptographic pair with the first user's private key; and a first third party public key associated with the first third party, the first third party public key being a cryptographic pair with the first third party private key.

[0013] Thus, a hash of the (redemption) script may be provided in or associated with a blockchain transaction (Tx). This may be a P2SH transaction according to the Bitcoin protocol or another functionally equivalent transaction type in another blockchain protocol. The hash of the script may serve as a lookup key for a hash table or other storage resource. This storage resource may be a public domain repository of invitations. The storage resource may include the lookup key (i.e., the hash) and all fields from the metadata that, in combination, define the invitation. The lookup key may be a hash of the rest of the record, i.e., a hash of the concatenated metadata values. In a preferred embodiment, the metadata may include a pointer or other reference to the location of the contract associated with the token. The contract may be stored in a separate storage resource. The invitation (defined by the metadata in the storage resource) may be linked to the blockchain transaction via the hash.

[0014] The present invention provides many advantages, some of which are described herein. First, because information about the exchange is contained in metadata securely embedded in the distributed ledger, the exchange is performed securely on a peer-to-peer basis, thereby eliminating the need for a trusted third party. This, in turn, avoids the need for large amounts of confidential information about both parties to the exchange to be held by any third party, such as a service provider, and therefore avoids the risk of the third party being compromised. This advantage is provided while also maintaining the anonymity of the transaction. Because the first script is hashed, it would be impractically difficult to change the value of the metadata without a change in the script's corresponding hash value. This also allows the terms of the transaction to be verifiable by the parties because they are locked in a publicly available distributed ledger, which makes the integrity of the transaction trustworthy. An advantage also provides that the first metadata can be embedded in one or more locations available for public keys in the first script, thereby allowing nodes that are not suited to processing the metadata to simply send the script to another node, as opposed to blocking progress. This, in turn, improves the computational efficiency of the associated transaction. A further advantage is provided in that control data can be incorporated into the metadata, such as an access code to a barrier in the case of a token representing a ticket to a meeting location or a travel ticket or voucher. The metadata can also include an off-block repository of exchange details to which pointers point, thereby reducing memory and / or processing resources used in processing the associated transaction. Yet another advantage is provided in that a token can be split, allowing for two or more transaction outputs, each of which may be associated with a tokenized or non-tokenized electronically transferable digital asset.

[0015] The method further includes generating a second exchange transaction and broadcasting the second exchange transaction on the first network for inclusion in the P2P distributed ledger, where the second exchange transaction includes an indication of a second amount of virtual currency to be transferred, a second input provided from an output of a second invitation transaction from the second user, the second invitation transaction having been previously included in the P2P distributed ledger, the second input, a second script, a second user private key associated with the second user, a second third party private key associated with the second third party, and a second output indicating the transfer of the second entity from the second user to the first user. wherein the second script includes a second set of metadata providing instructions for a second entity to be transferred and a second set of conditions for the transfer; a second user public key associated with the second user, the second user public key being a cryptographic pair with the second user's private key; and a second third party public key associated with the second third party, the second third party public key being a cryptographic pair with the second third party private key.

[0016] Additionally or alternatively, the present invention may provide a computer-implemented method for efficient transfer of entities in a peer-to-peer distributed ledger, the method including generating a first exchange transaction and broadcasting the first exchange transaction over a first network for inclusion in the P2P distributed ledger. wherein the first exchange transaction includes: an indication of a first amount of virtual currency to be transferred; a first input provided from the output of a first invitation transaction from a first user, the first invitation transaction previously included in the P2P distributed ledger; the first input; a first script; a first user private key associated with the first user; a first third-party private key associated with a first third party; a first output directing the transfer of a first entity from the first user to a second user; an indication of a second amount of virtual currency to be transferred; a second input provided from the output of a second invitation transaction from a second user, the second invitation transaction previously included in the P2P distributed ledger; the second input; a second script; a second user private key associated with the second user; a second third-party private key associated with the second third party; and a second output directing the transfer of a second entity from the second user to the first user. wherein the first script includes a first set of metadata providing an indication of a first entity to be transferred and a first set of conditions for the transfer, a first user public key associated with the first user, and a first third-party public key associated with the first third party, and wherein the second script includes a second set of metadata providing an indication of a second entity to be transferred and a second set of conditions for the transfer, a second user public key associated with the second user, and a second third-party public key associated with the second third party.

[0017] Preferably, the step of generating the first exchange transaction includes the steps of sending a first script to the first user for signing with the first user's private key, receiving from the first user the first script signed with the first user's private key, sending the signed first script for signing with a first third party's private key, and receiving from the first third party the first script signed with the first third party's private key.

[0018] Advantageously, the step of generating the first exchange transaction further comprises the steps of sending the first script to the second user for signing with the second user's private key, receiving from the second user the first script signed with the second user's private key, sending the first script to a second third party for signing with the second third party's private key, and receiving from the second third party the first script signed with the second third party's private key.

[0019] The step of generating a second exchange transaction includes the steps of sending a second script to the second user for signing with the second user's private key, receiving from the second user the second script signed with the second user's private key, sending the second script to a second third party for signing with the second third party's private key, and receiving from the second third party the second script signed with the second third party's private key.

[0020] The method further includes, prior to the step of generating or broadcasting the first exchange transaction and / or the second exchange transaction, sending a prompt to one or more of the first user and the second user to accept the exchange.

[0021] The method further includes receiving a first invitation to conduct the exchange from the first user, the first invitation including the first set of metadata; generating a first script; hashing the first script to generate a first script hash; and sending the first script and the first script hash over a second network; and sending the first invitation transaction over the first network for inclusion in the peer-to-peer distributed ledger, the first invitation transaction including an indication of a third amount of virtual currency to be transferred and the first script hash.

[0022] The method further includes receiving a second invitation to conduct the exchange from the second user, the second invitation including a second set of metadata associated with the invitation; generating a second script; hashing the second script to generate a second script hash; sending the second script and the second script hash over a second network; and sending the second invitation transaction over the first network for inclusion in a peer-to-peer (P2P) distributed ledger, the second invitation transaction including an indication of a fourth amount of virtual currency to be transferred and the second script hash.

[0023] The first entity may be a first amount of virtual currency. Additionally or alternatively, the second entity is a second amount of virtual currency.

[0024] Sending the first script and the first script hash over the first network includes publishing the first script and the first script hash in a distributed hash table (DHT), or alternatively, sending the first script and the first script hash to a second user.

[0025] Sending the second script and the second script hash over the second network includes publishing the second script and the second script hash in a distributed hash table (DHT), or alternatively, sending the second script and the second script hash to the first user.

[0026] In some embodiments, the P2P distributed ledger is the Bitcoin blockchain.

[0027] Preferably, the first third party is an escrow service provider. Similarly, the second third party may be an escrow service provider.

[0028] Advantageously, one or more of the first exchange transaction, the second exchange transaction, the first invitation transaction, and the second invitation transaction are pay-to-script hash (P2SH) transactions.

[0029] The first script hash and the second script hash may be Base58 encoded.

[0030] The first entity and / or the second entity may be bitcoin, a contract, a product, or a service.

[0031] The contract may be for one or more of the following: fiat currency, real estate deeds, tickets, goods, or services.

[0032] The first set of conditions and / or the second set of conditions may include one or more of the following: a) one or more limit ranges on one or more prices for the exchange; b) an exchange rate; c) a deadline for fulfilling the first invitation; d) a restriction on the geographic area for making the exchange.

[0033] Embodiments of the present invention may include techniques for embedding metadata within (blockchain) transactions; generating a blockchain transaction (Tx) having an output (TxO) related to the asset (B1) and a hash of a redemption script; metadata, including tokens that are representations or references to tokenized entities; At least one (and preferably two or more) public encryption keys. The digital asset (B1) may be a quantity of virtual currency, for example Bitcoin. The redemption script may be provided in the locking script of the transaction output TxO. The metadata may be provided in the redemption script in a location specified in the blockchain protocol as the location of the cryptographic keys. This provides the advantage that the metadata can be transferred without requiring any changes to the underlying blockchain protocol. Nodes operating the protocol will be agnostic about the use of metadata instead of cryptographic keys. The method may further include a step of submitting the transaction Tx to the blockchain. In effect, the virtual currency (B1) may thus be locked in the blockchain in association with the token. The amount of virtual currency (B1) can only be spent (redeemed) upon provision of an unlocking script that satisfies the requirements of the locking script for the output TxO. In particular, a redemption script must be presented that, when hashed, matches the hash provided in the locking script of the TxO. The locking script for the output TxO includes (in metadata) a hash of the redemption script, which in turn hash the token, so that the virtual currency (B1) is associated with the token. Once the correct unlocking (redeeming) script is presented, ownership of the virtual currency (B1) is transferred, i.e., spent, to the redeeming party or user.

[0034] The present invention may provide a computer-implemented system arranged and configured to perform any of the methods described above. Any feature described above in relation to one aspect or embodiment may be used with respect to any other embodiment or aspect. Any feature mentioned in relation to a method of the present invention may equally be applied to a corresponding performing system, and vice versa.

[0035] According to one aspect of the invention, there is provided a processor or group of processors operable to carry out the above-described method.

[0036] In accordance with one aspect of the present invention, a computer readable medium having stored thereon instructions operable, when executed, to perform the above-described method is provided.

[0037] Throughout this specification the word "comprise" or variations such as "comprises" or "comprising" will be understood to mean the inclusion of a stated element, integer, or step, or group of elements, integers, or steps, but not the exclusion of any other element, integer, or step, or group of elements, integers, or steps. [Brief explanation of the drawings]

[0038] Embodiments of the present invention will now be described, by way of non-limiting example only, with reference to the accompanying drawings, in which: [Figure 1] FIG. 1 is a schematic diagram of a system according to one embodiment of the present invention. [Figure 2] FIG. 2 is a flow chart of a process carried out by a user of the system according to FIG. [Figure 3] FIG. 3 is a flow chart illustrating the process performed by an exchange service provider. [Figure 4]FIG. 4 is a table illustrating the metadata format for an invitation generated by an exchange service provider. [Figure 5] FIG. 5 is a table illustrating the metadata format for an invitation generated by an exchange service provider. [Figure 6] FIG. 6 is a flow chart illustrating the process of matching invitations from two or more users of the system according to FIG. [Figure 7] FIG. 7 is a transaction table for multiple transactions between multiple parties for the system according to FIG. [Figure 8] FIG. 8 is a transaction diagram illustrating a transaction between parties to the system according to FIG. [Figure 9] FIG. 9 is a transaction table for multiple transactions between multiple parties for the system according to FIG. [Figure 10] FIG. 10 is a transaction table for multiple transactions between multiple parties for the system according to FIG. [Figure 11A] FIG. 11A is a transaction table for a transaction between two parties for the system according to FIG. [Figure 11B] FIG. 11B is a transaction table for a transaction between two parties for the system according to FIG. [Figure 11C] FIG. 11C is a transaction table for a transaction between two parties for the system according to FIG. DETAILED DESCRIPTION OF THE INVENTION

[0039] State-of-the-art methods of conducting common financial transactions, such as paying someone else's bank account or exchanging foreign currency, incur costs in both transaction fees and time delays. In contrast, transactions in electronic currencies such as Bitcoin can be processed at much faster rates (i.e., minutes instead of days) and at very low costs (on the order of cents instead of tens of dollars per transaction).

[0040] There is a need for faster and cheaper ways to perform and keep permanent records of day-to-day transactions, both financial and non-financial. It is important to note that the present invention is not limited to use with or benefits from financial applications. Instead, the present invention generally relates to methods and apparatus for utilizing a P2P distributed ledger, such as the Bitcoin blockchain, to allow parties to offer, request, and exchange any type of value entity. The methods described herein allow for the entry of an invitation (or order) to effect an exchange of entities, as well as the enactment of the actual exchange upon acceptance of the invitation. Embodiments therefore provide for a permanent record of every step in the exchange process to be kept. Furthermore, each stage in the process (offer, acceptance, and exchange) can be secured using cryptographic locking techniques similar to those used in cryptocurrency transactions. The methods described herein can also be used to exchange any type of entity. Examples of such entities include, but are not limited to, Bitcoin, fiat currencies, contracts, goods, and services. By "cryptocurrency" we mean encrypted, electronically transferable digital assets, such as, but not limited to, Bitcoin. Exchanges such as Coinffeine (http: / / www.coinffeine.com / ) that incorporate the use of blockchain technology are known in the art. However, such prior art arrangements still rely on traditional models and also rely on third-party sources, escrows, and other multi-currency non-bank accounts / processors to operate. These known arrangements achieve decentralization through their business models, rather than through technological innovation and cryptography (as in the present invention).

[0041] The present invention incorporates the use of tokenization techniques. Contracts can be exchanged using a system of tokens. A token is an exchangeable entity represented by a contract. Contracts can take one of several forms. For example, a contract can confer rights on a holder or represent ownership of property. The value of a token can be specified in a contract and linked to an underlying BTC amount via a "pegging rate." Tokens are exchangeable through a novel type of transaction using a cryptocurrency protocol such as the Bitcoin protocol. The Bitcoin value in a transaction acts as a token that digitally represents a rights contract. The contract itself can be stored on the blockchain, stored in a publicly accessible off-block location, or privately held by the parties to the contract, depending on the specific embodiment. If the contract is not stored on the blockchain, the transaction can store a unique pointer, identifier, or other reference to any other type of contract.

[0042] Tokens may be divisible. A divisible token is one in which the value in a transaction output can be divided into smaller amounts, and the value can be allocated across multiple new tokens. Examples of divisible tokens include tokens for fiat currencies, or tokens for shares in racehorses, etc. Divisible contracts may be defined as specifying a non-zero peg ratio. In other words, the token value is tied to the underlying Bitcoin value. Alternatively, tokens may be non-divisible. A non-divisible token is a contract that specifies the holder's rights in a fixed value, for example, a contract to redeem a house or $1,000 Australian dollars. Indivisible tokens are therefore not linked to the underlying Bitcoin value. Because they are indivisible, they can only be transferred as a whole.

[0043] To be valid, a token must be digitally signed by a token issuer. The issuer may be, for example, an institution such as the Registrar of Title deeds. The issuer can issue a token to a user in return for payment. The token can then grant the user the right to exercise a contract linked to the token, whether the contract is the right to redeem fiat currency, the right to have a service performed, or the transfer of property (i.e., a deed).

[0044] Implementations of tokens according to the above include: A fiat currency token pegged to the BTC value of the transaction output by the contract issuer. For example, "The spender of this token (a Bitcoin transaction) is entitled to redeem any portion of this token for Canadian dollars (CAD) at the rate of 1 share (10 cents) per 1,000 satoshis." A racehorse owned by multiple members of a syndicate. Any item whose ownership is by title deed. For example, a house or other property could be dealt with in this way. An electronic contract representing a concert ticket, which is indivisible in nature. ·bearer bond (indivisible) A unique identifier (such as a barcode or RFID) attached to the good / service. When used, this identifier is still preferably validated by the signature of an authorized entity; without a signature, it falls into the less secure "goods / service" category (explained below). A contract for the right to a service to be performed. Note that this is not the same as the actual service itself, but just the right to have the service performed for you. This right can be traded. For example, a voucher from Michael's Mowing for up to 3 hours of lawn mowing in the Sydney metropolitan area. The holder of this voucher (contract) can redeem the voucher for the actual service.

[0045] The token must specify the value of the share, e.g. 1 share = 10 cents CAD, 1 share = 1 rupia, or 1 share = an item or property (a racehorse, a house, etc.).

[0046] While the embodiments described below may make specific reference to recording transactions on the Bitcoin blockchain (or simply blockchain), it will be appreciated that the present invention may be implemented using any P2P distributed ledger. Blockchain is used below to describe aspects of the present invention for its simplicity, due solely to its high level of standardization and the large amount of associated public documentation.

[0047] As is well known in the art, a blockchain is a transaction ledger or database distributed across networked nodes participating in a system based on the Bitcoin protocol. A complete copy of a currency's blockchain contains every transaction ever executed in the currency, thus providing a continuously growing list of transaction data records. Each transaction entered on the blockchain is cryptographically implemented, making the blockchain hardened against tampering and revision, even by operators of data store nodes.

[0048] In embodiments of the present invention, instead of or in addition to being used in its designed function of storing records of transactions representing payments of Bitcoin (or other virtual currency) from one party to another, blockchain is used in a novel way to enable the transfer of entities or assets between parties. An exchange transfers control and / or ownership of a digital entity from one party to another. To accomplish this, the present invention provides a mechanism for holding and recording invitations (or orders) to effect an exchange involving one or more entities. The present invention therefore provides a novel and advantageous communication solution conducted via blockchain.

[0049] As mentioned above, any type of entity or asset can be exchanged. These can be physical, "real world" entities or virtual, digital entities. Examples of entities that can be exchanged include bitcoin, tokens (representing any type of transferable contract), and any type of goods and services. Tokens can represent contracts that confer specific rights on their holders. They can be redeemed for fiat currency (virtual banknotes), represent ownership of property (e.g., title deeds), or grant access to events, to name a few of many examples. Goods and services can include new or used products, labor (e.g., billed by the hour), and complete jobs (e.g., mowing the lawn), to name a few of many examples.

[0050] FIG. 1 is a network diagram of a P2P exchange system 100 according to one embodiment. The system 100 includes a network 102 and multiple parties to the network. The parties include an exchange service provider 104, a first user 106, a second user 108, an escrow service provider 110, and an issuer 112. As described in more detail below, a combination of the functions of the exchange service provider 104, the escrow service provider 110, and the issuer 112 can be undertaken by a single party. In other words, a single party can perform each function simultaneously. Additionally, and as described in more detail below, the exchange service provider 104 and the escrow service provider 110 are optional, as the P2P exchange system can be implemented entirely without the use of these service providers 104, 110.

[0051] Exchange service provider 104 provides exchange services to multiple users, including first user 106 and second user 108. Issuer 112 is optional to network 102, as indicated by the dashed line. As explained in more detail below, issuer 112 is only required when an exchange of tokens is involved.

[0052] In some embodiments, network 102 is the Internet. Thus, other parties (not shown) may be parties to network 102. All parties to network 102 can communicate with all other parties to network 102. Hosted on network 102 are a peer-to-peer distributed hash table (P2P DHT) and a peer-to-peer distributed ledger (P2P DL). It will be appreciated that some or all of the parties shown in system 100, along with others not shown, may act as host nodes for the P2P DHT and / or P2P DL.

[0053] Invitation Structure The invitation may be configured to include various parameters or codes, which can be used for various purposes, such as invitation matching, as described in more detail below. In one or more embodiments, the following structure can be used: [Table 1] [Table 2]

[0054] One purpose of the exchange service provider 104 is to provide a gateway for users 106, 108 to place invitations (or orders) in both the P2P DHT and the P2P DL. While users 106, 108 of the network 102 can themselves place invitations in both the P2P DHT and the P2P DL, the exchange service provider 104 provides a simplified interface, improves the efficiency with which invitations are generated, and, as one skilled in the art will appreciate, reduces the risks associated with directly handling transactions in a distributed ledger such as the Bitcoin ledger (e.g., lost transactions, etc.). In addition to enabling the issuance of user invitations in the P2P DHT and the P2P DL, the exchange service provider can perform one or more of the following additional services: · Invitation MatchingMatching invitations—As mentioned above, an invitation may include a) details of an entity with which a user wishes to exchange and b) one or more user-applied options / conditions attached to the exchange. Two invitations may match if their respective entity details are mirrored and one or more of the conditions of the two invitations match. In other words, a match may occur if one or more parameters or characteristics included in a first invitation are also included in a second invitation. There is some commonality between the parameters in the invitations. An example of mirrored entity details is when a first user (Alice) offers bitcoin for apples and a second user (Bob) offers apples for bitcoin. Service providers can therefore offer matching services to match compatible invitations to accommodate an exchange. Matching may involve scanning the P2P DHT for one or more invitations with matching entities and / or conditions. In some embodiments, service provider 104 can scan the P2P DHT in response to a request from a user. For example, a user can provide service provider 104 with one or more criteria for a desired invitation. Based on the provided criteria, service provider 104 can then search for invitations already placed on the P2P DHT that match those criteria. In other embodiments, service provider 104 can implement a non-specific pairing algorithm that searches the P2P DHT for matching or near-matching invitations that are not related to a specific user request. It will be appreciated that matching services may be provided by other third-party providers.There may be one or more third-party providers whose primary purpose is to provide matching services in accordance with the above and also to provide match alerts, as described below. In some embodiments, matching is provided by a matching service provider (MSP). According to one or more embodiments, and with reference to the table shown in the "Invitation Structure" section above, a matching algorithm can be employed from matching invitations between A and B as follows: A's Offer-type-code must match B's Request-type-code A's Request-type-code must match B's Offer-type-code A's Rate-min ≦ B's Rate-max (when expressed in equivalent units) A's Rate-max ≥ B's Rate-min (when expressed in equivalent units) The Request-item-ID must match the Offer-Item-ID A's Request-QTY-min ≦ B's Offer-QTY-max A's Request-QTY-max ≧ B's Offer-QTY-min A's conditions (if any) must be met by B's invitation B's conditions (if any) must be met by A's invitation The present invention can be configured to incorporate machine-executable rules that implement this algorithm or variations thereof. · Alert MatchesMatch alerts - When a match or near match is found, the exchange service provider 104 can alert the user in known ways, such as by email or via a phone or tablet application. Thus, the present invention can provide a novel communication or alert mechanism. · Generate new invitations based on matches Generating new invitations based on matches—When a user provides details of an invitation or order they wish to place, the service provider 104 can scan the P2P DHT for one or more invitations that meet the conditions of the user's order. If a matching invitation is found in the P2P DHT, the service provider 104 can then generate an invitation that mirrors the identified invitation already on the P2P DHT to facilitate a successful match. Note that to complete a final transaction on the P2P DL, all parties to the transaction must have an invitation already published on the P2P DL. However, not all invitations need to be published on the P2P DHT. In this embodiment, for example, the service provider does not need to publish an offer on the P2P DHT because there is no need for the invitation to be advertised (the desired match has already been found). However, it will be appreciated that the generated invitation may still be placed on the P2P DHT, for example, if the initial match fails. · Executing a TransactionExecuting transactions—After a pair of invitations is successfully matched, the service provider 104 can act as a proxy to implement the final transaction. For example, upon determining that two invitations match, the service provider 104 can record the actual transaction, i.e., the transaction involving the exchange of entities, in the P2P distributed ledger. This process may occur automatically, without the parties expressing approval, or after prompting one or more parties to approve the transaction. In some embodiments, metadata in the invitation may indicate whether the parties need to be notified before the exchange is finalized. · e-wallet service (eWallet services) - In addition to the above, the service provider 104 may also provide traditional eWallet services, such as holding virtual currency keys, etc.

[0055] In the system 100 of Figure 1, a single service provider 104 is shown. However, it will be appreciated that one or more additional exchange service providers may be parties to the network 102. When more than one exchange service provider is present, users may select an exchange service provider according to their requirements, which may include, for example, the service provider's fee structure, location, compatibility, etc. Thus, it will be appreciated that in certain situations, two users with matching invitations may use different exchange service providers. In such situations, the users' respective exchange service providers may communicate with each other to facilitate the exchange.

[0056] In addition to the exchange service provider 104, an escrow service provider 110 (or escrow for short) may be a party in the network 102. The escrow service provider 110 allows the user's offer to be held until the transaction is settled (i.e., the offered amount is reserved) or, under certain conditions, to cancel the order and return whatever was offered in the invitation. The escrow service provider 110 acts as a neutral third party trusted by the two parties to the transaction to provide escrow services for the transaction. Thus, the system allows users to participate in the final transaction and have assurance that the user making the offer will be able to fulfill the offered amount (in Bitcoin or tokens).

[0057] As with the exchange service provider, one or more escrows may be parties to the network 104. Users of the P2P exchange system 100 may also choose which escrow provider, if any, to use. In some embodiments, the services of the escrow 110 may be incorporated into the services of the exchange service provider 104, or vice versa. In such cases, a separate escrow may not be required.

[0058] In addition to the above, the system 100 may also include an issuer 112. The issuer 112 may be involved if the transaction involves an exchange of tokens. In such a situation, the process involves an issuer signing the tokens. Each transaction involving a transfer of tokens preferably includes the issuer 112. In the embodiment described herein, an issuer signature is required in invitation transactions, where tokens are provided and held in escrow. An issuer signature is also required in exchange transactions, where tokens are paid out to a counterparty.

[0059] An important aspect of embodiments of the present disclosure is the ability to embed metadata about the invitation to perform the exchange in a Bitcoin exchange transaction (or virtual currency transaction), and similarly, the ability to embed metadata about the actual exchange in a Bitcoin or other virtual currency transaction. The embodiments described herein use multi-signature pay to script hash (P2SH) type transactions to enable such metadata embedding, as described below.

[0060] (i) Redeem script in P2SH in general As background, in the Bitcoin protocol's standard pay-to-script hashing method, a redemption script takes the following form: <NumSigs PubK1 PubK2 ... PubK15 NumKeys OP_CHECKMULTISIG> where: NumSigs is the number of valid signatures, 'm', required to satisfy the redemption script to unlock the transaction. PubK1, PubK2, ..., PubK15 are the public keys corresponding to the signatures that unlock the transaction (up to a maximum of 15 public keys). NumKeys is the number of public keys "n" (must be 15 or less).

[0061] To redeem the above redemption script, at least "m" signatures corresponding to the public keys are required. In some implementations, the order of the public keys is important, and "m" of the "n" signatures for signing must be done in order. For example, suppose "m" is 2 and the number of public keys "n" is 15. If two signatures are available for use, say Sig1 (corresponding to PubK1) and Sig15 (corresponding to PubK15), the redemption script must first be signed by Sig1, and then by Sig15.

[0062] (ii) Embedding metadata in P2SH The inventors have recognized that metadata can be embedded in P2SH in one or more of the 15 locations available for the public key in the redemption script.

[0063] For example, P2SH takes the following form: <NumSigs Metadata1 Metadata2 ... PubK1 PubK2 ... NumKeys OP_CHECKMULTISIG> where: NumSigs is the number of valid signatures, 'm', required to satisfy the redemption script to unlock the transaction. Metadata1 and Metadata2 each contain metadata in place of a public key. PubK1 and PubK2 are the actual public keys, and NumKeys is the total number of positions taken by metadata and public keys (which must be 15 or less).

[0064] By placing metadata in the redemption script corresponding to the terms of the invitation, details of the contract associated with the token, and / or other information related to the exchange, a hash of that information is included in the P2P distributed ledger.

[0065] This embedding method can be summarized as follows: generating a blockchain transaction (Tx) having an output (TxO) for a portion of cryptocurrency and a hash of a redemption script, where Tx is: Metadata including tokens, which are representations or references of tokenized entities; and At least one (and preferably two or more) public encryption keys. The tokenized entity may be a contract and / or other entity on an exchange. The metadata is provided in a location specified by the protocol for the cryptographic key.

[0066] Thus, the use of multi-signature P2SH Bitcoin transactions in embodiments of the present invention provides several advantages. First, it allows invitation transactions to carry metadata payloads. Second, it facilitates the use of escrow services in exchange transactions. Third, it allows exchange transactions to carry metadata about one or more tokens being exchanged, at the location where tokens are transferred in the exchange. Additionally, the underlying blockchain protocol is agnostic to the fact that metadata is being sent via the transaction. Therefore, no changes to the blockchain protocol are required to convey this information.

[0067] The metadata may include statements or keywords describing the offer or request in the invitation transaction. The metadata may also include conditions related to the invitation. For example, a deadline date may be attached to the invitation. The deadline may specify a time and / or date by which the order must be fulfilled. If a deadline condition is provided with the invitation transaction, a cancellation transaction may be generated that spends the same amount of BTC and includes a locktime representing the deadline by which the exchange must occur. The cancellation transaction may prevent distribution on the P2P DL until the locktime. If the exchange does not occur by the deadline, the cancellation transaction is added to the P2P DL, effectively refunding the payer and / or service provider. If the exchange occurs before the deadline expires, the exchange transaction spends its amount, creating a double-spend that hits the P2P DL prior to the time-locked cancellation transaction, thereby blocking the cancellation transaction. In some embodiments, the metadata may not include a deadline; instead, the cancellation transaction may simply be responsible for canceling the original invitation transaction. Alternatively, the deadline metadata condition may not automatically trigger the spending of the cancellation transaction. In other words, the deadline may be a flexible deadline that remains under the control of the payer. This deadline may therefore be extended by the party simply allowing it to expire and still accepting late matching invitations. Similarly, a service provider may still attempt to match an expired order if it remains unused.

[0068] Instead of locking in the cancellation transaction at the same time as placing the invitation transaction, the user can wait until after the deadline and manually enter the cancellation transaction if they so desire.

[0069] Conditions can also include one or more location conditions that can specify, for example, that a transaction will only be broadcast on the P2P DL if the location of the transaction broadcast is within X meters of specified coordinates. This ensures that the transaction only takes place at a specified location, e.g., Bob's Coffee Shop.

[0070] There may be a facility that allows users to create their own new conditions and add them to the list of conditions by assigning them to previously unused condition codes. This facility can resist abuse. For example, each service provider could simply publish its own table of conditions along with the associated condition codes, and other parties in system 100 could choose to adopt the same coding and also add new codings of their own. Then, if a dispute arises due to, for example, the reuse of condition codes, the dispute can be resolved by the service provider or other users of system 100.

[0071] Some examples of implementations of the present invention will now be described, taking as an example a transaction between a first user 106 (herein referred to as Alice) and a second user (herein referred to as Bob). In this example, the transaction is an exchange of tokenized Canadian dollars for Bitcoin.

[0072] Posting an invitation

[0073] In a first example, Alice wants to purchase some Canadian dollars (CAD) tokenized for Bitcoin. To advertise her interest, Alice contacts the exchange service provider 104, for example, via a web interface or an app running on a tablet or mobile phone. As shown in FIG. 2 , in step 202, Alice logs into the web interface of the service provider 104. In steps 204 and 206, Alice then sends details of her invitation to the service provider, including the entity to be exchanged (CAD tokenized for Bitcoin), the terms of the exchange, and any selected options offered by the service provider. Alice can enter this information into an interface hosted by the service provider 104, for example, using ordinary language, which can then be translated by the service provider 104 into a valid invitation, or alternatively, Alice can simply enter the information via pre-selecting options, for example, via a drop-down selection menu.

[0074] In step 208, Alice receives a redeem script from the service provider 104, which is generated by the service provider 104 based on her selection and includes information about the entity Alice wishes to exchange with and any terms and conditions regarding the invitation. Because Alice signed up to use a particular service provider 104, the service provider 104 may already have Alice's public key. Alternatively, Alice can provide her public key to the service provider 104 either during the initial selection or upon request from the service provider 104.

[0075] Alice signs the redemption script using her private key, which is the cryptographic pair to her public key, in step 210, and sends the signed redemption script back to the service provider 104 for distribution in step 212. This process may be supported by the use of an app, which may itself be provided by the service provider 104.

[0076] Flowchart 300 shown in FIG. 3 describes the corresponding process performed by service provider 104. In step 302, service provider 104 receives invitation details from Alice and, in step 304, generates a redemption script using Alice's public key, entity details, and the terms of the invitation. The redemption script may be in a format suitable for P2SH bitcoin transactions. The invitation details may be stored in a metadata field in place of the 32-byte public key typically used in multisig unlocking scripts. FIG. 4 illustrates the metadata format for Alice's invitation, according to one embodiment. In the invitation, Alice requests tokenized CAD and, in return, offers bitcoin at a rate of 400 CAD / Bitcoin or greater. As described in more detail below, FIG. 4 also illustrates deadline conditions that can be added to the invitation. The deadline conditions can allow the invitation to be canceled at the deadline if the exchange is not confirmed based on the invitation.

[0077] The redemption script is then sent to Alice for signing. Upon receiving the signed redemption script from Alice, in step 308, the service provider 104 generates a hash of the signed redemption script.

[0078] The service provider 104 uses the hash in two ways. First, in step 310, the service provider 104 lists the details of the invitation along with the hash in a publicly available P2P DHT. As mentioned above, this table employs torrent techniques so that it is distributed rather than centralized, and therefore remains publicly accessible and safe from adulteration. Other service providers 104 can then access the invitation and list it on their own sites. (In practice, the service provider 104 simply uses the hash table as the only repository and need not even maintain its own local database of invitations.)

[0079] The second way hashes are used is to create a locking script for a Bitcoin transaction in step 312. This transaction spends some of Alice's Bitcoins against a P2SH script that requires two signatures to unlock: Alice's signature and the signature of the designated escrow service provider 110 (which, as noted above, may or may not be the same entity as service provider 104). The purpose of this transaction is twofold. First, the invitation is logged on the P2P DL. Any user or their service provider can verify that the invitation on the P2P DHT is legitimate by ensuring that a matching transaction exists on the P2P DL (via a matching hash value). Second, the transaction "locks" the commitment Alice made in the invitation. The amount of Bitcoin Alice provides in exchange for tokenized CAD is the amount spent by the order transaction. Thus, it can be verified that the order is backed by sufficient funds.

[0080] Pairing matching invitations

[0081] In a second example, Bob wants to sell some of the tokenized CAD for his BTC and independently lists his own invitation using either the same or a different service provider as used by Alice, service provider 104. Bob's order is also listed in a hash table and embedded in the P2P DL transaction, as described with reference to Figures 2 and 3. The metadata of Bob's invitation is shown in Figure 5.

[0082] 6, a process 400 for matching Alice and Bob's orders is illustrated. In this example, service provider 104 is described as performing the process. However, it will be appreciated that any exchange service provider, or indeed any other suitable third party, may perform process 400.

[0083] The exchange service provider 104 can execute a matching algorithm operable to identify a full or partial match between Alice's and Bob's invitations. In step 402, the exchange service provider 104 scans the P2P DHT for matching entity details. During the scan, the service provider 104 checks for a match between the entity details of Alice's and Bob's invitations. If a match is not found in step 404, then the process returns to step 402, and the exchange service provider 104 continues scanning the P2P DHT for matching entity details. If a match is found in step 404, then the process 400 continues with step 406, where a check is made for a match between one or more conditions in each of Alice's and Bob's invitations. If a match is not found in step 406, then the process returns to step 402. If a match between one or more conditions is found, then the process moves to step 408, where the exchange service provider 104 attempts to create and confirm a transaction between Alice and Bob.

[0084] A direct match of all terms in the two invitations may not be required in step 406 for a positive match to be confirmed. Indeed, process 400 may only require that some of the terms match. Additionally or alternatively, one or more terms need not match exactly. For example, if the terms being compared are the exchange rates offered in each term, process 400 may confirm a positive match if the rates are within a predetermined threshold range of each other. For example, if Alice is 4×10 -5 You are offering a minimum tokenized CAD / satoshi rate, and Bob's maximum similar offer is 3.9 x 10 -5 In the case of tokenized CAD / Satoshi, even if Bob's offered rate does not fully meet Alice's original requirements, the process may still confirm or provide a match. In such a situation, upon match, Alice may be given the option to accept. If Bob's equivalent maximum offered rate is 4.1×10 -5 It will be appreciated that the condition is met if the tokenized CAD / Satoshi is present. In another example, the condition may be the respective values ​​for the goods and services offered in the offer and request. Process 400 may again confirm a positive match if the two values ​​are within a predetermined threshold range of each other. In either case, the predetermined threshold range may be, for example, a discrete value or a percentage of the offer value or request value. In some embodiments, there may be conditions that can be set to allow or not allow close matches, i.e., when there is no direct match between Alice and Bob's respective offers. Similarly, there may be conditions that can be set to allow or not allow counter offers that are not strictly within the offered range.

[0085] As mentioned above, the transactional metadata of each or both of Bob's and Alice's invitations may further include one or more location conditions, for example, specifying that the transaction will only be broadcast on the P2P DL if the location of the transactional broadcast is within X meters of specified coordinates. This ensures that the transaction will only take place at the specified location, e.g., Bob's coffee shop.

[0086] Once a match is found and before completing the transaction, one or more intervening steps may be performed. These may include alerting the parties that a match has been found, followed by a request to confirm that they wish to proceed, and so on. For example, as described above, if the conditions are largely, but not completely, satisfied by one or more users, a match may still be recorded but may not be finalized until all parties are satisfied with the terms of the invitation. This process may result in counteroffers to negotiate final agreement on the terms, which may then result in the generation of further invitations according to the process described above.

[0087] The final exchange can be performed by creating one or more Bitcoin transactions that spend the outputs of each invitation transaction. The inventors have discovered several novel ways to complete a transaction, which may depend on the circumstances, including but not limited to the users involved in the transaction, the entities being exchanged, and the service providers and issuers involved in the transaction. Examples of some of these methods are described below.

[0088] Continuing from the example described above with reference to Figures 2 through 6, a transaction table 500 for separate transactions for Alice-Bob and Bob-Alice is shown in Figure 7, and a schematic diagram 600 of the transaction flow is shown in Figure 8. As with the metadata values ​​shown in Figures 4 and 5, the values ​​provided in transaction table 500 are for illustrative purposes only. In this example, Alice's Bitcoin in her invitation transaction is spent on Bob, and Bob's CAD tokenized Bitcoin in Bob's invitation transaction is spent on Alice.

[0089] Turning first to the Alice-Bob transaction, the input 602 of this transaction is provided from the output of the invitation transaction that was placed on the P2P DL along with Alice's invitation. As with the first transaction, the input script is signed by both Alice and the escrow service provider 110 (assuming Alice is happy for the transaction to proceed). The script unlocks the spent bitcoins and can output them a) to Bob as his payment in return for the tokenized CAD (604), b) to the exchange service provider 104 as payment for the exchange (606), and c) to Alice as change, if any (608).

[0090] Now, turning to the Bob-Alice transaction, this transaction has two inputs. The first input 610 of the transaction comes from the output of the invitation transaction that was placed on the P2P DL along with Bob's invitation. Because the inputs to this transaction are tokenized, the input script needs to be signed by both Bob and the token issuer. In this situation, the token issuer also acts as an escrow, holding the funds until Bob (and optionally Alice) is satisfied with the transaction. The signed script unlocks the spent tokens, which can then be output a) to Alice as a return payment for BTC (612) and b) back to Bob as a change token for the original token value less the value sent to Alice (614). The second input 616 is from Bob's previous Bitcoin transaction. This input is unlocked and output a) to the service provider 104 as payment for the exchange, b) to the Bitcoin miner as a fee for the exchange transaction, and c) to Bob as change in Bitcoin for the value of the original Bitcoin input value less the service provider 104 fee and the miner's fee.

[0091] The service provider's 104 fee for each transaction may be a slice of the transaction value. Alternatively or additionally, the fee may be a slice of the exchange rate spanning the corresponding rate terms indicated in the two invitations. For example, if the offered rates overlap, the service provider 104 may fulfill both sides of the exchange at their respective asking rates and keep the difference as a fee. Alternatively or additionally, a flat fee (in satoshis, tokenized currency, or otherwise) may be taken by the service provider 104. In some embodiments, the service provider may not derive the fee through the actual transaction. Instead, the user may be charged a fee outside of the transaction. For example, the user may be charged a membership fee or a per-transaction bill for one or more transactions (e.g., per transaction or on account).

[0092] Once the transaction is complete, Bob and Alice's respective service providers can remove their invitation entries from the P2P DHT or enter additional entries that invalidate the original entries. For example, the service provider could simply leave the entry on the P2P DHT because it corresponds to a spend transaction. This means that the invitation is no longer valid. Alternatively, the service provider could mark the transaction with a field indicating it has been spent. This may be a separate field in the DHT that corresponds to the particular entry, but does not change the actual metadata associated with the invitation (this may ensure that the script hash still matches the hash in the transaction). Alternatively, the service provider could delete the entry from the P2P DHT. However, an advantage of the P2P DHT is persistent audit control of transactions using system 100. Preferably, therefore, deletion of entries from the P2P DHT is prevented, or deleted entries are archived to maintain a record of the entries. In one example, deleted entries are archived.

[0093] In the above example transaction, no puzzles are exchanged. In other words, the two transactions (Alice-Bob and Bob-Alice) are completely separate and distinct. However, in some cases, it is desirable for the two transactions to be either valid or invalid. Figure 9 shows the transaction for Alice (Alice- The following example shows an alternative transaction where puzzles are exchanged between two parties (one for each of them, Bob). By doing so, the two transactions are locked together and one cannot be spent without the other being spent. This prevents a transaction from passing from one party to another without the other party's transaction also passing.

[0094] In the two examples above, two Bitcoin transactions are executed to complete the exchange. If possible, however, it would be desirable to combine the two transactions above into a single Bitcoin transaction. Doing so would automatically lock the two parts of the exchange together and reduce the overall fees paid by Alice and Bob for the transaction.

[0095] Figure 10 shows transaction table 700 for a single transaction between Alice and Bob. The transaction flow for the exchange is the same as in the previous two examples, i.e., that shown in Figure 6. However, the exchange has been consolidated into a single multi-input-multi-output (MIMO) transaction. Note that in Figure 8, two separate fees are paid to the exchange service provider 104. However, if the exchange service provider 104 is the same for both Bob and Alice, these two fees can be consolidated into a single transaction paid by Bob, Alice, or both Bob and Alice.

[0096] Transactions involving two or more parties

[0097] The above transaction involves an exchange between two entities. However, it will be appreciated that in some instances, more than two entities may be involved in an exchange. For example, consider the following scenario: Alice wants to exchange bitcoin for apples but will only accept a minimum of 1,000 apples. Bob wants to exchange apples for bitcoin but can only supply 500 apples. Carol wants to exchange apples for bitcoin but can only supply 600 apples. In this situation, the terms of Alice's invitation cannot be satisfied by Bob or Carol individually. However, together, Bob and Carol have 1,100 apples and can satisfy Alice's invitation.

[0098] In another example, Alice wants to exchange tokenized CAD for tokenized GBP, Bob wants to exchange tokenized GBP for tokenized AUD, and Carol wants to exchange tokenized CAD for tokenized AUD. While there is no direct match between any two of the three parties, they can be combined to satisfy each of the invitations—Alice's tokenized CAD can go to Carol, Bob's tokenized GBP can go to Alice, and Carol's tokenized AUD can go to Bob. Figures 11A-11C show example transaction tables for transactions between Alice, Bob, and Carol.

[0099] Referring first to Figure 11A, a transaction table is shown for a payment from Alice to Carol. Alice has $1500 in tokenized CAD and needs 500 tokenized GBP from Bob. The transaction pays 1000 tokenized CAD from Alice to Carol, and Alice pays herself the remaining 500 tokenized CAD (1500 - 1000). Using regular BTC, Alice can pay the service provider's fee (which may be a flat fee as shown in Figure 11A or a fee based on the value of the transfer) and pay herself the change minus 1000 satoshis for the miner.

[0100] Referring now to Figure 11B, a transaction table is shown for the payment of tokenized GBP from Bob to Alice. Bob has 750 tokenized GBP and needs tokenized AUD from Carol. The transaction pays 500 tokenized GBP from Bob to Alice, and Bob pays himself the remaining 250 tokenized GBP (750 - 500). Using standard BTC, Bob can pay the service provider's fee (which may be a flat fee as shown in Figure 11B, or a fee based on the value of the transfer) and pay himself the change minus 1000 satoshis for the miner.

[0101] Referring now to FIG. 11C, a transaction table is shown for a tokenized AUD payment from Carol to Bob. Carol has tokenized AUD 1500 and needs tokenized CAD from Alice. The transaction pays tokenized AUD 1000 from Carol to Bob, and Carol pays herself the remaining tokenized AUD 500 (1500 - 1000). Using standard BTC, Carol can pay the service provider's fee (which may be a flat fee as shown in FIG. 11C or a fee based on the value of the transfer) and pays herself the change minus 1000 satoshis for miners. It will be appreciated that if an exchange consists of two or more separate transactions (e.g., 1: Alice transfers to Bob and 2: Bob transfers to Alice), the transactions may be linked to ensure that either all parties receive their entitlements or none receive them. This can be achieved by satisfying the following condition (we use an example of two parties, A and B, but can easily be extended to three or more parties): a transaction output that transfers from A to B exists and can be spent by B if and only if a transaction output that transfers from B to A also exists and can be spent by A, and vice versa. Note that parties A and B refer not only to Alice and Bob but also to the set of signers required for each transaction (e.g., including token issuer, escrow, etc.).

[0102] Receiving a selection from the user

[0103] In a variation of the exemplary exchange described above with reference to Figure 6, instead of a service provider parsing the P2P DHT for matching orders, current users themselves can scan or browse the P2P DHT to view current invitations. Browsing may be facilitated by a third party, such as the exchange service provider 104. The third party can provide an interface in which users can browse, scan, and search for invitations that may be of interest.

[0104] Users can then skip the process of entering their own prospective invitations on the P2P DHT, but instead choose to create invitations that match or nearly match the orders they are interested in.

[0105] For example, following from, but in contrast to, the previous example, Bob can find Alice's invitation on the P2P DHT via a browsing or search interface. Bob can then enter his own invitation to match Alice's. Bob can do this in one of several ways. In one example, there may be a function on the interface that displays Alice's order to "Accept" the order. If Bob is a client of the same exchange service provider 104 that Alice used for the invitation, they may already have access to Bob's eWallet (public key, etc.) and can therefore create a matching order based on that information. In response, the exchange service provider 110 can generate a redemption script for the matching invitation, send it to Bob for signing, receive the signed redemption script, and enter the order on the P2P DL in preparation for the transaction. If Bob is not a client of Alice's exchange service provider 104, a facility may be provided to allow Bob to enter the required information and authorizations, and then allow the service provider to create a matching order for Bob. The same process as described above with reference to Figures 7 and 8 is then followed.

[0106] The above example describes exchanging BTC for tokenized CAD. However, it will be appreciated that system 100 works with any type of token, including, for example, BTC for any type of token (i.e., representing any contract, not just a currency contract), any type of token for any other type of token, BTC for goods / services, tokens for goods / services, or goods / services for goods / services. Additionally, and theoretically, the above process could be modified to exchange BTC for BTC, although such an exchange would have no real meaning.

[0107] Exchange of goods / services

[0108] When goods / services are involved in the exchange, slight modifications to the transaction process described above are required.

[0109] In such cases, the transaction (of goods and / or services) includes a description of the goods or services involved in the exchange. Unlike the tokens represented by a contract or title deed, the description does not constitute a contract.

[0110] The description may or may not uniquely identify the item. For example, if a physical item is involved in the transaction, the description may explicitly reference a unique identifier associated with the physical item. Additionally or alternatively, the description metadata may include one or more of the following: a) a general description of the desired item being offered or requested, e.g., "dishwasher, < 3 yo"; b) a reference to a specific item for sale on an auction website, e.g., "used items for sale on an auction site"; c) any number of an item type, e.g., advertising 15 T-shirts for sale, available for purchase individually or in any quantity up to 15; d) a reference to cash, in any particular currency; e) a description of labor and payment, either for each completed job or for regular lawn mowing (a repetitive task) with recurring or hourly payment; or f) one or more keywords, e.g., "dishwasher".

[0111] With respect to services, services are backed by contracts as well as tokens. As such, services are divisible into shares, and indivisible services can be thought of as one-time jobs, i.e., divisible but with a single share. When a service is indivisible, it may be treated as a token for purposes of invitation and exchange. When an item is backed by a token, it is treated as a token for purposes of both invitation and exchange and is exchanged in the same way as other tokens, such as tokens for fiat currency.

[0112] One implementation of a transaction involving a physical item associated with a unique identifier will now be described. As with the previous example, in this example, Alice uses her exchange provider to place an invitation on the P2P DL and P2P DHT. This invitation includes a statement that she wishes to purchase a physical item with unique identifier XYZ123, which may be related to Raphael's masterpiece "Deposition of Christ," for no more than 2500 BTC. Similarly, Bob can place a matching invitation in which he sells item XYZ123 for no less than 2400 BTC. Alice can browse the P2P DL to find the item with item number XYZ123 and place a matching order based on this information. Or, alternatively, Alice can place a generic invitation that is then matched by a third party, e.g., an exchange service provider, and then a new invitation including the catalog item number and description is created to match Bob's order.

[0113] It will be appreciated that for transactions involving unique IDs, such IDs must be permanently unique not only to a particular exchange service provider, but across the entire P2P DL. Thus, if the unique identifier is not entirely unique to the device (e.g., the device's serial number), the exchange service provider may generate a unique identifier for the device. To ensure that each identifier is unique across the P2P DL, each exchange service provider may, for example, have their own unique code that they prefix to the number they use to uniquely identify the product being advertised on the P2P DL.

[0114] Once an agreement is reached between Alice and Bob, the transaction is conducted according to the exemplary transaction process described above with reference to FIGS.

[0115] A further example of a transaction involving a physical item will now be described, however, in this example the item does not have a unique identifier associated with it.

[0116] If an invitation includes offers to sell multiple similar items, metadata may be required to describe the maximum and minimum quantities of the items that can be purchased with any one transaction. For example, Alice may place an invitation inferring that she will sell up to 15 Dead Lizard 2015 concert tour T-shirts at 0.025 BTC each, with at least five per transaction. In this case, metadata values ​​may include the minimum rate (0.025 BTC / item), the maximum quantity (Offer-QTY-max(15)), and the minimum quantity (Offer-QTY-min(5)). The following table summarizes the metadata associated with an invitation: [Table 3]

[0117] The actual BTC value in the payment transaction is then calculated by the exchange service provider. Because this transaction merely represents an invitation to perform an exchange, the actual value of the transaction may be as small as, for example, dust (546 satoshis). Alternatively, as explained below, the value may be a nominal amount required by the service provider to secure the invitation (e.g., so that Alice is incentivized not to withdraw).

[0118] In a further embodiment, goods in the form of hard currency (cash) can be exchanged. For example, Alice can place an invitation to sell Bitcoin for Canadian dollars (hard currency, not tokens), with a maximum purchase of 150 BTC. The invitation may additionally include a location condition that the exchange must occur only at her store address (371 Whimsy Avenue, Brentford). After placing a matching invitation, Bob may then come to Alice's store to deliver cash in lieu of payment in the Bitcoin transaction to finalize the transaction. Once Bob and Alice meet at her store for the physical transfer, an actual digital transaction of Bitcoin to Bob and a digital record of the transfer of coins to Alice may then be made.

[0119] In the case of transactions involving goods / services exchanged for other goods / services, it will be appreciated that transactions on the P2P DL exist only as records and do not represent an exchange of value between the parties (apart from any fees to service providers, etc.). Users may choose to pay a nominal service fee for using the system and entering the transaction on the P2P DL so that the exchange is permanently recorded.

[0120] Note that the original invitation transaction acts only as an invitation, not as a transfer of value or a record of an event. If a goods-for-goods exchange is conducted, such that the exchange involves only physical items, the final exchange does not need to be recorded on the P2P DL, since the P2P DL is not required to complete any transactions in the final exchange. Nevertheless, if the parties to an exchange of physical items wish to record the exchange on the P2P DL, they can spend the invitation transaction with each other, subject to a fee to the miner for doing so. If the parties do not wish to record the final exchange on the P2P DL, they can spend the invitation transaction back to themselves or leave it unused on the P2P DL.

[0121] In the case of an exchange involving BTC for goods or tokens for goods, at least one transaction is spent on the P2P DL to transfer the value of the BTC or tokens. In this case, an invitation transaction offering up the goods may or may not be spent, as no value in the exchange (goods) is transferred by spending the invitation transaction. However, again, the parties may decide to spend the transaction nonetheless to provide a permanent record of the transfer (e.g., a sales receipt).

[0122] The amount spent in the above transaction may not represent the amount offered in some cases, especially if Alice's offer is for goods / services rather than Bitcoin or tokens. Instead, the service provider could require a "deposit" by Alice in an amount representing the value of the goods, or only a nominal amount if Alice can otherwise "guarantee" the offer; or (iii) the service provider itself could provide Bitcoin for Alice (who may not have any) and cover this funding cost by any means of charging the client a fee.

[0123] In the above-described embodiment, the user's invitation is published in the P2P DHT. In some embodiments, however, the user's invitation (e.g., the script and script hash) may be published on a website and sent directly to another user.

[0124] In some embodiments, a user's invitations may be stored locally by the service provider. For example, the service provider may host a private auction where only certain users have access to the details of the user's invitations.

[0125] It will be understood by those skilled in the art that many variations and / or modifications may be made to the above-described embodiments without departing from the broad general scope of the present disclosure, which embodiments are, therefore, to be considered in all respects as illustrative and not restrictive.

[0126] The steps, features, integers, mixtures and / or compounds are individually or collectively disclosed herein or indicated in the specification of this application, as are any and all combinations of two or more of the steps or features described above. [Explanation of symbols]

[0127] 100 P2P Exchange Systems 102 Network 200, 300 Flowchart 400 processes 600 Transaction flow diagram

Claims

1. 1. A computer-implemented method for embedding metadata in a blockchain transaction, the method comprising: generating a blockchain transaction (Tx) having a transaction output (TxO) relating to the digital asset (B1) and a hash of a redemption script; The blockchain transaction (Tx) is metadata including tokens that are representations or references of tokenized entities, the metadata being included in the redemption script; at least one public encryption key; The metadata further comprises: including one or more location conditions specifying that the transaction is broadcast only on a peer-to-peer distributed ledger (P2P DL); method.

2. The digital asset (B1) is an amount of virtual currency, and The virtual currency is Bitcoin. The method of claim 1.

3. The redemption script is included in a locking script of the transaction output (TxO). The method according to claim 1 or 2.

4. The metadata is provided within the redemption script at a location designated in a blockchain protocol as the location of a cryptographic key.

4. The method according to any one of claims 1 to 3.

5. The method further comprises: submitting the blockchain transaction (Tx) to a blockchain; 5. The method according to any one of claims 1 to 4.

6. The digital asset (B1) is spent upon providing an unlocking script that satisfies the requirements of the redemption script for the transaction output (TxO); The method of claim 5.

7. The tokenized entity is a contract and / or other entity associated with an exchange.

7. The method according to any one of claims 1 to 6.

8. The metadata is a description or keyword describing the offer or request in the invitation transaction.

8. The method according to any one of claims 1 to 7.

9. The invitation transaction further comprises: including deadlines that specify the time and / or date by which the order must be fulfilled; The method of claim 8.

10. The deadline condition does not automatically trigger payment of the cancelled transaction; 10. The method of claim 9.

11. The metadata further comprises: include one or more location conditions that specify that the transaction will only be broadcast on the P2P DL if the location of the transaction broadcast is within X meters of specified coordinates; 11. The method according to any one of claims 1 to 10.

12. The metadata further comprises: Includes a facility that allows users to create their own new conditions and add them to the list of conditions by assigning them to a previously unused condition code, 12. The method according to any one of claims 1 to 11.