Indexing Structure for Blockchain Ledgers
By using an index structure on the blockchain ledger to separate critical and non-critical queries, the issue of phantom read errors is resolved, improving performance and enabling concurrent smart contract execution.
Patent Information
- Application Number
- JP2022544157
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-01-23
- Filing Date
- 2021-01-12
- Publication Date
- 2024-09-11
- Estimated Expiration
- 2041-01-12
AI Technical Summary
Blockchain systems face performance issues due to phantom read errors during non-critical range queries, which can lead to transaction failures and hinder concurrent execution of smart contracts.
Implementing an index structure, such as a binary tree, on top of the blockchain ledger to separate critical and non-critical queries, allowing peers to read non-critical queries directly from the index structure, thereby avoiding phantom read errors.
This approach enhances chaincode performance by enabling concurrent smart contract execution and improves transaction throughput by preventing rejections due to non-critical phantom read errors.
Smart Images

Figure 0007549426000018 
Figure 0007549426000005 
Figure 0007549426000022
Abstract
Description
[Technical field]
[0001] The present application relates generally to storing data via a blockchain, and more particularly to an index structure that can store key values from a blockchain ledger and be accessed for non-critical queries, thereby reducing phantom data items. [Background technology]
[0002] A centralized database stores and maintains data in a single database in one location (e.g., a database server). This location is often a central computer, such as a desktop central processing unit (CPU), a server CPU, or a mainframe computer. Information stored in a centralized database is typically accessible from several different points. Multiple users or client workstations can work simultaneously on the centralized database, for example, based on a client / server configuration. Centralized databases are easier to manage, maintain, and control, especially for security purposes, because of their single location. Within a centralized database, data redundancy is minimized, since the single storage location of all data also implies that a given set of data has one primary record.
[0003] Blockchain systems, on the other hand, store data in an immutable ledger, provide distributed and decentralized access to the immutable ledger through non-trusted participants, establish consensus requirements for agreement among non-trusted participants so that no entity can modify the immutable ledger without agreement from the other entities, can also invoke smart contracts, etc. Blockchains are formed by a network of participants who agree to add blocks (including the data to be stored therein) to the immutable ledger. Before a block is added, it is linked to the previous block on the immutable ledger, thereby forming a chain. This immutable and timeless nature of blockchains makes them safe from tampering and hacking. The decentralized nature also offers the inherent quality of being trustless in that parties do not need to establish trust before they can transact securely. Through blockchains, new and improved opportunities for data storage, communication and security are emerging. Summary of the Invention
[0004] One example embodiment provides an apparatus including: storage configured to store an index structure including an index of keys from a blockchain ledger, the keys being stored as nodes in the index structure; and one or more processors configured to do one or more of: receive blockchain requests for data stored in the blockchain ledger; read, from the nodes in the index structure, a set of keys for non-critical queries included in the blockchain request; and generate and store a set of reads for blockchain requests that do not include values for the set of keys for the non-critical queries.
[0005] Preferably, the present invention provides an apparatus in which the index structure comprises a binary tree in which keys are arranged as nodes in a hierarchical manner.
[0006] Preferably, the present invention provides an apparatus, wherein the processor is further configured to construct an index structure based on key values added to the blockchain ledger.
[0007] Preferably, the present invention provides an apparatus, wherein the processor is configured to retrieve the set of keys one by one from the nodes in the index structure via a next function.
[0008] Preferably, the present invention provides an apparatus, wherein a processor is configured to identify a query of a blockchain request as a non-critical query if the query does not affect the validity of the blockchain request.
[0009] Preferably, the present invention provides an apparatus, wherein the processor is further configured to validate the blockchain request based on a previous set of reads for the blockchain request that did not include values for the set of keys read from the index structure.
[0010] Preferably, the present invention provides an apparatus, wherein the index structure is implemented within the chaincode logic of a blockchain peer node.
[0011] Preferably, the present invention provides an apparatus wherein the keys in the index structure correspond to unique values stored in a blockchain of the blockchain ledger.
[0012] Another exemplary embodiment provides a method that includes one or more of the following steps: storing an index structure including an index of keys from a blockchain ledger, the keys being stored as nodes in the index structure; receiving a blockchain request for data stored in the blockchain ledger; reading a set of keys for non-critical queries included in the blockchain request from the nodes in the index structure; and generating and storing a set of reads for blockchain requests that do not include values for the set of keys for the non-critical queries.
[0013] Preferably, the present invention provides a method, wherein the index structure comprises a binary tree in which keys are arranged as nodes in a hierarchical manner.
[0014] Preferably, the present invention provides a method further comprising the step of building an index structure based on key values added to the blockchain ledger.
[0015] Preferably, the present invention provides a method further comprising the step of reading the set of keys one by one from the nodes in the index structure via a next function.
[0016] Preferably, the present invention provides a method further comprising the step of identifying a query of a blockchain request as a non-critical query if the query does not affect the validity of the blockchain request.
[0017] Preferably, the present invention provides a method further comprising the step of validating the blockchain request based on a previous set of reads for the blockchain request that did not include values for the set of keys read from the index structure.
[0018] Preferably, the present invention provides a method, wherein the index structure is implemented within the chaincode logic of a blockchain peer node.
[0019] Preferably, the present invention provides that keys in the index structure correspond to unique values stored in a blockchain of the blockchain ledger.
[0020] Viewed from another exemplary aspect, the invention provides a non-transitory computer-readable medium including instructions that, when read by a processor, cause the processor to perform a method, the method including the steps of: storing an index structure including an index of keys from a blockchain ledger, the keys being stored as nodes in the index structure; receiving a blockchain request for data stored in the blockchain ledger; reading a set of keys for non-critical queries included in the blockchain request from the nodes in the index structure; and generating and storing a set of reads for blockchain requests that do not include values for the set of keys for the non-critical queries.
[0021] Preferably, the present invention provides a non-transitory computer-readable medium in which the index structure comprises a binary tree in which keys are arranged as nodes in a hierarchical manner.
[0022] Preferably, the present invention provides a non-transitory computer readable medium, wherein the method further comprises building an index structure based on the key values added to the blockchain ledger.
[0023] Preferably, the present invention provides a non-transitory computer readable medium, wherein the method comprises the step of reading said set of keys one by one from a node in an index structure via a next function. [Brief description of the drawings]
[0024] [Figure 1A] FIG. 1A illustrates a blockchain network implementing a binary index structure, according to an example embodiment. [Figure 1B]FIG. 1B is a diagram illustrating an example of the binary index structure of FIG. 1A, according to an example embodiment. [Figure 2A] FIG. 2A is a diagram illustrating a blockchain architecture configuration, according to an example embodiment. [Figure 2B] FIG. 2B illustrates a diagram of a blockchain transaction flow between nodes, according to an example embodiment. [Figure 3A] FIG. 3A is a diagram illustrating a permissioned network, according to an example embodiment. [Figure 3B] FIG. 3B illustrates another permissioned network according to an example embodiment. [Figure 3C] FIG. 3C is a diagram illustrating a permissionless network, according to an example embodiment. [Figure 4A] FIG. 4A illustrates a process for querying a blockchain ledger via range queries, according to an example embodiment. [Figure 4B] FIG. 4B illustrates a process for querying an index structure on top of a blockchain ledger, according to an example embodiment. [Diagram 5] FIG. 5 illustrates a method for accessing an index structure on top of a blockchain ledger, according to an example embodiment. [Figure 6A] FIG. 6A illustrates an example system configured to perform one or more operations described herein, according to an example embodiment. [Figure 6B] FIG. 6B illustrates another example system configured to perform one or more operations described herein, according to an example embodiment. [Figure 6C] FIG. 6C illustrates a system configured to utilize smart contracts, according to an example embodiment. [Figure 6D] FIG. 6D illustrates yet another example system configured to utilize blockchain, according to an example embodiment. [Figure 7A] FIG. 7A illustrates a process for adding a new block to a distributed ledger, according to an example embodiment. [Figure 7B] FIG. 7B is a diagram illustrating the data contents of the new data block according to an example embodiment. [Figure 7C] FIG. 7C illustrates a block chain for digital content, according to an example embodiment. [Figure 7D] FIG. 7D is a diagram illustrating a block that may represent the structure of a block in a blockchain, according to an example embodiment. [Figure 8A] FIG. 8A illustrates an example of a blockchain for storing machine learning (artificial intelligence) data, according to an example embodiment. [Figure 8B] FIG. 8B illustrates an example quantum-secure blockchain, according to an example embodiment. [Figure 9] FIG. 9 illustrates a system that supports one or more of the example embodiments. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0025] It will be readily understood that the components of the illustrative examples, as generally described and illustrated in the Figures herein, could be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of at least one embodiment of a method, apparatus, non-transitory computer-readable medium, and system, as illustrated in the accompanying Figures, is not intended to limit the scope of the present application as claimed, but is merely representative of selected embodiments.
[0026] Particular features, structures, or characteristics described throughout this specification may be combined or removed in any suitable manner in one or more embodiments. For example, the use of "exemplary embodiment," "some embodiments," or other similar phrases throughout this specification refers to the fact that particular features, structures, or characteristics described in connection with this embodiment may be included in at least one embodiment. Thus, throughout this specification, the appearance of the phrases "exemplary embodiment," "in some embodiments," "in some embodiments," and "exemplary embodiment" do not necessarily all refer to the same group of embodiments, and the described features, structures, or characteristics may be combined or removed in any suitable manner in one or more embodiments. Furthermore, in the figures, the connections between any elements may enable communication in one or both directions, or both, even if the connections shown are one-way or two-way arrows. Also, any devices shown in the figures may be another device. For example, where a mobile device is shown to transmit information, a wired device may be used to transmit the information.
[0027] In addition, although the term "message" may be used in describing the embodiments, the present application may apply to many types of networks and data. Further, although certain types of connections, messages, and signaling may be shown in the exemplary embodiments, the present application is not limited to certain types of connections, messages, and signaling.
[0028] Example embodiments provide methods, systems, components, non-transitory computer-readable media, devices, or networks, or combinations thereof, that implement an index structure that is logically on top of a blockchain ledger and that prevents non-critical (important) phantom items from occurring during blockchain transactions.
[0029] In one embodiment, the application utilizes a decentralized database (such as a blockchain), which is a distributed storage system that includes multiple nodes that communicate with each other. A decentralized database includes an append-only immutable data structure similar to a distributed ledger that can maintain records between mutually untrusted parties. The untrusted parties are referred to herein as peers or peer nodes. Each peer maintains a copy of the database record, and no single peer can modify the database record without reaching a consensus among the distributed peers. For example, peers can run a consensus protocol to validate storage transactions in the blockchain, group the storage transactions into blocks, and build a hash chain over the blocks. This process forms a ledger by ordering the storage transactions for consistency, if necessary. Various embodiments may use permissioned and / or permissionless blockchains. In a public or permissionless blockchain, anyone can participate without a specific identity. Public blockchains may involve native cryptocurrencies and use consensus based on various protocols such as Proof of Work (PoW), while permissioned blockchain databases provide secure interactions between groups of entities that share a common purpose but do not fully trust each other, such as businesses exchanging funds, goods, information, etc.
[0030] Applications may utilize blockchain to run arbitrary programmable logic tailored to a decentralized storage scheme, referred to as a "smart contract" or "chaincode." In some cases, there may be specialized chaincodes for managing functions and parameters, referred to as system chaincodes. The application may further utilize smart contracts, which are trusted distributed applications that utilize the tamper resistance of the blockchain database and the underlying consensus between nodes, also referred to as endorsement or endorsement policy. Blockchain transactions related to the application may be "endorsed" before being committed to the blockchain, while transactions that are not endorsed are ignored. An endorsement policy allows the chaincode to specify endorsers for a transaction, in the form of a set of peer nodes required for endorsement. When a client sends a transaction to a peer specified in the endorsement policy, the transaction is executed and the transaction is validated. After validation, transactions enter the ordering phase, where a consensus protocol is used to generate an ordered sequence of endorsed transactions that are grouped into blocks.
[0031] The application may utilize nodes, which are the communicating entities of the blockchain system. A "node" may perform a logical function in the sense that multiple nodes of different types can run on the same physical server. Nodes are grouped in trust domains and associated with logical entities that control them in various ways. Nodes may include different types such as client or sending client nodes that submit transaction invocations to endorsers (e.g., peers) and broadcast transaction proposals to ordering services (e.g., ordering nodes). Another type of node is a peer node that can receive client submitted transactions, commit transactions, and maintain a ledger state and copy of blockchain transactions. Although not a requirement, a peer may also have the role of an endorser. An ordering service node or orderer is a node that performs communication services for all nodes and implements delivery guarantees such as broadcasts to each of the peer nodes in the system when committing transactions and modifying the blockchain world state, where the blockchain world state is another name for the initial blockchain transaction, which typically includes control and configuration information.
[0032] The application may utilize a ledger, which is an ordered, tamper-resistant record of all state transitions of the blockchain. State transitions may result from chaincode invocations (i.e., transactions) issued by participating parties (e.g., client nodes, ordering nodes, endorser nodes, peer nodes, etc.). Each participating party (e.g., peer node) maintains a copy of the ledger. A transaction may result in a set of key-value pairs of assets being committed to the ledger as one or more operands, such as create, update, or delete. The ledger includes a blockchain (also called a chain) that is used to store immutable, ordered records in blocks. The ledger also includes a state database that maintains the current state of the blockchain.
[0033] This application may utilize a chain, which is a transaction log structured as hash-linked blocks, where each block contains a sequence of N transactions, where N is 1 or greater. The block header contains a hash of the block’s transactions and a hash of the previous block’s header. In this way, all transactions on the ledger may be ordered and cryptographically linked to each other. Thus, it is impossible to tamper with the ledger data without breaking the hash links. The hash of the most recently added blockchain block represents all transactions on the chain that occurred before it, allowing all peer nodes to guarantee that the state is consistent and trustworthy. The chain may be stored in the file systems of peer nodes (i.e., locally, on attached storage, on the cloud, etc.), efficiently supporting the append-only nature of blockchain workloads.
[0034] The current state of the immutable ledger may be stored in a state database and represents the latest values for all keys contained in the chain's transaction log. The current state is sometimes referred to as the world state, as it represents the most recent key values known to the channel. Chaincode invocations execute transactions against the ledger's current state data. To make these chaincode interactions efficient, the latest values of keys may be stored in the state database. The state database may simply be an indexed view into the chain's transaction log, and therefore can be regenerated from the chain at any time. The state database may be automatically restored (and generated, if necessary) when a peer node starts up and before any transactions are received.
[0035] Before data can be added to a distributed database like a blockchain, a consensus protocol needs to be executed to ensure that the data is agreed upon. This form of decentralized agreement allows for managing the blockchain without a central / control entity. In Hyperledger Fabric, this consensus protocol has various phases including endorsement, ordering, and validation / commitment. During the endorsement phase, a subset of blockchain peers simulate the transaction and ensure that the transaction can be processed based on the current state of the blockchain (stored in the blockchain ledger). However, at this point, no data is added to the blockchain. If endorsed, the transaction is sent to an orderer node, which aggregates the endorsed transactions into a data block. The orderer node then disconnects the data block if it becomes full and broadcasts the data block to blockchain peers on its channel. The blockchain peers replay the transaction based on the current state of the blockchain, ensuring that the data is still valid. If approved, the transaction is used to update the ledger state and the data block is stored on the blockchain.
[0036] To provide proofs for the endorsement phase, endorser nodes generate a read set that identifies the key values read from the blockchain ledger and a write set that identifies the values to be written to the blockchain ledger. During the validation / commitment phase, when the transaction is finally committed by the blockchain peers, the read set is re-executed at commit time. If the result is different from the proposal / endorsement time, a phantom read error is thrown. This check ensures that the state and environment have not changed from the proposal time to the commit time. However, the read set is only evaluated during range queries and is the result of the range queries executed by Hyperledger Fabric. Phantom read errors from non-critical range queries can be a huge obstacle to the performance of smart contract logic, as phantom read errors cause the transaction to be rejected.
[0037] In many cases, a transaction may perform multiple range queries, and not all range queries are critical to evaluate an endorsement. If a range query is not critical to the evaluation, there is no need for peers to check for phantom read errors. However, the current framework of blockchain solutions such as Hyperledger Fabric does not provide a way to avoid performing range queries. Due to this limitation, some transactions fail when they should succeed. Such failures preclude the possibility of concurrently executing transactions that perform the same non-critical range query.
[0038] Exemplary embodiments overcome shortcomings in related blockchain solutions by building an index structure on the blockchain ledger and allowing blockchain peers to query the index structure instead of range querying the blockchain ledger. In some embodiments, the index structure is a binary tree where keys are stored as nodes connected to each other via links. The index structure may include a hierarchical format, and the nodes / keys may be connected to each other based on any desired business rules. When a blockchain transaction is received, a blockchain peer may endorse the transaction by reading keys for non-critical queries from the index structure instead of the blockchain ledger. In doing so, when an endorser peer generates a read set for the transaction, the blockchain peer may omit data read from the index structure. Thus, when a commit peer re-executes a query upon commit, the commit peer may read keys for non-critical queries from the index structure and avoid performing comparisons of non-critical data. Thus, phantom read errors for non-critical items may be avoided.
[0039] This index may be structured as a binary search tree that is logically placed on top of the blockchain ledger, thereby allowing transactions to bypass phantom error checks for non-critical range queries. Advantages of the exemplary embodiments include significantly improving the performance of chaincode by allowing developers to implement concurrent smart contract logic. Additionally, transaction throughput is also improved because transactions are no longer rejected due to phantom items in non-critical transaction data. The system still allows critical range queries to be processed from the ledger. Thus, phantom read errors may be checked for critical range queries.
[0040] FIG. 1A illustrates a blockchain network 100 that implements an index structure 130 on top of a blockchain ledger 120, according to an example embodiment. With reference to FIG. 1A, multiple blockchain peers 121-125 share management of a blockchain (not shown). The blockchain may include a chain of hash-linked blocks on the blockchain ledger 120. The blockchain ledger 120 may also store a state database (referred to herein as the world state) that includes the current values of all keys (unique data items) stored in the blockchain. In a typical transaction from a client 110, a blockchain peer will endorse the transaction based on key-values obtained from the state database of the blockchain ledger 120.
[0041] Now, in an example embodiment, blockchain peers 121-125 may build and maintain an index structure 130 on top of the blockchain ledger 120. The index structure 130 may include an index of keys from the blockchain ledger 120 that are ordered / connected based on business logic defined by the system. When a blockchain request (e.g., a transaction) is received from a client 110, non-critical queries of the blockchain request may be processed using the index structure 130, while critical queries may still be processed from the key values on the blockchain ledger 120.
[0042] In FIG. 1A, the client 110 selects blockchain peers 123 and 124 as endorsing peers for a transaction. Each of these blockchain peers 123 and 124 may simulate the transaction by invoking a chaincode (deployed / packaged smart contract logic) that reads data from the blockchain ledger 120 to verify whether the transaction will succeed. To endorse the transaction, the blockchain peer 123 may execute multiple range queries that retrieve data from the blockchain ledger 120. According to various embodiments, the blockchain peer 123 may identify one or more range queries that are not critical to the endorsement (i.e., do not affect the validity of the transaction) and query the index structure 130 for keys of such queries. When the blockchain peer 123 generates a read set for the endorsement, the blockchain peer 123 may include all keys read from the blockchain ledger 120 (critical range queries) or omit keys read from the index structure 130 (non-critical queries).
[0043] The resulting read set is returned to the client 110 and forwarded to an ordering node (not shown) for inclusion in the blockchain. When a data block containing the transaction (and its read set) is carved out and sent to the blockchain peers 121-125, each of the blockchain peers 121-125 may re-run the query to validate the transaction before committing the block to their local copy of the blockchain ledger 120. Here, for critical range queries, the blockchain peers 121-125 may query the blockchain ledger 120 and compare key values read from the blockchain ledger 120 with key values stored in the transaction's read set. However, for non-critical queries, the blockchain peers 121-125 may query their own copy of the index structure 130 without performing validation for non-critical queries. As a result, phantom read errors for non-critical data / queries may be avoided.
[0044] FIG. 1B illustrates an example of the index structure 130 of FIG. 1A, according to an example embodiment. With reference to FIG. 1B, chaincode executing on a blockchain peer can build an index structure 130 on top of the blockchain ledger 120 and create custom indexes for less error-prone queries. In this example, the index structure 130 is a binary tree. The index structure 130 may be part of the smart contract logic packaged in the chaincode deployed and executed by the blockchain peers 121-125 shown in FIG. 1A.
[0045] A range query uses a range iterator to examine a set of ledger keys in the blockchain ledger 120. This iterator can be used to iterate over all keys between a start key and an end key in a range. Each key has a value associated with it. A peer uses a range query to get a range of values. A phantom read error occurs when two executions of a query give different results. For example, a phantom error is detected when a range query performed during the endorsement of a transaction and an identical range query performed during validation / commitment return different keys / values as results. A phantom error can be caused by concurrent transactions that modify keys within the range of a record between the endorsement and validation / commit.
[0046] In an exemplary embodiment, the index structure 130 persists for the duration of a transaction. This is an alternative way of storing ledger keys other than simply storing the keys in the blockchain ledger 120 database. In FIG. 1B, the keys are stored as nodes 132 in the index structure. Additionally, the keys / nodes 132 are linked by links 134 in a binary tree. Each node 132 in the index structure 130 corresponds to a key value stored in the blockchain ledger 120, as indicated by the arrows in FIG. 1B. The blockchain ledger 120 may store a key-value pair including a key (e.g., a system value) and a timestamp when the key was added to the system. Each ledger key corresponds to a node in the index structure 130. Additionally, the next property of each key's node points to another key. Keys may be sorted into the index structure 130 upon insertion based on business logic in the blockchain peer's smart contract.
[0047] To query the index structure 130, a blockchain peer can read the keys one by one as nodes in a tree instead of querying them by range on the blockchain ledger 120. In the example of a binary search tree as the index structure 130, a blockchain peer can identify the next node 132 in the index structure 130 by calling Next(). This function identifies the order among the keys in the index structure 130. A blockchain peer will not generate a phantom read error by simply querying the next node. Some phantom read errors are valid as data that is within the same read-write set should not be modified. These data items may still be queried from the blockchain ledger 120. However, other phantom read errors are due to changes in data that are not critical to the validity of the transaction. The exemplary embodiment provides an innovative way to avoid non-critical phantom read errors by querying the index structure 130 and not adding the results to the read set.
[0048] Without the custom index structure built by the exemplary embodiments, performing a range query on the iterator (such as by using Fabric's GetStateByRange function) is the only way for a blockchain peer to understand what the next key is. Therefore, if a key in the range is added, updated, or removed between the proposal and commit time, GetStateByRange would return different results and a phantom read error would occur. In contrast, rather than reading the keys in the range query, the exemplary embodiments use an index structure such as a binary search tree to read each individual element in the range one by one. With a binary search tree, a blockchain peer can identify the next key by calling Next(). By eliminating the need for a ledger's native range query function, the embodiments create an approach that eliminates non-trivial phantom read checks and enables better chaincode performance.
[0049] The blockchain, i.e., Hyperledger Fabric, has the following functions (or similar) to store and query ledger data. Ledger data is typically stored as key-value pairs. For example, PutState(k,v) is a function that stores value V at key k in the ledger. GetState(k) is a function that retrieves the value stored in the ledger for key k. This query is not added to the read set of a transaction during phantom read error checking. GetStateByRange(startKey,endKey) is a function that queries the ledger data between the start key (inclusive) and the end key (exclusive). This range query is added to the read set of a transaction during phantom read error checking.
[0050] On the other hand, index structures (e.g., binary search trees, red-black trees, etc.) provide the following functions to add nodes or find nodes in the binary tree. In this example, the node values in the binary search tree represent ledger keys. For example, Insert(k) can insert key k into the binary search tree and rebalance if necessary. Find(k) can find a node in the binary search tree whose key is greater than or equal to the input key value k. Next(k) can receive the current node k in the binary search tree and return the next key k+1 in the binary search tree. The order of the keys in the index structure may be based on the business logic implemented in the smart contract.
[0051] Additionally, the exemplary embodiment allows peers to build an index of ledger keys using a binary search tree on top of the ledger. When a piece of data (key-value pair) is added to the blockchain ledger, blockchain peers can use the following logic instead of using the blockchain's native PutState() function:
number
[0052] In this example, before adding data to the ledger, a peer can add the key to a binary search tree to build an index of ledger keys. To bypass the phantom read error check for non-critical range queries, a blockchain peer can query a range of data using a binary search tree index instead of the blockchain's native GetStateByRange() function, using the following logic: The following function uses the binary search tree index to find the next key to read, and then reads each value individually from the ledger using the native GetState() function. This avoids adding a set of reads for the phantom read error check.
number
[0053] FIG. 2A illustrates a blockchain architecture configuration 200 according to an example embodiment. Referring to FIG. 2A, the blockchain architecture 200 may include a group of blockchain elements, such as blockchain nodes 202. The blockchain nodes 202 may include one or more nodes 204-210 (these four nodes are shown merely as an example). These nodes participate in a number of activities, such as the addition and validation process (consensus) of blockchain transactions. One or more of the blockchain nodes 204-210 may endorse transactions based on an endorsement policy and provide an ordering service for all blockchain nodes in the architecture 200. The blockchain nodes may initiate blockchain authentication and attempt to write to the blockchain's immutable ledger stored in the blockchain layer 216, a copy of which may also be stored in the underlying physical infrastructure 214. A blockchain configuration may include one or more applications 224 linked to an application programming interface (API) 222 for accessing and executing stored program / application code 220 (e.g., chaincode, smart contracts, etc.), where the program / application code 220 may be created according to customized configurations desired by participants, maintaining their own state, controlling their own assets, and receiving external information, which may be deployed as transactions and installed on all blockchain nodes 204-210 by appending to the distributed ledger.
[0054] The blockchain base or platform 212 includes various layers of blockchain data, services (e.g., cryptographic trust services, virtual execution environments, etc.) and an underlying physical computer infrastructure that may be used to receive and store new transactions and provide access to auditors seeking access to data entries. The blockchain layer 216 may expose an interface that provides access to the virtual execution environment necessary to engage the physical infrastructure 214 to process program code. The cryptographic trust services 218 may be used to verify transactions, such as asset exchange transactions, and keep information private.
[0055] The blockchain architecture of FIG. 2A may process and execute program / application code 220 through one or more interfaces and services exposed by the blockchain platform 212. The code 220 may control assets of the blockchain. For example, the code 220 may store and transfer data and may be executed by the nodes 204-210 in the form of smart contracts and associated chaincode with conditions or other code elements that are subject to execution. As a non-limiting example, smart contracts may be created to perform reminders, updates or modifications, other notifications targeted to updates, or combinations thereof, and the like. The smart contract may itself be used to identify authentication and access requirements and rules associated with the use of the ledger. For example, the smart contract (or chaincode executing the logic of the smart contract) reads the blockchain data 226 from the index structure. The blockchain data may be processed by one or more processing entities (e.g., virtual machines) included in the blockchain layer 216 to generate results 228 of the chaincode invocation. The outcome may be determined by the business logic in the smart contract. The physical infrastructure 214 may be utilized to retrieve any data or information described herein.
[0056] A smart contract may be created via high-level application and programming languages and then written into a block in the blockchain. A smart contract may include executable code that is registered, stored, or replicated on the blockchain (e.g., a distributed network of blockchain peers), or a combination thereof. To be deployed, a smart contract may be packaged into chaincode (along with other smart contracts) and deployed on blockchain peers. A transaction is the execution of smart contract code that may be executed in response to a condition associated with the smart contract being satisfied. Executing a smart contract may trigger a trusted change to the state of the digital blockchain ledger. Changes to the blockchain ledger resulting from the execution of a smart contract may be automatically replicated across a distributed network of blockchain peers through one or more consensus protocols.
[0057] Smart contracts may be written to the blockchain in the form of key-value pairs. Additionally, smart contract code may read values stored in the blockchain and use them in the operation of the application. Smart contract code may write the output of various logical operations to one or more blocks in the blockchain. The code may be used to create temporary data structures in a virtual machine or other computing platform. Data written to the blockchain may be public, or encrypted and kept private, or both. The temporary data used / generated by the smart contract is kept in memory by the execution environment provided and deleted after the data required for the blockchain has been identified.
[0058] The chaincode may include a code interpretation of the smart contract along with additional functionality, where the chaincode may include a packaged and deployable version of the logic in the smart contract. As described herein, the chaincode may be program code that is deployed on a computing network where it is executed together and validated by chain validators during a consensus protocol. The chaincode receives the hash and retrieves from the blockchain a hash associated with a data template created by use of a previously stored feature extractor. If the hash of the hash identifier and the hash created from the stored identification template data match, the chaincode sends an authentication key to the requesting service. The chaincode may write the blockchain data associated with cryptographic details.
[0059] FIG. 2B illustrates an example of a blockchain transaction flow 250 between nodes of a blockchain, according to an example embodiment. With reference to FIG. 2B, the transaction flow may include a client node 260 sending a transaction proposal 291 to an endorsing peer node 281. The endorsing peer node 281 may verify the client signature and execute a chaincode function to initiate the transaction. The output may include the chaincode result, a set of versions of the keys / values that were read into the chaincode (the read set) and a set of keys / values that were written into the chaincode (the write set). The endorsing peer 281 may then decide whether to endorse the transaction proposal. If approved, a proposal response 292 is sent back to the client node 260 along with the endorsement signature. The client 260 incorporates the endorsement into a transaction payload 293 and broadcasts it to the ordering service node 284. The ordering service node 284 then distributes the ordered transactions as a block to all peer nodes 281-283 on the channel. Before committing it to the blockchain, each peer node 281-283 can validate the transaction. For example, a peer can check an endorsement policy to ensure that the correct allocation of a given peer has signed the result and authenticated the signature on the transaction payload 293.
[0060] Referring again to FIG. 2B, a client node initiates a transaction 291 by constructing and sending a request to an endorser peer node 281. The client 260 may include an application that utilizes a supported software development kit (SDK), which utilizes available APIs to generate a transaction proposal. A proposal is a request that calls a chaincode function to allow data to be read from and / or written to the ledger (i.e., writing a new key-value pair for an asset). The SDK can act as a shim to package the transaction proposal into a suitably designed format (e.g., protocol buffers over remote procedure calls (RPCs)), obtain the client's cryptographic credentials, and generate a unique signature for the transaction proposal.
[0061] In response, the endorsing peer node 281 may verify that (a) the transaction proposal is properly formed, (b) the transaction has not already been submitted in the past (replay attack protection), (c) the signature is valid, and (d) the submitter (in this example, client 260) is properly authenticated to perform the proposed operation on the channel. The endorsing peer node 281 may take the transaction proposal input as an argument to a chaincode function that is called. The chaincode is then executed against the current state database to generate a transaction result that includes a response value, a read set, and a write set. However, no updates are made to the ledger at this point. At 292, the set of values, along with the signature of the endorsing peer node 281, is returned as a proposal response 292 to the client 260's SDK, which parses the payload for the application to retrieve.
[0062] In response, the client 260 application checks / verifies the signature of the endorsing peer and compares the proposal response to determine whether the proposal responses are identical. If the chaincode only queried the ledger, the application would check the query response and would typically not submit the transaction to the ordering service node 284. If the client application intends to submit a transaction to the ordering service node 284 to update the ledger, the application would determine whether the specified endorsement policy is satisfied (i.e., all peer nodes required for the transaction have endorsed the transaction) prior to submitting. Here, a client may include only one of multiple parties to a transaction. In this case, each client may include its own endorsing node and each endorsing node would need to endorse the transaction. The architecture is such that even if the application chooses not to check the response or forwards an otherwise unendorsed transaction, the endorsement policy would still be enforced and honored by peers in the commit validation phase.
[0063] After a successful inspection, in step 293, the client 260 incorporates the endorsement into a transaction proposal and broadcasts the transaction proposal and transaction response in a transaction message to the ordering node 284. The transaction may include a read set, a write set, the signatures of endorsing peers, and a channel ID. The ordering node 284 does not need to inspect the entire contents of the transaction to perform its operation; instead, the ordering node 284 can simply receive transactions from all channels in the network, order them chronologically by channel, and create blocks of transactions by channel.
[0064] The block is distributed from the ordering node 284 over the channel to all peer nodes 281-283. The data sections in the block may be validated to ensure that signature policies are satisfied and that there have been no changes to the ledger state for the variables in the read set since the read set was generated by the execution of the transaction. Furthermore, in step 295, each peer node 281-283 appends the block to the channel's chain and, for each valid transaction, a write set is committed to the current state database. An event may be emitted to notify the client application that the transaction (invocation) has been immutably appended to the chain, and whether the transaction was valid or invalid.
[0065] FIG. 3A illustrates an example of a permissioned blockchain network 300 featuring a decentralized, decentralized, peer-to-peer architecture. In this example, users 302 of the blockchain can initiate transactions against the permissioned blockchain 304. In this example, transactions may be deployed, invoked, or queried, and may be issued directly through a client-side application utilizing an SDK, for example, an API, or the like. The network may provide access to regulators 306, such as auditors. The blockchain network operator 308 manages the authorization of members, such as registering regulators 306 as “auditors” and registering users 302 of the blockchain as “clients.” Auditors may be limited to only querying the ledger, while clients may be authorized to deploy, invoke, and query certain types of chaincode.
[0066] A blockchain developer 310 writes the chaincode and client-side applications. The blockchain developer 310 may deploy the chaincode directly to the network through an interface. To include credentials from traditional data sources 312 in the chaincode, the developer 310 may use an out-of-band connection to access the data. In this example, a blockchain user 302 connects to the permissioned blockchain 304 through a peer node 314. Before initiating any transaction, the peer node 314 obtains the user's registration and transaction certificate from a certificate authority 316 that manages the user's roles and permissions. In some cases, blockchain users must possess their digital certificates to transact on the permissioned blockchain 304. On the other hand, users who wish to run chaincode may be required to verify their credentials on traditional data sources 312. To verify the user's authentication, the chaincode may use an out-of-band connection to this data through a traditional processing platform 318.
[0067] FIG. 3B illustrates another example of a permissioned blockchain network 320 featuring a decentralized, decentralized, peer-to-peer architecture. In this example, users 322 of the blockchain can submit transactions to the permissioned blockchain 324. In this example, transactions can be deployed, invoked, or queried, and can be issued directly through a client-side application utilizing an SDK, for example, an API, or the like. The network can provide access to regulators 326, such as auditors. The blockchain network operator 328 manages member authorization, such as registering regulators 326 as “auditors” and registering users 322 of the blockchain as “clients.” Auditors may be limited to only querying the ledger, while clients may be authorized to deploy, invoke, and query certain types of chaincode.
[0068] A blockchain developer 330 writes the chaincode and client-side applications. The blockchain developer 330 may deploy the chaincode directly to the network through an interface. To include credentials from traditional data sources 332 in the chaincode, the developer 330 may use an out-of-band connection to access the data. In this example, a blockchain user 322 connects to the network through a peer node 334. Before initiating any transaction, the peer node 334 obtains the user's registration and transaction certificate from a certificate authority 336. In some cases, blockchain users must have their digital certificates to transact on the permissioned blockchain 324. On the other hand, users who wish to run chaincode may be required to verify their credentials on traditional data sources 332. To verify the user's authentication, the chaincode may use an out-of-band connection to this data through a traditional processing platform 338.
[0069] In some embodiments, the blockchain herein may be a permissionless blockchain. In contrast to a permissioned blockchain, which requires permission to participate, anyone can participate in a permissionless blockchain. For example, to participate in a permissionless blockchain, a user can generate a personal address and begin interacting with the network by sending transactions and thus adding entries to the ledger. Additionally, all parties have the option to run nodes on the system and help validate transactions using a mining protocol.
[0070] FIG. 3C illustrates a process 350 in which a transaction is processed by a permissionless blockchain 352 that includes multiple nodes 354. A sender 356 wishes to send a payment or other form of value (e.g., a deed, medical records, contracts, goods, services, or other assets that may be encapsulated in a digital record) to a receiver 358 via the permissionless blockchain 352. In one embodiment, the sender device 356 and the receiver device 358 may each have a digital wallet (associated with the blockchain 352) that provides user interface controls and transaction parameter display. In response, the transaction is broadcast across the blockchain 352 to the nodes 354. Depending on the network parameters of the blockchain 352, the nodes validate (360) the transaction based on rules established by the creator of the permissionless blockchain 352, which may be predefined or dynamically assigned. For example, this may include verifying the identities of the parties involved. The transaction may be verified immediately, or it is placed in a queue with other transactions and node 354 determines whether the transaction is valid based on a set of rules for the network.
[0071] In structure 362, valid transactions are formed into blocks and sealed with a lock (hash). This process may be performed by mining nodes among nodes 354. Mining nodes may utilize additional specialized software for mining and generating blocks for the permissionless blockchain 352. Each block may be identified by a hash (e.g., a 256-bit number) created using an algorithm agreed upon by the network. Each block may contain a header, a pointer or reference to the hash of the header of the previous block in the chain, and a group of valid transactions. The reference to the hash of the previous block is associated with the creation of a secure, independent chain of blocks.
[0072] Before a block can be added to the blockchain, it must be validated. Validation for a permissionless blockchain 352 may involve Proof of Work (PoW), which is the solution to a puzzle derived from the block's header. Another process to validate a block, not shown in the example of FIG. 3C, is Proof of Stake. Unlike Proof of Work, where an algorithm rewards miners for solving a mathematical problem, in Proof of Stake, the creators of new blocks are chosen in a deterministic manner depending on their wealth, also referred to as stake. Then, a similar proof is performed by the selected / elected nodes.
[0073] In mining 364, nodes attempt to solve a block by making incremental changes to one variable until the solution meets a network-wide target. This creates a proof of work, which guarantees a correct answer. In other words, a potential solution must prove that it has exhausted computational resources in solving the problem. In some types of permissionless blockchains, miners may be rewarded with value (e.g., coins) for successfully mining a block.
[0074] Here, the PoW process, along with the chaining of blocks, makes it extremely difficult to modify the blockchain, since an attacker must modify all subsequent blocks in order for a change to one block to be accepted. Furthermore, as new blocks are mined, the difficulty of modifying the block increases, increasing the number of subsequent blocks. In distribution 366, the successfully validated block is distributed through the permissionless blockchain 352, and all nodes 354 add the block to the majority chain, which is an auditable ledger of the permissionless blockchain 352. Furthermore, the value of the transaction sent by the sender 356 is deposited or otherwise transferred to a digital wallet of the recipient device 358.
[0075] FIG. 4A illustrates a process 400A for querying a blockchain ledger via a range query according to an example embodiment. With reference to FIG. 4A, a smart contract 444 executing on a blockchain peer includes a state database 446 (stored in the blockchain ledger). In this example, a logging system 442 tracks users logged on to the enterprise network and records data about user activity. Data may be stored on the blockchain managed by the smart contract 444, including keys. The current values of all keys may be stored by the smart contract 444 in the state database 446.
[0076] In this example, smart contract 444 has logic to count the number of users / employees logged into logging system 442 every second and log the results to the blockchain ledger (state DB 446). Figure 4A shows an example communication sequence in which smart contract 444 stores a transaction in state database 446 and also illustrates the occurrence of a phantom read error.
[0077] Due to network overhead, the time taken between proposing a transaction and committing that transaction can vary. At 401, the logging system initiates the first transaction at 12:00:00. At 402, smart contract 444 counts the number of employees logged into the system via a range query. There are currently 6 employees logged into the system. The range query is then added to the read set to check for phantom read errors.
[0078] Meanwhile, at 403, a new user 440 logs on to the system. Currently, seven employees are logged on the system. Furthermore, the smart contract 444 updates the blockchain ledger 446 with the new user information. This occurs simultaneously between the endorsement and validation of the first transaction received at 401. At 405, the logging system 442 triggers the start of the next counting transaction (transaction 2) at 12:00:01. At 406, the smart contract 444 counts the number of employees logged in by a range query. The total count is seven. A range query is added to the read set for transaction 2 to check for phantom read errors. Now, the phantom error check for the second transaction is performed at 407 and is successful. Thus, at 408, the second transaction is committed to the blockchain and state DB 446, and at 409, a success notification is sent.
[0079] Meanwhile, the first transaction is delayed due to overhead. Now, at 411, the smart contract 444 performs a phantom error check based on the current state of the ledger (state DB 446). In this example, the current number of users logged into the system is recorded as 7, but the read set of the first transaction shows that the number of users is 6. Thus, the phantom error check fails. Thus, at 412, the smart contract 444 outputs a failure notification.
[0080] FIG. 4B illustrates a process 400B for querying an index structure 448 on top of a blockchain ledger 446 according to an example embodiment. In this example, the index structure 448 stores the current keys of the blockchain ledger in an index that logically resides on the blockchain ledger's state DB 446. At 421, the logging system 442 triggers the first transaction at 12:00:00. In response, at 422, the smart contract 444 counts the number of employees logged into the system by querying the index structure 448 without issuing a range query to the state DB 446. There are currently 6 employees logged into the system. Because a range query was not used, this read is not added to the read set of transaction 1. Instead, a read set is created with only the critical query (not shown in this example).
[0081] At 423, a new user 440 logs into the system. Currently, there are seven employees logged in. In this example, both the state DB 446 and the index structure 448 are updated with the new key for the user 440.
[0082] Meanwhile, as in FIG. 4A, the logging system 442 triggers the start of a second transaction at 425. In this case, transaction 2 starts at 12:00:01. At 426, the smart contract 444 counts the number of employees who logged in by querying the index structure 448. The total count is 7. This read, however, is not added to the read set for transaction 2 because a range query was not used. At 427, the smart contract 444 performs a phantom error check based on the read set of the second transaction, which is successful. At 428, the second transaction is added to the blockchain ledger and a success message is sent to the logging system 442.
[0083] Meanwhile, similar to the example of Figure 4A, the first transaction is delayed. However, at 430, a phantom error check is performed and succeeds because the non-critical transaction (employee / user count) was not added to the read set. Therefore, there is no need to perform a phantom error check on the employee count value read at 422. Instead, the first transaction is committed at 431 and a success message is provided at 432.
[0084] FIG. 5 illustrates a method 500 for accessing an index structure on top of a blockchain ledger according to an example embodiment. As a non-limiting example, the method 500 may be performed by a blockchain peer, a chaincode executing on the blockchain peer, etc., however, embodiments are not limited thereto. With reference to FIG. 5, the method includes, at 510, storing an index structure including indexes of keys from the blockchain ledger, where the keys are stored as nodes in the index structure. By way of example, the index structure is a binary tree, also referred to as a binary search tree. The tree may include nodes representing keys stored in the blockchain.
[0085] In some embodiments, the blockchain peer nodes also build an index structure over time as keys are added to the blockchain. For example, the index structure may be created and implemented in a smart contract (deployed as chaincode) that executes on the blockchain peer nodes. The nodes may be ordered or otherwise connected to each other in a desired manner. For example, the smart contract may include business rules, methods, procedures, etc., for connecting the nodes / keys in the index structure. If the index structure is a tree, such as a binary tree, the keys may be arranged as nodes in a hierarchical fashion.
[0086] At 520, the method includes receiving a blockchain request for data stored in the blockchain ledger. For example, the blockchain request may include a blockchain transaction that invokes a smart contract on a blockchain peer node. The blockchain request may be processed using one or more queries on the blockchain ledger. In traditional blockchains, these requests may be processed using range queries. However, at 530, instead of performing range queries on the blockchain ledger, the method includes retrieving a set of keys for non-critical queries included in the blockchain request from a node in an index structure. Here, the blockchain request may include / require critical and non-critical queries on the ledger. The blockchain peer may process critical queries on the ledger. However, for non-critical queries, the blockchain peer node may retrieve the data from the index structure instead.
[0087] Further, at 540, the method includes generating and storing a read set for the blockchain request that does not include values for the set of keys of the non-critical query. Thus, by processing the non-critical query on the index structure instead of the blockchain ledger, phantom read errors are avoided. Further, a peer can avoid placing keys read from the index structure in the read set of the smart contract.
[0088] In some embodiments, the reading step includes reading the set of keys one by one from the nodes in the index structure via a next function, where the next function can move to the next key / node in the index structure based on how the nodes are ordered by the smart contract when the smart contract is building the index structure. In some embodiments, the method can include identifying a query of the blockchain request as a non-critical query if the query does not affect the validity of the blockchain request. In some embodiments, the method can include validating the blockchain request based on a previous read set for the blockchain request that does not include a value for the set of keys read from the index structure. In some embodiments, the index structure is implemented within the chaincode logic of the blockchain peer node. In these embodiments, the keys in the index structure correspond to unique values stored in the blockchain of the blockchain ledger.
[0089] FIG. 6A illustrates an example system 600 including a physical infrastructure 610 configured to perform various operations according to example embodiments. With reference to FIG. 6A, the physical infrastructure 610 includes a module 612 and a module 614. The module 614 includes a blockchain 620 and a smart contract 630 (which may reside in the blockchain 620), which may perform any of the operational steps 608 (in the module 612) included in any of the example embodiments. The steps / operations 608 may include one or more of the described or illustrated embodiments and represent output or written information written or read from one or more smart contracts 630 or the blockchain 620 or both. The physical infrastructure 610, the module 612, and the module 614 may include one or more computers, servers, processors, memories, or wireless communication devices, or combinations thereof. Additionally, the module 612 and the module 614 may be the same module.
[0090] FIG. 6B illustrates another example system 640 configured to perform various operations according to example embodiments. Referring to FIG. 6B, the system 640 includes a module 612 and a module 614. The module 614 includes a blockchain 620 and a smart contract 630 (which may be present in the blockchain 620), which may perform any of the operational steps 608 (in the module 612) included in any of the example embodiments. The steps / operations 608 may include one or more of the described or illustrated embodiments and represent output or written information written or read from one or more smart contracts 630 or the blockchain 620 or both. The physical infrastructure 610, the module 612, and the module 614 may include one or more computers, servers, processors, memories, or wireless communication devices, or combinations thereof. Additionally, the module 612 and the module 614 may be the same module.
[0091] FIG. 6C illustrates an example system configured to utilize smart contract configuration between contracting parties and an intermediary server configured to enforce smart contract clauses on a blockchain, according to an example embodiment. With reference to FIG. 6C, configuration 650 may represent a communication session, asset transfer session, or process or procedure, which is driven by a smart contract 630, which explicitly identifies one or more user devices 652 or 656, or both. The execution, operation, and results of the execution of the smart contract may be managed by a server 654. The contents of the smart contract 630 may require digital signatures by one or more of the entities 652 and 656 that are parties to the smart contract transaction. The results of the smart contract execution may be written to the blockchain 620 as a blockchain transaction. The smart contract 630 resides on the blockchain 620, which may reside on one or more computers, servers, processors, memories, or wireless communication devices, or a combination thereof.
[0092] FIG. 6D illustrates a system 660 including a blockchain, according to an example embodiment. Referring to the example of FIG. 6D, an application programming interface (API) gateway 662 provides a common interface for accessing blockchain logic (e.g., smart contracts 630 or other chaincode) and data (e.g., distributed ledger, etc.). In this example, the API gateway 662 is a common interface for making transactions (calls, queries, etc.) on the blockchain by connecting one or more entities 652, 656 to a blockchain peer (i.e., server 654). Here, the server 654 is a blockchain network peer component that holds a copy of the world state and distributed ledger, allowing clients 652 and 656 to query the world state data and submit transactions to the blockchain network, where endorsing peers will execute the smart contracts 630 according to the smart contracts 630 and endorsement policies.
[0093] The above embodiments may be implemented in hardware, in a computer program executed by a processor, in firmware, or in a combination thereof. The computer program may be embodied in a computer readable medium, such as a storage medium. For example, the computer program may reside in a random access memory (RAM), a flash memory, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), an electronically erasable programmable read-only memory (EEPROM), a register, a hard disk, a removable disk, a compact disk read-only memory (CD-ROM), or any other form of storage medium known in the art.
[0094] An exemplary storage medium may be coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an Application Specific Integrated Circuit (ASIC). In the alternative, the processor and the storage medium may reside as discrete components.
[0095] FIG. 7A illustrates a process 700 in which a new block is added to a distributed ledger 720, according to an example embodiment, and FIG. 7B illustrates the contents of a new data block structure 730 for a blockchain, according to an example embodiment. With reference to FIG. 7A, a client (not shown) may submit a transaction to blockchain nodes 711, 712, or 713, or a combination thereof. A client may be an instruction received from any source to perform an activity on the blockchain 720. As an example, a client may be an application acting on behalf of a requester, such as a device, person, or entity, to propose a transaction to the blockchain. Multiple blockchain peers (e.g., blockchain nodes 711, 712, 713) may maintain a copy of the blockchain network state and the distributed ledger 720. Different types of blockchain nodes / peers may exist in a blockchain network, including endorsing peers that simulate and endorse transactions proposed by clients, and committing peers that verify the endorsements, validate the transactions, and commit the transactions to the distributed ledger 720. In this example, blockchain nodes 711, 712, and 713 can act as endorser nodes, committer nodes, or both.
[0096] The distributed ledger 720 includes a blockchain that stores immutable ordered records in blocks, and a state database 724 that maintains the current state of the blockchain 722 (current world state). There may be one distributed ledger 720 per channel, and each peer maintains a copy of the distributed ledger 720 for each channel in which it is a member. The blockchain 722 is a transaction log structured as hash-linked blocks, where each block contains a sequence of N transactions. A block may include various components as shown in FIG. 7B. Block links (shown by arrows in FIG. 7A) may be generated by appending a hash of the preceding block's header in the block header of the current block. In this way, all transactions on the blockchain 722 are ordered and cryptographically linked such that the blockchain data cannot be tampered with without breaking the hash link. Furthermore, due to the linking, the latest block in the blockchain 722 represents all transactions that came before it. The blockchain 722 may be stored on a peer file system (local or attached storage) that supports append-only blockchain workloads.
[0097] The current state of the blockchain 722 and distributed ledger 720 may be stored in a state database 724, where the current state data represents the latest values for all keys ever included in the chain transaction log of the blockchain 722. Chaincode invocations execute transactions against the current state in the state database 724. To make these chaincode interactions highly efficient, the latest values of all keys are stored in the state database 724. The state database 724 may contain an indexed view into the blockchain 722 transaction log, which can therefore be regenerated off-chain at any point in time. The state database 724 is automatically restored (or generated on demand) when peers start up before receiving transactions.
[0098] An endorsing node receives transactions from clients and endorses transactions based on simulated results. An endorsing node holds a smart contract that simulates a transaction proposal. When an endorsing node endorses a transaction, it creates a transaction endorsement, which is a signed response from the endorsing node indicating the endorsement of the simulated transaction to the client application. The manner in which a transaction is endorsed depends on the endorsement policy, which may be specified in the chaincode. An example of an endorsement policy is that “a majority of endorsing peers must endorse the transaction.” Different channels may have different endorsement policies. The endorsed transaction is forwarded by the client application to the ordering service 710.
[0099] The ordering service 710 accepts endorsed transactions, orders them into blocks, and distributes the blocks to commit peers. For example, the ordering service 710 may initiate a new block when a transaction threshold is reached, a timer times out, or other conditions. In the example of FIG. 7A, blockchain node 712 is a commit peer that receives new data, new data block 730, for storage on the blockchain 722. The first block in a blockchain is also referred to as a genesis block, and the genesis block contains information about the blockchain, its members, the data stored in it, etc.
[0100] The ordering service 710 may consist of a cluster of orderers. The ordering service 710 does not process transactions, smart contracts, or maintain a shared ledger. Rather, the ordering service 710 may receive endorsed transactions and identify the order in which those transactions are committed to the distributed ledger 720. The architecture of the blockchain network may be designed such that specific implementations of "ordering" (e.g., Solo, Kafka, BFT, etc.) are pluggable components.
[0101] Transactions are written to the distributed ledger 720 in a consistent order. The order of transactions is established to ensure that updates to the state database 724 are valid when committed to the network. Unlike cryptocurrency blockchain systems (such as Bitcoin) where ordering occurs through solving cryptographic puzzles or through mining, in this example the parties to the distributed ledger 720 can choose the ordering mechanism that is best for their network.
[0102] When the ordering service 710 initializes a new data block 730, the new data block 730 may be broadcast to the commit peers (e.g., blockchain nodes 711, 712, 713). In response, each commit peer validates the transactions in the new data block 730 by verifying that the read set and the write set still match the current state of the world in the state database 724. Specifically, the commit peers may determine whether the read data that existed when the endorser simulated the transaction is identical to the current state of the world in the state database 724. If the commit peers validate the transaction, the transaction is written to the blockchain 722 on the distributed ledger 720, and the state database 724 is updated with the write data from the read-write set. If the transaction fails, i.e., if the commit peers determine that the read-write set does not match the current state of the world in the state database 724, the transactions that were ordered into the block will still be included in the block, but will be marked as invalid, and the state database 724 will not be updated.
[0103] With reference to FIG. 7B, a new data block 730 (also referred to as a data block) stored in the blockchain 722 of the distributed ledger 720 may include multiple data segments, such as a block header 740, block data 750 (block data section), and block metadata 760. It should be understood that the various depicted blocks and their contents as shown in FIG. 7B, such as the new data block 730 and its contents, are merely examples and are not meant to limit the scope of the example embodiments. In a conventional block, the data section may store transaction information for N (e.g., 1, 10, 100, 500, 1000, 2000, 3000, etc.) transactions in the block data 750.
[0104] The new data block 730 may include a link to the previous block (e.g., on the blockchain 722 of FIG. 7A) in the block header 740. In particular, the block header 740 may include a hash of the header of the previous block. The block header 740 may include a unique block number, a hash of the block data 750 of the new data block 730, etc. The block numbers of the new data block 730 are unique and may be assigned in various orders, such as an incremental / consecutive order starting from zero.
[0105] The block metadata 760 may store multiple fields of metadata (e.g., as a byte array, etc.). The metadata fields may include a signature at the creation of the block, a reference to the last constituent block, a transaction filter that identifies valid and invalid transactions in the block, the last surviving offset of the ordering service that orders the block, etc. The signature, the last constituent block, and the orderer metadata may be added by the ordering service 710. Alternatively, the committer of the block (e.g., blockchain node 712) may add valid / invalid information based on the endorsement policy, read / write set validation, etc. The transaction filter may include a byte array of size equal to the number of transactions included in the block data 750, and a validation code that identifies whether the transaction is valid / invalid.
[0106] FIG. 7C illustrates an embodiment of a blockchain 770 for digital content, according to embodiments described herein. Digital content may include one or more files and associated information. Files may include media, images, video, audio, text, links, graphics, animations, web pages, documents, or other forms of digital content. The append-only aspect of the immutable blockchain serves as a safeguard to protect the integrity, validity, and authenticity of the digital content, making it suitable for use in legal proceedings where admissibility rules apply, or other settings where evidence is considered or otherwise interested in the presentation and use of digital information. In this case, the digital content may be referred to as digital evidence.
[0107] A blockchain can be formed in a variety of ways. In one embodiment, digital content may be contained in and accessed from the blockchain itself. For example, each block of the blockchain may store a hash value of the reference information (e.g., headers, values, etc.) alongside the associated digital content. The hash value and the associated digital content may then be encrypted together. Thus, by decrypting each block in the blockchain, the digital content of each block may be accessed, and the hash value of each block may be used as a basis to reference the previous block. This can be shown as follows: [Table 1]
[0108] In one embodiment, the digital content may not be included in the blockchain. For example, the blockchain may store an encrypted hash of the contents of each block without any digital content. The digital content may be stored in another storage area or memory address in association with the hash value of the original file. The other storage area may be the same storage device used to store the blockchain, a different storage area, or even a separate relational database. The digital content of each block may be referenced or accessed by taking or querying the hash value of the block of interest and looking up the hash value in the storage area where the actual digital content is stored correspondingly. This operation may be performed by a database gatekeeper, for example. This can be illustrated as follows: [Table 2]
[0109] In the example embodiment of FIG. 7C , the blockchain 770 is a set of multiple cryptographically linked blocks 7781, 7782, ... 778, where N >= 1, in an ordered sequence. N Contains blocks 7781, 7782, … 778 N The encryption used to link the blocks 7781, 7782, ... 778 may be any of a number of keyed or unkeyed hash functions. Nare subjected to a hash function that generates an n-bit alphanumeric output (where n is 256 or any other number) from an input based on the information in the block. Examples of such hash functions include, but are not limited to, SHA-type (SHA stands for Secured Hash Algorithm) algorithms, the Merkle-Dangard algorithm, the HAIFA algorithm, the Merkle Tree algorithm, nonce-based algorithms, and non-collision resistant PRF algorithms. In another embodiment, blocks 7781, 7782, ... 778 N may be cryptographically linked with a function different from the hash function. The following description is given with reference to a hash function, such as SHA-2.
[0110] Blocks 7781, 7782, … 778 in the blockchain N Each of the files includes a header, a file version, and a value. The header and value are different for each block as a result of hashing in the blockchain. In one embodiment, the value may be included in the header. As described in more detail below, the file version may be the original file or a different version of the original file.
[0111] The first block 7781 in a blockchain is referred to as the genesis block and contains a header 7721, an original file 7741, and an initial value 7761. The hashing scheme used in the genesis block, and indeed in subsequent blocks, may vary. For example, all of the information in the first block 7781 may be hashed together at once, or each or portions of the information in the first block 7781 may be hashed separately and then the separately hashed portions may be hashed.
[0112] The header 7721 may include one or more initialization parameters, which may include, for example, a version number, a timestamp, a nonce, route information, difficulty level, consensus protocol, duration, media format, source, descriptive keywords, or other information (related to the origin file 7741 or the blockchain or both), or a combination thereof. The header 7721 may be generated automatically (e.g., by blockchain network management software) or manually by a blockchain participant. The genesis block header 7721 may be used to identify other blocks 7782-7783 in the blockchain. N Unlike the header in , it does not reference the previous block, but simply because there is no previous block.
[0113] The original file 7741 in the genesis block may be, for example, data captured by a device, with or without processing prior to inclusion in the blockchain. The original file 7741 is received through an interface of the system from a device, media source or node. The original file 7741 is associated with metadata, which may be generated, for example, by a user, device or system processor, or a combination thereof, either manually or automatically. The metadata may be included in a first block 7781 associated with the original file 7741.
[0114] The value 7761 in the origin block is an initial value generated based on one or more unique attributes of the original file 7741. In one embodiment, the one or more unique attributes may include a hash value of the original file 7741, metadata of the original file 7741, and other information associated with the file. In one embodiment, the initial value 7761 may be based on the following unique attributes: (1) The SHA-2 hash value of the original file (2) Device ID (3) The start timestamp of the original file (4) Initial storage location of the original file (5) The blockchain network member ID for the software that currently manages the original file and associated metadata
[0115] Other blocks in the blockchain: 7782 to 778 N However, unlike the first block 7721, the headers 7722 to 7723 of the other blocks N Each of the remaining blocks includes a hash value of the immediately preceding block, which may simply be a hash of the previous block's header, or may be a hash value of the entire previous block. By including the hash value of the preceding block in each of the remaining blocks, it is possible to trace block-by-block, as shown by arrow 780, from the Nth block back to the origin block (and associated original file), establishing an auditable and immutable chain-of-custody.
[0116] Headers 7722 to 772 in other blocks N Each of the may include other information, such as a version number, a timestamp, a nonce, root information, a difficulty level, a consensus protocol, or other parameters or information (generally related to the corresponding file or blockchain or both), or a combination thereof.
[0117] Files 7742-774 in other blocks N may be equal to the original file or may be a modified version of the original file in the origin block, depending, for example, on the type of processing performed. The type of processing performed may vary from block to block. Processing may include, for example, any modification of the file in the preceding block, such as revising information, or otherwise changing the content of the file, removing information from the file, or adding or appending information to the file.
[0118] Additionally or alternatively, processing may include just copying a file from a previous block, changing the storage location of a file, analyzing a file from one or more preceding blocks, moving a file from one storage or memory location to another, or performing an action on a file and / or its associated metadata in the blockchain. Processing that includes analyzing a file may include, for example, appending, including, or otherwise associating various analytical results, statistics, or other information related to the file.
[0119] Other blocks 7762~776 N The values in each of the blocks are unique and all different as a result of the operations performed. For example, the value in any one block corresponds to an updated version of the value in the previous block. The update is reflected in the hash of the block to which the value is assigned. The value of the block thus provides an indication of what operations have taken place in the block, and also allows tracing back through the blockchain to the original file. This tracing confirms the chain of custody of the file across the blockchain.
[0120] For example, consider the case where portions of a file in a previous block are redacted and blocked out or pixelated to protect the identity of the person represented in the file. In this case, the block containing the revised file would include metadata associated with the revised file, such as how the revision was made, who performed the revision, the timestamp at which the revision occurred, etc. The metadata can be hashed to form a value. Because the metadata for the block is different from the information hashed to form the value in the previous block, the values will be different and can be recovered when decrypted.
[0121] In one embodiment, the value of the previous block may be updated (e.g., a new hash value calculated) to form the value of the current block when any one or more of the following occurs. The new hash value, in this example embodiment, may be calculated by hashing all or part of the following information: (a) a new SHA-2-computed hash value whenever the file is processed in any way (e.g., when the file is revised, copied, altered, accessed, or any other action is taken); (b) New location of the file (c) any new metadata identified in association with the file; (d) Transfer of access to or control of a file from one blockchain participant to another blockchain participant.
[0122] FIG. 7D illustrates an embodiment of a block, which may represent the structure of a block in a blockchain 790, according to one embodiment. i Header 772 i And, File 774 i and the value 776 i Includes:
[0123] Header 772 i Block i-1 and additional reference information, which may be, for example, any of the types of information discussed herein (e.g., header information including references, properties, parameters, etc.). Every block references the hash of the previous block, except of course for the origin block. The hash value of the previous block may just be a hash of the header in the previous block, or it may be a hash of all or part of the information in the previous block, including files and metadata.
[0124] File 774 icontains multiple data, Data1, Data2, ... DataN, in that order. The data are tagged with metadata, Metadata1, Metadata2, ... MetadataN, that describe content and / or characteristics associated with the data. For example, the metadata for each data may include information indicating a timestamp for the data, information for processing the data, keywords indicative of people or other content depicted in the data, or other characteristics that may help establish the validity and content of the file as a whole, and more specifically, the use of digital evidence as described in connection with the embodiments discussed below. In addition to the metadata, each data may include a reference REF1, REF2 ... REF to the previous data to prevent tampering, gaps in the file, and sequential referencing through the file. N will be tagged.
[0125] Once metadata is assigned to data (e.g., via a smart contract), it cannot be altered without changing the hash, which can be easily identified as invalid. The metadata thus creates a data log of information that blockchain participants can access for use.
[0126] Value 776 i is a hash value or other value calculated based on any of the types of information discussed previously. For example, for any given block, Block i For a block, the value for that block may be updated to reflect the operation performed on that block, such as a new hash value for the associated file, a new storage location, new metadata, a transfer of control or access, an identifier, or other action or information to be added. Although the values in each block are shown as being separate from the metadata for the file and header data, in other embodiments the values may be based in part or in whole on this metadata.
[0127] Once the blockchain 770 is formed, at any point in time, an immutable chain of custody for a file can be obtained by querying the blockchain for a transaction history of values across blocks. This query or tracking procedure starts by decrypting the value of the most currently included block (e.g., the last (Nth) block), and then successively decrypting the values of other blocks until the origin block is reached and the original file is recovered. Note that the decoding may include decoding the header and file and associated metadata block by block.
[0128] Decryption is performed based on the type of encryption that occurred with each block. This may include the use of a private key, a public key, or a public-private key pair. For example, if asymmetric encryption is used, a blockchain participant or processor in the network may generate a public and private key pair using a predefined algorithm. The public and private keys are related to each other via a mathematical relationship. The public key may be publicly distributed so that it can be used as an address to receive messages from other users, for example an IP address or a home address. The private key is kept secret and is used to digitally sign messages sent to other blockchain participants. The signature is included in the message so that the recipient can verify it using the sender's public key. In this way, the recipient can be sure that only the sender could have sent this message.
[0129] Generating a key pair can be similar to creating an account on the blockchain, but without the need to actually register anywhere. Also, every transaction performed on the blockchain is digitally signed by the sender using his private key. This signature ensures that only the account owner can track and process files on the blockchain (if within the scope of permissions determined by the smart contract).
[0130] 8A and 8B show additional examples of use cases for blockchain that may be incorporated and used herein. In particular, FIG. 8A shows an example 800 of a blockchain 810 that stores machine learning (artificial intelligence) data. Machine learning relies on vast amounts of historical data (or training data) to build predictive models for accurate predictions on new data. Machine learning software (e.g., neural networks, etc.) often sift through millions of records to discover non-intuitive patterns.
[0131] In the example of FIG. 8A, the host platform 820 builds and deploys machine learning models for predictive monitoring of assets 830. Here, the host platform 820 may be a cloud platform, an industrial server, a web server, a personal computer, a user device, etc. The assets 830 may be any type of asset (e.g., machinery or equipment, etc.), such as an aircraft, a locomotive, a turbine, a medical machine and equipment, an oil and gas installation, a boat, a ship, a vehicle, etc. As another example, the assets 830 may be intangible assets, such as stocks, currency, digital coins, insurance, etc.
[0132] The blockchain 810 can be used to significantly improve both the process of training 802 the machine learning model and the process of predicting 804 based on the trained machine learning model. For example, at 802, rather than requiring a data scientist / engineer or other user to collect the data, historical data may be stored on the blockchain 810 by the assets 830 themselves (or through an intermediary, not shown). This can significantly reduce the collection time required by the host platform 820 to train the predictive model. For example, by using smart contracts, data can be transferred directly and securely from its original location to the blockchain 810. By using the blockchain 810 to ensure security and ownership of the collected data, the smart contract can send the data directly from the assets to the individuals who use the data to build the machine learning model. This allows data to be shared among the assets 830.
[0133] The collected data may be stored in the blockchain 810 based on a consensus mechanism that pulls together (authorized nodes) to ensure that the data being recorded is verified and accurate. The recorded data is time-stamped, cryptographically signed, and immutable; therefore, it is auditable, transparent, and secure. Adding IoT devices that write directly to the blockchain can increase both the frequency and accuracy with which data is recorded in some cases (i.e., supply chain, healthcare, logistics, etc.).
[0134] Additionally, training the machine learning model on the collected data may require multiple rounds of refinement and testing by the host platform 820. Each round may be based on additional data or data not previously considered useful for expanding the knowledge of the machine learning model. At 802, the different training and testing steps (and their associated data) may be stored on the blockchain 810 by the host platform 820. Each refinement of the machine learning model (e.g., changes in variables, weights, etc.) may be stored on the blockchain 810. This provides a verifiable proof of how the model was trained and what data was used to train the model. Additionally, when the host platform 820 finally realizes the trained model, the resulting model may be stored on the blockchain 810.
[0135] After the model is trained, it may be deployed to a live environment where predictions / decisions may be made based on the execution of the final trained machine learning model. For example, at 804, the machine learning model may be used for condition-based maintenance for assets such as aircraft, wind turbines, healthcare machines, etc. In this example, data fed back from the asset 830 may be input into the machine learning model and used to make event predictions such as failure events, error codes, etc. Decisions made by the execution of the machine learning model on the host platform 820 may be stored on the blockchain 810 to provide an auditable / verifiable proof. As one non-limiting example, the machine learning model may predict future damage / failure of a part of the asset 830 and create an alert or notification to replace the part. The data behind this decision may be stored on the blockchain 810 by the host platform 820. In one embodiment, the functions and / or actions described and / or illustrated herein may occur in or with respect to the blockchain 810.
[0136] New transactions for the blockchain may be grouped together into a new block and added to the existing hash value. This is then encrypted to create a new hash for the new block, which, when encrypted, is added to the list of upcoming transactions. The result is a chain of blocks, each containing the hash values of all preceding blocks. The computers that store these blocks periodically compare their hash values to ensure that they are all in agreement. Computers that do not agree discard the offending records. This approach is good for ensuring the tamper resistance of the blockchain, but it is not perfect.
[0137] One way for malicious users to play the system is to modify the list of transactions to their liking, but in a way that does not change the hash. This can be done by brute force, i.e. by modifying the record, encrypting the result, and asking if the hash value is the same; if not, they try again and again until they find a matching hash. The security of the blockchain is based on the belief that ordinary computers can only carry out this kind of brute force attack over totally unrealistic timescales, such as the age of the universe. Quantum computers, in contrast, are much faster (thousands of times faster) and therefore pose a much bigger threat.
[0138] FIG. 8B shows an example 850 of a quantum-secure blockchain 852 that implements quantum key distribution (QKD) to protect against quantum computing attacks. In this example, users of the blockchain can verify each other's identity using QKD, which transmits information using quantum particles such as photons that an eavesdropper cannot copy without corrupting it. In this way, senders and receivers via the blockchain can be sure of each other's identity.
[0139] In the example of FIG. 8B, there are four users 854, 856, 858, and 860. Each pair of users can share a secret key 862 (i.e., QKD) between them. In this example, there are four nodes, so there are six pairs of nodes, and thus the QKD AB , QKD AC , QKD AD , QKD BC , QKD BD , QKD CD Six different private keys862 are used, including the 862 cipher suite, the 863 cipher suite, and the 864 cipher suite. Each pair can create QKD by transmitting information using quantum particles, such as photons, that an eavesdropper cannot copy without corrupting it. In this way, pairs of users can be sure of each other's identity.
[0140] The operation of the blockchain 852 is based on two procedures: (i) the creation of transactions and (ii) the construction of blocks that aggregate new transactions. New transactions may be created in the same way as in traditional blockchain networks. Each transaction may contain information about the sender, the recipient, the creation time, the amount (or value) to be transferred, a list of reference transactions that validate that the sender has the funds for the operation, etc. This transaction record is then sent to all other nodes, where it is placed in a pool of transactions that have not yet been confirmed. Now, the two parties (i.e., a pair of users among 854-860) authenticate the transaction by providing their shared secret key 862 (QKD). This quantum signature may be attached to every transaction and is extremely difficult to tamper with. Each node checks their entries against its local copy of the blockchain 852 and verifies that each transaction has sufficient funds. However, the transaction is not yet confirmed.
[0141] Rather than performing a traditional mining process on the blocks, the blocks may be generated in a decentralized manner using a broadcast protocol. At a given time (e.g., seconds, minutes, hours, etc.), the network may apply the broadcast protocol to transactions that have not yet been confirmed, thereby achieving Byzantine consensus on the correct version of the transaction. For example, each node may possess a secret value (that particular node's transaction data). In a first round, the nodes send their secret values to each other. In subsequent rounds, the nodes communicate the information they received from other nodes in previous rounds. Now, the trusted nodes have the ability to create a complete set of transactions in a new block. This new block may be added to the blockchain 852. In one embodiment, the functions and / or actions described and / or illustrated herein may occur in or with respect to the blockchain 852.
[0142] 9 illustrates an example system 900 that supports one or more of the example embodiments described and / or illustrated herein. The system 900 includes a computer system / server 902 that is operable with numerous other general purpose or special purpose computing system environments or configurations. Examples of well-known computing systems, environments or configurations or combinations thereof suitable for use with the computer system / server 902 include, but are not limited to, personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of these systems or devices, and the like.
[0143] The computer system / server 902 is described in the general context of computer system executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system / server 902 may also be practiced in a distributed cloud computing environment where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media, including memory storage devices.
[0144] 9, a computer system / server 902 in a cloud computing node 900 is shown in the form of a general purpose computing device. The components of the computer system / server 902 may include, but are not limited to, one or more processors or processing units 904, a system memory 906, and a bus connecting various system components including the system memory 906 to the processor 904.
[0145] A bus may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or local bus, using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0146] The computer system / server 902 typically includes a variety of computer system readable media. Such media may be any available media accessible by the computer system / server 902, including both volatile and non-volatile removable and non-removable media. The system memory 906, in one embodiment, implements the flow diagrams of the other figures. The system memory 906 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 910 and / or cache memory 912. The computer system / server 902 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage system 914 may be provided for reading from and writing to a non-removable, non-volatile magnetic medium (not shown, but commonly referred to as a "hard drive"). Although not shown, a magnetic disk drive for reading from and writing to a removable, non-volatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from and writing to a removable, non-volatile optical disk, such as a CD-ROM, DVD-ROM, or other optical media, may be provided. In such an example, each may be connected to the bus by one or more data media interfaces. As shown and described in more detail below, the memory 906 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of an embodiment of the present application.
[0147] A program / utility 916 having a set (at least one) of program modules 918 may be stored in the memory 906, by way of example and not limitation, as well as an operating system, one or more application programs, other program modules and program data. Each of the operating system, one or more application programs, other program modules and program data, or some combination thereof, may include an implementation of a network environment. The program modules 918 generally perform the functions and / or methodologies of various embodiments of the present application described herein.
[0148] As will be appreciated by one of ordinary skill in the art, aspects of the present application may be embodied as a system, method, or computer program product. Accordingly, aspects of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, microcode, etc.), or an embodiment combining software and hardware aspects, all of which may be generally referred to herein as a "circuit," "module," or "system." Additionally, aspects of the present application may take the form of a computer program product embodied in one or more computer readable medium(s) having computer readable program code embodied therein.
[0149] The computer system / server 902 may communicate with one or more external devices 920, such as a keyboard, pointing device, display 922; one or more devices that allow a user to interact with the computer system / server 902; or any device (e.g., network card, modem, etc.) that allows the computer system / server 902 to communicate with one or more other computing devices, or a combination thereof. Such communication may occur through an I / O interface 924. Additionally, the computer system / server 902 may communicate with one or more networks, such as a local area network (LAN), a general wide area network (WAN), or a public network (e.g., the Internet), or a combination thereof, through a network adapter 926. As shown, the network adapter 926 communicates with other components of the computer system / server 902 through a bus. It is understood that other hardware and / or software components, not shown, may be used in conjunction with the computer system / server 902. Examples include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives and data archive storage systems.
[0150] Although at least one exemplary embodiment of the system, method and non-transitory computer-readable medium has been illustrated in the accompanying drawings and described in the detailed description above, it will be understood that the present application is not limited to the disclosed embodiments, but may be subject to numerous rearrangements, modifications and substitutions, as made clear and defined by the following claims. For example, the capabilities of the systems of the various drawings may be performed by one or more of the modules or components described herein, or may be performed in a distributed architecture, including pairs of transmitters, receivers, or both. For example, all or part of the functionality performed by individual modules may be performed by one or more of those modules. Furthermore, the functionality described herein may be performed at various times, with respect to various events, within or outside of a module or component. Also, information transmitted between the various modules may be transmitted between the modules via at least one of a data network, the Internet, a voice network, an Internet Protocol network, a wireless device, a wired device, or multiple protocols, or a combination thereof. Also, messages transmitted or received by any of the modules may be transmitted or received directly, or via one or more of the other modules, or both.
[0151] Those skilled in the art will appreciate that the "system" may be embodied as a personal computer, a server, a console, a personal digital assistant (PDA), a mobile phone, a tablet computing device, a smartphone, or any other suitable computing device or combination of devices. Presenting the above functions as being performed by a "system" is not intended to limit the scope of the present application in any way, but is intended to provide one example of many embodiments. Indeed, the methods, systems, and apparatus disclosed herein may be implemented in localized and distributed fashions consistent with computing technology.
[0152] It should be noted that some of the functionality of the systems described herein have been presented as modules, among other things, to emphasize their implementation independence. For example, a module may be implemented as a hardware circuit comprising custom very large scale integrated (VLSI) circuits or gate arrays, off-the-shelf semiconductors such as logic chips, transistors, or other discrete components. A module may also be implemented in programmable hardware devices such as field programmable gate arrays, programmable array logic, programmable logic devices, graphics processing units, and the like.
[0153] The modules may be implemented at least in part in software for execution by various types of processors. An identified unit of executable code may include one or more physical or logical blocks of computer instructions, which may be organized, for example, as an object, procedure, or function. Nevertheless, the executable files of the identified modules need not be physically located together, but may include different instructions stored in different locations, which, when logically combined together, comprise the modules and achieve the stated purpose of the modules. Furthermore, the modules may be stored on a computer-readable medium, which may be, for example, a hard disk drive, a flash device, a random access memory (RAM), a tape, or any other medium used to store data.
[0154] Indeed, a module of executable code may be a single instruction, or many instructions, and may be distributed across several different code segments, among different programs, and across multiple memory devices. Similarly, operational data may be identified and illustrated herein in modules, but may be embodied in any suitable form and organized within any suitable type of data structure. Operational data may be collected as a single data set, or may be distributed across different locations, including different storage devices, or may simply exist at least in part as electronic signals over a system or network.
[0155] It will be readily understood that the components of the present application, as generally described and illustrated in the figures herein, could be arranged and designed in a wide variety of different configurations, and thus, the detailed description of the embodiments is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application.
[0156] Those skilled in the art will readily appreciate that the above may be practiced in a different order of steps, or with hardware elements in different configurations, or both, than those disclosed. Thus, while the present application has been described based on these preferred embodiments, it will be apparent to those skilled in the art that certain modifications, variations, and alternative constructions will be apparent.
[0157] While preferred embodiments of the present application have been described, it should be understood that the described embodiments are merely exemplary, and that the scope of the present application should be defined solely by the appended claims, taking into account their full range of equivalents and modifications (e.g., protocols, hardware devices, software platforms, etc.).
Claims
1. a storage configured to store an index structure including an index of keys from a blockchain ledger, the keys being stored as nodes in the index structure; a processor configured to receive a blockchain request for data stored in the blockchain ledger, read a set of keys for non-critical queries included in the blockchain request from the nodes in the index structure, and generate and store a read set for the blockchain request that does not include values for the set of keys for the non-critical queries; 13. An apparatus comprising:
2. The apparatus of claim 1 , wherein the index structure comprises a binary tree in which the keys are arranged as nodes in a hierarchical manner.
3. 2. The apparatus of claim 1, wherein the processor is further configured to build the index structure based on key values added to the blockchain ledger.
4. The apparatus of claim 1 , wherein the processor is configured to retrieve the set of keys one by one from nodes in the index structure via a next function.
5. The apparatus of claim 1 , wherein the processor is configured to identify a query of the blockchain request as the non-critical query if the query does not affect the validity of the blockchain request.
6. 2. The apparatus of claim 1, wherein the processor is further configured to validate the blockchain request based on a previous set of reads for the blockchain request that did not include values for the set of keys read from the index structure.
7. 2. The apparatus of claim 1, wherein the index structure is implemented within the logic of a chaincode of a blockchain peer node.
8. 2. The apparatus of claim 1 , wherein the keys in the index structure correspond to unique values stored in a blockchain of the blockchain ledger.
9. storing an index structure including an index of keys from a blockchain ledger, the keys being stored as nodes in the index structure; receiving a blockchain request for data to be stored in the blockchain ledger; Retrieving a set of keys for non-critical queries included in the blockchain request from the nodes in the index structure; generating and storing a read set for the blockchain request that does not include values for the set of keys of the non-critical query; A method comprising:
10. The method of claim 9 , wherein the index structure comprises a binary tree in which the keys are arranged as nodes in a hierarchical manner.
11. 10. The method of claim 9, further comprising building the index structure based on key values added to the blockchain ledger.
12. 10. The method of claim 9, further comprising the step of reading the set of keys one by one from nodes in the index structure via a next function.
13. 10. The method of claim 9, further comprising identifying a query of the blockchain request as the non-critical query if the query does not affect the validity of the blockchain request.
14. 10. The method of claim 9, further comprising: validating the blockchain request based on a previous set of reads for the blockchain request that did not include values for the set of keys read from the index structure.
15. 10. The method of claim 9, wherein the index structure is implemented within the logic of a chaincode of a blockchain peer node.
16. 10. The method of claim 9, wherein the keys in the index structure correspond to unique values stored in a blockchain of the blockchain ledger.
17. 1. A non-transitory computer-readable medium comprising instructions that, when read by a processor, cause the processor to perform a method, the method comprising: storing an index structure including indexes of keys from a blockchain ledger, the keys being stored as nodes in the index structure; receiving a blockchain request for data to be stored in the blockchain ledger; Retrieving a set of keys for non-critical queries included in the blockchain request from the nodes in the index structure; generating and storing a read set for the blockchain request that does not include values for the set of keys of the non-critical query; A non-transitory computer readable medium comprising:
18. 20. The non-transitory computer-readable medium of claim 17, wherein the index structure comprises a binary tree in which the keys are arranged as nodes in a hierarchical manner.
19. 20. The non-transitory computer-readable medium of claim 17, wherein the method further comprises building the index structure based on key values added to the blockchain ledger.
20. 20. The non-transitory computer-readable medium of claim 17, wherein the method includes reading the set of keys one by one from nodes in the index structure via a next function.
Citation Information
Patent Citations
Consistent execution of partial queries in hybrid dbms
US20180046643A1
Automatic generating analytics from blockchain data
WO2018172839A1
Anti-replay attack authentication protocol
WO2019137563A2
