Method for processing blockchain transactions
Patent Information
- Application Number
- PCT/EP2025/052632
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-05
- Filing Date
- 2025-02-03
- Publication Date
- 2025-10-02
AI Technical Summary
Existing blockchain explorers offer limited search functionality, making it difficult to efficiently identify and manage relevant transactions for storage and processing, especially as block sizes and transaction numbers increase.
The application of regular expressions to blockchain transactions allows for customizable and complex search criteria, enabling the selective identification and management of target data, such as transactions with specific patterns or formats, and initiating actions like storage or notification based on these criteria.
This approach reduces memory consumption and processing power by retaining only relevant transactions, enhances transaction tracking and storage efficiency, and supports advanced applications like improved analytics, compliance monitoring, and user-friendly interfaces.
Smart Images

Figure EP2025052632_02102025_PF_FP_ABST
Abstract
Description
[0001] METHOD FOR PROCESSING BLOCKCHAIN TRANSACTIONS
[0002] TECHNICAL FIELD
[0003] The present disclosure relates to a computer-implemented method of processing transactions broadcast to a blockchain network.
[0004] BACKGROUND
[0005] A block explorer, such as a “bitcoin explorer”, allows users to explore the contents of blocks and transactions on a blockchain. Many popular cryptocurrencies, like Bitcoin and Ethereum, have their own block explorers and these are normally web tools. For Bitcoin SV, a commonly used block explorer is WhatsOnChain (whatsonchain.com). The blockchain explorer typically offers users a limited set of search criteria for retrieving information from the blockchain. For example, the user can enter the block height or hash to retrieve information about a block, an address to view a balance and transaction history of a wallet, or a transaction ID (TxID) to find specific transactions. As a consequence of the limited search functionality available, it is typically only possible to search for transactions of which you are the author.
[0006] A regular expression, often abbreviated as regex or regexp, is a sequence of characters that forms a search pattern. It is tool used in computer science and programming for matching and manipulating strings. Regular expressions describe patterns within text data, allowing a user to search, match, and extract information from strings. Regular expressions can be built, tested and debugged using a regular expression tester, such as Regex101 (regex101.com).
[0007] With increasing block size and transaction numbers, keeping track of transactions requires ever expanding storage. Therefore, it is desirable to be able to identify those transactions that are relevant to a particular application, ensuring that only relevant transactions are retained for further processing, and / or storage. The invention is directed to the use of regular expressions for retrieving information regarding blockchain transactions and specific applications of this solution. SUMMARY OF INVENTION
[0008] According to a first aspect disclosed herein, there is provided a computer- implemented method of processing blockchain transactions, the method comprising: applying a regular expression to blockchain transactions to selectively identify target data meeting a search criterion defined by the regular expression; and initiating an action in response to identifying the target data.
[0009] In contrast to the limited search functionality offered by existing block explorers, application regular expressions enable more customisable and complex definition of search criteria including pattern matching. This provides numerous potential advantages depending on the application and the actions initiated. For example, the application of regular expressions can be used to identify those transactions that are relevant to a particular purpose, ensuring that only relevant transactions or data are retained for further processing, and / or storage.
[0010] Selectively identifying target data typically comprises filtering transactions to identify a subset of transactions for further processing in the following action. The action typically comprises: storing the target data in non-volatile memory, deleting the target data, and / or sending a notification to a user device. The target data may include the corresponding transaction data. The target data may therefore include one or more target transactions. Applications of the method include the searching or filtering of transactions for Ordinal outputs, other NFT-looking transactions, transactions with specific loT data formats or tags, and more.
[0011] Initiating an action preferably comprises extracting the target data, preferably from a block in the blockchain, and storing the extracted target data as a collection in a data file. The extracted target data may comprise the data matched using the regular expression, and / or the transaction(s) containing the matched data (also referred to herein as the “target transactions”). Typically, the extracted target data comprises the transaction(s) containing data meeting the search criterion. Each time target data is identified, the corresponding transactions may be added to a collection. The collection may effectively form a record of blockchain transactions having data meeting the search criterion. A local database can hence be formed comprising or consisting of the target data, without the remaining unwanted transaction data, which may comprise the rest of the blockchain. Efficiency gains can then be realised both in terms of reduced memory consumption for storing the data and reduced processing power for later accessing and manipulating this data. It may be advantageous to store the collection data file locally for the user or otherwise make it readily available to the user. Initiating an action may therefore comprise sending the data file to a user device or cloud storage accessible to a user device.
[0012] The blockchain transactions which are searched are typically received through the blockchain network and the recipient may form part of the network. The blockchain device carrying out the method may be connected to the blockchain network, typically engaging in peer-to-peer networking. The blockchain device carrying out the method may engage as a “node”, “full node” or “miner” in the network, engaging in propagation of transactions, mining, appending transactions to the blockchain and validating previous blocks, but typically will implement the peer-to-peer networking protocol without performing these roles. The blockchain device carrying out the method may receive the blocks broadcast on the blockchain network, each block containing transactions that have been published and deemed valid. The blockchain device may apply the regular expressions to each transaction that is received in this way.
[0013] Additionally or alternatively, initiating an action may comprise sending a notification to a user device. The user device may be operating a lightweight client in communication with the blockchain device (typically for transaction validation). The user may register the search criteria on the blockchain device, which monitors all broadcast transactions in the blockchain. Prior to applying the regular expression, the method may therefore further comprise a step of receiving the search criterion from the user device, the search criterion typically comprising a pattern for matching. In response to identifying target data meeting the search criteria, the blockchain node notifies the user accordingly, for example by electronic message such as by push notification or email. The regular expression is preferably applied to one or more transactions broadcast to the blockchain network, and preferably occurring on the blockchain, to selectively identify the target data. The regular expression may be applied to transactions or a subset thereof, irrespective of their state (e.g. it may be applied where the state of the transaction is: transmitted, transmitted by mutable peers, mined in a block or contained in a block that has been confirmed multiple times)
[0014] The method may be performed by a blockchain device that monitors all broadcast blocks and transactions in the blockchain network and applies the regular expression to the transactions in the newest block each time a new block is added to the blockchain.
[0015] The blockchain device may form an unspent transaction (UTXO) service provider. A user may register a regular expression with the UTXO service provider and when a transaction matches the search criterion, the service provider may send the user a notification and / or the corresponding transaction. Alternatively, or in addition, the blockchain device may store the transactions, or references to the transactions, that match the search criterion, which may be downloadable by the user. Moreover, the service provider can offer cloud storage to the user to store all the transactions that match the regular expression. The user can be a blockchain application provider, e.g., nChain Sign, a blockchain-based social media platform, a token issuer, or an overlay network provider / owner.
[0016] The regular expression may be constructed to retrieve and / or identify a different set of transactions than is possible using existing search functions available through block explorers. The regular expression applied may identify a plurality of target transactions by pattern matching. Selectively identifying target data may comprise applying the search criterion to different parts of the transactions, such as outputs, inputs or account / nonce / data section of transactions. The regular expression is preferably applied to transaction outputs, preferably still unspent transaction outputs, to selectively identify the target data.
[0017] For example, depending on the blockchain, arbitrary data can be embedded within a transaction , for example using a OP_RETURN script, which is an unspendable output of the transaction in BSV blockchain. The regular expression may be constructed to identify transactions based on the contents of the script, (e.g. the OP_RETURN script or NULL DATA script in the case of BTC blockchain). The target data preferably therefore resides in one or more target transactions having OP_RETURN script meeting the search criterion (typically specifying a pattern). The arbitrary data may relate to any form of data embedded within a transaction (and typically not required for transaction verification) and which the user may later need to reference. Initiating an action therefore typically comprises storing the target transactions in non-volatile memory.
[0018] In a preferred implementation, applying a regular expression comprises: identifying if a locking script is present in a transaction output; in response to identifying the locking script, identifying if the transaction identifying if a transaction is a coinbase transaction; and in response to identifying that the transaction is not a coinbase transaction, determining if the unlocking script for the transaction input matches the search criterion. Initiating an action may comprise one or more of the following: storing a transaction, storing a script_public_key for a transaction, storing part of a transaction that matches the regular expression or storing a transaction ID of the transaction.
[0019] It will be appreciated that the method may further comprise a step of tagging a transaction to make it easier to retrieve by using the regular expression. For example, the method may comprise generating a transaction comprising a tag embedded within the transaction, the tag meeting the search criterion. This step is typically performed by a different entity from that which is performing the searching / filtering function through application of the regular expression.
[0020] In some implementations it is desirable to track the descendants of previously identified target transactions, also referred herein to as “collection elements”. The method may further comprise: identifying if the inputs of the transactions include any of previous transaction hashes stored in memory (e.g. volatile or non-volatile); in response to identifying that the transaction input includes a previous transaction hash, initiating the action. The action may comprise placing the target data in a data file (optionally forming the collection earlier discussed) and / or any of the other actions previously described. These steps may be performed in the context of applying the regular expression. More generally, the method may comprise: identifying if a blockchain transaction is a descendent of a previously-identified transaction containing target data; and initiating a second action in response to identifying that the blockchain transaction is a descendent. Advantageously, because the descendants of the transactions in the collection are being tracked, it is not necessary to generate tags (or “special OP_RETURN scripts”) for the descendants. This reduces the total size of the transaction, thereby saving bandwidth and storage space required of the nodes in the blockchain network.
[0021] Further aspects of the invention will now be discussed. Each aspect may incorporate any of the features discussed in connection with the remaining aspects.
[0022] According to a second aspect, there is provided a device (typically 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 the first aspect.
[0023] According to a third aspect, there is provided a computer program embodied on computer-readable storage and configured so as, when run on one or more processors, to perform the method of the first aspect.
[0024] According to a fourth aspect, there is provided a system comprising: a first device according to the first aspect, a second device configured to perform one or more of the following: receive a notification from the first device when the first device identifies a transaction according to a pattern specified by the regular expression, receive a transaction from the first device when the device identifies a transaction according to the pattern, and / or generate a pattern forming the regular expression and provide the regular expression to the first device such that the first device is then configured to watch for a transaction that matches said pattern. In a particularly desirable implementation, the blockchain device implements an UTXO as a Service (UaaS) function. For example, the system may be configured wherein the first device is a blockchain device implementing a peer-to-peer networking protocol for broadcasting blockchain transactions across a blockchain network; the first device receives a pattern forming the regular expression from the second device; the first device is configured to apply to the regular expression to transactions and / or subsets of transactions in the newest block each time a new block is added to the blockchain; the first device is configured to store transactions or references to transactions identified by the regular expression in a collection of transactions; and the first device provides the collection of transactions to the second device. The second device may be a user device and may hence be provided with access to target transactions of interest matching the specified criterion, without receiving, processing or storing additional unwanted data from the blockchain.
[0025] BRIEF DESCRIPTION OF DRAWINGS
[0026] 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:
[0027] Figure 1 is a schematic block diagram of a system for implementing a blockchain;
[0028] Figure 2 schematically illustrates some examples of transactions which may be recorded in a blockchain;
[0029] Figure 3 schematically illustrates the application of regular expressions to transactions in accordance with an embodiment of the invention;
[0030] Figure 4 schematically illustrates an example of the application of a regular expressions in accordance with an embodiment of the invention; and
[0031] Figures 5a and 5b provide code extracts exemplifying transaction classification rules. DETAILED DESCRIPTION OF EMBODIMENTS
[0032] 1. INVENTION SPECIFIC MATERIAL
[0033] Embodiments of the invention will now be discussed with reference to Figures 3, 4, 5a and 5b.
[0034] Transaction data is received by a blockchain device that is in communication with other blockchain devices (“peers”, which could be miners) through a peer-to-peer messaging protocol (the blockchain network), wherein peers transmit messages across the network including the latest transactions to be added to the blockchain. Typically, the blockchain device will receive broadcast blocks on the blockchain network, which contain transactions validated by nodes in the network and subsequently appended to the blockchain. In this way, the blockchain device is a peer in the network, but typically does not act as a miner, node or full node, i.e. does not carry out mining, validation, or appending transactions to the blockchain.
[0035] In an alternative embodiment, the transaction data can be obtained using a block explorer API through specific endpoints that return data in a structured format, typically JSON. For example, the method may involve retrieving from the API all transaction data from the latest block added to the blockchain or a series of blocks within a predefined range of timestamps. This transaction data may then be stored in memory.
[0036] Regular expressions can be constructed to act on any part of a blockchain transaction and to identify virtually any matching pattern in the data. The regular expressions can be applied to individual transactions, regardless of their state (e.g. where the state is transmitted, transmitted by mutable peers, mined in a block or in a block that has been confirmed multiple times). For example, a regular expression may be used to identify the presence of a particular string in an OP_RETURN script (or equivalent), commonly used to append arbitrary additional data to transactions on a blockchain, such as the BSV blockchain. This may take the form of detecting an OP_RETURN field prefaced with a known string, allowing identification of transactions marked in this way. Application of the regular expressions to the transaction data identifies target data meeting a search criterion defined by the regular expression. Having identified the target data meeting the search criterion, a subsequent action is taken depending on the circumstances. In some examples, the user may wish to be immediately notified of a particular class of transaction that is important to them. The regular expression may be used to match transactions with a particular public key hash in an output of the transaction, the public key chosen being of particular significance to the user. In this case, the subsequent action may be the notification of the user via push notifications, API calls, RPC calls, email, SMS, or other means. In some examples, the user will be sent the transaction.
[0037] In other examples, the user may wish to store all transactions meeting a particular search criterion for download in future. This saves the user from having to download, verify and actively filter the entire blockchain, using vast amounts of network bandwidth, local storage and computation. In this case, the subsequent action may comprise storing the transaction, or a reference to the transaction, in a collection of transactions for future processing. The future processing may comprise downloading by the user, or the provision of statistics or information about the collection of transactions to the user.
[0038] It is envisaged that the invention provides numerous potential advantages depending on the application and the actions initiated. For example, for companies involved in blockchain transactions, the flexible searches can streamline accounting and auditing processes, reducing the time and cost involved in tracking and reconciling transactions. The improved searching can also enable improved analytics for blockchain transactions, allowing for deeper data analysis and trend identification, aiding in market predictions and investment strategies. Regulatory bodies, compliance departments in financial institutions and law enforcement agencies can use the enhanced search tools to the improved searching to aid in monitoring transactions for anti-money laundering (AML) and know your customer (KYC) compliance, detecting fraudulent activities more efficiently. Regular users and investors in blockchain can benefit from a user- friendly search interface with flexible criteria to make it easier to track their transactions and understand their history. It is also envisaged that access to more granular blockchain data, retrieved through the use of regular expressions, can inspire the development of new financial products and services, such as tailored risk assessment tools or personalized investment advice. Researchers may also gain deeper insights into blockchain technology and its uses, potentially leading to technological improvements and innovations. Moreover, the general public and participants in the blockchain ecosystem will benefit from greater transparency in transactions, which enhances trust in the blockchain system, contributing to its stability and long-term viability.
[0039] An example of a process for applying regular expressions to blockchain transactions is illustrated in Figure 3. Transaction data 301 (referred to in Figure 3 as “Block_Tx”), for example corresponding to all transactions occurring within a specified block on the blockchain, is entered into an application 302 (referred to in Figure 3 as “Transaction_UTXO_Regex”). The application 302 may be hosted by a blockchain device in communication with nodes in the blockchain network. The role of the application 302 is to provide a mechanism to filter transactions, ensuring that only relevant transactions are retained for further processing, and / or storage. The application 302 applies search criteria or rules in the form of a regular expression (referred to in Figure 3 as the “classification_rules”) to the transaction data 301 using the classification_engine within the application 302. The application 302 can operate on blocks (containing many transactions) or individual transactions. Typically, the regular expressions are applied to each transaction in the newest block each time a new block is added to the chain. The blockchain device may be implementing an UTXO as a Service (UaaS) function and configured to carry out an action each time a matching pattern is found. Following application of the regular expression, any target data meeting the pattern specified by the regular expression is identified and the corresponding transaction(s) including this target data (referred to herein as “target transaction(s)”) are classified into a respective or common collection. A subsequent action is then taken, which in this case involves storing the collection (referred to in Figure 3 as “interesting_txs”) as a data file 303 (referred to in Figure 3 as “collection_n”) in non-volatile memory , e.g. locally. One or more additional actions may be taken, such as notifying a user device that one or more transactions have been identified having target data satisfying the search criterion set by the regular expression. For example, this notification may be sent by a push message across a telecommunications network or by email.
[0040] The application 302 may have dynamically loadable rules for placing transactions into particular collections. For example, a user (such as a UTXO service provider) may register one or more search criteria using the application and change the search criteria over time. Figure 4 provides an example of a process the application 302 may apply to each transaction to classify transactions and identify the target data. This process may be used in combination with one or more other processes to selectively identify the target data matching one or more regular expressions applied. In the present embodiment the entire transaction is stored each time a match is found however alternatively the application may, for example, store only the script_public_key for the transaction, part of the transaction or the transaction ID if a match is found. Each time the process terminates it is repeated on a subsequent transaction.
[0041] Transaction data 401 is initially received, for example in a peer -to-peer serialised format. A first pattern match process is then applied to the transaction outputs to form a collection.
[0042] In one example, a single transaction in the transaction data comprises a “struct” or “record” format, with multiple pieces of independent data concatenated together. This may take the form of data of known length, such as a 32-bit integer version number or a 32-bit number of inputs. A transaction is also able to contain data of variable length, such as the scripts attached to inputs and outputs of the transaction. In these cases, in this example, the format also contains a length, of known size, of any variable-size field. In this way, it is possible to calculate the total size of the transaction, and therefore to navigate from one transaction to the next in the transaction data.
[0043] In particular, at step 402, if a script_public_key regular expression pattern is present, then the application 302 proceeds to check that the transaction script_public_key (also known as the locking script) matches a pattern set by a regular expression. It is at this stage that target data that is embedded within a transaction using an OP_RETURN script may be identified. In particular, the regular expression may be constructed to identify transactions based on the contents of the OP_RETURN script. This may include identifying particular tokens or NFTs included to a transaction. Transactions having a matching script_public_key are extracted and stored as a collection at step 403.
[0044] At step 404, an optional filtering step is applied to the transaction data 401 to exclude any coinbase transactions. For example, a coinbase transaction may be identified as the first transaction in the block. If the transaction is a coinbase transaction then the process terminates. If the transaction is determined to not be a coinbase transaction, a pattern match process is applied to the transaction inputs. Similarly to the other pattern match, if a match is found, the transaction data is stored in the collection. At step 405, a regular expression is applied to the transaction inputs to first determine if a script_signature regular expression pattern is present, then check that the transaction script_public_key (also known as the unlocking script) matches that pattern. If the transaction has a matching script_public_key, it is stored in the collection at step 406.
[0045] At step 407, an optional step is undertaken to determine whether the transaction data 401 spends a transaction which is already present in the collection of transactions. Preferably, step 407 is conducted by obtaining the TxlD(s) of the inputs of the transaction data 401 , and comparing them to the TxIDs of the transaction data already stored in the collection. Preferably, any descendant transactions are also stored in the transaction collection.
[0046] As will be discussed in relation to Figure 5b, obtaining transactions which directly relate to a previously identified transaction of importance allows the operators or users of the UaaS greater flexibility in their transaction construction, as well as reducing the need for further tags, thereby reducing transaction size and reducing total network bandwidth requirements on a blockchain network. The flexibility is achieved by enabling relevant transactions to be captured without needing the specific tags to be included on the inputs or outputs of the spending transaction. Examples of transaction classification rules are shown in Figures 5a and 5b. Any format could be used to specify the classification rules. In this example we have used TOML file format, as this format is widely supported and provides arrays of configuration and comments. Note that one service can support many rules (or collections). Figure 5a is a first example of a classification rule in TOML that captures all Pay to Public key hash (P2PKH) transactions. Here the regular expression is defined by the locking_script_pattern 76a9 i 4 [ o-9a-f ] { 40 } 88 ac and may be applied at step 402 of the method in Figure 4. Note that each collection is defined in double square brackets '[[]]'. Each collection section may have the following fields:
[0047] • name - the name of the collection, the service will create a table with this name and store collection matching transaction in it;
[0048] • locking_script_pattern - a regular expression that identifies the locking script that defines the transactions of interest;
[0049] • track descendants - a flag to indicate if decedent transactions should also be captured; and optionally
[0050] • unlocking_script_pattern - a regular expression that identifies the unlocking script that defines the transactions of interest
[0051] Figure 5b is a second example of a classification rule in TOML. Figure 5b refers a configuration for an example use case where the spending status of a UTXO is used to impart a further information. The example use case is called Certificate on Chain, also known as “CoCvl”. In Certificate on Chain, a first certificate transaction is constructed which comprises a spendable output ( / .e. a non- OP_RETURN output) and an OP_RETURN output. The OP_RETURN output comprises the OP_0 and OP_RETURN op codes, an optional length, an ASCII encoded version of “CoCvl” (where C = 43, o = 6f, v = 76, and 1 = 31), and finally any certificate data. This example encoding can be considered a form of length- type-value encoding. The certificate data can comprise the certificate itself, a URL to the certificate, an id associated with the certificate, and / or any other metadata associated with the certificate.
[0052] The “locking_script_pattern” of Figure 5b shows a regex pattern to match the specific OP_RETURN output discussed above. As can be seen, the 006a matches OP_0 OP_RETURN; the [0-9a-f]{2} matches a length of up to 2 characters long; the 436f437631 matches ASCII encoded “CoCvl”, and [0-9a-f]* matches any data following on after the CoCvl tag.
[0053] The spending status of the spendable output is used to signify whether the certificate referenced or comprised in the OP_RETURN output is valid. Thus, it is the presence of descendants of the first certificate transaction which indicate the validity of the certificate. In some examples, the UaaS provides a “track descendants” configuration option.
[0054] A user wanting to revoke, invalidate, or otherwise expire the certificate referenced in the first certificate transaction, the user (or other party enabled to revoke certificates) constructs a second certificate transaction which spends the spendable output of the first certificate transaction. When the second certificate transaction is on-chain (i.e. is a valid transaction appended to the blockchain), the certificate is considered invalid.
[0055] Here, the TOML file has “track_descendants” set to “true”. With this set to true, step 407 is conducted when the method of Figure 4 is conducted.
[0056] By way of example, the following paragraphs provide examples of how the UaaS (as described with reference to Figure 4) can be used with the above described Certificate on Chain system.
[0057] A UaaS is setup using at least the “[[collection]]” of Figure 5b such that the UaaS is now configured to apply the locking_script_pattern regex on all transactions received. Additionally, the UaaS is configured to track any transactions which are descendants of those already stored in the collection. A certificate management system creates a certificate for a first user. The certificate is stored on an internal system and is referred to using an UUID. The certificate management system creates a first certificate transaction similar to that as described above, such that the first certificate transaction comprises a spendable output and an OP_RETURN output. The OP_RETURN output comprises a “CoCvl” tag and the UUID of the relevant certificate. The first certificate transaction is submitted to the blockchain for mining into the next block.
[0058] The UaaS obtains the first certificate transaction. The UaaS optionally obtains the first certificate transaction from a node in the network through use of its own P2P interface, or by obtaining a newly mined block, or any other method. With the transaction obtained (see step 401), the outputs are checked (step 402). Because the certificate management system constructed the OP_RETURN output in accordance with the regex pattern of Figure 5a, the step 402 returns true and the first certificate transaction is stored in the collection.
[0059] Sometime later, the certificate needs to be revoked. Optionally, the certificate management system constructs a second certificate transaction which spends the spendable output of the first certificate transaction. The second certificate transaction is submitted for mining into a block. The UaaS obtains second certificate transaction and processes it according to the method of Figure 4. Step 402 returns False, because the second certificate transaction comprises no OP_RETURN outputs as set out in the “locking_script_pattern”. The second certificate transaction is not a coinbase transaction, so we continue to step 405. Step 405 is False because there is no script_sig_pattern to match against from the TOMLfile. Finally, because track_descendants is true, step 407 is conducted. The TxIDs referenced in the inputs second certificate transaction are extracted and the collection of previously stored transactions are scanned to determine whether there is a match. In this case, there is a match with the first certificate transaction. Thus, the second certificate transaction is stored in the collection. Optionally, if parties are subscribed to notifications of this collection being updated, they are sent such a notification. Advantageously, because the descendants of the transactions in the collection (i.e. transactions which have already been identified as of interest to an operator or user of the UaaS) are being tracked, no special OP_RETURN outputs are needed, or similar for the second / following certificate transactions. This reduces the total size of the transaction, thereby saving bandwidth and storage space required of the nodes in the blockchain network.
[0060] In each instance that a collection is formed, a subsequent action is taken which depends on the application. Typically the collection is stored in memory, either locally within the device hosting the application 302, uploaded to cloud storage or transmitted to a user device. A user device may also be notified that target data has also been identified and that the collection is available to view.
[0061] An advantage of the system(s) and method(s) described herein is the ability for any UaaS operator to monitor for transactions they may not know the exact final format and / or transaction ID of. Traditionally, without such a UaaS system, users wishing to track transactions need to know the transaction ID, block height, block id, and / or SPV proof of a transaction of interest. This is usually not a problem if you are only interested in the transactions you yourself have generated, because you can determine the transaction ID of your own transactions and the transaction IDs should not change between you submitting it to the blockchain network, and the transaction appearing in a subsequently mined block.
[0062] If you are interested in a third parties transactions however, usually extra communication is required with said third party to obtain the transaction IDs of their transactions (thereby enabling you to look them up using the traditional methods mentioned above).
[0063] Advantageously, UaaS as described herein skips this need for transaction ID transmission between different devices, as the specific tags are able to get searched for using specific pattern matching rules instead.
[0064] Further, in general, in order to be aware of all transactions matching their specified criterion, the user must maintain a copy of the blockchain and a connection to the blockchain network, in order to receive broadcasts of new blocks and transactions. In this way, the user receives a large volume of data which does not correspond to their interests, which must be downloaded, processed, filtered, and discarded. The method described herein allows a user to receive only the transactions they are interested in, thus requiring less bandwidth, storage and computational power than methods known in the art.
[0065] 2. EXAMPLE SYSTEM OVERVIEW
[0066] 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.
[0067] 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.
[0068] 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. 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 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.
[0069] In such a model, when the second 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 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.
[0070] 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.
[0071] Figure 1 shows an example system 100 for implementing a blockchain 150. The system 100 may comprise a packet-switched network 101 , typically a wide-area internetwork such as the Internet. The packet-switched network 101 comprises a plurality of blockchain nodes 104 (often referred to as “miners”) that may be arranged to form a peer-to-peer (P2P) network 106 within the packet-switched network 101 . Whilst not illustrated, the blockchain nodes 104 may be arranged as a near-complete graph. Each blockchain node 104 is therefore highly connected to other blockchain nodes 104.
[0072] 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.
[0073] 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.
[0074] A blockchain node 104 may be configured to forward transactions 152 to other blockchain nodes 104, and thereby cause transactions 152 to be propagated throughout the network 106. A blockchain node 104 may be configured to create blocks 151 and to store a respective copy of the same blockchain 150 in their respective memory. A blockchain node 104 may also maintain an ordered set (or “pool”) 154 of transactions 152 waiting to be incorporated into blocks 151. The ordered pool 154 is often referred to as a “mempool”. This term herein is not intended to limit to any particular blockchain, protocol or model. It refers to the ordered set of transactions which a node 104 has accepted as valid and for which the node 104 is obliged not to accept any other transactions attempting to spend the same output.
[0075] In a given present transaction 152j, the (or each) input comprises a pointer referencing the output of a preceding transaction 152i in the sequence of transactions, specifying that this output is to be redeemed or “spent” in the present transaction 152j. Spending or redeeming does not necessarily imply transfer of a financial asset, though that is certainly one common application. More generally spending could be described as consuming the output, or assigning it to one or more outputs in another, onward transaction. In general, the preceding transaction could be any transaction in the ordered set 154 or any block 151. The preceding transaction 152i need not necessarily exist at the time the present transaction 152j is created or even sent to the network 106, though the preceding transaction 152i will need to exist and be validated in order for the present transaction to be valid. Hence “preceding” herein refers to a predecessor in a logical sequence linked by pointers, not necessarily the time of creation or sending in a temporal sequence, and hence it does not necessarily exclude that the transactions 152i, 152j be created or sent out-of-order (see discussion below on orphan transactions). The preceding transaction 152i could equally be called the antecedent or predecessor transaction. Due to the resources involved in transaction validation and publication, typically at least each of the blockchain nodes 104 takes the form of a server comprising one or more physical server units, or even whole a data centre. However in principle any given blockchain node 104 could take the form of a user terminal or a group of user terminals networked together.
[0076] 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.
[0077] Any given blockchain node may be configured to perform one or more of the following operations: validating transactions, storing transactions, propagating transactions to other peers, performing consensus (e.g. proof-of-work) I mining operations. In some examples, each type of operation is performed by a different node 104. That is, nodes may specialise in particular operation. For example, a nodes 104 may focus on transaction validation and propagation, or on block mining. In some examples, a blockchain node 104 may perform more than one of these operations in parallel. Any reference to a blockchain node 104 may refer to an entity that is configured to perform at least one of these operations.
[0078] 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.
[0079] 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.
[0080] 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.
[0081] 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.
[0082] 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.
[0083] 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.
[0084] An alternative type of transaction protocol operated by some blockchain networks may be referred to as an “account-based” protocol, as part of an account-based transaction model. In the account-based case, each transaction does not define the amount to be transferred by referring back to the UTXO of a preceding transaction in a sequence of past transactions, but rather by reference to an absolute account balance. The current state of all accounts is stored, by the nodes of that network, separate to the blockchain and is updated constantly. In such a system, transactions are ordered using a running transaction tally of the account (also called the “position” or “nonce”). This value is signed by the sender as part of their cryptographic signature and is hashed as part of the transaction reference calculation. In addition, an optional data field may also be signed the transaction. This data field may point back to a previous transaction, for example if the previous transaction ID is included in the data field.
[0085] Some account-based transaction models share several similarities with the output-based transaction model described herein. For example, as mentioned above, the data field of an account-based transaction may point back to a previous transaction, which is equivalent to the input of an output-based transaction which references an outpoint a previous transaction. Thus both models enable linking between transactions. As another example, an account-based transaction contains a “recipient” field (in which a receiving address of an account is specified) and a “value” field (in which an amount of digital asset may be specified). Together the recipient and value fields are equivalent to the output of an output-based transaction which may be used to assign an amount of digital asset to a blockchain address. Similarly, an account-based transaction has a “signature” field which includes a signature for the transaction. The signature is generated using the sender's private key and confirms the sender has authorized this transaction. This is equivalent to an input I unlocking script of an output-based transaction which, typically, includes a signature for the transaction. When both types of transaction are submitted to their respective blockchain networks, the signatures are checked to determine whether the transaction is valid and can be recorded on the blockchain. On an account-based blockchain, a “smart contact” refers to a transaction that contains a script configured to perform one or more actions (e.g. send or “release” a digital asset to a recipient address) in response to one or more inputs (provided by a transaction) meeting one or more conditions defined by the smart contact’s script. The smart contract exists as a transaction on the blockchain, and can be called (or triggered) by subsequent transactions. Thus, in some examples, a smart contract may be considered equivalent to a locking script of an output-based transaction, which can be triggered by a subsequent transaction, and checks whether one or more conditions defined by the locking script are met by the input of the subsequent transaction.
[0086] 3. UTXO-BASED MODEL
[0087] 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.
[0088] 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.
[0089] Say Alice 103a wishes to create a transaction 152j transferring an amount of the digital asset in question to Bob 103b. In Figure 2 Alice’s new transaction 152j is labelled “Tx1”. It takes an amount of the digital asset that is locked to Alice in the output 203 of a preceding transaction 152i in the sequence, and transfers at least some of this to Bob. The preceding transaction 152i is labelled “TxO” in Figure 2. TxO and Tx1 are just arbitrary labels. They do not necessarily mean that TxO is the first transaction in the blockchain 151 , nor that Tx1 is the immediate next transaction in the pool 154. Tx1 could point back to any preceding (i.e. antecedent) transaction that still has an unspent output 203 locked to Alice.
[0090] 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.
[0091] 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.
[0092] The locking script (aka scriptPubKey) is a piece of code written in the domain specific language recognized by the node protocol. A particular example of such a language is called “Script” (capital S) which is used by the blockchain network. The locking script specifies what information is required to spend a transaction output 203, for example the requirement of Alice’s signature. Locking scripts appear in the outputs of transactions. The unlocking script (aka scriptSig) is a piece of code written the domain specific language that provides the information required to satisfy the locking script criteria. For example, it may contain Bob’s signature. Unlocking scripts appear in the input 202 of transactions.
[0093] So in the example illustrated, UTXOO in the output 203 of TxO comprises 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 Tx1 comprises a pointer pointing back to Tx1 (e.g. by means of its transaction ID, TxIDO, which in embodiments is the hash of the whole transaction TxO). The input 202 of Tx1 comprises an index identifying UTXOO within TxO, to identify it amongst any other possible outputs of TxO. The input 202 of Tx1 further comprises an unlocking script <Sig PA> which comprises a cryptographic signature of Alice, created by Alice applying her private key from the key pair to a predefined portion of data (sometimes called the “message” in cryptography). The data (or “message”) that needs to be signed by Alice to provide a valid signature may be defined by the locking script, or by the node protocol, or by a combination of these.
[0094] When the new transaction Tx1 arrives at a blockchain node 104, the node applies the node protocol. This comprises running the locking script and unlocking script together to check whether the unlocking script meets the condition defined in the locking script (where this condition may comprise one or more criteria).
[0095] 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.
[0096] Typically an input of a transaction contains a digital signature corresponding to a public key PA. In embodiments this is based on the ECDSA using the elliptic curve secp256k1. A digital signature signs a particular piece of data. In some embodiments, for a given transaction the signature will sign part of the transaction input, and some or all of the transaction outputs. The particular parts of the outputs it signs depends on the SIGHASH flag. The SIGHASH flag is usually a 4-byte code included at the end of a signature to select which outputs are signed (and thus fixed at the time of signing).
[0097] 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.
[0098] 4. FURTHER REMARKS
[0099] 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.
[0100] 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.
[0101] 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).
[0102] 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.
[0103] 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.
[0104] Some embodiments have been described in terms of the blockchain network implementing a proof-of-work consensus mechanism to secure the underlying blockchain. However proof-of-work is just one type of consensus mechanism and in general embodiments may use any type of suitable consensus mechanism such as, for example, proof-of-stake, delegated proof-of-stake, proof-of-capacity, or proof-of-elapsed time. As a particular example, proof-of-stake uses a randomized process to determine which blockchain node 104 is given the opportunity to produce the next block 151. The chosen node is often referred to as a validator. Blockchain nodes can lock up their tokens for a certain time in order to have the chance of becoming a validator. Generally, the node who locks the biggest stake for the longest period of time has the best chance of becoming the next validator.
[0105] 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.
[0106] Statement 1. A computer-implemented method of processing blockchain transactions, the method comprising: applying a regular expression to blockchain transactions to selectively identify target data meeting a search criterion defined by the regular expression; and initiating an action in response to identifying the target data. Statement 2. A method according to statement 1 , wherein initiating an action comprises extracting the target data, preferably from a block in the blockchain, and storing the extracted target data as a collection in a data file.
[0107] Statement 3. A method according to statement 2, wherein the extracted target data comprises the transaction(s) containing data meeting the search criterion.
[0108] Statement 4. A method according to statements 2 or 3, wherein the collection forms a record of transactions having target data meeting the search criterion.
[0109] Statement 5. A method according to any of statements 2 to 4, wherein initiating an action further comprises sending the data file to a user device or cloud storage accessible to a user device.
[0110] Statement 6. A method according to any of the preceding statements, wherein initiating an action comprises sending a notification to a user device.
[0111] Statement 7. A method according to statements 5 or 6, wherein the method is performed by a blockchain device implementing a peer-to-peer networking protocol for broadcasting blockchain transactions across a blockchain network, and wherein the user device is operating a lightweight client in communication with the blockchain node for transaction validation.
[0112] Statement 8. A method according to any of the preceding statements, wherein the method is performed by a blockchain device implementing a peer-to-peer networking protocol for broadcasting blockchain transactions across a blockchain network.
[0113] Statement 9. A method according to any of the preceding statements, wherein the regular expression is applied to transactions and / or a subset thereof to selectively identify the target data.
[0114] Statement 10. A method according to any of the preceding statements, wherein the regular expression is applied to transactions and / or subsets of transactions in the newest block each time a new block is added to the blockchain. Statement 11 . A method according to any of the preceding statements, wherein the regular expression is applied to one or more transactions broadcast to the blockchain network, and preferably occurring on the blockchain, to selectively identify the target data.
[0115] Statement 12. A method according to any of the preceding statements, wherein the regular expression is applied to inputs / outputs and / or account / nonce / data section of transactions to selectively identify the target data.
[0116] Statement 13. A method according to any of the preceding statements, wherein the regular expression is applied to transactions outputs to selectively identify the target data.
[0117] Statement 14. A method according to any of the preceding statements, wherein the regular expression is applied to unspent transactions outputs to selectively identify the target data.
[0118] Statement 15. A method according to any of the preceding statements, wherein the target data resides in one or more target transactions having OP_RETURN script meeting the search criterion.
[0119] Statement 16. A method according to statement 15, wherein initiating an action comprises storing the target transactions in non-volatile memory.
[0120] Statement 17. A method according to any of the preceding statements, wherein applying a regular expression comprises: identifying if a locking script is present in a transaction output; in response to identifying the locking script, identifying if the transaction identifying if a transaction is a coinbase transaction; and in response to identifying that the transaction is not a coinbase transaction, determining if the unlocking script for the transaction input matches the search criterion.
[0121] Statement 18. A method according to any of the preceding statements, further comprising the steps of: identifying if the inputs of the transactions include any of previous transaction hashes stored in memory; and in response to identifying that the transaction input includes a previous transaction hash, initiating the action.
[0122] Statement 19. A method according to any of the preceding statements, wherein initiating an action comprises one or more of the following: storing a transaction, storing a script_public_key for a transaction, storing part of a transaction that matches the regular expression or storing a transaction ID of the transaction.
[0123] Statement 20. A method according to any of the preceding statements, further comprising: identifying if a blockchain transaction is a descendent of a previously- identified transaction containing target data; and initiating a second action in response to identifying that the blockchain transaction is a descendent.
[0124] Statement 21 . A method according to any of the preceding statements, further comprising generating a transaction comprising a tag embedded within the transaction, the tag meeting the search criterion.
[0125] Statement 22. A device 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 the preceding statements.
[0126] Statement 23. 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 21 .
[0127] Statement 24. A system comprising: a first device according to statement 22; and a second device configured to perform one or more of the following: receive a notification from the first device when the first device identifies a transaction according to a pattern specified by the regular expression, receive a transaction from the first device when the device identifies a transaction according to the pattern, and / or generate a pattern forming the regular expression and provide the regular expression to the first device such that the first device is then configured to watch for a transaction that matches said pattern.
[0128] Statement 25. A system according to statement 24, wherein: the first device is a blockchain device implementing a peer-to-peer networking protocol for broadcasting blockchain transactions across a blockchain network; the first device receives a pattern forming the regular expression from the second device; the first device is configured to apply to the regular expression to transactions and / or subsets of transactions in the newest block each time a new block is added to the blockchain; the first device is configured to store transactions or references to transactions identified by the regular expression in a collection of transactions; and the first device provides the collection of transactions to the second device.
Claims
CLAIMS1. A computer-implemented method of processing blockchain transactions, the method comprising: applying a regular expression to blockchain transactions to selectively identify target data meeting a search criterion defined by the regular expression; and initiating an action in response to identifying the target data.
2. A method according to claim 1 , wherein initiating an action comprises extracting the target data, preferably from a block in the blockchain, and storing the extracted target data as a collection in a data file.
3. A method according to claim 2, wherein the extracted target data comprises the transaction(s) containing data meeting the search criterion.
4. A method according to claims 2 or 3, wherein the collection forms a record of transactions having target data meeting the search criterion.
5. A method according to any of claims 2 to 4, wherein initiating an action further comprises sending the data file to a user device or cloud storage accessible to a user device.
6. A method according to any of the preceding claims, wherein initiating an action comprises sending a notification to a user device.
7. A method according to claims 5 or 6, wherein the method is performed by a blockchain device implementing a peer-to-peer networking protocol for broadcasting blockchain transactions across a blockchain network, and wherein the user device is operating a lightweight client in communication with the blockchain node for transaction validation.
8. A method according to any of the preceding claims, wherein the method is performed by a blockchain device implementing a peer-to-peer networking protocol for broadcasting blockchain transactions across a blockchain network.
9. A method according to any of the preceding claims, wherein the regular expression is applied to transactions and / or a subset thereof to selectively identify the target data.
10. A method according to claims 8 and 9, wherein the regular expression is applied to transactions and / or subsets of transactions in the newest block each time a new block is added to the blockchain.
11. A method according to any of the preceding claims, wherein the regular expression is applied to one or more transactions broadcast to the blockchain network, and preferably occurring on the blockchain, to selectively identify the target data.
12. A method according to any of the preceding claims, wherein the regular expression is applied to inputs / outputs and / or account / nonce / data section of transactions to selectively identify the target data.
13. A method according to any of the preceding claims, wherein the regular expression is applied to transaction outputs to selectively identify the target data.
14. A method according to any of the preceding claims, wherein the regular expression is applied to unspent transactions outputs to selectively identify the target data.
15. A method according to any of the preceding claims, wherein the target data resides in one or more target transactions having OP_RETURN script meeting the search criterion.
16. A method according to claim 15, wherein initiating an action comprises storing the target transactions in non-volatile memory.
17. A method according to any of the preceding claims, wherein applying a regular expression comprises: identifying if a locking script is present in a transaction output; in response to identifying the locking script, identifying if the transaction identifying if a transaction is a coinbase transaction; andin response to identifying that the transaction is not a coinbase transaction, determining if the unlocking script for the transaction input matches the search criterion.
18. A method according to any of the preceding claims, further comprising the steps of: identifying if the inputs of the transactions include any of previous transaction hashes stored in memory; and in response to identifying that the transaction input includes a previous transaction hash, initiating the action.
19. A method according to any of the preceding claims, wherein initiating an action comprises one or more of the following: storing a transaction, storing a script_public_key for a transaction, storing part of a transaction that matches the regular expression or storing a transaction ID of the transaction.
20. A method according to any of the preceding claims, further comprising: identifying if a blockchain transaction is a descendent of a previously- identified transaction containing target data; and initiating a second action in response to identifying that the blockchain transaction is a descendent.
21. A method according to any of the preceding claims, further comprising generating a transaction comprising a tag embedded within the transaction, the tag meeting the search criterion.
22. A device 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 the preceding claims.
23. 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 21.
24. A system comprising: a first device according to claim 22; and a second device configured to perform one or more of the following: receive a notification from the first device when the first device identifies a transaction according to a pattern specified by the regular expression, receive a transaction from the first device when the device identifies a transaction according to the pattern, and / or generate a pattern forming the regular expression and provide the regular expression to the first device such that the first device is then configured to watch for a transaction that matches said pattern.
25. A system according to claim 24, wherein: the first device is a blockchain device implementing a peer-to-peer networking protocol for broadcasting blockchain transactions across a blockchain network; the first device receives a pattern forming the regular expression from the second device; the first device is configured to apply to the regular expression to transactions and / or subsets of transactions in the newest block each time a new block is added to the blockchain; the first device is configured to store transactions or references to transactions identified by the regular expression in a collection of transactions; and the first device provides the collection of transactions to the second device.