SCALABLE, SECURE, EFFICIENT, AND ADAPTABLE DISTRIBUTED DIGITAL LEDGER TRANSACTION NETWORK
The present disclosure relates to systems, methods, and non-transitory computer readable storage media for implementing a scalable, secure, efficient, and adaptable distributed digital ledger transaction network. Indeed, the disclosed systems can reduce storage and processing requirements, improve security of implementing computing devices and underlying digital assets, accommodate a wide variety of different digital programs (or “smart contracts”), and scale to accommodate billions of users and associated digital transactions. For example, the disclosed systems can utilize a host of features that improve storage, account/address management, digital transaction execution, consensus, and synchronization processes. The disclosed systems can also utilize a new programming language that improves efficiency and security of the distributed digital ledger transaction network.
The present application is a continuation of U.S. application Ser. No. 16/442,475, filed on Jun. 15, 2019. The aforementioned application is hereby incorporated by reference in its entirety.
BACKGROUNDRecent years have seen significant advancements in hardware and software platforms for managing distributed ledger databases across a network of computing devices. Indeed, so-called “blockchain” systems can manage a consensus ledger via a network of entities distributed throughout the world and without a central entity that can be corrupted or otherwise manipulated to undermine the security and performance of the digital ledger. Specifically, conventional blockchain systems can decentralize control by maintaining a digital ledger on many replicated servers, or validator nodes. Algorithms, cryptography, and incentives enable such networks of validator nodes to maintain a collective, tamper-resistant ledger of transactions or other digital information.
Despite these advances, however, conventional blockchain systems suffer from several technological shortcomings that undermine efficiency, scalability, flexibility, and security of the implementing computing devices and corresponding distributed databases. For example, conventional blockchain systems often require significant processing and storage for validator nodes and client devices that interact across the implementing network. As mentioned above, many conventional blockchain systems maintain a duplicate database across replicated servers that store a history of digital transactions. Moreover, many conventional blockchain systems sequentially analyze transactions across the validator nodes to achieve consensus on the transactions and ultimately to update the distributed and duplicated ledger. This approach can place exorbitant storage and processing demands on computing devices. Indeed, the demand for certain processing devices has skyrocketed in recent years in proportion to the increased computing demand required by conventional blockchain systems in storing and analyzing transactions across distributed computer networks.
The inefficiencies of conventional blockchain systems have also hampered the scalability of these systems. For example, processing and storage burdens imposed by conventional blockchain systems undermine transaction throughput across the network and thus limit the rate and number of transactions that conventional systems can manage. Accordingly, conventional blockchain systems generally lack the scalability to provide a global distributed computing solution for managing digital transactions. Indeed, to date, conventional blockchain systems have generally been limited to a small population of niche users, excluding billions from accessing and utilizing blockchain technology.
In addition to efficiency and scalability concerns, conventional blockchain systems are also rigid and inflexible. For example, conventional blockchain systems provide limited options with regard to different programs, transactions, contracts, assets, and/or resources that can be accommodated or executed via a distributed database. Moreover, conventional blockchain systems provide limited control for storage at validator nodes, limited flexibility in executing transactions at validator nodes, and limited options over authentication keys and validation approaches for account holders and users of client devices accessing the network.
As mentioned above, conventional blockchain systems are also susceptible to inaccuracies and/or digital security attacks. For example, groups of validator nodes can agree on different versions of digital ledgers, resulting in inaccuracies, hard-forks, and insecurity of the underlying digital information. Some conventional systems perform consensus on transaction blocks, assuming execution of the transactions will be deterministic; thus, any non-deterministic execution behavior can result in inaccurate results at individual devices (or inaccuracies propagated across the digital ledger). Further, many conventional systems utilize bloom filters when providing transaction details in response to a query, risking false positives and failing to provide the ability for negative proofs to confirm accuracy of account data. Further, conventional blockchain systems often provide unrestricted digital asset access to user accounts storing digital assets, leading to exposure of all assets to malicious attacks upon loss of a private key associated with a user account. Additionally, as many conventional systems perform reference safety analysis on source code while programs are executed at the machine code level, many such systems inaccurately identify reference safety issues and/or introduce vectors for malicious attacks.
These, along with additional problems and issues, exist with regard to conventional blockchain systems.
SUMMARYOne or more embodiments described herein provide benefits and/or solve one or more of the foregoing or other problems in the art with systems, methods, and non-transitory computer readable storage media for implementing a scalable, secure, efficient, and adaptable distributed digital ledger transaction network. Indeed, the disclosed systems can reduce storage and processing requirements, improve security of implementing computing devices and underlying digital assets, accommodate a wide variety of different digital programs (or “smart contracts”), and scale to accommodate billions of users and associated digital transactions.
For example, the disclosed systems can make data storage more scalable and efficient by treating the blockchain in consensus as a single data structure that records the history of transactions and states over time. This implementation simplifies the work of computing devices accessing the blockchain, allowing them to read data from any point in time and verify integrity using a unified framework. Similarly, to obtain agreement among validator nodes, the disclosed systems can utilize a unique Byzantine-fault-tolerant consensus protocol. This approach provides high transaction throughput, low latency, and a more computationally-efficient method for achieving consensus relative to other blockchains.
In addition, the disclosed systems can utilize a new programming language to implement smart contracts on the blockchain. In particular, this new programming language makes it inherently easier to write code to fulfill user intent, thereby avoiding unintended bugs or security incidents (e.g., preventing asset cloning). Specifically, the disclosed systems can utilize a programming language that enables a linear data type that constrains digital assets to properties of a physical asset (e.g., a single owner, can only be spent once, restrictions against creation of new resources). In some embodiments, the disclosed systems also utilize an implementing programming language having a tree structure memory model for improved reference safety analysis. Using this programming language, the disclosed systems can implement a static-dynamic reference safety analysis at the bytecode level, reducing vectors for malicious attacks.
Furthermore, the disclosed systems provide a host of additional features that improve storage, account/address management, digital transaction execution, consensus, and synchronization processes. For example, with regard to storage, the disclosed systems can implement flexible storage deletion and/or storage consolidation policies that allow individual computer nodes to delete distributed data structures while retaining sufficient ledger information to accurately achieve consensus across the distributed digital ledger transaction network. The disclosed systems can also implement lazy account eviction policies that allow for more flexible storage management based on the individual preferences and/or the availability of computer memory or processing power at individual computing devices. The disclosed systems can also utilize a unique scratch pad data structure that flexibly tracks variations of the digital ledger while waiting for consensus.
Similarly, the disclosed systems can provide a variety of improvements with regard to user accounts, addresses, and account data accessible on a digital ledger. To illustrate, the disclosed systems can utilize re-encrypted sub-addresses to avoid tracing of account activity across the network. The disclosed systems can reduce barriers to initiate transactions by utilizing e-mail addresses (or other user identifiers) to determine and encrypt main address and sub-address identifiers corresponding to the distributed ledger. In addition, the disclosed systems can separate smart contract code from smart contract data within user accounts, allow individual accounts to store multiple smart contracts, delegate account permissions to other user accounts on the digital ledger, and decouple account addresses from cryptographic keys (allowing accounts to flexibly rotate authenticated keys to improve security across the network).
Furthermore, the disclosed systems can improve digital transactions executed across a distributed digital ledger transaction network. For example, the disclosed systems can implement transactions on the network using arbitrary transactions scripts and configurable smart contracts to manage tasks surrounding transaction execution. To illustrate, in some embodiments, the disclosed systems can utilize configurable smart contracts to accept/reject transactions, deduct gas payments, increment sequence numbers, and distribute gas to computer nodes (and flexibly modify these processes by consensus as needs of the distributed digital ledger transaction network change over time). In some embodiments, the disclosed systems further improve transaction execution by performing speculative parallel execution of transactions to reduce the time and computing overhead needed to execute a block of transactions, utilizing access limits to reduce exposure of digital assets resulting from theft or loss of an access key, and using transaction event counters to accurately identify transaction event details and perform negative proofs.
In addition to improvements in digital transaction execution, the disclosed systems can also improve consensus processes relative to conventional systems. For example, the disclosed systems can improve accuracy by performing consensus on state data structures reflecting execution results (rather than performing consensus on potentially non-deterministic transactions). The disclosed systems can also implement consensus pipeline rules to ensure that committed ledgers accurately reflect the state of the digital ledger. In some embodiments, the disclosed systems further implement system restart protocols to maintain consensus safety of the network (e.g., even when all nodes experience a shutdown). Moreover, the disclosed systems can efficiently, flexibly, and accurately control validator nodes participating in consensus by managing epochs of voting rights via smart contracts.
In addition to the foregoing improvements, the disclosed systems can also improve synchronization processes across the distributed digital ledger transaction network. For instance, the disclosed systems can improve the efficiency of synchronization across the distributed digital ledger transaction network by implementing incremental and parallel verification at various computer nodes synchronizing to the network. In addition, in some embodiments the disclosed systems utilize waypoints (e.g., published indicators of particular ground-truth reference states) to facilitate synchronization of computer nodes to the network (e.g., to correct conflicting digital ledger states, to generate a hard fork, or implement a genesis block).
In sum, the disclosed systems can implement a distributed digital ledger transaction network with high transaction throughput, low latency, and an efficient, high-capacity storage system. Moreover, the disclosed systems can securely manage a wide variety of digital assets, flexibly accommodate a variety of different customizable programs and smart contracts, and scale to execute and manage digital transactions for users across the globe.
This disclosure will describe one or more embodiments of the invention with additional specificity and detail by referencing the accompanying figures. The following paragraphs briefly describe those figures, in which:
One or more embodiments described herein include a ledger transaction system for implementing a scalable, secure, efficient, and adaptable distributed digital ledger transaction network. For example, the ledger transaction system can manage a programmable database to support low-volatility digital assets (e.g., digital cryptocurrency) accessible around the world. To illustrate, the ledger transaction system can be implemented as part of a decentralized network in which a set of validator node devices jointly maintain a database of programmable resources (e.g., digital assets). The ledger transaction system can utilize an authenticated data structure that maps a logical data model of these databases to a set of tree structures (e.g., Merkle trees). The ledger transaction system can then utilize validator node devices to execute transactions and communicate via consensus to agree on the state of the authenticated data structures. In particular, the ledger transaction system can utilize a unique Byzantine fault tolerant consensus protocol that allows the network (even with potentially malicious validators) to maintain a consistent database over time by executing transactions via a new programming language and coming to agreement on their execution using the authenticated data structures.
As mentioned above, the ledger transaction system can provide a variety of improvements relative to conventional blockchain systems. For instance, in one or more embodiments, the ledger transaction system utilizes a new programming language that improves security, efficiency, and flexibility. In particular, the ledger transaction system can utilize a programming language that enables flexible transactions via arbitrary transaction scripts and allows user-defined code and datatypes, including “smart contracts” via modules.
Specifically, the programming language provides the ability to define custom resource types that enforce linearity. For example, the ledger transaction system can utilize linear data types to represent digital assets associated with the distributed digital ledger transaction network. By representing the digital assets as linear data types, the ledger transaction system subjects the digital assets to linear typing rules. For example, a digital asset represented as a linear data type must be used exactly once within a transaction and cannot be copied. By representing digital assets as linear data types, the ledger transaction system provides more flexible and more secure management of digital assets.
In some embodiments, the ledger transaction system uses a verifiable bytecode language as the executable representation of this programming language. This allows the ledger transaction system to utilize a combined static-dynamic reference safety analysis of transaction scripts and modules submitted for execution on the distributed digital ledger transaction network. Indeed, the ledger transaction system can perform the bulk of a reference safety analysis statically at the bytecode level using load-time bytecode verification (on structured memory tree models) and perform the remainder of the analysis dynamically at runtime. This approach improves security and reduces vectors for malicious attacks (e.g., attacks that seek to exploit or bypass a compiler). This approach also results in fewer instructions than a higher-level source language, reducing the overall footprint and making it easier to spot and avoid implementation errors.
In addition to improvements with regard to the implementing programming language, the ledger transaction system can improve a variety of other processes across a distributed digital ledger transaction network. For example, the ledger transaction system can improve storage, addressing and account management, transaction execution, consensus, and synchronization processes. For example, with regard to storage, the ledger transaction system can implement a variety of features to improve the efficiency, flexibility, and security of data structures maintained across a distributed digital ledger transaction network.
To illustrate, as mentioned above, the ledger transaction system can maintain a plurality of authenticated data structures that store the data of the digital ledger. In particular, an authenticated data structures can include a tree data structure (e.g., a sparse Merkle tree or Merkle accumulator) with nodes mapped to entries in a versioned database. For example, the authenticated data structures can include a state data structure (e.g., a state tree mapped to a state database reflecting user account states), an event data structure (e.g., an event tree mapped to event data for a particular transaction), and a transaction data structure (e.g., a transaction tree reflecting transactions together with states and events resulting from the transactions). By utilizing an authenticated tree data structure, the ledger transaction system can efficiently encode current and historical states, events, and/or transactions reflected in databases storing programmable resources. For example, the ledger transaction system can utilize a transaction tree structure, where the root value of the transaction state tree provides a unique representation of the current and historical states, events, and transactions recorded in corresponding databases. Moreover, the ledger transaction system can efficiently obtain consensus across the distributed digital ledger transaction network with reference to this root value.
In addition, in some embodiments, the ledger transaction system implements a set of storage deletion rules and/or a set of storage consolidation rules to manage the storage of the computer nodes of the distributed digital ledger transaction network. For example, the ledger transaction system can apply configurable storage deletion rules that allow different computer nodes to identify what (or what portions) of data structures to maintain. Moreover, the ledger transaction system can automatically remove portions of data structures to reduce storage and processing demands. For instance, the ledger transaction system can delete sub-trees of authenticated tree structures upon identifying that the sub-trees include full (e.g., populated) leaf nodes. Similarly, the ledger transaction system can store multiple different versions of a data structure by re-using unchanged portions of a previous version. In particular, the ledger transaction system can generate sub-tree components (reflecting only modified nodes) together with pointers referring unchanged nodes within historical tree structures. Thus, the ledger transaction system can efficiently and flexibly manage storage on the distributed digital ledger transaction network.
In some embodiments, the ledger transaction system can also improve storage by performing lazy account eviction. In particular, the ledger transaction system can delete, at a computer node, account data associated with expired user accounts based on user preferences and/or the computing resources available at that computer node. For example, the ledger transaction system can delete expired account data at a computer node without executing a transaction on the distributed digital ledger transaction network. Moreover, by embedding eviction dates in authenticated data structures, the ledger transaction system can maintain consistent query responses for data across the distributed digital ledger transaction network (even while providing each client device flexibility to delete expired data at its leisure). Furthermore, in one or more embodiments, the ledger transaction system can securely re-cache evicted accounts based on data representations remaining in the authenticated data structure. In this manner, the ledger transaction can securely and flexibly delete storage at computer nodes for more efficient storage management.
Additionally, one or more embodiments of the ledger transaction system improves storage processes by utilizing a scratch pad data structure to track execution results before committing them to storage. In particular, the ledger transaction system can utilize the scratch pad data structure to temporarily store execution results of conflicting transaction blocks and how those execution results affect the state of user accounts maintained on the distributed ledger. The ledger transaction system can then commit execution results stored in the scratch pad data structure based on the consensus protocol. Accordingly, the ledger transaction system can flexibly execute conflicting transaction blocks to ensure that computer nodes accurately reflect the consensus digital ledger.
In addition to improvements in storage, as mentioned above the ledger transaction system can also improve management of addresses and/or accounts within a distributed digital ledger transaction network. For example, in some embodiments, the ledger transaction system generates encrypted sub-addresses unique to a particular transaction in order to securely protect the sub-address from identification by external entities. For example, the ledger transaction system can encrypt a sub-address associated with a user account using a public cryptographic key associated with the user account. In one or more embodiments, the ledger transaction system utilizes a public document (e.g., a billboard), digital visual codes, email addresses (and/or DNS records), telephone numbers, or user IDs to identify account addressing information and/or public encryption keys. In this manner, the ledger transaction system can flexibly initiate and execute transactions without leaving traceable information linked to sub-addresses on the digital ledger.
Additionally, in one or more embodiments, the ledger transaction system can separate smart contract code from smart contract data within user accounts (in contrast to conventional systems that use singleton-like objects to execute smart contracts). The ledger transaction system can utilize a module (smart contract code) to define the attributes of a resource (smart contract data/values) owned by a corresponding user account, where the module defines the procedures that can be used to modify, create, delete, or otherwise interact with the resource. The ledger transaction system can utilize the module to generate one or more resources sharing the same attributes and governed by the same set of procedures. Further (in contrast to conventional systems that generally store a single smart contract with regard to an account), the ledger transaction system can implement an addressing scheme for storing multiple modules and/or resources under a single user account address.
The ledger transaction system can further improve account management by storing and transferring variety of digital assets. For example, in one or more embodiments, the ledger transaction system can generate a resource corresponding to withdraw permissions of a user account. The ledger transaction system can then delegate the withdraw permissions to another user account by executing a transaction sent from the user account transferring the withdraw permissions (i.e., as a digital asset). Thus, the ledger transaction system can flexibly provide access to the digital assets of a user account to another account according to the needs of the user associated with the user account.
Additionally, the ledger transaction system can improve management of accounts across the distributed digital ledger transaction network by decoupling authentication keys associated with user accounts from the addresses of the user accounts. For example, the ledger transaction system can replace the authentication key of a user account without requiring the contents of the user account be moved to a new address. To illustrate the ledger transaction system can generate a new authentication key for a user account if one of the cryptographic keys—such as the private encryption key—associated with the user account leaks. Thus the ledger transaction system can modify authentication keys to provide flexible security solutions for user accounts.
As mentioned above, in addition to storage and account/addressing improvements, the ledger transaction system can also improve transaction execution within a distributed digital ledger transaction network. For example, in some embodiments, the ledger transaction system utilizes arbitrary transaction scripts for executing transactions on the distributed digital ledger transaction network. Indeed, the ledger transaction system can utilize transaction scripts containing an arbitrary bytecode program that can invoke multiple procedures from various modules, use conditional logic, and perform local computation in a single script. The transaction script can invoke the module procedures to modify, create, destroy, or otherwise interact with one or more resources corresponding to that module. In other words, the ledger transaction system can utilize transaction scripts to interact with resources based on the procedures defined in the corresponding module. Indeed, in one or more embodiments, the ledger transaction system limits interaction with the resources to the corresponding module's procedures in order to provide for data abstraction. Thus, the ledger transaction system can utilize transaction scripts to more flexibly execute transactions on the distributed digital ledger transaction network.
The ledger transaction system can further improve transactions by utilizing modules (i.e., smart contracts) as part of the process of transaction execution. For example, the ledger transaction system can utilize a smart contract to perform checks on transactions and reject the transactions if necessary. In addition, the ledger transaction system can utilize a smart contract to perform post-execution tasks, such as incrementing a sequence number stored at a user account and deducting a transaction fee from the user account. Additionally, the ledger transaction system can utilize a smart contract to distribute gas payments to computer nodes participating on the distributed digital ledger transaction network. In one or more embodiments, these modules are configurable, such that they can be replaced or updated as needed. Thus, the ledger transaction system utilize smart contracts to execute transactions and flexibly modify the rules governing transactions by consensus over time.
In one or more embodiments, the ledger transaction system also improves execution of transactions by performing speculative parallel execution of a plurality of transactions. For example, the ledger transaction system can identify a first state data structure of the distributed digital ledger transaction network (i.e., a first state of the digital ledger) and a plurality of transactions associated with user accounts of the distributed digital ledger transaction network. The ledger transaction system can then perform a preliminary execution of the transactions in parallel relative to the first state data structure to determine a plurality of transaction results and dependencies among the transactions with regard to the user accounts. The ledger transaction system can then modify the first state data structure to a second state data structure by applying the plurality of transaction results based on the dependencies of the transactions. By executing transactions in parallel, and committing transactions to storage based on determined dependencies, the ledger transaction system executes transactions more flexibly and efficiently than conventional systems.
The ledger transaction system can also improve security and flexibility of transaction execution by utilizing access limits to control access to digital assets associated with a user account. For example, in one or more embodiments, the ledger transaction system can implement access limits that must be satisfied before granting access to digital assets. In some embodiments, the ledger transaction system can require a threshold number of access keys from a group of keys before providing access to a user account. Moreover, in some embodiments, the ledger transaction system 106 utilizes rate/value limited access keys and corresponding key limits to limit the access provided to the digital assets of a user account in executing transactions. For example, the ledger transaction system can limit the time for which an access key is valid and/or the amount of digital assets (e.g., the value of digital currency) accessible by that access key. Using these access limits, the ledger transaction system provides more security with regard to digital assets. Specifically, the ledger transaction system can utilize access limits to prevent unlimited access to digital accounts from a malicious actor in the event that an access key is leaked or stolen.
The ledger transaction system can also improve transactions across the distributed digital ledger transaction network by utilizing transaction event counters to track and report transaction event details. For example, upon executing a transaction associated with a user account, the ledger transaction system can generate one or more transaction events corresponding to that user account (within an event data structure). The ledger transaction system can then increment count values of transaction event counters corresponding to those transaction events (within a state data structure). Client devices implementing the ledger transaction system can monitor (e.g., poll) the transaction event counters to determine when events have occurred, and then utilize count values to request and verify transaction details (from the transaction data structure). Thus, the ledger transaction system can more accurately indicate when a transaction event has occurred and more efficiently provide event data. The ledger transaction system can also poll transaction event counters to perform negative proofs establishing that account data has not changed.
As mentioned above, in addition to improving execution of transactions, the ledger transaction system can also improve the process of obtaining consensus across the distributed digital ledger transaction network. For example, in one or more embodiments, the ledger transaction system utilizes the validator node devices of the distributed digital ledger transaction network to perform consensus based on the execution results corresponding to a transaction block, rather than the performing consensus only on the transactions themselves. In other words, the ledger transaction system can have validators collectively sign the full resulting state of a block, rather than a sequence of transactions. In this manner, the ledger transaction system anticipates non-deterministic execution behavior and ensures that the validator nodes commit an accurate representation of the digital ledger to storage upon the transaction blocks reaching consensus.
In addition, the ledger transaction system can also improve consensus processes by utilizing a method for pipelining the consensus protocol. Indeed, in one or more embodiments, the validator node devices of the distributed digital ledger transaction network vote on the execution results of a transaction block in several rounds of voting before the ledger transaction system commits those execution results to storage. For example, the ledger transaction system can apply a contiguous 3-chain commit rule by committing a first state of the digital ledger to memory after three contiguous rounds (the first state of the digital ledger and two subsequent states of the digital ledger) have obtained consensus across the distributed digital ledger transaction network. In this manner, the ledger transaction system can ensure the accuracy of committed data structures.
Further, the ledger transaction system can also improve consensus safety of validator node devices upon a system restart. For example, before a validator node device submits a vote for a transaction block, the ledger transaction system can store, at each validator node device, the consensus state for that validator node device (including the last voted round and the preferred block round). Upon a system restart, the ledger transaction system can load the consensus state at the validator node device to continue participating in consensus without issue. In this manner, even if all validator nodes shut down, the ledger transaction system can ensure consensus safety when the validator nodes restart.
As mentioned above, consensus can include voting amongst a plurality of validator nodes for a particular ledger state. In one or more embodiments, the ledger transaction system improves this consensus process by managing the voting rights of the validator node devices via smart contract. For example, the ledger transaction system can implement a proof-of-stake protocol to allow user accounts of the distributed digital ledger transaction network to manage participation in the set of validator node devices. The ledger transaction system can further manage changes to the set of validator node devices via a smart contract. In one or more embodiments, the ledger transaction system utilizes modules to manage the proof-of-stake protocol and/or the changes to the set of validator node devices. Indeed, the ledger transaction system can utilize a module to enforce a change to the set of validator node devices at the boundary of an epoch.
In addition to consensus, the ledger transaction system can also provide technical benefits with regard to synchronization processes of the distributed digital ledger transaction network. For example, in some embodiments, the ledger transaction system uses incremental verification at a computer node in synchronizing to the distributed digital ledger transaction network. Indeed, a synchronizing computer node can download data associated with the digital ledger together with data proofs (e.g., a Merkle proof) in segments. The ledger transaction system can then verify, at the client device, that the received data is accurate before downloading more data. Thus, the ledger transaction system can more efficiently synchronize computer nodes to the distributed digital ledger transaction network.
Additionally, the ledger transaction system can improve synchronization efficiency utilizing a parallel synchronization approach. Indeed, the ledger transaction system can download different segments of data and corresponding proofs associated with the digital ledger (e.g., different snapshots of the state of the digital ledger) on separate verification devices. The ledger transaction system can then use each verification device to verify the segment of data downloaded to that device in parallel with the other verification devices. Accordingly, the ledger transaction system can more efficiently synchronize computer nodes to the distributed digital ledger transaction network.
In one or more embodiments, the ledger transaction system also facilitates synchronization across the distributed digital ledger transaction network utilizing waypoints. In particular, the ledger transaction system can generate and use a waypoint to indicate the correct/preferred version of a digital ledger to utilize across the distributed digital ledger transaction network. By utilizing waypoints, the ledger transaction system can also facilitate acceptance of certain transaction (i.e., FTVM transactions) that may otherwise be rejected. For example, the ledger transaction system can utilize waypoints to facilitate acceptance of FTVM transactions that establish a genesis block or create a hard fork on the distributed digital ledger transaction network.
As illustrated by the foregoing discussion, the present disclosure utilizes a variety of terms to describe features and benefits of the ledger transaction system. Additional detail is now provided regarding the meaning of these terms. For example, As used herein, the term “digital ledger” (or “distributed digital ledger” or “public ledger”) refers to common data maintained across a plurality of computing devices. In particular, a digital ledger can include one or more common data structures maintained by a plurality of computing devices that reflects states, transactions, events, and/or account data. To illustrate, a digital ledger can include one or more data structures reflecting the state of the network (i.e., the state of the user accounts of the network), data associated with transactions executed across the network, data corresponding to transaction events, and/or data relating to consensus of the digital ledger. The digital ledger can include, but is not limited to, the following properties: publicly-available (i.e., viewed by anyone), tamper-resistant (i.e., data manipulation is detectable), transparent (i.e., anyone can view the history of the digital, including executed transactions), and replicated (i.e., every computer node has a copy).
Additionally, as used herein, the term “distributed digital ledger transaction network” refers to a network of computing devices for maintaining a digital ledger. In particular, a distributed digital ledger transaction system can include a collection of computing devices, associated peripherals, communication protocols, and communication mediums that can implement and/or interact with a system implementing a digital ledger (e.g., the ledger transaction system). For example, a distributed digital ledger transaction network can include one or more client devices and computer nodes communicating via a network to implement and/or interact with the ledger transaction system. As the distributed digital ledger transaction network can implement a digital ledger, in one or more embodiments, the terms “state of the distributed digital ledger transaction network” and “state of the digital ledger” are used synonymously.
Further, as used herein, the term “computer node” refers to a computing device participating in the distributed digital ledger transaction network. In particular, a computer node can refer to a computing device that stores and maintains, at least part of, the digital ledger. For example, a computer node can include a full node device (e.g., a “full node”) or a validator node device (e.g., a “validator node”).
Additionally, as used herein, the term “user account” refers to an account of the distributed digital ledger transaction network. In particular, a user account can refer to a collection of code and/or data (i.e., modules and/or resources) stored within a state data structure of the distributed digital ledger transaction network. A user account can be associated with a user of the distributed digital ledger transaction network but is not limited to such an account. For example, a user account can also include an administrative account, or an account otherwise used to store code or data unassociated with a particular user. Similarly, a user account can include custodial wallets that act on behalf of their users.
As used herein, the term “public key” (or “public cryptographic key,” or “public encryption key,” or “asymmetric key”) refers to a publicly visible cryptographic key. In particular, a public key can refer to a cryptographic key associated with a user account meant to be sent to and/or used by entities unassociated with the user account. For example, a public key can be sent with a transaction from a user account to a validator node device of the distributed digital ledger transaction network. A public key can have a corresponding private key.
As used herein, the term “private key” (or “private cryptographic key,” or “private encryption key”) refers to a privately kept cryptographic key. In particular, a private key can refer to a cryptographic key associated with a user account (and corresponding to a public key of the user account) that is maintained in secrecy. An example use of a private key includes signing (e.g., encrypting) a transaction sent from a user account using a private key corresponding to the user account.
Additionally, as used herein, the term “authentication key” refers to a value authenticating a user account. In particular, an authentication key can refer to a value stored at a user account used to authenticate the user account when the user account sends a data (e.g., a transaction request) across the distributed digital ledger transaction network (e.g., to a validator node device). For example, an authentication key can include the account address or hash of the account address of the corresponding user account or a hash of the public key of the corresponding user account. As described below, in some embodiments the ledger transaction system creates a modified authentication key that is divorced from the account address.
Further, as used herein, the term “main public address identifier” (or “main address identifier” or “public address identifier”) refers to an identifier for the main address of a user account of the distributed digital ledger transaction network. In particular, a main public address identifier can include the main public address itself or a value associated with a user account that indicates the main address of the user account. As used herein, the term “main public address” or “main address” or “public address” or “address” refers to an account address of a user account on the distributed digital ledger transaction network. In particular, a main public address can refer to an account address directly associated with and tracked by the digital ledger.
Relatedly, as used herein, the term “sub-address identifier” refers to an identifier for a sub-address associated with a user account of the distributed digital ledger transaction network. In particular, a sub-address identifier can refer to a sub-address itself or a value indicating a sub-account associated with a user account of the distributed digital ledger transaction network. Indeed, in one or more embodiments, a user account of the distributed digital ledger transaction network maintains an internal database of one or more sub-accounts. The user account can identify a particular sub-account using the corresponding sub-address.
Additionally, as used herein, the term “consensus” refers to a confirmation of a digital ledger (e.g., confirmation of a ledger reflecting a state and/or transactions). In particular, consensus can refer to acceptance of a digital ledger (e.g., state reflecting a transaction or block of transactions) via a consensus protocol. In some embodiments, consensus refers to acceptance of the execution results corresponding to a transaction or transaction block. Consensus can be determined using a variety of different consensus protocols, including various members of the Byzantine fault tolerant family of consensus protocols. To illustrate, consensus can be determined using a HotStuff consensus protocol, a proof-of-work consensus protocol, a proof-of-stake consensus protocol, and/or a delegated proof-of-stake consensus protocol. For example, consensus can be determined based on a number of votes provided by a set of validator nodes confirming that a block of transactions (or the execution results corresponding to the block of transactions) is valid.
As used herein, the term “epoch” refers to a period that a set of validator node devices participate in consensus. In particular, an epoch can refer to a minimum delay between changes in the set of validator node devices. Epochs can, for example, be measured by time or a number of transaction blocks that have gone through consensus (e.g., a number of voting rounds).
Further, as used herein, the term “request” refers to a transmission to a computer node of the distributed digital ledger transaction network. In particular, a request can refer to a transmission to a computer node requesting performance of an action. For example, a request can include a transaction request or a query for information retrieval. Though the following disclosure will generally discuss requests as submitted by client devices, requests are not so limited. In some embodiments, requests can be sent by an administrator device or another computer node of the distributed digital ledger transaction network (e.g., in the processing of sharing requests among computer nodes).
Specifically, as used herein, the term “transaction request” (or “transaction event request” or “request for a transaction”) refers to a request corresponding to a transaction (e.g., a request to execute or commit a transaction to the digital ledger). In particular, a transaction request can refer to a transmission, received by a computer node, requesting execution of a transaction via the distributed digital ledger transaction network. A transaction request can include a transaction to be executed (e.g., as detailed within a transaction script). In some embodiments, a transaction request includes additional detail, such as a sequence number corresponding to the requested transaction, an account address of the sending user account, a public key of the sending user account, etc. Though the following disclosure will generally discuss transaction requests as submitted by client devices, transaction requests are not so limited. Transaction requests can be sent by an administrator device or another computer node (e.g., in the processing of sharing transaction requests among computer nodes) of the distributed digital ledger transaction network.
Specifically, as used herein, the term “account reinstatement request” refers to a transaction request to reactivate a user account. In particular, an account reinstatement request can refer to a request to re-cache, within an account state data structure, account data associated with an expired user account. An account reinstatement request can include proposed account data for the requested re-caching.
Further, as used herein, the term “transaction” refers to a program or action performed on the distributed digital ledger transaction network. In particular, a transaction can include the performance of at least one operation (e.g., by a computer node) that modifies the state data structure of the distributed digital ledger transaction network. For example, a transaction can include a transfer of one or more digital assets between user accounts or an account reinstatement.
As used herein, the term “execution” or “execution of a transaction” refers to one or more acts carried out with regard to a transaction. In particular, the term execution can refer to running a transaction script with its arguments and the current ledger state as input to produce a transaction output. In performing execution of a transaction, the ledger transaction system can perform a collection of acts that includes, but is not limited to, performing initial checks upon receiving a transaction, analyzing the transaction (e.g., verifying transaction script and modules), publishing modules (e.g., publishing models corresponding to the transaction within impacted user accounts), running transaction script, and running epilogue (e.g., charging for gas used and incrementing user sequence number).
As used herein, the term “dependencies” or “dependencies of transactions” refers to a relation between two or more transactions. In particular, dependencies can refer to two or more transactions within the same transaction block that are associated with one or more of the same user accounts. More specifically, two or more transactions can be dependent when the execution of one transaction depends on the execution of another transaction. For example, two transactions can be dependent where one transaction writes to a user account and another transaction reads from the user account. The dependencies can refer to a variety of different relations corresponding to a variety of granularities of the account data. For example, dependency can refer to utilization of any common resource stored in a user account and identified by two or more transactions.
Additionally, as used herein, the term “transaction event” or “event” refers to a result of a transaction. In particular, a transaction event can refer to side effects (e.g., updates or modifications) produced by executing a transaction. Examples of transaction events include, but are not limited to, a withdrawal of a digital asset from a user account or a deposit of a digital asset to a user account. As used herein, the term “transaction event detail request” refers to a query for information that requests event data corresponding to a transaction event. A transaction event detail request can include a request for event data corresponding to a single transaction event or event data. Additionally, a transaction event detail request can include a transaction event sequence request for event data corresponding to a sequence of events.
Further, as used herein, the term “event type” or “event class” refers to a transaction event category. In particular, an event type can refer to a classification applicable to a set of transaction events having one or more common characteristics. For example, an event type can refer to transaction events corresponding to payments received by a user account or transaction events corresponding to payments sent by a user account.
As used herein, the term “event data” or “transaction event data” refers to digital data associated with a transaction event. For example, event data can include details of the transaction event (referred to as “transaction event details”), an access path corresponding to a transaction event counter corresponding to the transaction event, and a sequence number corresponding to the count value of the transaction event counter associated with the transaction event.
As used herein, the term “transaction event counter” refers to a counter (e.g., stored at a user account) that tracks events associated with a user account. For example, a transaction event counter can include a resource, stored at a user account, generated to track events associated with the user account. A transaction event counter can store a count value that indicates a number (or volume) of events associated with the user account that have been generated. As used herein, the term “event count request” refers to a query for information regarding the count value of a transaction event counter.
Further, as used herein, the term “account state” or “user account state” refers to a condition of a user account of the distributed digital ledger transaction network at a particular period, iteration, version, or time. In particular, an account state can refer to the values (e.g., key-value pairs) associated with a user account at a particular time, iteration, or version of a digital ledger. An account state can include any values relevant to or associated with a user account. For example, an account state can include the resources (e.g., digital assets) and modules associated with a user account. An account state can include other values as well, such as an eviction date association with a user account.
Additionally, as used herein, the term “data structure” or “authenticated data structure” refers to a collection of data. In particular, an authenticated data structures can refer to a collection of data that allows a verifier to measure accuracy of the data. For example, an authenticated data structure can include one or more tree structures that maps to entries of one or more corresponding databases. A verifier can analyze a short authenticator of the tree structure to verify the accuracy of the tree structure and/or the corresponding database. As mentioned above (and described in greater detail below), a data structure can include, but is not limited to, a state data structure, an event data structure, a transaction data structure, and a signature data structure.
In particular an authenticated data structure can allow a verifier, V, to hold a short authenticator, a, which forms a binding commitment to a data structure D. An untrusted prover P, which holds D computes and returns both r, the result of the computation for some function F, as well as π, a proof F(D)→r of the correct computation of the result to the verifier. V can run Verify(a, F, r, π) which returns true if an only if F(D)=r. As mentioned, authenticated data structures can include tree structures used to store maps between integers and string values.
Further, as used herein, the term “data tree,” “tree structure,” or “tree data structure” refers to data represented as a set of linked nodes (with a root node and one or more subtrees of parent nodes and children nodes) mapped to one or more entries of a database (e.g., mapping integers of the nodes to string values of the database). A data tree can include, but is not limited to, a binary tree. For example, a data tree can include a Merkle tree, such as a sparse Merkle tree or Merkle accumulator. A tree can refer to a state tree, an event tree, or a transaction tree.
For example, in a Merkle tree of size 2k, D maps every integer key i∈[0, 2k), to a string value si. The authenticator is formed from the root of a full binary tree created from the strings, labeling leaves as H(i∥si) and internal nodes as H(left∥right) where H is a cryptographic hash function (or “hash”). The function F the prover wishes to authenticate relates to lookups of key-value pairs, e.g., F: (k, v)∈D, where r=(k, v). P authenticates lookups for an item i in D by returning a proof π consisting of the labels of the siblings of each of the ancestors of node i.
As used herein, the term “database” or “database structure” refers to a collection of data (e.g., string values). For example, a database can include a versioned database comprising account values, event details, transactions details, signatures or other information. Accordingly, a database can include, but is not limited to, a state database, an event database, a transaction database, or a signature database. In some embodiments, the ledger transaction system can combine a state database, event database, transaction database, and/or signature database into a single database (e.g., a single digital file).
Relatedly, as used herein, the term “intermediate state data structure” refers to an uncommitted state data structure. In particular, an intermediate state data structure can refer to a state data structure that has not been written into storage (i.e., permanent storage). For example, an intermediate state data structure can include a state data structure that is stored in temporary storage as a result of preliminarily executing transactions in a transaction block before consensus has been achieved.
As used herein, the term “data representation” or “account state representation” refers to node values (e.g., integers) in a data structure representing corresponding entries (e.g., strings) in a database. For example, an account state representation can refer to digital data stored within a node (e.g., a leaf node) of a state tree that reflects account data corresponding to the node within a state database. For example, a data representation can include a hash of entries (e.g., an account value) stored within an entry of a database (e.g., a state database). A data representation can further include an authentication key and/or an eviction date of the corresponding user account.
As used herein, the term “account data” refers to digital data stored in a state database. In particular, account data can refer to digital data stored within one or more entries of a database, the entries being associated with a particular user account. Account data can include, but is not limited to, an account value (e.g., the digital assets owned by the user account) and a hash of the account value that provides a mapping between the database entries and the account state representation of the user account.
Additionally, as used herein, the term “lazy deletion” refers to an asynchronous deletion among computer nodes of the distributed digital ledger transaction network. In particular, lazy deletion can include marking an element as deleted/expired (without deleting the underlying data until a later time selected at the leisure of the computing device). For example, the act of deleting can occur based on user preferences set at the computer node or based on availability of computing resources of the compute node. The act of deleting can occur independent of when other computer nodes of the distributed digital ledger transaction network delete the corresponding database entries stored at those computer nodes.
As used herein, the term “scratch pad data structure” refers to a collection of (temporary) data storing execution results until the ledger transaction system has determined whether consensus has failed or succeeded with regard to those execution results. The scratch pad data structure can store the execution results of multiple transaction blocks, some of which may conflict, representing alternative possible additions to the digital ledger.
Additionally, as used herein, the term “eviction date” refers to an expiration time of a user account. In particular, an eviction date can refer to a time at which a user account is no longer considered active. To illustrate, an eviction date can include a timestamp associated with a user account. If a time of the distributed digital ledger transaction network is greater than the time included in the timestamp, that user account has expired.
Further, as used herein, the term “rent deposit amount” refers to a payment for storage on the distributed digital ledger transaction network. In particular, a rent deposit amount can refer to currency paid to use storage on the distributed digital ledger transaction network to store digital data corresponding to a user account of the distributed digital ledger transaction network. A rent deposit amount can refer to a value paid in digital currency (i.e., gas or other digital currency exchanged on the distributed digital ledger transaction network).
As used herein, the term “module” refers to smart contract code. In particular, a module can refer to a code value. More specifically, a module can refer to an object on the distributed digital ledger transaction network that contains code defining and declaring types and procedures used in implementing the module. For example, a module can define a class of objects that implement that module. To illustrate, a module can include bytecode that declares resource types and procedures. In some embodiments, a module is defined by an address of an account where the module is declared.
As used herein, the term “resource” refers to smart contract data. In particular, a resource can refer to a data value. Indeed, a resource can refer to an object that provides a specific instance or implementation of a module, subject to the data type(s) defined therein and manipulated using the procedures defined therein. For example, a resource can include a language feature that that enables implementation of digital assets (such as a digital currency, from a class of digital assets defined within a module), data structures, and logic. In one or more embodiments, a resource includes a record that binds name fields to simple values (i.e., integers) or complex values (i.e., other resources embedded inside the particular resource).
As used herein, the term “digital asset” refers to digital data associated with (e.g., owned by or belonging to) a user account. In particular, a digital asset can refer to a resource that is owned by a user account and generated from a module defining a class of digital assets. For example, a digital asset can include a title representing ownership of a physical asset or another digital asset, or one or more units of a digital currency or a fraction of a unit of digital currency. In one or more embodiments, the ledger transaction system represents a digital asset as a linear data type, subject to associated linear typing rules.
Additionally, as used herein, the term “linear data type” refers to a programming value. In particular, a linear data type can refer to a programming value used to enforce linearity with regard to a resource on the distributed digital ledger transaction network. For example, a linear data type can represent units of digital currency or other digital assets on the distributed digital ledger transaction network. Relatedly, as used herein, the term “linear typing rules” refer to one or more rules associated with linear data types, the rules enforcing linearity. For example, the linear typing rules can include a linear typing rule that requires that a digital asset of a linear data type be used exactly once during a transaction in which the digital asset is referenced. Additionally, the linear typing rules can include a linear typing rule that prohibits a digital asset from being duplicated (i.e., copied).
As used herein, the term “in parallel” (when referring to processes performed by one or more computing devices) means performing processes with some overlap with regard to time (e.g., simultaneously or near simultaneously). In particular, the term “in parallel” can refer to a plurality of processes performed in a way so that at least two of the processes overlap in some way so that at least part of the at least two process occur at the same time. For example, the at least two processes can overlap entirely so that they both begin and end concurrently. In parallel can include, but is not limited to, executing transactions, downloading data, or verifying data.
Further, as used herein, the term “access path” refers to an identifier of a location of digital data within a data structure. In particular, an access path can refer to a location of a module or resource within a user account of the distributed digital ledger transaction network. For example, an access path can include an address (e.g., a main address) associated with a user account and an identifier corresponding to the resource or module.
Additionally, as used herein, the term “nonce” (or “cryptographic nonce”) refers to a character set. In particular, a nonce can refer to a non-deterministic (e.g., random one or pseudo-random) number. For example, a nonce can include a single character (e.g., a single numeric value) or a string of characters.
As used herein, the term “digital visual code” refers to an image that encodes digital data. In particular, a digital visual code can refer to image (e.g., a pattern) that can be decoded to obtain digital data associated with a user account of the distributed digital ledger transaction network. For example, a digital visual code can include a quick response (“QR”) code but can also include any other image from which digital data can be determined.
Additionally, as used herein, the term “DNS record” refers to an entry in a Domain Name System (“DNS”). In particular, a DNS record can refer to an entry in a DNS database that maps an email address to account identification information (e.g., a main public address identifier and/or a public encryption key) for a user account on the distributed digital ledger transaction network. For example, a DNS record can include a DNS text record (“TXT record”). Relatedly, as used herein, the term DNSSEC (or “Domain Name System Security Extensions”) refers to a set of security extensions to DNS that can assist in authenticating or otherwise validating data stored on a DNS.
Further, as used herein, the term “gas” refers to a digital asset used for fee payments. In particular, gas can refer to a digital currency associated with a user account used to pay fees for actions taken on the distributed digital ledger transaction network. For example, gas can include digital currency used to pay transaction fees, an account startup fee, an account reinstatement fee, or a rent deposit. Gas can include a distinct digital asset or can be extracted from other digital assets associated with a user account.
I. System OverviewA. Computing Environment
Additional detail regarding the ledger transaction system will now be provided with reference to the figures. For example,
Although the distributed digital ledger transaction network 100 of
The communication network 102, the computer nodes 114, and the client devices 112a-112n may be communicatively coupled with each other either directly or indirectly (e.g., through the communication network 102 discussed in greater detail below in relation to
As mentioned above, the distributed digital ledger transaction network 100 includes the computer nodes 114. In general, the computer nodes 114 can generate, store, receive, and/or transmit data, including data corresponding to a digital ledger. For example, the computer nodes 114 can receive transaction requests and transmit transaction execution results. In one or more embodiments, at least one of the computer nodes 114 comprises a data server. In some embodiments, at least one of the computer nodes 114 comprises a communication server or a web-hosting server. In further embodiments, one or more of the computer nodes 114 include personal computing devices operated by a user.
In one or more embodiments, as shown in
In one or more embodiments, a computer node transmits data to other computer nodes in several steps. For example, at a first step, the transmitting computer node can make the data available (i.e., passively publish the data). The transmitting computer node can then send a notification to each potential recipient computer node, indicating that the data is now available. Subsequently, the transmitting computer node can let the potential recipient computer nodes connect to the transmitting computer node and retrieve the available data.
As shown
Additionally, as shown in
For example, in one or more embodiments, the ledger transaction system 106 implements a Byzantine-fault-tolerant consensus approach. Specifically, in some embodiments, the validator node devices 108a-108b implement a modified HotStuff consensus protocol. In particular, in one or more embodiments, the computer nodes 114 select a lead validator node device to drive consensus for a transaction block. In one or more embodiments, the lead validator node device is selected deterministically (e.g., via a round-robin selection from a pre-defined list). In some embodiments, the lead validator node device is selected non-deterministically (e.g., candidate validator node devices attempt to solve a cryptographic puzzle or participate in a cryptographic lottery, and the winner becomes the lead validator node device). When selected, a lead validator node device can assemble a transaction block containing transactions received from one or more of the client devices 112a-112n and propose the transaction block to the other validator node devices. The other validator node devices execute the transactions within the transaction block and then vote on the execution results.
For example, assume that there exists a fixed, unknown subset of malicious validator node devices (also known as “Byzantine validator node devices) within the current set of validator node devices. Assume further that all other validator node devices (known as “honest validator node devices”) follow the consensus protocol scrupulously. Referring to the total voting power of all validator node devices as N and defining a security threshold f, the ledger transaction system 106 can operate so that N>3f. In other words, the ledger transaction system 106 can operate so that the combined voting power of the malicious node devices does not exceed the security threshold f.
A subset of nodes whose combined voting power M verifies a transaction block (i.e., M≥N−f) can be referred to as a quorum. In some embodiments, the ledger transaction system 106 can further operate under a “BFT assumption” that indicates, for every two quorums of nodes in the same epoch, there exists an honest node that belongs to both quorums.
Upon determining that a threshold number of votes confirming the execution results have been received, the lead validator node device can determine to finalize the block of transactions and transmit confirmation to the other validator node devices. As mentioned above, by utilizing a Byzantine failure model, the ledger transaction system 106 can accommodate validators that arbitrarily deviate from the protocol without constraint. Moreover, the ledger transaction system 106 can utilize a byzantine fault tolerance consensus approach to mitigate failures caused by malicious or hacked validators. Specifically, in one or more embodiments, the ledger transaction system 106 utilizes 2f+1 votes as the threshold number of votes, where f refers to a number of Byzantine voters (e.g., malicious, fraudulent, or untrustworthy validators) that can be accommodated by the consensus protocol. For instance, in some embodiments f reflects the number of Byzantine voters that can be accommodated while preventing attacks or other unsafe behaviors (e.g., double-spends or forks). In some embodiments, 2f+1 votes corresponds to just over two-thirds of the validator node devices participating in consensus.
Once the block of transaction is finalized, the validator node devices can commit the transaction results to storage. Indeed, in one or more embodiments, each validator node device generates data structures for storing data relevant to the digital ledger (e.g., a transaction data structure, a state data structure, and an event data structure). The validator node devices can update these data structures based on the execution results when the execution results achieve consensus. In particular, each validator node device can generate and maintain an independent copy of the data structures and then update the data structures stored at that validator node device based on the execution results.
To provide an additional example, in one or more embodiments, a full node device can receive a query for information. In response, the full node device can locate the relevant data within the data structures stored at the full node device and transmit the data to the requesting client device. Indeed, in one or more embodiments, each full node device can generate and maintain an independent copy of the data structures. The full node device can communicate with the validator node devices 108a-108b to identify the results of executing transactions and update the data structures stored at the full node device accordingly. In one or more embodiments, the full node device can further submit a proof (e.g., a Merkle proof) to demonstrate the accuracy of the provided data in response to receiving the query for information.
In one or more embodiments, the client devices 112a-112n include computer devices that allow users of the devices (e.g., the users 116a-116n) to submit transaction requests and queries for information. For example, the client devices 112a-112n can include smartphones, tablets, desktop computers, laptop computers, or other electronic devices (examples of which are described below in relation to
In some embodiments, a subset of the client devices 112a-112n (and/or a subset of the computer nodes 104) can have cryptographic keys to modify or manage features of the distributed digital ledger transaction network (referred to as “authorized devices”). In particular, smart contracts can be implemented that provide authorized devices (or authorized accounts corresponding to authorized devices) with permissions to make modifications through consensus protocols (and collective agreement among the authorized devices). For example, within the confines of smart contracts used to make modifications, authorized devices can manage changes to the set of validator node devices participating in consensus (i.e., voting rights), changes to the processes utilized in validating rejections or distributing transaction fees (i.e., gas) amongst the computer nodes 114, and/or changes to tangible monetary reserves (e.g., diverse real-world assets) utilized to back digital assets (e.g., a cryptographic currency) on the distributed digital ledger transaction network.
In one or more embodiments, the distributed digital ledger transaction network 100 further includes one or more reporting managers (not shown). The reporting manager can track and report actions taken by the components of the distributed digital ledger transaction network 100 (e.g., one of the validator node devices 108a-108b) for which rewards should be provided or fees extracted. Some actions that the reporting manager can track and report include, but are not limited to, a client device submitting a transaction request, a lead validator node device proposing or failing to propose a transaction block, a lead validator node device proposing an incorrect or malformed transaction block, validator node devices participating in consensus, validator node devices committing a block of transactions to storage, and general information dissemination (whether among the computer nodes 114 or to the client devices 112a-112n). In one or more embodiments, the reporting manager reports such actions to the computer nodes 114 to determine and carryout the corresponding reward or fee. The reporting manager can be implemented by any of the devices of the distributed digital ledger transaction network 100 shown in
The ledger transaction system 106 can be implemented in whole, or in part, by the individual elements of the distributed digital ledger transaction network 100. Indeed, although
To provide an example, the ledger transaction system 106 can utilize the client devices 112a-112n to perform various functions. To illustrate, the ledger transaction system 106 can utilize a client device to poll one or more of the computer nodes 114 for transaction event updates and request data corresponding to a sequence of events. Additionally, the ledger transaction system 106 can utilize a client device to generate a transaction request. In particular, the ledger transaction system 106 can utilize a client device to identify a main public address identifier and sub-address identifier corresponding to a user account and then encrypt the sub-address identifier using an encryption key. The ledger transaction system 106 can then utilize the client device to generate and submit a transaction request associated with the user account using the main public address identifier and the encrypted sub-address corresponding to that user account.
B. Validator Components and Transaction Process
As mentioned above, a client device can submit a request for a transaction to one of the computer nodes. The validator node devices of the distributed digital ledger transaction network can then execute the transaction (as part of a block of transactions) and implement the consensus protocol. If consensus is achieved, the validator node devices (and the full node devices) can commit the execution results to permanent storage by updating the data structures stored therein (e.g., updating the ledger state).
The following discussion in relation to
As shown in
In one or more embodiments, the client device 202 further utilizes the client application 204 to add a sequence number to the transaction request. Indeed, in one or more embodiments, a validator node device rejects transaction requests having an incorrect sequence number. In some embodiments, computer nodes of the distributed digital ledger transaction network can store the current sequence number associated with a user account. The client application 204 can query one of the computer nodes to identify the current sequence number associated with the corresponding user account. The client application 204 can then increment the sequence number and add the incremented sequence number to the transaction request. The computer nodes can update the sequence number associated with the user account in storage upon application of the transaction (e.g., execution of the transaction or acceptance of the transaction into the mempool manager). In one or more embodiments, however, the client application 204 keeps track of the current sequence number associated with the user account to avoid querying the computer nodes.
Additionally, the client device 202 can utilize the client application 204 to sign the transaction request. For example, the client application can utilize a private key associated with the user of the client device 202 (i.e., associated with the sending user account) to apply a signature to the transaction request (e.g., by encrypting the transaction request). The client device 202 can then transmit the signed transaction request to the validator node device 206.
In one or more embodiments, the client device 202 submits the transaction to a particular address associated with the validator node device 206. For example, the client device 202 can submit the transaction to an address associated with an admission control component (e.g., the admission control(s) 210) of the validator node device 206. In one or more embodiments, the client device 202 utilizes the client application 204 to identify the address of the validator node device 206. For example, the client device 202 can utilize the client application 204 to contact the computer nodes of the distributed digital ledger transaction network and then identify the address of the validator node device 206 via a round-robin DNS implementation, optimized based on geographic location to reduce latency. In one or more embodiments, upon receiving the transaction request, the validator node device 206 signs the transaction request (e.g., using a private key stored in the privacy signature manager 216) and returns the signed transaction request back to the client device 202.
As shown in
Indeed, the admission control(s) 210 can manage multiple request types. In particular, in addition to transaction requests, the admission control(s) 210 can manage queries for information. The admission control(s) 210 can direct a given request to the proper components of the validator node device 206 utilized to service that request. For example, the admission control(s) 210 can direct transaction requests to the mempool manager 212 and direct queries for information to the storage manager 220 to perform the requested reads. Accordingly, the admission control(s) 210 can prevent a query for information from interfering with components used to service a transaction request and vice versa.
Upon receiving a transaction request, the admission control(s) 210 can perform a series of initial checks. For example, in one or more embodiments, the admission control(s) 210 performs basic spam checks to limit the amount of data received from a given IP address. In doing so, the admission control(s) 210 can provide DDoS protection by performing blacklisting and filtering out invalid or high-volume input, preventing such input from wasting the resources of the subsequent components. Indeed, in some embodiments, the admission control(s) 210 blacklists IPs/user accounts that generate high volumes of traffic.
The admission control(s) 210 can then access the virtual machine 222 to perform a series of additional checks in order to determine whether the transaction request is properly formed. For example, admission control(s) 210 can check the input signature(s) on the transaction request to determine whether the transaction request is properly signed; check the authentication key of the user account (e.g., the address of the user account or the hash of the public key associated with the user account) sending the transaction request to confirm that the authentication key corresponds to the public key whose private key was used to sign the transaction; verify that the sequence number for the signed transaction is correct; verify that the transaction script included in the transaction request is not malformed; and verify that there is sufficient balance in the account to support the maximum amount of gas that may be consumed upon execution of the transaction. Upon determining that the transaction request satisfies the series of checks, the admission control(s) 210 can forward the transaction request to the mempool manager 212.
In one or more embodiments, the virtual machine 222 can implement a bytecode verifier and a bytecode interpreter for the programming language utilized by the ledger transaction system 106. Indeed, in one or more embodiments the ledger transaction system 106 utilizes a programming language with three different program representations: source code, intermediate representation (IR), and bytecode. Programmers can develop modules and transaction scripts in IR, which is high-level enough to write human-readable code, yet low-level enough to have a direct translation to bytecode. In some embodiments, both the source language and IR are compiled into bytecode.
The ledger transaction system 106 can use a verifiable bytecode language as the executable representation of the programming language for a variety of reasons. For example, in some embodiments the ledger transaction system 106 applies safety guarantees to all programs. Enforcing these guarantees in a compiler is often not sufficient inasmuch as an adversary could choose to bypass the compiler by writing malicious code directly in the bytecode language (unless running the compiler is part of transaction execution, but this would make execution slower and more complex). Thus, the ledger transaction system 106 can avoid trusting the compiler by enforcing safety guarantees via bytecode verification: type safety, reference safety, and resource safety.
Further, the virtual machine 222 can use a stack-based bytecode language that has fewer instructions than a higher-level source language. In addition, each instruction has semantics that can be expressed via an even smaller number of atomic steps. This reduces the specification footprint of the ledger transaction system 106 and makes it easier to spot implementation mistakes.
As mentioned above, the virtual machine 222 can implement a bytecode verifier and a bytecode interpreter for the bytecode language. The bytecode language can include a stack-based virtual machine with a procedure-local operand stack and registers. Unstructured control-flow can be encoded via gotos and labels.
A developer can write a transaction script or module in IR that can then be compiled into the bytecode language. Compilation converts structured control-flow constructs (e.g., conditionals, loops) into unstructured control-flow and converts complex expressions into a small number of bytecode instructions that manipulate an operand stack. The virtual machine 222 can execute a transaction by verifying then running this bytecode.
The virtual machine 222 can support various types and values: Booleans, unsigned 64-bit integers, 256-bit addresses, fixed-size byte arrays, structs (including resources), and references. In some embodiments, struct fields cannot be reference types, which prevents storage of references in the ledger state. In some embodiments the virtual machine 222 does not have a heap (local data is allocated on the stack and freed when the allocating procedure returns). Persistent data can be stored in the ledger state.
The mempool manager 212 can provide an in-memory buffer of transactions. In particular, the mempool manager 212 can receive transactions provided by the admission control(s) 210 of the validator node device 206 as well as the mempool manager of the other node devices 224 (e.g., other validator node devices). Indeed, the transactions managed by mempool include transactions that have been submitted but not yet executed and agreed upon via consensus.
Because the mempool manager 212 manages multiple transactions (possibly multiple transactions submitted by the same user account), the mempool manager 212 can perform a series of additional checks. Indeed, the mempool manager 212 can perform additional checks to validate the transaction request in light of the other manages transactions.
For example, in one or more embodiments, the mempool manager 212 checks whether the transaction request forwarded by the admission control(s) 210 conflicts with the transactions already stored. To illustrate, if the mempool manager 212 already stores one or more transactions sent by the same user account that sent the transaction request forwarded by the admission control(s) 210, the mempool manager 212 determines whether the user account has sufficient digital assets to fund the transactions already stored as well as the transaction request forwarded by the admission control(s) 210. If the mempool manager 212 determines there is a possibility that the transactions already stored will consume enough of the user account's digital assets so that the transaction request forwarded by the admission control(s) 210 cannot be funded, the mempool manager 212 can deny entry of the transaction request forwarded by the admission control(s) 210.
Upon satisfaction of the additional checks the mempool manager 212 can accept the transaction request (which will now be referred to as the “transaction”). In one or more embodiments, the validator node device 206 can transmit a notification to the client device 202 indicating that the transaction has been added to the mempool manager 212. In some embodiments, the validator node device 206 further transmits the current version of the digital ledger (e.g., the current version of the transaction data base or, more specifically, the transaction Merkle tree). In further embodiments, the validator node device 206 transmits an identifier to the client device 202, the identifier being uniquely associated with the validator node device 206. Indeed, in some embodiments, the client device 202 can include the identifier of the validator node device 206 in a query for the status of the transaction.
In one or more embodiments, upon entering the transaction into the mempool manager 212, the validator node device 206 broadcasts (i.e., transmits) the transaction to the other node devices 224. In one or more embodiments, the validator node device 206 broadcasts the transaction as soon as the transaction is entered into the mempool manager 212. In some embodiments, the validator node device 206 broadcasts the transaction as part of a periodic broadcast. In one or more embodiments, the validator node device 206 determines the likelihood that the transaction will be included in the next transaction block and broadcasts the transaction to the other node devices 224 based on that determination. For example, in some embodiments, the validator node device 206 broadcasts a transaction to the other node devices 224 only if the sequence number of the transaction is equal to or sequential to the next sequence number for the corresponding user account (e.g., broadcasts the transactions 2, 3, and 4 but not transactions with subsequent sequence numbers when the current sequence number of the user account is 2). In one or more embodiments, the mempool manager 212 maintains an ordered queue and determines the likelihood that a transaction will be included in the next transaction block based on the ordered queue.
In one or more embodiments, upon receiving a transaction from one of the other node devices 224, the validator node device 206 performs the same checks that are performed when receiving a transaction request from the client device 202. For example, the validator node device 206 can use the mempool manager 212 and/or the admission control(s) 210 to perform the same initial checks and additional checks. Accordingly, the validator node device 206 can prevent a malicious validator node device form sending an invalid or otherwise malicious transaction that could interfere with operation of the validator node device. In some embodiments, upon receiving a transaction from one of the other node devices 224, the validator node device 206 adds the transaction to the ordered queue maintained by the mempool manager 212.
In one or more embodiments, the mempool manager 212 includes a mapping between user account addresses and pending transactions with various indexes built on top. For example, as mentioned, the mempool manager 212 can maintain an index referred to as the ordered queue that includes transactions that are ready to be included in the next transaction block. In one or more embodiments, the mempool manager 212 orders the transactions within the ordered queue based on gas price, providing priority to transactions submitted by users willing to pay higher fees per transaction. In some embodiments, though the transactions in the ordered queue are ordered based on gas price, the mempool manager 212 can order the transactions submitted by the same account by sequence number within the mapping between account addresses and pending transactions.
In one or more embodiments, the mempool manager 212 includes transactions that are not ready to be included in the next block in a separate index referred to as the parking lot. The mempool manager 212 can move a transaction from the parking lot to the ordered queue once some event indicates that the transaction is ready to be included in a transaction block (e.g., the transaction having the immediately preceding sequence number was broadcast to the other node devices 224).
In one or more embodiments, the mempool manager 212 limits the number of total transactions stored therein. In some embodiments, the mempool manager 212 limits the number of transactions stored from the same user account. In this manner, the mempool manager 212 can prevent a user account from constantly attacking the distributed digital ledger transaction network.
In one or more embodiments, the mempool manager 212 applies an expiration to the transactions stored therein. For example, the mempool manager 212 can apply a time to live (TTL) expiration to a transaction. The mempool manager 212 can check the TTL expiration of a transaction periodically. In some embodiments, the mempool manager 212 applies a client-specified expiration to a transaction. Indeed, in some embodiments, a client device submitting a transaction request can specify an expiration for that transaction. In one or more embodiments, the mempool manager 212 enforces a minimum time on client-specified expirations to prevent a client from overwhelming the validator node device 206 by submitting numerous transactions with low expiration times. Upon determining that the transaction has expired (i.e., either based on the TTL expiration or the client-specified expiration), the mempool manager 212 can remove the transaction. In one or more embodiments, the mempool manager 212 utilizes a separate component (e.g., a system TTL component) to check expirations and remove transactions accordingly.
As shown in
Subsequently, the validator node device 206 can utilize the execution engine 218 to execute the transactions within the transaction block. The other node devices 224 similarly execute the transactions within the transaction block. As will be discussed in more detail below with regards to
In one or more embodiments, the execution engine 218 utilizes the virtual machine 222 to execute the transactions within a transaction block. In particular, the virtual machine 222 can verify the transaction script and modules, publish the modules (under the transaction sender's account), run the transaction script, determine the execution results, and run epilogue processes (e.g., charge the user for gas and increment the user's sequence number). In one or more embodiments, as will be discussed in more detail below with regard to
The execution engine 218 can utilize the portions of the data structures in the scratch data pad and the execution results corresponding to the transactions within the transaction block to determine a proposed root value of the transaction tree (i.e., a “root hash”). The consensus manager 214 can then sign the proposed root value using a private key stored at the privacy signature manager 216 and attempt to reach agreement on the proposed root value with the other node devices 224. In one or more embodiments, if the validator node device 206 is selected as the lead validator node device, the validator node device 206 can communicate with the other node devices 224 about the proposed root value. Indeed, in some embodiments, the validator node device 206 (as the lead validator node device) communicates with the other node devices 224 in a series of messages that converge towards a final decision. In one or more embodiments, the lead validator node device participates in the communications but does not vote on the proposed root hash. The decision can include a final decision to accept or reject the transactions included in the transaction block.
If enough votes (e.g., at least 2f+1 votes) are provided for the same root value (e.g., the proposed root value determined by the validator node device 206), the consensus manager 214 can provide an indication, to the execution engine 218, that the transaction block (i.e., the previously determined result from executing the transaction block) is ready to be committed to storage. In one or more embodiments, the lead validator node device receives the consensus votes and determines whether the block has been finalized (i.e., whether enough votes have been received). The lead validator node can then transmit the indication based on this determination of finalization. In one or more embodiments, the indication includes the signatures of validator node devices from the other node devices 224 that voted to confirm the agreed upon root value. In response to receiving the indication, the execution engine 218 can send the corresponding execution results stored at the scratch pad data structure to the storage manager 220 to be written into permanent storage. Additionally, the execution engine 218 can clear out the values from the scratch pad data structure that are no longer needed (e.g., parallel transaction blocks that will not be committed to storage, as will be discussed in more detail below).
The validator node device 206 utilizes the storage manager 220 to add the execution results to the digital ledger. In particular, the storage manager 220 can commit the transactions within the transaction block, including the changes to the digital ledger based on the execution results. In one or more embodiments, the storage manager 220 further stores the signatures of the validator node devices that voted to confirm the agreed-upon root value. Upon committing a transaction from the transaction block, the storage manager 220 (or the execution engine 218) can assign a version to each transaction and store the transaction, the root value, and the version to the transaction database (e.g., the transaction tree). The storage manager 220 can then increase the version number for assignment to the next transaction. When a transaction has been committed to storage, the consensus manager 214 can notify the mempool manager 212, which can then delete the transaction from its internal storage.
In one or more embodiments, upon a failure in storing a transaction block, the storage manager 220 will “panic” (e.g., disconnect from the execution engine 218). Upon re-establishing a connection, the storage manager 220 and/or the execution engine 218 will determine the current state of the distributed digital ledger transaction network. For example, in one or more embodiments, the storage manager 220 sends, to the execution engine 218, the root value from the previously committed transaction block, and the execution engine 218 continues from there. Additional detail regarding consensus safety upon restart is provided below (e.g., in relation to
In one or more embodiments, the validator node device 206 further includes a state sync manger component (not shown). In particular, the state sync manager can perform synchronization operations when the validator node device 206 restarts or is behind the currently proposed state of the distributed digital ledger transaction network. For example, if the consensus manager 214 identifies a transaction block that is based on a version of the digital ledger (i.e., a version of the transaction tree) that is unknown to the validator node device 206, the state sync manager can update the validator node device 206 to the latest state to allow for consensus participation. To illustrate, in one or more embodiments, the state sync manager pulls chunks of transactions and executes the chunks (e.g., using the execution engine 218) to determine a ledger state of the distributed digital ledger transaction network that is consistent with the currently agreed upon ledger state.
In some embodiments, the validator node device 206 further includes a system state machine manager. In particular, the system state machine manager can perform overall node management operations, such as node blacklisting and bad transaction handling.
As mentioned above, in addition to servicing transaction requests, the computer nodes of the distributed digital ledger transaction network can service queries for information. For example, upon receiving a query for information, the admission control(s) 210 of the validator node device 206 can connect directly to the storage manager 220. The admission control(s) 210 can receive, from the storage manager 220, the requested information along with the corresponding proof. The validator node device 206 can then forward the information to the submitting client device. Though the discussion of
In one or more embodiments, the validator node device 206 (or other computer node of the distributed digital ledger transaction system) will restart upon encountering a technical problem (e.g., a crash). The components of the validator node device 206 can act accordingly in response to, or in anticipation of, technical problems. For example, in one or more embodiments, the admission control(s) 210 loses a transaction (e.g., submitted by the client device 202) on which initial checks are being performed upon crashing. Accordingly, the validator node device 206 may fail to respond to the client device 202 as expected (e.g., fail to notify the client device 202 that the transaction has been accepted by the mempool manager 212). Consequently, the client device 202 can then resubmit the transaction.
The mempool manager 212 can similarly drop all stored transactions upon a crash. In one or more embodiments, the mempool manager 212 implements walk-ahead logging (WAL) to avoid issues associated with dropping the transactions.
In one or more embodiments, the consensus manager 214 stores voting data to a WAL prior to submitting a vote corresponding to a transaction block. For example, in some embodiments, the consensus manager 214 utilizes the storage manager 220 to store and delete voting data as necessary. After a crash, the consensus manager 214 can retrieve the voting data to identify the transaction block voted on. In some embodiments, the consensus manager 214 avoids operating off blocks that conflicts with this voting data.
In one or more embodiments, upon restart after a crash, the execution engine 218 can re-establish a connection with the consensus manager 214 and retrieve transaction blocks corresponding to the voting data stored in the WAL by the consensus manager 214. The execution engine 218 can then re-execute the transaction blocks and provide an error if the resulting root value does not match the root valued stored in the WAL. Further, the consensus manager 214 can retrieve, from the storage manager 220, the latest committed version of the transaction tree. If there are enough votes for committing another block, the consensus manager 214 can request to commit the transaction block via execution.
If a crash occurs before adding a transaction block to permanent storage, the storage manager 220 can re-establish a connection to the execution engine 218. The execution engine 218 can then provide the next transaction block to the storage manager 220. In particular, the execution engine 218 can re-execute the transaction block to get the write-sets. In some embodiments, the validator node device 206 implements a callback upon completion of committing a transaction block or a synchronous call to the storage manager 220 from the execution engine 218, after which the execution engine 218 prunes the scratch pad data structure. Further, upon committing a transaction block to permanent storage, the storage manager 220 can delete the voting data corresponding to the transaction block stored in the WAL by the consensus manager 214.
Each of the components of computing devices described in relation to
The components can comprise software, hardware, or both. For example, the components 204-222 can comprise one or more instructions stored on a computer-readable storage medium and executable by processors of one or more computing devices. When executed by the one or more processors, the computer-executable instructions of the ledger transaction system 106 can cause a client device and/or a server device to perform the methods described herein. Alternatively, the components 204-222 and their corresponding elements can comprise hardware, such as a special purpose processing device to perform a certain function or group of functions. Additionally, the components 204-222 can comprise a combination of computer-executable instructions and hardware.
Furthermore, the components 204-222 of the ledger transaction system 106 may, for example, be implemented as one or more operating systems, as one or more stand-alone applications, as one or more modules of an application, as one or more plug-ins, as one or more library functions or functions that may be called by other applications, and/or as a cloud-computing model. Thus, the components 204-222 may be implemented as a stand-alone application, such as a desktop or mobile application. Furthermore, the components 204-222 may be implemented as one or more web-based applications hosted on a remote server. The components 204-222 may also be implemented in a suite of mobile device applications or “apps.”
II. StorageA. Overview
As mentioned above, a number of technical problems exist with regard to storage of data across computing devices utilizing conventional blockchain systems. Indeed, conventional blockchain systems are rigid and inflexible (e.g., fail to provide individual computing devices with flexible storage management options) and utilize excessive computer resources. The ledger transaction system 106 can implement storage processes across computing devices of a distributed digital ledger transaction network in a manner that improves security and flexibility and reduces storage and processing requirements. Indeed, the ledger transaction system 106 can utilize various data structures and storage processes that reduce susceptibility to tampering, that allow for computer devices (e.g., validator nodes or full nodes) to flexibly modify storage of the digital ledger based on local features, and that allow for reduction of computer storage and processing overhead.
For example, in one or more embodiments, the ledger transaction system 106 generates a single versioned database (e.g., a database reflecting transactions, events, and accounts states at any particular iteration). A version number can include an unsigned 64-bit integer timestamp, which corresponds to the number of transactions the system has executed. At each version i, the database can hold a (transaction T1, transaction output Oi, ledger state Si) tuple. Given an execution function f, the tuple can indicate that executing transaction Ti against ledger state Si-1 produces output Oi and a new ledger state Si; that is f(Si-1, Ti)→(Oi, Si). To illustrate,
In one or more embodiments, the ledger transaction system 106 can, at a client device, verify that a particular ledger state is correct by re-executing each transaction Ti in the ledger history corresponding to that ledger state and then comparing the resulting ledger state to the particular ledger state Si and transaction output Oi in the versioned database. This allows client devices to audit the validator node device of the distributed digital ledger transaction network to ensure that transactions are being executed correctly.
For example,
For instance, as further shown in
Where the address represented by the address key corresponds to an existing user account, the ledger transaction system 106 can store an account state representation within (i.e., as part of) the leaf node associated with that address key. In one or more embodiments, the ledger transaction system 106 generates an account state representation for a user account by applying a hash function to the account data associated with that user account to generate a hash value corresponding to the account data. Specifically, the ledger transaction system 106 can apply the hash function to one or more components of the account data. For example, in one or more embodiments, the ledger transaction system 106 applies the hash function to an account value of the user account to generate a hash of the account value (i.e., the same hash value that is stored as part of the account data for the user account). The ledger transaction system 106 can then store the hash of the account value as the account state representation. In some embodiments, the ledger transaction system 106 generates the account state representation by further combining the hash value corresponding to the account data (e.g., the hash of the account value) with additional data (e.g., an eviction date for the user account).
In one or more embodiments, if the address key corresponds to a non-existent user account, the ledger transaction system 106 stores a default value (e.g., an empty string) within the leaf node. As shown in
In one or more embodiments, the ledger transaction system 106 generates the root value of the state tree 306 by combining and hashing the node values stored within each pair of nodes within the state tree 306. Specifically, for each internal node of the state tree 306, the ledger transaction system 106 can combine (e.g., concatenate) the node values stored within the respective child nodes and then apply a hash function to the combined value. In some embodiments, the ledger transaction system 106 hashes the node values stored within the child nodes and then combines the hashed values to generate the node value for the corresponding internal node. The ledger transaction system 106 can iteratively combine and hash node values starting at the bottom of the state tree 306 and progressing towards the top, eventually generating the root value of the state tree 306. The ledger transaction system 106 can then store the root value in the state root 308 of the state tree 306. As such, the root value stored within the state root 308 represents the account state of every user account of the distributed digital ledger transaction network at a particular state of the distributed digital ledger transaction network. As will be discussed below, the ledger transaction system 106 can further store the root value of the state tree 306 within a transaction tree of the distributed digital ledger transaction network.
Further, in one or more embodiments, the ledger transaction system 106 generates a state tree for each state of the distributed digital ledger transaction network. In particular, for each transaction (or block of transactions) executed across the distributed digital ledger transaction network, the ledger transaction system 106 can generate a new state tree representing the state of the distributed digital ledger transaction network resulting from the transaction (or block of transactions). Specifically, the new state tree can represent the account state of every user account after executing a block of transactions (i.e., reflecting how the user accounts associated with those particular transactions have changed). In some embodiments, the ledger transaction system 106 updates the state tree after execution of every transaction (e.g., by updating the account state representations corresponding to the user accounts associated with the transactions).
In some embodiments, the ledger transaction system 106 represents the initial state of the distributed digital ledger transaction network as an empty state (e.g., an empty state database). The ledger transaction system 106 can then generate the genesis state through a special transaction T0 that defines specific modules and resources to be created, rather than going through the normal transaction process. The ledger transaction system 106 can configure client devices and validator node devices to accept only ledger histories beginning with a specific T0, which is identified by its cryptographic hash.
As mentioned above, in some embodiments, the ledger transaction system 106 reduces storage and processing requirements by storing a subset of modified nodes. For example, the ledger transaction system 106 can generate a state tree component having node values corresponding to changed user account states. These node values can point to the node values of previous state trees that correspond to unchanged user account states. In this manner, the ledger transaction system 106 can track changed nodes at different states without duplicating the entire state tree. In some embodiments, the ledger transaction system 106 utilizes this approach to track multiple states while awaiting consensus and committing consensus state data structures to memory. Additional detail regarding storing a subset of modified nodes to track different states is provided below (e.g., in relation to
As both the account data 304 stored in the state database 302 and the account state representations stored in the state tree 306 include a hash of an account value of a user account, the state database 302 can include a mapping between account state representations and account values of user accounts. For instance, the ledger transaction system 106 can index the account value within the account data 304 using the corresponding hash of the account value. Indeed, the ledger transaction system 106 can then utilize the state tree 306 to locate the account value for a given user account. Specifically, the ledger transaction system 106 can locate the state root 308 of the state tree 306 and then traverse the state tree 306 (e.g., using the address of the user account) to find the leaf node for the user account. The ledger transaction system 106 can then identify the account state representation stored within the leaf node and use the mapping of the state database 302 to locate the account value of the user account based on that account state representation for the user account (i.e., based on the hash of the account value stored as part of the account state representation).
In addition to generating a data structure storing data associated with account states, the ledger transaction system 106 can generate a data structure storing data associated with transaction events generated upon execution of transactions across the distributed digital ledger transaction network.
In one or more embodiments, the event tree 402 corresponds to a particular transaction executed across the distributed digital ledger transaction network, and the leaf nodes 408a-408f correspond to the transaction events generated by execution of that transaction. In other words, upon executing a transaction across the distributed digital ledger transaction network, the ledger transaction system 106 can generate any number of transaction events (i.e., zero or more). Accordingly, the ledger transaction system 106 can generate an event tree that corresponds to that transaction and represents the transaction events generated upon its execution.
In particular, where the ledger transaction system 106 generates one or more transaction events upon execution of a transaction, the ledger transaction system 106 can generate a transaction event representation corresponding to each transaction event. The ledger transaction system can then store each transaction event representation within one of the leaf nodes 408a-408f of the event tree 402. The ledger transaction system 106 can generate a transaction event representation corresponding to a given transaction event by applying a hash function to one or more components of the event data associated with the transaction event.
Further, in one or more embodiments, the ledger transaction system 106 generates the root value of the event tree 402 as described above with reference to the root value of the state tree 306 of
Additionally, as shown in
In addition to data structures storing data associated with user accounts and transaction events, the ledger transaction system 106 can generate a data structure storing data associated with transactions executed across the distributed digital ledger transaction network.
As shown in
The ledger transaction system 106 can store, within each of the leaf nodes 506a-506e, a transaction representation corresponding to the transaction associated with the leaf node. In one or more embodiments, the ledger transaction system 106 generates a transaction representation corresponding to a particular transaction by combining several data components. For example, as shown in
The signed transaction 508 includes an authenticated representation of a particular transaction. For example, the signed transaction 508 can include data identifying the transaction (e.g., with a transaction identifier or other transaction details) that is signed utilizing a private key of a user account. To illustrate, a client device of a user associated with a user account can generate the signed transaction 508 by utilizing a private key corresponding to the user account to verify that the transaction is authorized.
As shown, the ledger transaction system 106 can also utilize the state tree root value 510 in generating a transaction representation within the transaction tree 502. The state tree root value 510 includes the root value stored within the state root of the state tree (e.g., the state root 308 of the state tree 306 of
In addition, the ledger transaction system 106 can also utilize the event tree root value 512 in generating a transaction representation within the transaction tree 502. The event tree root value 512 includes the root value stored within the event root of the event tree (e.g., the event root 406 of the event tree 402 of
As further shown in
Moreover, the ledger transaction system 106 can determine values for various nodes in the transaction tree 502, including a root value of a transaction root 516. In particular, the ledger transaction system 106 can combine node values corresponding to child nodes and then apply a hash function to the combined values to determine node values within the transaction tree 502. The ledger transaction system 106 can iteratively combine node values and apply a hashing function (working from the bottom of the tree to the top) to generate the root value of the transaction tree 502.
By building the transaction tree 502 in this manner, the root value of the transaction root 516 of the transaction tree 502 represents a combination of events, transactions, and states. Indeed, in one or more embodiments, by utilizing state root tree values and event tree root values to generate the root value of the transaction tree, the ledger transaction system 106 can generate a root value of the transaction tree that uniquely identifies transactions, events, and account states (historical and current) across the life of the digital ledger. In other words, modification to an event, account, or transaction would propagate through the various Merkle trees and result in a different root value of the transaction tree.
Though not shown in
In one or more embodiments, the ledger transaction system 106 utilizes a root value of a transaction data structure within a digital ledger to obtain consensus across the distributed digital ledger transaction network. For example,
As illustrated by
As shown in
In one or more embodiments, the ledger transaction system 106 can store additional data in the ledger information 602. For example, the ledger transaction system 106 can store the current timestamp of the distributed digital ledger transaction network within the ledger information 602. The ledger transaction system 106 can provide such data (as well as the data described above) to a client device in response to a query received from the client device.
In one or more embodiments, the validator node devices of the distributed digital ledger transaction network utilize the ledger information 602 to generate a vote and achieve consensus on the current state of the distributed digital ledger transaction network. As shown in
Upon generating the validator signatures for version N of the transaction tree, the ledger transaction system 106 can discard or overwrite the validator signatures for the previous version of the transaction tree. However, in some embodiments, if execution of a transaction marks a change to the set of validator node devices, the ledger transaction system 106 archives the validator signatures for the previous version of the transaction tree (i.e., corresponding to the previous set of validator node devices). For example, the ledger transaction system 106 can store the validator signatures corresponding to the previous set of validator nodes within a signature data structure.
Though not shown in the figures, the ledger transaction system 106 can utilize a signature data structure to store a validator set history and a signature history associated with the distributed digital ledger transaction network. In particular, the validator set history can include the validator node devices associated with each set of validator node devices able to vote on blocks of transactions (e.g., each set of validator node devices associated with a voting epoch). In one or more embodiments, the ledger transaction system 106 stores a complete set of validator node devices by storing the public key associated with each validator node device from the set. Effectively, the validator set history includes a history of changes to the set of validator node devices able to vote on blocks of transactions. The signature history can include the validator signatures associated with each transaction executed across the distributed digital ledger transaction network before the set of validator node devices changes (e.g., before the end of a voting epoch).
Additionally, as shown in
In one or more embodiments, the ledger transaction system 106 can chain transaction blocks. Indeed, the ledger transaction system 106 can chain transaction blocks by including, within the transaction block, the consensus certificate hash of another transaction block. For example, the ledger transaction system 106 can include the consensus certificate hash of a pervious (e.g., the immediately preceding) transaction block. In some embodiments, the ledger transaction system 106 can include a fixed consensus certificate hash value.
In one or more embodiments, each validator node device maintains a local tree of records (e.g., the transaction tree 502). The initial root of the tree can include a consensus certificate hash agreed upon by the current set of validator node devices as part of the setup for the current epoch. In particular, each branch of the local tree can include a chain of records alternating between transaction blocks and consensus certificates. In some embodiments, when selected, a lead validator node device proposes a new transaction block, usually extending the quorum certificate of (one of) the longest branch(es) of the local tree. If the proposal is successfully broadcast, honest validator node devices can verify the data, execute the transaction block, and send back a vote to the lead validator node device. Upon receiving enough votes that agree with the state of the digital ledger resulting from execution of the transaction block, the lead validator node device can create a consensus certificate for the transaction block and broadcast it to the other validator node devices, extending the chain length by one. Subsequently, the ledger transaction system 106 can select a new lead validator node devices that will drive another round of consensus, further extending the chain.
Thus, the ledger transaction system 106 can utilize data structures to store, validate, and distribute data representative of the digital ledger implemented and maintained by the distributed digital ledger transaction network. In particular, the ledger transaction system 106 can store, within the transaction data structure, data that describes every transaction executed across the distributed digital ledger transaction network, the transaction events resulting from those transactions, and how those transaction events change user accounts. Any unauthorized modification to an event, account, or transaction will modify the corresponding data structures, modify the ledger information, and fail to gain consensus across the distributed digital ledger transaction network.
B. Policy for Storage Deletion
As mentioned above, conventional blockchain systems generate and store a significant amount of data. For example, conventional systems may generate data regarding the transactions that have been executed across the network as well as data associated with user accounts of the network. Many of these conventional systems store the data on the network (i.e., on computer nodes participating in the network). The conventional systems can then use the data stored on the network to update the state of the network (i.e., update the digital ledger implemented on the network) and/or service queries for information.
As mentioned above, however, these conventional blockchain systems suffer from technological shortcomings that result in inefficient and inflexible operation. For example, conventional blockchain systems are often inefficient in that they store all data related to the digital ledger (i.e., the entire history of the digital ledger) on computer nodes participating in the network. As the digital ledger grows, the conventional systems require more computing resources (e.g., computing memory) from the computer nodes in order to maintain the data corresponding to the digital ledger.
In addition to efficiency concerns, conventional blockchain systems are also inflexible. In particular, many conventional blockchain systems rigidly require the computer nodes participating in the network to store the entire history of the digital ledger regardless of the role of that computing device. Consequently, the conventional systems may require some computer nodes to store more data than is necessary to fulfill their respective role. Accordingly, the conventional systems often fail to implement flexible storage requirements that accommodate the needs of the computer nodes.
One or more embodiments of the ledger transaction system 106 implement flexible storage deletion and consolidation to more efficiently manage the limited storage resources of computer nodes participating in the distributed digital ledger transaction network. In particular, the ledger transaction system 106 can utilize configurable data storage deletion rules to remove (all or a portion of) various data structures stored at various computer nodes across the distributed digital ledger transaction network. Indeed, the ledger transaction system 106 can implement different data storage deletion rules across different devices depending on user preferences, computing device roles or functions (e.g., validator node versus full node), or storage capabilities (e.g., remaining storage). For example, users of computer nodes can define what data structures to keep (what types, what portions, or at what frequency), or for how long (e.g., how old). To illustrate, the ledger transaction system 106 can receive (via a user interface of a computer nodes) user interaction indicating a selection to identify account balances at a particular time of day each week. The ledger transaction system 106 can traverse the data structures (e.g., the state database and/or state tree), identify the pertinent nodes for the requested information, and remove the remaining data. Accordingly, the ledger transaction system 106 can flexibly determine what events, transactions, states, and/or account data to retain and/or delete at various computing devices of the distributed digital ledger transaction network.
The ledger transaction system 106 can remove data while still retaining the ability to validate or accurately determine consensus of historical or proposed digital ledgers. For example, the ledger transaction system 106 can remove underlying data from a database, while retaining data representations (e.g., hashes) within an authenticated data structure. This approach allows the ledger transaction system 106 to confirm the validity of historical or proposed data structures without retaining the underlying data used to generate the structures themselves.
In some embodiments, the ledger transaction system 106 can remove different portions of data structures to reduce the storage burdens at the computer node. For example, in one or more embodiments, the ledger transaction system 106 deletes, at a computer node, data stored in a transaction tree that corresponds to a completed subtree. In some embodiments, the ledger transaction system 106 can also consolidates data structures (e.g., structures reflecting different states) to reduce size and memory requirements. To illustrate, upon updating the state of the distributed digital ledger transaction network, the ledger transaction system 106 can generate a state tree component (rather than an entire state tree) that points to the node values of previous state trees that correspond to unchanged user account states.
In one or more embodiments, the ledger transaction system 106 applies different storage deletion rules to different computing devices (e.g., different rules depending on whether the computer node is a full node device or a validator node device). In some embodiments, the ledger transaction system 106 deletes and/or consolidates data structures based on the capabilities or preferences of the particular computer node. In this manner, the ledger transaction system 106 can flexibly apply different storage deletion and consolidation rules to improve the efficiency of storage resources.
For example,
In one or more embodiments, however, the ledger transaction system 106 can determine that the validator node device 730 will not service queries for information. For example, the ledger transaction system 106 can determine that there are a sufficient number of full node devices participating in the distributed digital ledger transaction network to respond to queries for information. In determining that the validator node device 730 will not service queries, the ledger transaction system 106 can determine to maintain only those nodes of the transaction tree 702 (e.g., maintain the data stored within those nodes) necessary for the validator node device 730 to perform the validation role. Thus, the ledger transaction system 106 can apply a set of storage deletion rules to delete the tree nodes (e.g., delete the data stored within those nodes) that are not necessary for validation in order to reduce the amount of storage utilized in storing the transaction tree 720.
For example, in one or more embodiments, the ledger transaction system 106 determines that a subtree is complete and deletes the child nodes included in that subtree while maintaining the root node of that subtree. In one or more embodiments, the ledger transaction system 106 determines that a subtree is complete when every node in that subtree has two child nodes (except for the leaf nodes).
For example, as shown in
Similarly, the ledger transaction system 106 determines that the subtree from the internal node 706d is full. In response, the ledger transaction system 106 deletes the leaf nodes 704e-704f (and/or corresponding database entries). The ledger transaction system 106 maintains the internal node 706d as the root node of that subtree. As can be seen in
As the ledger transaction system 106 continues to append leaf nodes to the transaction tree 702 in response to transaction execution, the ledger transaction system 106 can continue to identify completed subtrees and delete the child nodes of those subtrees while maintaining their root nodes. In one or more embodiments, the ledger transaction system 106 further identifies subtrees consisting of exactly one leaf node and replaces those subtrees with a single node representing the leaf node. In one or more embodiments, the ledger transaction system 106 maintains the root nodes of a subtree to enable the validator node device 730 to participate in validating transaction blocks. Indeed, by maintaining the root nodes of the subtrees, the ledger transaction system 106 can re-evaluate the root value of the root node 710 of the transaction tree 702 after appending a new leaf node. By maintaining root nodes that contain hash values reflecting leaf nodes, the ledger transaction system 106 can still verify the accuracy of a transaction tree without storing the leaf nodes originally utilized to determine the hash values at the root.
As further shown in
In addition to deleting or consolidating portions of transaction data structures, the ledger transaction system 106 can also delete or consolidate state data structures (or other data structures) stored at a computer node to reduce the amount of data stored at the computer node. For example,
As shown in
However, the ledger transaction system 106 can reduce the amount of storage utilized in storing the state data structure. In particular, in one or more embodiments, the ledger transaction system 106 determines that the validator node device 802 will not service queries for information, and therefore will not store state trees representing previous states of the distributed digital ledger transaction network. Indeed, as the validator node device 802 only requires the most current state of the distributed digital ledger transaction network to determine the next state, the ledger transaction system 106 can determine that the validator node device 802 will only store the most current state tree (or some other subset of data structures, such as the previous two state trees).
Accordingly, as shown in
In particular, the ledger transaction system 106 overwrites the state tree 804 (and generates the state tree 820) by updating the node values stored at the state tree 804 that are modified by the transaction. As illustrated by
In some embodiments, rather than overwriting a state data structure, the ledger transaction system 106 can generate a state data structure component that reflects changes to a prior version of a state data structure. In this manner, the ledger transactions system 106 can store multiple versions of a state data structure, without storing the entirety of the state data structures. For example, as further shown in
For example, in one or more embodiments, the ledger transaction system 106 determines that the full node device 830 will service queries for information. Accordingly, the ledger transaction system 106 determines that the full node device 830 will store, within the state data structure, data corresponding to every state of the distributed digital ledger transaction network.
As shown in
In particular, as shown in
As shown in
In one or more embodiments, the ledger transaction system 106 can utilize state tree components to store multiple states and then delete nodes within the state tree to reduce the amount of data stored at the computer node. For example, a computer node can decide to transition from storing multiple data structures reflecting multiple states to storing a state data structure reflecting fewer states.
As shown in
As shown in
As shown in
As shown in
In one or more embodiments, the ledger transaction system 106 stores, at each node, the total number of associated parent nodes (e.g., by appending the total number of parents to the node value stored at the node). The ledger transaction system 106 can then delete nodes based on the total number of parent nodes. For example, the ledger transaction system 106 can identify nodes having a total number of parent nodes that indicate the node does not correspond to the current state of the distributed digital ledger transaction network. To illustrate, a node from a state tree corresponding to the first state is associated with only one parent node (i.e., the root node of that state tree). Accordingly, the ledger transaction system 106 can delete that node.
As mentioned, in one or more embodiments, the ledger transaction system 106 can delete all nodes having outdated node values. In some embodiments, however, the ledger transaction system 106 deletes all nodes that have outdated node values corresponding to a state that is earlier than a designated state. In other words, the ledger transaction system 106 can identify a designated state (e.g., via input from a user of the full node device 902 or via input from an authorized device) and delete all nodes corresponding to states that are previous to the designated state. In this way, the full node device 902 can maintain data corresponding to a desired subset of states of the distributed digital ledger transaction network.
In one or more embodiments, the ledger transaction system 106 can delete, consolidate, and store a variety of different data structures to efficiently manage storage at computer nodes. For example, in one or more embodiments, the ledger transaction system 106 uploads data corresponding to the most current state (or some other designated state) to another storage device and then stores all data corresponding to subsequent states to that storage device. In some embodiments, the ledger transaction system 106 determines to maintain snapshots of the history of states of the distributed digital ledger transaction network. As an illustration, the ledger transaction system 106 can determine to maintain data corresponding to one in every thousand states or data corresponding to one state out of every week. The ledger transaction system 106 can then delete data that does not correspond to those states. Accordingly, the ledger transaction system 106 can identify the implementing computer node as one that can only service queries for information regarding at least one of the maintained states.
Although
As mentioned, in one or more embodiments the set of storage deletion rules and the set of storage consolidation rules are configurable. In particular, the ledger transaction system 106 can change the deletion rules and consolidation rules based on the changing needs of the distributed digital ledger transaction network or based on the changing needs or preferences of individual computer nodes. In some embodiments, the ledger transaction system 106 configures the set of storage deletion rules and/or the set of storage consolidation rules based on input received from a user of a node device or from an authorized device. In some embodiments, the ledger transaction system 106 changes the storage deletion rules and/or the storage consolidation rules based on consensus (e.g., procedures of a smart contract executed across the distributed digital ledger transaction network).
By implementing the set of storage deletion rules and/or the set of storage consolidation rules, the ledger transaction system 106 operates more efficiently than conventional systems. In particular, the ledger transaction system 106 reduces the demand for storage placed on the computer nodes of the distributed digital ledger transaction network. Indeed, the ledger transaction system 106 reduces the computing resources utilized by the computer nodes while still allowing the computer nodes to maintain data corresponding to the digital ledger.
Further, the ledger transaction system 106 is more flexible than conventional systems. For example, by managing storage based on a classification or role of a computer node, the ledger transaction system 106 flexibly narrows the use of storage to the needs of particular nodes (e.g., serving queries or participating in consensus). Further, by allowing for configurable storage approaches, the ledger transaction system 106 can flexibly modify or update storage management to accommodate the changing needs of the distributed digital ledger transaction network.
C. Account Eviction
Many conventional blockchain systems store account data for users within storage managed by the conventional system (e.g., a separate database managed by each computer node participating in the system). As more users create accounts associated with the conventional systems, the demand for storage increases, exhausting storage resources at individual computing devices. To avoid these issues, many conventional systems purge their storage structures of unwanted (e.g., old) account data. For example, conventional blockchain systems may limit the time allotted to the storage of account data for a particular user. When the allotted time expires, the conventional systems may delete or overwrite the account data within the storage structure, allowing for the reuse of storage resources.
As mentioned above, however, despite these advances, conventional blockchain systems suffer from technological shortcomings that result in inflexible and inefficient operation. For example, conventional blockchain systems are often inflexible in that they rigidly require all participating computer nodes to delete account data associated with an expired user account synchronously. To illustrate, many conventional blockchain systems delete account data associated with an expired user account by broadcasting a transaction (e.g., originating from a computer node) that triggers the deletion to all computer nodes storing the account data. Consequently, a given computer node typically must wait for such a transaction before deleting the account data.
In addition to flexibility concerns, conventional blockchain systems are also inefficient. In particular, because conventional systems often utilize transactions to trigger the deletion of account data associated with expired user accounts, a computer node storing the account data may maintain the data within its database longer than necessary. Specifically, as mentioned, a computer node may maintain the account data while waiting for a transaction that triggers deletion even after having the computing resources (e.g., processing down-time) available to locate and delete the data. Accordingly, conventional systems often utilize a significant amount of computing resources (e.g., memory) to accommodate expired user accounts. Further, to delete an account, conventional systems generally broadcast a separate transaction to trigger deletion of the account data which further utilizes computer resources across the distributed digital ledger transaction network in executing and obtaining consensus on the transaction.
One or more embodiments of the ledger transaction system 106 utilize flexible account eviction to more efficiently manage the storage resources of computer nodes within the distributed digital ledger transaction network. In particular, as mentioned above, the ledger transaction system 106 can generate a state data structure that stores account data corresponding to user accounts as well as account state representations of the account data. The ledger transaction system 106 can allow for lazy deletion (e.g., marking items as expired or ready for deletion without imposing a requirement to delete the data) of account data across computing devices of the distributed digital ledger transaction network. For example, the ledger transaction system 106 can store an eviction date associated with each user account. Based on the eviction date, the ledger transaction system can determine expiration of a user account and subsequently delete the account data from the state data structure at a flexible time for each computing device (e.g., when computing resources become available for the device). In this manner, the ledger transaction system 106 enables each computer node of the distributed digital ledger transaction network to flexibly and efficiently delete expired account data.
As mentioned above, the ledger transaction system 106 can generate a state data structure that stores account data and account state representations corresponding to user accounts of the distributed digital ledger transaction network.
As described above, and as shown in
As described above, in one or more embodiments, the account state representation 1008 includes a hash value 1010 corresponding to the account data 1006 (i.e., a hash of the account value 1016). In some embodiments, however, the account state representation 1008 includes additional data. For example, as shown in
As shown in
In one or more embodiments, the ledger transaction system 106 can update (i.e., modify) the eviction date 1014 associated with the user account. For example, the ledger transaction system 106 can update the eviction date 1014 to extend the active status of the user account after detecting activity corresponding to the user account (e.g., after executing a transaction submitted by the user account on the distributed digital ledger transaction network). Additionally, the ledger transaction system 106 can update the eviction date 1014 upon re-caching the account data 1006 associated with the user account, as will be explained in more detail below. In one or more embodiments, the ledger transaction system 106 sets the eviction date 1014 based on a time of a last user account access (e.g., the time of the last activity of the user account with regard to the distributed digital ledger transaction network) and a threshold value that includes a predetermined minimum length of time that a user account may remain active before expiration. Similarly, the ledger transaction system 106 can set or update an eviction date based on rent deposit amount, a time of a transaction that transfers digital assets from the user account, or a time of a transaction that transfers digital assets to the user account.
When the ledger transaction system 106 determines to delete the account data 1006 (e.g., when sufficient computing resources become available), the ledger transaction system can access the account state representation 1008 to determine (or confirm) expiration of the eviction date 1014 (i.e., the user account). In response to determining expiration of the eviction date 1014, the ledger transaction system 106 can delete the account data 1006 (e.g., the account value 1016 and corresponding hash 1018) from the state database 1002. As shown in
Notably, in one or more embodiments, the ledger transaction system 106 initiates the deletion of account data associated with a given user account without submission of a transaction event request on the distributed digital ledger transaction network for deleting the account data. Rather, as mentioned, the ledger transaction system 106 can initiate deletion of the account data at any time after expiration of the user account (e.g., based on preferences, settings, or capabilities of individual computing devices).
The ledger transaction system 106 can determine when to purge account data based on a variety of factors. In one or more embodiments, the ledger transaction system 106 performs a periodic scan to identify expired user accounts and then delete the corresponding account data (and other associated data) from the state database 1002. The ledger transaction system 106 can optimize the frequency of this periodic scan in order to more efficiently manage the computing resources available at any given time. In some embodiments, the ledger transaction system 106 optimizes the periodic scan independently for each computer node (e.g., validator node device or full node device) of the distributed digital ledger transaction network. Specifically, for a given computer node, the ledger transaction system 106 can identify the computing resource of the computer node, determine the availability of those computing resources, and then determine how to optimize the frequency of the scan for locating expired user accounts.
In some embodiments, the ledger transaction system 106 provides selectable options for setting conditions for purging purge account data. For example, the ledger transaction system 106 can provide a user interface for selecting a time, frequency, or trigger for removing account data. In other embodiments, the ledger transaction system 106 automatically purges account data based on a pre-defined schedule or trigger (e.g., based on current processing power utilized by the computing device falling below a threshold level).
By deleting account data corresponding to an expired user account without requiring a transaction event request, the ledger transaction system 106 provides more flexibility for managing expired user accounts when compared to conventional systems. Specifically, the ledger transaction system 106 can flexibly delete account data based on individual user preferences and/or the availability of computing resources. Further, by optimizing account data deletion independently for each computer node within the distributed digital ledger transaction network, the ledger transaction system 106 can extend the flexibility to accommodate the computing resources available to each individual computer node.
Additionally, the ledger transaction system 106 operates more efficiently than conventional systems. As an initial matter, the ledger transaction system 106 avoids wasting computer resources across the distributed digital ledger transaction network in transmitting, analyzing, and executing separate transactions to remove outdated content. Indeed, each individual device can remove content without having to execute and gain consensus on an additional transaction. In addition, by allowing individual computing devices to remove account data at their leisure, the ledger transaction system 106 can efficiently locate and delete account data based on the available computer resources on individual devices. Accordingly, the ledger transaction system 106 can avoid overburdening computer resources of individual devices.
In some circumstances, allowing individual computer nodes to flexibly delete account data could potentially result in inconsistency across computer nodes. For example, a request by a client device for information from a user account could produce a different response depending on whether individual node had purged particular account data. In one or more embodiments, the ledger transaction system 106 provides flexibility while maintaining consistency by limiting access to accounts across the distributed digital ledger transaction network (e.g., even when the account data has not yet been deleted from a particular device).
For example, in one or more embodiments, the ledger transaction system 106 rejects requests (e.g., transactions, queries, etc.) associated with the user account that are received after expiration of the user account and prior to deleting the account data 1006. Specifically, in some embodiments, upon receiving a request associated with the expired user account, the ledger transaction system 106 can access the account state representation 1008 corresponding to the user account and determine that the eviction date 1014 (i.e., the user account) has expired. The ledger transaction system 106 can subsequently continue with processing of the transaction as if the account had expired. For example, the ledger transaction system 106 can respond to the request by sending an indication (e.g., to the client device that submitted the request) that the user account has expired. Said differently, even while maintaining the account data 1006 within the state database 1002, the ledger transaction system 106 can deny access to the account data 1006 (i.e., deny access to the user account itself) if the user account (i.e., the eviction date 1014) has expired. In this manner, the ledger transaction system 106 can give each computer node flexibility to delete account data (without initiating a separate transactions) while still ensuring consistent behavior (e.g., response to queries) across the entire distributed digital ledger transaction network.
As mentioned above, in one or more embodiments, the ledger transaction system 106 can re-cache account data that has previously been deleted from the state database. In particular, the ledger transaction system 106 can utilize a transaction to accurately re-cache the account data.
As shown in
Subsequently, the ledger transaction system 106 can compare the proposed account data 1106 to the account state representation of the user account stored within the state tree. For example, in one or more embodiments, the ledger transaction system 106 performs an act 1108 of generating a proposed account value hash. In particular, the ledger transaction system 106 can perform the act 1108 by applying a hash function to the proposed account value of the proposed account data 1106.
As shown in
As illustrated, the ledger transaction system 106 can also perform an act 1112 of comparing the proposed account value hash and the hash value at the account address. In particular, in one or more embodiments, the ledger transaction system 106 determines whether the proposed account value hash is equal to the hash value at the account address. This comparison allows the ledger transaction system 106 to validate or verify the accuracy of the proposed account data 1106. Indeed, if the proposed account value hash matches the hash value at the account address, the proposed account data 1106 matches the data deleted from the account. If, however, the proposed account value hash does not match the hash value at the account address, the proposed account data 1106 does not match the data deleted from the account (e.g., the data has been modified or otherwise corrupted).
As shown in
By maintaining the account state representation within the leaf node of the state tree that is associated with a user account, even after deleting account data corresponding to that user account, the ledger transaction system 106 manages storage resources more flexibly and efficiently than conventional systems. Specifically, the ledger transaction system can flexibly delete and reinstate account data associated with user accounts while maintaining accuracy and security of the digital ledger.
D. Tracking Multiple Writes in Memory
As mentioned above, conventional blockchain systems can receive blocks of transactions and (upon consensus) execute the transactions within the block. Indeed, through consensus protocols, such conventional systems can identify which blocks of transactions have been agreed upon by the other computer nodes in the network. Thus, the conventional systems can add transactions to the digital ledger based on which blocks of transactions have achieved consensus within the network.
As mentioned above, however, conventional blockchain systems are often inflexible and inaccurate at determining the order in which transactions (or blocks of transactions) are to be added to the digital ledger. For example, many conventional blockchain systems are often inflexible in that they rigidly add transaction blocks to the digital ledger in the order in which those transaction blocks were received. However, this can cause issues—especially for conventional systems implementing a leader-based consensus protocol—where multiple transaction blocks are received at or around the same time (e.g., due to communication delays) or a new transaction block has been received before the previous block has been committed to storage. For instance, in the circumstance of receiving a new transaction block before the previous block is committed to storage, a conventional system may execute the new transaction block based on the previous transaction block and then determine that the previous transaction block has been rejected by the network. This can require conventional systems to generate conflicting ledgers and result in a waste of computing resources in correcting inaccurate transaction blocks committed to storage.
In addition to flexibility concerns, the conventional blockchain systems may also operate inaccurately. In particular, due to the failure to flexibly accommodate various issues surrounding the order in which transactions are added to the digital ledger, many conventional blockchain systems may inaccurately represent the digital ledger. For example, one computer node participating in a network may add transactions to the digital ledger in a different order than another node in the network. Thus, the two computer nodes may disagree as to the current state of the digital ledger, and at least one of those computer nodes may be inaccurately representing that current state.
One or more embodiments of the ledger transaction system 106 utilize a scratch pad data structure to flexibly track multiple possible variations of the digital ledger while waiting for consensus on one or more transaction blocks. In particular, the ledger transaction system 106 can utilize the scratch pad data structure as temporary memory in which to store possible (e.g., speculative) branches of execution. For example, the ledger transaction system 106 can identify multiple transaction blocks containing distinct transactions. In one or more embodiments, the multiple transactions blocks include conflicting transactions (e.g., at least two of the transaction blocks includes a transaction that withdraws a digital asset from a user account, and the user account does not contain enough digital assets to satisfy both transactions). The ledger transaction system 106 can perform an execution for each of the transaction blocks and store the results of the execution in the scratch pad data structure. In particular, the ledger transaction system 106 can store, for each transaction block, how execution of that transaction block modifies the current state of the distributed digital ledger transaction network (i.e., the last state committed to permanent storage via consensus) independent of how execution of the other transaction blocks modifies that state. The ledger transaction system 106 can then commit the transaction blocks to permanent storage (or reject the transaction blocks altogether) based on the results of consensus. In this manner, the ledger transaction system 106 can flexibly track possible consensus outcomes in a manner that results in a more accurate representation of the digital ledger.
As mentioned above, the ledger transaction system 106 can utilize the scratch pad data structure to track how execution of a transaction block modifies the most current committed state of the distributed digital ledger transaction network. Indeed, the ledger transaction system 106 can utilize the state data structure in conjunction with the scratch pad data structure to track the various branches of execution.
As shown in
Specifically,
As shown in
As shown in
As shown in
To illustrate, the state tree component 1402 includes the leaf node 1412a, which corresponds to the user account modified by the first transaction 1306. The state tree component 1402 also includes the leaf node 1412b. Though the user account corresponding to the leaf node 1412b remains unchanged from the first transaction 1306, the ledger transaction system 106 utilizes the node value of the leaf node 1412b to determine the node value of the internal node 1414, which is further used to determine the root value of the root node 1406. In one or more embodiments, the ledger transaction system 106 generates, within the scratch pad data structure, an entire state tree corresponding to the state resulting from a transaction, rather than a state tree component.
In one or more embodiments, because the first transaction 1306 and the second transaction 1308 indicate the user accounts modified by those transactions, the ledger transaction system 106 can preload the account states corresponding to those user accounts before using the virtual machine to initiate execution. Indeed, in one or more embodiments, the ledger transaction system 106 preloads the account states to the virtual machine from storage in parallel, improving execution time as the virtual machine does not need to wait for the account states for execution.
As shown in
Indeed, as shown in
Upon committing a transaction block to storage, the ledger transaction system 106 can deallocate the corresponding state trees (e.g., remove from the scratch pad data structure). The ledger transaction system 106 can further deallocate any remaining nodes that do not have an associated parent node in the scratch pad data structure. In one or more embodiments, if one or both of the transaction blocks 1310, 1314 fail to achieve consensus, the ledger transaction system 106 can remove the corresponding state tree component from the scratch pad data structure. In one or more embodiments, the ledger transaction system 106 clears the scratch pad data structure entirely whenever a block of transactions is committed to storage.
By using the scratch pad data structure to track the various possible branches of execution, the ledger transaction system 106 accommodates the reception of multiple transaction blocks more flexibly than conventional systems. Specifically, the ledger transaction system 106 can flexibly execute the transaction blocks and then temporarily store the execution results until consensus fails or is achieved for at least one of the blocks. Further, by temporarily storing execution results, the ledger transaction system 106 can flexibly accommodate the delay between executing a transaction block and obtaining consensus. Indeed, by utilizing the scratch pad data structure, the ledger transaction system 106 can continue to execute transaction blocks based on the execution results of a given transaction block waiting to be committed into storage.
Additionally, the ledger transaction system 106 operates more accurately than conventional systems. Indeed, due to the flexibility offered by the scratch pad data structure, the ledger transaction system 106 can more accurately represent the digital ledger. Specifically, because the ledger transaction system 106 can use the scratch pad data structure to temporarily store the execution results of a transaction block, the ledger transaction system 106 can postpone committing the execution results to storage until the consensus on those results are achieved. Accordingly, the ledger transaction system 106 ensures that the computer nodes of the distributed digital ledger transaction network commit transaction blocks in the same order.
E. Proofs and Verification
As mentioned above, in one or more embodiments, a computer node (e.g., a full node device) responding to a query for information can transmit a proof, along with the requested information, to the requesting client device. Indeed, in one or more embodiments, the distributed digital ledger transaction network represents a trustless system in which a client device does not trust the computer node from which it receives data. Accordingly, the ledger transaction system 106 can provide, from a computer node, a proof as evidence of the accuracy of the data.
For example, the ledger transaction system 106 can provide proof of a signed transaction at a specified version of the transaction data structure. Additionally, the ledger transaction system 106 can provide proof of the state of a user account at a particular state of the distributed digital ledger transaction network using the state data structure. In further embodiments, the ledger transaction system 106 can provide proof of a particular transaction event emitted as part of the execution of a particular transaction using the event data structure. As discussed above, the transaction data structure, the state data structure, and the event data structure can each include a tree, such as a Merkle tree. Accordingly, in one or more embodiments, the proofs provided by the ledger transaction system 106 include Merkle proofs.
In one or more embodiments, a proof includes three parts: a partial proof, transaction info, and a common proof. For a partial proof corresponding to a signed transaction, the ledger transaction system 106 can provide the raw data of the signed transaction. For a partial proof corresponding to a user account state, the ledger transaction system 106 can provide proof from the leaf node of the state tree corresponding to the user account to the root node (including the associated intermediate nodes and sibling nodes in between) as well as the account data (e.g., the account value). For the partial proof corresponding to a transaction event, the ledger transaction system 106 can provide proof from the leaf node of the corresponding event tree to the root node (including the associated intermediate nodes and sibling nodes in between) as well as the event data (e.g., the transaction event details). For the transaction info part of the proof, the ledger transaction system 106 can provide the data stored within the corresponding leaf node of the transaction tree. And for the common proof, the ledger transaction system 106 can provide the proof from the leaf node to the root node of the transaction tree (including the associated intermediate nodes and sibling nodes in between).
Upon receiving a proof of data, a client device (i.e., the ledger transaction system 106 operating at a client device) can verify the root value of the transaction tree root node against the signatures of the ≥2f+1 validator node devices that signed off on that root value. For example, the ledger transaction system 106 can deserialize the data from the applicable data structure. The ledger transaction system 106 can then determine whether the deserialized data matches an expected value. For proofs corresponding to user account states or transaction events, the ledger transaction system 106 can then iteratively hash the list of nodes (i.e., sibling nodes) provided as part of the partial proof to obtain the root value of the corresponding tree. The ledger transaction system 106 can then compare the raw data of the signed transaction, the root value of the state tree, or the root value of the event tree (whichever is applicable) to the data stored within the corresponding leaf node of the transaction tree. The ledger transaction system 106 can then iteratively hash the list of nodes (i.e., sibling nodes) provided as part of the common proof to get the root value of the transaction tree. If the determined root value of the transaction tree has at least 2f+1 signatures with the correct set of validator node devices, the ledger transaction system 106 can verify the accuracy of the data. If, however, the comparisons fail at any step of verification, or if the root value of the transaction tree does not have the required signatures from the correct set of validator node devices, the ledger transaction system 106 can determine that the proof is invalid.
III. Addressing and AccountsA. Overview
As previously mentioned, the ledger transaction system 106 utilizes addresses to specify and identify user accounts on the distributed digital ledger transaction network. For example, the ledger transaction system 106 can maintain an authenticated state structure that maps account address keys to account values. Moreover, the ledger transaction system 106 can utilize addresses (or keys) included in a transaction to identify the user accounts between which digital assets are to be transferred. The ledger transaction system 106 can further use addresses identified within queries for information in order to retrieve the appropriate information.
As shown in
In some embodiments, an account address is a 256-bit value. To create a new account, the ledger transaction system 106 generates a key-pair (Kr, Ks) for a signature scheme and uses the cryptographic hash of the public verification key Kp as an account address a. The new account is created in the ledger state when a transaction sent from an existing account invokes the create_account(a) instruction. This typically occurs when a transaction attempts to send digital assets to an account address a that has not yet been created.
Once the new account is created at a, the user can sign transactions to be sent from that account using the private signing key Ks. As outlined below, the user can also rotate the key used to sign transactions from the account without changing its address.
As shown in
As further shown in
Thus, a user account can be associated with a main address that identifies the user account within the state tree of the distributed digital ledger transaction network. If a user account is associated with a private digital ledger, the user account can include both a main address and a sub-address, where the main address provides the address of an account on the public digital ledger (i.e., the account of the private digital ledger) and the sub-address identifies the user account from among the plurality of user accounts managed by the private digital ledger.
B. Utilizing Encrypted Sub-Addresses for Transaction Requests
Conventional blockchain systems typically utilize addresses associated with user accounts when generating and executing transactions. In particular, many conventional systems generate transactions that specify a main address and a sub-address to identify the public ledger account and the private ledger address, respectively, of the associated user accounts. Accordingly, when executing a transaction associated with particular user accounts, conventional blockchain systems ensure the correct user accounts are modified (e.g., digital assets are transferred to/from the correct user accounts).
However, conventional blockchain systems have a number of shortcomings, leading to inflexible and/or unsecure operation. For example, conventional blockchain systems typically execute transactions based on the addresses associated with user accounts of a network. Accordingly, the conventional systems are often rigid in requiring input that includes the addresses of the user accounts in order to generate a request for a transaction via the network. Users that seek to transact with a user account may not have access to specific addressing information.
Further, many conventional blockchain systems can introduce security concerns by publishing the addresses of user accounts associated with a transaction on the network, allowing external entities to access the network and identify those addresses. For example, even if these sub-addresses are encrypted, conventional systems may publish the same address to the network several times (e.g., if the address is associated with multiple transactions), allowing external entities to determine that the same user account has been involved in multiple transactions. Conventional systems fail to incorporate privacy measures to counteract tracking and potential manipulation of this information on the network.
One or more embodiments of the ledger transaction system 106 utilize encryption keys associated with user accounts for flexible and secure sub-address encryption when generating transaction requests. For example, the ledger transaction system 106 can generate a request for a transaction directed to a user account by identifying a main public address identifier, a sub-address identifier, and an encryption key associated with the user account. The ledger transaction system 106 can then generate a non-deterministic encrypted sub-address that is unique to the transaction by applying the encryption key to the sub-address with an added nonce value. Thus, for example, the ledger transaction system 106 can allow a recipient account to receive a variety of different digital assets via the distributed digital ledger transaction network at the same sub-address without publishing repeated account identifiers on the digital ledger.
For example, the ledger transaction system 106 can execute a transaction that transfers digital assets to the owner of a recipient account corresponding to a main address. The owner of the recipient account can identify that an event and corresponding transaction have occurred on the digital ledger. The owner of the recipient account can access (e.g., via event details or transaction details stored on event or transaction data structures) an encrypted sub-address. The recipient account can use a private encryption key to de-encrypt the encrypted sub-address to identify the sub-address corresponding to the transaction. The owner of the recipient account can then attribute the assets to a user (or account) corresponding to the sub-address. Thus, the owner of the recipient account can identify the user corresponding to the sub-address, but the digital ledger will not include a traceable (or repeatable) reference to the sub-address.
Furthermore, the ledger transaction system 106 can identify main addresses, sub-addresses, and/or encryption keys from a variety of different public sources while still executing secure, anonymous transactions. For instance, in one or more embodiments, the ledger transaction system 106 identifies the main public address identifier, the sub-address identifier, and/or the encryption key from a digital visual code. Moreover, in some embodiments, the ledger transaction system 106 identifies the main public address identifier and the sub-address identifier from an email address. In other words, the ledger transaction system 106 can generate a request for a transaction by receiving an email address associated with the user account. In this manner, the ledger transaction system 106 can utilize identifiers and encryption keys associated with a user account to flexibly and securely generate transaction requests on the distributed digital ledger transaction network.
As mentioned above, in one or more embodiments, the ledger transaction system 106 utilizes a main public address identifier and a sub-address identifier of a user account to generate requests for transactions on the distributed digital ledger transaction network.
For example, the ledger transaction system 106 can scan, at the client device 1602, a digital visual code 1606 displayed by a computing device 1604. As shown in
Upon scanning the digital visual code 1606, the ledger transaction system 106 identifies (e.g., extracts or decodes) a main public address identifier 1608 and a sub-address identifier 1610 associated with a user account of the distributed digital ledger transaction network. As shown in
By identifying, from the digital visual code 1606, the main public address identifier 1608 and the sub-address identifier 1610, the ledger transaction system 106 can generate a request for a transaction associated with the user account (e.g., a transaction between the user account and another user account). The ledger transaction system 106 can then submit the request for the transaction for execution via the distributed digital ledger transaction network utilizing the main public address identifier 1608 and the sub-address identifier 1610.
The ledger transaction system 106 can dynamically generate digital visual codes unique to particular transactions (even when the transactions involve the same destination account). For example, in relation to as shown in
Upon scanning the digital visual code 1614, the ledger transaction system 106 can identify the main public address identifier 1608 and a sub-address identifier 1610 associated with the user account. As illustrated by
Moreover, by initiating transactions utilizing this approach, the digital ledger can avoid duplicate sub-addresses trackable by external entities. Indeed, even though multiple transactions on the digital ledger involve the same account, the digital ledger will reflect two different encrypted sub-addresses that would not allow for tracking and manipulation of repeat payments to the same account by parties external to the transaction. Specifically, a transaction executed via the distributed digital ledger transaction network utilizing the sub-address identifier 1610 would not be traceable to another transaction executed via the distributed digital ledger transaction network utilizing the sub-address identifier 1616 (even though both transactions are directed to the same account).
In addition to using dynamically generated digital visual codes that change with each scan, the ledger transaction system 106 can utilize a static digital visual code when generating a request for a transaction associated with a user account. Further, as mentioned above, the ledger transaction system 106 can utilize an encryption key associated with a user account when generating a request for a transaction associated with that user account.
As shown in
Although
Upon scanning the digital visual code 1706, the ledger transaction system 106 can identify (e.g., decode or extract from the digital visual code 1706) a main public address identifier 1708, a sub-address identifier 1710, and an encryption key 1712 associated with a user account of the distributed digital ledger transaction network. As shown in
As shown in
Thus, the ledger transaction system 106 can utilize the main public address identifier 1708, the sub-address identifier 1710, and the encryption key 1712 to generate a request for a transaction associated with a user account. In particular, the request for the transaction can include an encrypted sub-address that is unique to the requested transaction. The ledger transaction system 106 can then submit the request for the transaction for execution via the distributed digital ledger transaction network. Moreover, by utilizing the encryption key 1712 and nonce value, transactions initiated from the digital visual code 1706 will not repeat encrypted sub-addresses that can be tracked by entities external to the transactions. Thus, for recurring payments to the same address, which may have the same encrypted sub-address (and be recognizable as going to the same place), the ledger transaction system 106 can use the encryption key (e.g., a re-encryption key) to double-encrypt.
As mentioned above, the ledger transaction system 106 can also flexibly and securely identify sub-addresses to initiate transactions utilizing a variety of different sources (aside from the document 1704). In particular, the ledger transaction system 106 can identify addresses to initiate a transaction via the distributed digital ledger transaction network utilizing an email address. For example,
In one or more embodiments, the ledger transaction system 106 can determine the main address of the user account based on the domain name 1804 of the email address 1802. For example, in one or more embodiments, the ledger transaction system 106 (or a third-party system such as a domain name managing system) generates domain name system text records that reflect main addresses of the distributed digital ledger transaction network. In particular, the ledger transaction system 106 can generate DNS records that associate the main address of an entity within the distributed digital ledger transaction network with a domain address corresponding to the entity on the web. The ledger transaction system 106 can utilize DNSSEC to verify provenance of the data correspondence between the domain and the corresponding main address.
As illustrated in
As shown in
Although
Upon retrieving the main address 1812 and the encryption key 1814 associated with the user account, the ledger transaction system 106 can encrypt the personal email identifier 1816 (or a different sub-address identifier received from the remote server 1808). In particular, the ledger transaction system 106 can apply the encryption key 1814 to the personal email identifier 1816 to generate an encrypted sub-address. The ledger transaction system 106 can then submit a request for a transaction associated with the user account based on the main address 1812 identified from the DNS record 1810 and the encrypted sub-address generated by applying the encryption key 1814 to the personal email identifier 1806.
Utilizing this approach, the ledger transaction system 106 allows for transactions utilizing the distributed digital ledger transaction network based on the email address of a user account. For example, users can transfer digital assets utilizing the distributed digital ledger transaction network by sharing email addresses. Moreover, the ledger transaction system 106 can perform these transactions without sharing confidential account information. In addition, for repeated transactions involving the same payee, the ledger transaction system 106 can avoid publishing repeat/trackable address information corresponding to the transactions on the digital ledger.
Though
By using encryption keys to encrypt sub-addresses associated with user accounts, the ledger transaction system 106 can manage the visibility of user accounts associated with transactions more flexibly than conventional systems. In particular, by adding a unique nonce value to the sub-address of a user account before encryption, the ledger transaction system 106 can flexibly generate a unique sub-address encryption for each transaction associated with that user account. Accordingly, the ledger transaction system 106 can prevent identification of the user account from external entities observing transactions on the distributed digital ledger transaction network. Further, by identifying address information from address identifiers (e.g., included in an email address) associated with a user account, the ledger transaction system 106 can generate transaction requests more flexibly than conventional systems.
C. Separating and Storing Smart Contract Code and Smart Contract Data
Conventional blockchain systems are generally inflexible and rigid with regard to storage, implementation, and use of smart contracts. For example, many conventional blockchain systems utilize smart contracts to define and implement programs utilizing singleton objects particular to each program. Consequently, the smart contracts used by the conventional systems are inflexible in that they cannot be used or repeated across a network (i.e., the smart contracts are not reusable). For instance, in conventional blockchain systems, a device implementing a subsequent smart contract that depends on a previous smart contract would be unable to flexibly interact or reference the common dependencies between contracts because each smart contract implements code and singleton objects particular to each contract. In other words, conventional systems cannot rely on a common type class to flexibly and efficiently reference digital assets across the distributed digital ledger transaction network.
Additionally, conventional blockchain systems generally store associated smart contracts inflexibly. For example, many conventional blockchain systems store smart contracts under an address that corresponds to the hash value resulting from applying a hash function to the smart contract code. Accordingly, the address under which a smart contract is stored is typically unique to that smart contract. As a result, conventional systems typically store one smart contract per address.
One or more embodiments of the ledger transaction system 106 separates smart contract code and smart contract data for flexible reuse of smart contract code. Indeed, in one or more embodiments, the ledger transaction system 106 utilizes smart contract code (referred to as “modules”) to define attributes and procedures implemented by smart contract data (i.e., referred to as “resources”). Thus, the ledger transaction system 106 can flexibly utilize a module to create multiple resources having duplicate properties and being governed by the same procedures.
Further, one or more embodiments of the ledger transaction system 106 implement an addressing scheme for storing multiple smart contracts under a single user account. Indeed, the addressing scheme allows a user account to store multiple modules and resources while allowing for clear identification of a particular module or resource. Thus, the ledger transaction system 106 can more flexibly implement smart contracts across the distributed digital ledger transaction network.
In one or more embodiments, the ledger transaction system 106 treats a module as immutable. In other words, the ledger transaction system 106 can protect the module from modification or deletion. In some embodiments, however, the ledger transaction system 106 allows such actions. The ledger transaction system 106 can generate a module that invokes procedures in one or more other modules. In some embodiments, however, the ledger transaction system 106 limits modules to invoking procedures defined within other modules that were generated previously on the distributed digital ledger transaction network.
In one or more embodiments, the ledger transaction system 106 can generate multiple resources utilizing the same module. Indeed, the ledger transaction system 106 can utilize a module as a template from which to generate multiple resources. For example, as shown in
Thus, by implementing smart contracts as separate modules and resources, the ledger transaction system 106 implements smart contracts more flexibly than conventional systems. Indeed, the ledger transaction system 106 can flexibly reuse a single module to generate multiple resources that behave similarly. Thus, the ledger transaction system 106 avoids creating an entirely new smart contract to create an object having the same properties and behavior as a previously created smart contract.
Additionally, as mentioned above, the ledger transaction system 106 can implement an addressing scheme with reference to modules and resources. Indeed, in one or more embodiments, the ledger transaction system 106 can store zero or more modules and one or more resources under the same user account. In one or more embodiments, the ledger transaction system 106 utilizes these modules and resources via transaction scripts (e.g., submitted as part of a transaction request). For example, a transaction script can include calls to one or more procedures of a module with reference to a particular resource. In executing the transaction script, the ledger transaction system 106 executes the procedure calls defined within the module and modifies, moves, or otherwise interacts with the referenced resource (transaction scripts will be discussed in more detail below with reference to
To provide an illustration,
In one or more embodiments, the ledger transaction system 106 implements the addressing scheme by defining a module namespace usable for uniquely identifying modules. In one or more embodiments, the ledger transaction system 106 defines the module namespace for a particular module as the combination of the address of the user account storing the module and an identifier for the module itself. To illustrate, the ledger transaction system 106 can define the module namespace for the Currency module stored at the user account 1902a as “0x0.Currency.” Therefore, upon receiving a transaction script that includes the namespace “0x0.Currency” (e.g., as part of a call to a procedure) the ledger transaction system 106 can identify the Currency module stored at the user account 1902a having the address 0x0.
More specifically, the ledger transaction system 106 can utilize the module namespace to identify a module that corresponds to a particular resource. Indeed, in one or more embodiments, the ledger transaction system 106 extends the module namespace by appending a resource identifier to the end of the module namespace. Indeed, the extended module namespace identifies the type of the resource (i.e., the type defined by the module). Accordingly, when referencing a particular resource, the ledger transaction system 106 can utilize the extended module namespace to identify the module (i.e., the type) that corresponds to that resource. In one or more embodiments, the extended module namespace represents an access path for a resource stored at a given user account.
For example, as shown in
In one or more embodiments, to identify a resource stored at a particular user account, the ledger transaction system 106 can prefix the extended module namespace with the address of the desired user account. For example, to identify the Coin resource 1906b stored at the user account 1902b, the ledger transaction system 106 can utilize the call “0x1/0x0.Currency.Coin.” Thus, the ledger transaction system 106 can further differentiate among resources that have been generated using the same module.
In one or more embodiments, the ledger transaction system 106 limits the number of resources of a given type stored under the same user account. For example, in some embodiments, the ledger transaction system 106 only stores one resource of a given type (e.g., one Coin resource from the Currency module 1904) within a particular user account. This approach provides a predictable schema for top-level account values—that is, every account should store its currency.coin resource in the same place. This design is not restrictive, because programmers can define wrapper resources that organize resources in a custom way (e.g., resource TwoCoin {coin1: 0x181BD55:currency.coin, coin2: 0x181BD55:currency.coin}).
Additionally, in one or more embodiments, the ledger transaction system 106 only stores one module of a given name at an address. Otherwise, using the module namespace would not uniquely identify a particular module. However, the ledger transaction system 106 can store two modules having the same name under different user accounts. For example, the ledger transaction system 106 can store an additional Currency module at the user account 1902b. Using the module namespace “0x1.Currency,” the ledger transaction system 106 could uniquely identify that additional Currency module.
In sum, a resource value, or resource, can include a record that binds named fields to simple values (such as integers) or complex values (such as other resources embedded inside this resource). In some embodiments, every resource has a type declared by a module. Moreover, in one or more embodiments, resource types are nominal types which consist of the name of the type and the name and address of the resource's declaring module. Resources can be both mutated or deleted, and, in one or more embodiments, the rules for mutating, deleting, and publishing a resource are encoded in the module that created the resource and declared its type.
Similarly, a module value, or module, can include bytecode that declares resource types and procedures. Like a resource type, in some embodiments a module is identified by the address of the account where the module is declared. Further, in some embodiments, a module is uniquely named within an account (e.g., each account can declare at most one module with a given name). Moreover, in some embodiments modules are immutable.
By implementing this address scheme to differentiate between modules and/or resources stored at different user accounts, the ledger transaction system can store and use smart contracts more flexibly than conventional systems. Indeed, as mentioned, the ledger transaction system 106 can flexibly store a variety of different modules and resources at user accounts. The ledger transaction system 106 can then use the addressing scheme to define a module namespace usable for identifying the correct module when referencing a resource. Thus, when a transaction script utilizes the module namespace (or the extended module namespace) to modify or otherwise interact with a resource, the ledger transaction system 106 can correctly identify the attributes of the types and procedures that govern that resource. Further, the ledger transaction system can flexibly and efficiently reference and utilize resources across the distributed digital ledger transaction network in executing various smart contracts that utilize the resources.
D. Utilizing Resources to Delegate Account Permissions
As mentioned above, unlike conventional blockchain systems, the ledger transaction system 106 can flexibly delegate account permissions to different user accounts. Indeed, as just discussed the ledger transaction system 106 can store one or more resources in a user account and can execute transactions that modify these resources (e.g., by transferring digital assets from one user account to another user account). In some embodiments, the ledger transaction system 106 generates a resource reflecting user account withdrawal permissions and moves the resource to another account to flexibly delegate permissions across accounts.
As shown in
In one or more embodiments, the ledger transaction system 106 limits the ability to withdraw from the first user account based on the permission to withdraw. In other words, in some embodiments, the ledger transaction system 106 requires that a transaction attempting to withdraw from the first user account be associated with the permission to withdraw. For example, when the first user account submits a transaction request to transfer digital assets from the first user account to another user account, the ledger transaction system 106 can access the first user account to determine that the first user account has the resource granting the permission to withdraw.
As shown in
As shown in
As further shown in
In one or more embodiments, the ledger transaction system 106 can delegate the permission to withdraw from a user account in order to subject that user account to certain withdrawal limitations. For example, the ledger transaction system 106 can generate a cold wallet (i.e., from a cold wallet module published on the distributed digital ledger transaction network) and transfer the resource granting the permission to withdraw from the user account to the cold wallet. As used herein, the term “cold wallet” refers to an offline reserve of digital assets. Having the resource granting the permission to withdraw, the cold wallet can take digital assets out of the user account and store them within the cold wallet. The digital assets, therefore, become subject to the constraints (and protections) of the cold wallet. Though
E. Decoupling Account Addresses from Cryptographic Keys
Many conventional blockchain systems use authentication keys to authenticate user accounts sending transactions to a network. However, conventional blockchain systems are inflexible in managing these authentication keys. For example, conventional systems typically tie authentication keys of a user account directly to the user account address (e.g., the authentication key is the address of the user account). However, this presents security issues for which the conventional systems fail to offer flexible solutions. For example, if the authentication key of a user account becomes compromised, the conventional systems may require a user to move a user account to a new address to avoid account interference from a malicious party.
One or more embodiments of the ledger transaction system 106 decouples authentication keys from user account addresses to allow for flexible authentication key rotation. In particular, in one or more embodiments, the ledger transaction system 106 generates an attribute for the user account that stores the authentication key of the user account. Accordingly, the ledger transaction system 106 can store new authentication keys at the user account when desired or necessary. In this manner, the ledger transaction system 106 can provide more flexible security that allows a user account to maintain security while avoiding the need to move the contents of the user account to a new address.
In one or more embodiments, the first authentication key 2106 of the user account 2102 is further related to the public key (not shown) of the user account 2102. For example, in one or more embodiments, the ledger transaction system 106 determines the first authentication key 2106 by applying a hash function to the public key of the user account 2102 and setting the first authentication key 2106 to the resulting hash value. Indeed, in some embodiments, when creating the user account 2102 on the distributed digital ledger transaction network, the ledger transaction system 106 can first generate the public key (and private key) for the user account 2102 and then determine the first authentication key 2106 (and the account address 2104) by applying a hash function to the public key.
When a transaction is sent from the user account 2102, the ledger transaction system 106 can utilize the first authentication key 2106 to authenticate the user account 2102 as the sender of the transaction. For example, as mentioned above, upon receiving a transaction, the ledger transaction system 106 checks (e.g., utilizing the admission control of the receiving validator node device) that the first authentication key 2106 corresponds to the public key related to the private key used to sign the transaction. In one or more embodiments, the ledger transaction system 106 checks that the first authentication key 2106 corresponds to the public key by hashing the public key and determining that the resulting hash value matches the first authentication key 2106.
As shown in
Upon execution of the transaction 2108, the ledger transaction system 106 provides the user account 2102 with a second authentication key 2112. Indeed, in some embodiments, the ledger transaction system 106 generates the second authentication key 2112 by generating a new public key and private key for the user account 2102 and determining the second authentication key 2112 by applying a hash function to the new public key. For subsequent transactions sent by the user account 2102, the ledger transaction system 106 can verify that the user account 2102 sent the transaction using the second authentication key 2112.
In one or more embodiments, the ledger transaction system 106 can rotate the authentication key for a user account any number of times. For example, the ledger transaction system 106 can rotate the authentication key for a user account every time the user account sends a transaction. In some embodiments, however, the ledger transaction system 106 prevents the user account from rotating the authentication key multiple times in a single transaction.
Thus, by utilizing key rotation, the ledger transaction system 106 manages authentication keys more flexibly than conventional systems. In particular, the ledger transaction system 106 can generate a new authentication key for a user account without requiring the user account to move its contents to a new address. Accordingly, the ledger transaction system 106 provides for a flexibly security solution to prevent malicious attacks against a user account when the authentication key has been leaked keys while allowing for stability with regards to the user account address. Indeed, by implementing key rotation, the ledger transaction system 106 implements configurable keys for user accounts.
IV. TransactionsA. Overview
As mentioned above, the ledger transaction system 106 can execute transactions across the distributed digital ledger transaction network. Indeed, a user account may submit a transaction, and the ledger transaction system 106 can utilize validator node devices of the distributed digital ledger transaction network to execute the transaction, agree on the transaction results via consensus, and commit the transaction to storage. Indeed, through this process, the ledger transaction system 106 utilizes transactions to modify the ledger state of the distributed digital ledger transaction network.
The transaction request can include several pieces of information. For example, the transaction request can include the account address corresponding to the user account submitting the transaction request, the transaction script used to executed the requested transaction, the public key associated with the user account submitting the transaction, the sequence number associated with the transaction request, a maximum amount of gas the user account is willing to spend in executing the transaction, the amount of digital assets (e.g., digital currency) the user account is willing to spend per unit of gas in order to execute the requested transaction. In one or more embodiments, a transaction request can include additional information, such as a client-specified expiration for the transaction request.
As further shown in
The ledger transaction system 106 can implement many features that improve the execution of transactions across the distributed digital ledger transaction network. For example, in one or more embodiments, the ledger transaction system 106 can implement more flexible transactions using arbitrary transaction scripts. Further, the ledger transaction system 106 can utilize smart contracts (i.e., modules and resources) to configure the operation of features surrounding transaction execution (such as rejecting invalid transactions, deducting and distributing gas upon transaction execution, or incrementing sequence numbers). Further, the ledger transaction system 106 can utilize access keys that limit access to digital assets via transactions.
B. Utilizing Transaction Scripts and Interacting with Modules and Resources
As mentioned above, one or more embodiments of the ledger transaction system 106 utilize arbitrary transaction scripts to implement flexible transactions across the distributed digital ledger transaction network. In particular, in one or more embodiments, a transaction script includes an arbitrary program composed using a programming language implemented by the ledger transaction system 106. The program can call out the resources to modify and the module procedures to be used to implement the modifications. Transaction scripts can be arbitrary in that they can invoke multiple procedures from various different modules within a single script. Additionally, transactions scripts can include conditional logic and can perform local computations. Accordingly, the ledger transaction system 106 can utilize transaction scripts to implement transactions more flexibly than conventional blockchain systems. Indeed, conventional blockchain systems generally limit the number of procedures invoked by a transaction and may only allow simple transactions that implement basic logic (e.g., transferring an asset). Indeed, by utilizing arbitrary transaction scripts, the ledger transaction system 106 can implement more complex and expressive one-off acts via the distributed digital ledger transaction network.
Indeed, one or more embodiments of the ledger transaction system 106 implement a scheme for allowing transaction scripts to call out resources and module procedures. As mentioned above, the ledger transaction system 106 can deconstruct smart contracts into resources and modules. Accordingly, the ledger transaction system 106 can implement a set of rules by which arbitrary transaction scripts can utilize module procedures to manipulate (e.g., modify) resources.
For example,
In one or more embodiments, the Coin resource 2310 is opaque outside of the Currency module 2302. Indeed, in some embodiments, the ledger transaction system 106 limits the use of the Coin resource 2310 to procedures defined within the Currency module 2302 (and rejects transactions that seek to use or modify resources outside the procedures defined by the module). Specifically, in some embodiments, other modules and transaction scripts can only read or modify the value fields of the Coin resource 2310 using the public procedures defined within the Currency module 2302. Similarly, in one or more embodiments, only the procedures defined within the Currency module 2302 can create or destroy resources of type Coin. In other words, the Currency module 2302 provides an application programming interface (API) that has control over the access, creation, and destruction of the derived resources. In some embodiments, however, the ledger transaction system 106 defines a set of operations or procedures that can be used to interact with a resource, even though the operations and procedures are not defined within the corresponding module.
As an illustration, to execute a transaction that transfers the Coin resource 2310 from a first user account to a second user account, the ledger transaction system 106 can generate a transaction script that calls upon the withdraw procedure 2308 and the deposit procedure 2306 declared in the Currency module 2302. For example, the transaction script can include a call to the withdraw procedure 2308 (e.g., “let coin=0x0.Currency.withdraw_from_sender(copy(amount))”) in order to withdraw a value of a specified “amount” from the Coin resource 2310. Further, the transaction script can include a call to the deposit procedure 2306 (e.g., “0x0.Currency.deposit(copy(payee), move(coin))”) to deposit the withdrawn value to the user account specified by “payee.”
C. Utilizing Smart Contracts to Reject Transactions, Deduct Gas Payments, Increment Sequence Numbers, and Distribute Gas to Computer Nodes
Conventional blockchain systems perform a variety of tasks in conjunction with executing a transaction. For example, many conventional systems implement tasks, such as transaction validation, transaction fee withdrawal, and gas disbursement. Many conventional systems, however, hardcode these tasks. Indeed, many conventional systems define the implementation of these tasks within their source code. Consequently, this creates inflexibility within the conventional systems as modification of these tasks requires undesirable modification of the source code itself.
As mentioned above, one or more embodiments of the ledger transaction system 106 perform several transaction execution procedures (e.g., several acts in executing a transaction). For example, upon receiving a transaction request, the ledger transaction system 106 can perform a series of checks to determine whether the transaction request is valid. Additionally, as mentioned the ledger transaction system 106 can perform a variety of epilogue procedures. As will be discussed below, however, one or more embodiments of the ledger transaction system 106 utilize smart contracts (i.e., modules and resources) to perform these tasks and manage modifications or improvements to these tasks over time.
As mentioned previously, as the ledger transaction system 106 receives transaction requests from client devices, the ledger transaction system 106 performs a series of checks before executing the transaction. Specifically, in one or more embodiments, the ledger transaction system 106 utilizes the admission control and mempool manager (each discussed above with regard to
As shown in
As shown in
Additionally, as shown in
In one or more embodiments, the ledger transaction system 106 can utilize a smart contract to manage the above-mentioned checks on received transaction requests. In particular, in one or more embodiments, the ledger transaction system 106 can generate a smart contract (e.g., a module) for performing checks and rejecting transactions, the smart contract including a list of procedures that are usable for performing the checks on transaction requests. The ledger transaction system 106 can then implement the smart contract upon receiving a transaction request.
In one or more embodiments, the smart contract is configurable (subject to the public procedures defining the smart contract and consensus protocols). Indeed, in some embodiments, the ledger transaction system 106 can modify or otherwise change the smart contract used for performing the checks and rejecting transactions via a transaction across the distributed digital ledger transaction network. For example, in some embodiments, the smart contract itself includes rules or procedures that are used to modify the smart contract. To illustrate, a smart contract can authorize a subset of validator nodes (e.g., authorized devices with cryptographic keys) to submit a transaction that modifies validation rules for transactions. Thus, the ledger transaction system 106 can submit a transaction to change the smart contract to the distributed digital ledger transaction network (e.g., via a client device or validator node device) and, if consensus is achieved, apply the changes accordingly.
As further mentioned above, upon execution of a transaction, the ledger transaction system 106 can perform one or more epilogue tasks.
As shown in
Further, as shown in
In one or more embodiments, the ledger transaction system 106 determines the transaction fee based on a gas price and a gas cost. In particular, as mentioned above, each transaction request can specify a price, in digital currency, that the user account submitting the transaction request is willing to pay per unit of gas (i.e., the gas price). Further, the ledger transaction system 106 can dynamically account for the computational power expended in executing the transaction, which is translated into gas cost. In one or more embodiments, validator node devices can prioritize executing transactions with higher gas prices and may drop transactions with low prices when the distributed digital ledger transaction network is congested.
In some embodiments, the ledger transaction system 106 tracks the number of gas units used during execution. If the maximum gas limit specified in the transaction request is reached before execution completes, the ledger transaction system 106 can halt execution immediately. In some embodiments, the ledger transaction system 106 refrains from committing the partial changes resulting from the execution performed to the ledger state, but the transaction still appears in the transaction history and the ledger transaction system 106 charges the sending user account for the gas used.
Similar to the transaction checks discussed above, the ledger transaction system 106 can utilize a smart contract to perform one or more of the aforementioned post-execution tasks. Indeed, in some embodiments, the ledger transaction system 106 generates a smart contract (e.g., a module) for performing the post-execution tasks, the smart contract including one or more procedure calls for performing the requisite tasks. As discussed above, the smart contract for performing the post-execution tasks can be configurable, allowing for changes or updates to the implementation of the smart contract.
In addition to using smart contracts to perform checks against a transaction request and performing post-execution tasks, the ledger transaction system 106 can utilize smart contracts to distributed gas payments collected from client devices for executing transactions.
As shown in
As shown in
As shown in
By utilizing smart contracts, the ledger transaction system 106 can perform tasks surrounding the execution of a transaction more flexibly than conventional systems. In particular, as mentioned above, using smart contracts allows the ledger transaction system 106 to change how these tasks are performed more flexibility than conventional systems. Indeed, the ledger transaction system 106 can flexibly modify or otherwise change the smart contracts that performs these tasks without needing to change source code. This allows the distributed digital ledger transaction network to flexibly modify certain transaction features over time to accommodate the needs of the community, address new malicious threats as they arise, and scale as the number and type of digital transactions grow.
D. Speculative Parallel Execution
Many conventional blockchain systems assemble, at one or more computer nodes, transactions that have been submitted for execution into transaction blocks and then share the assembled transaction blocks across the network (e.g., to other computer nodes). The conventional systems may then execute, at each computer node, the transactions within a particular transaction block and modify the digital ledger accordingly.
However, these conventional systems suffer from a variety of problems. For example, conventional blockchain systems are often inflexible in that they rigidly execute the transactions within a block of transactions sequentially. Indeed, when executing a given block of transactions, conventional systems are typically configured to progress through the block beginning with the first transaction and executing each subsequent transaction one at a time. Upon executing a transaction, the conventional systems generate a new state of the network and execute the next transaction based on that new state.
As a result of this rigid approach, conventional blockchain systems are also inefficient. In particular, because conventional blockchain systems execute transactions within a block sequentially, such systems require a significant amount of time and computing resources (e.g., processing time) to execute a block of transactions. Indeed, to execute a transaction block conventional systems generally require an amount of time equal to the collective sum of time needed to execute each transaction individually within the block.
One or more embodiments of the ledger transaction system 106 utilize parallel transaction execution to efficiently execute transactions via the distributed digital ledger transaction network. For example, in one or more embodiments, the ledger transaction system 106 determines a first state data structure (e.g., the most current state) of the distributed digital ledger transaction network, representing account states for the user accounts of the distributed digital ledger transaction network. The ledger transaction system 106 can then identify a plurality of transactions that include transactions associated with a set of the user accounts. Subsequently, the ledger transaction system 106 can perform a preliminary execution of the transactions in parallel relative to the first state data structure. Through this preliminary parallel execution, the ledger transaction system 106 can identify execution results of applying each transaction to the first state data structure. The ledger transaction system 106 can also determine dependencies of the transactions with regard to the set of user accounts. Based on the determined dependencies, the ledger transaction system 106 can apply the execution results to generate a second state data structure (e.g., a second state data structure equivalent to executing the plurality of transactions serially against the first state data structure).
To illustrate, the ledger transaction system 106 can identify a first set of transactions that are independent of other transactions. The ledger transaction system 106 can apply the transaction results of these transactions against the first state data structure to generate an intermediate state data structure. After applying the transaction results of the first set of independent transactions, the ledger transaction system 106 can identify a second set of transactions that are (now) independent. The ledger transaction system 106 can execute the second set of transactions against the intermediate data structure. The ledger transaction system 106 can iteratively identify independent transactions, execute these independent transactions against intermediate state structures until generating the second state data structure (that is equivalent to executing the plurality of transactions serially). In this manner, the ledger transaction system 106 can efficiently and flexibly execute transactions in parallel while still considering dependencies to achieve consistent and accurate state data structures across the distributed digital ledger transaction network.
As mentioned above, the ledger transaction system 106 can perform a preliminary execution of transactions in parallel to determine transaction results and dependencies and then apply the transaction results based on the dependencies.
As shown in
As shown in
As shown, by performing the preliminary execution of the transactions, the ledger transaction system 106 can determine a plurality of transaction results 2704a-2704c relative to the state data structure. The plurality of transaction results 2704a-2704c reflect changes to accounts of the state data structure upon executing each of the transactions individually. Thus, for example, the transaction results 2704a reflect modifications to one or more user accounts upon executing the transaction “T1.”
By executing the transactions preliminarily (i.e., speculatively), the ledger transaction system 106 can identify how the transactions are associated with (e.g., interact with) the set of user accounts. For example, the ledger transaction system 106 can identify whether a transaction reads from and/or writes to a particular user account from the set of user accounts. Additionally, by executing the transactions preliminarily, the ledger transaction system 106 can determine whether the transaction has a valid signature, can pay the required transaction fee, and will not otherwise modify the distributed digital ledger transaction network.
As shown in
To illustrate, consider the following three transactions:
T1: Send 1 coin from A to B [reads A, B; writes A, B]
T2 Send 1 coin from X to Y [reads X, Y; writes X, Y]
T3: If A's balance is less than 50, send 1 coin from C to D [reads A, C, D; writes C, D]
Based on performing a preliminary execution, the ledger transaction system 106 can determine that T1 reads and writes to both accounts A and B (e.g., the transactions access A to determine digital assets, withdraw digital assets, accessing B, and deposit digital assets to B). Similarly, the ledger transaction system 106 can determine that T2 reads and writes to both accounts X and Y. Further, the ledger transaction system 106 can determine that T3 reads from A (i.e., accesses A to determine if the balance is less than 50) reads from C and D and writes to C and D. Accordingly, the ledger transaction system 106 determines that T3 depends from T1 (while T1 and T2 are independent of other transactions).
In one or more embodiments, the ledger transaction system 106 can further identify whether one or more transactions within the plurality of transactions 2702 will fail upon execution. To illustrate, the ledger transaction system 106 can determine that a transaction will fail upon if execution of the transaction triggers a withdrawal of digital assets from a user account and the value of the digital assets associated with that user account will be insufficient at the time of execution. In one or more embodiments, the ledger transaction system 106 rejects transactions that will fail upon execution.
As illustrated by
As shown in
As shown, upon executing the final transaction(s) from the plurality of transactions 2702, the ledger transaction system 106 can generate a second state data structure (“S1”) that includes modified account states that reflect the results of the transactions. In particular, the second state data structure includes the same state data structure that would have been reached had the ledger transaction system 106 executed each transaction within the plurality of transactions 2702 serially.
The ledger transaction system 106 can apply transaction results and execute dependent transactions to intermediate data structures in a variety of orders. For example, although
In some embodiments, the ledger transaction system 106 performs the act 2706 of determining dependencies based on a dependency indicator. For example, a validator node can receive a dependency indicator from another validator node (e.g., a leader node for consensus) indicating one or more dependencies between the plurality of transactions. In some embodiments, the ledger transaction system 106 can use the dependency indicator in performing the preliminary execution and/or applying transaction results.
To illustrate, in some embodiments, the ledger transaction system 106 receives a dependency indicator that T3 depends from T1. In response, the ledger transaction system 106 can exclude T3 from the act 2704. Specifically, the ledger transaction system 106 can perform preliminary execution for T1 and T2 in parallel (without performing preliminary execution on T3). The ledger transaction system 106 can apply the transaction results 2704a, 2704b to generate the intermediate state data structure SA, and then execute T3 against the intermediate state data structure SA.
Thus, the ledger transaction system 106 can utilize the dependency indicator to determine a first subset of transactions (e.g., intermediate transactions) and a second subset of transactions (e.g., dependent transactions). The ledger transaction system 106 can perform preliminary parallel execution of the first subset of transactions relative to the first state data structure, and then execute the second subset of transactions against intermediate data structures.
In some embodiments, even upon receiving a dependency indicator, the ledger transaction system 106 can still perform a preliminary execution across all transactions to determine whether the dependency indicator is accurate. For instance, if a computer node determines that a dependency indicator is inaccurate, the ledger transaction system 106 can disregard the dependency indicator. Moreover, the ledger transaction system 106 can penalize the computer node that distributed the inaccurate dependency indicator (or refuse to vote for the block).
In one or more embodiments, the ledger transaction system 106 stores data structure the second state data structure in temporary storage and delays modifying the first state data structure in storage until consensus is achieved. To illustrate, though not shown in the figures, the ledger transaction system 106 can receive an indication of consensus among computer nodes of the distributed digital ledger transaction network with respect to the second state data structure (“S1.”). In one or more embodiments, receiving the indication of consensus includes receiving, at the lead validator node, the requisite votes to finalize the plurality of transactions 2702. In some embodiments, receiving the indication of consensus includes receiving, at another (i.e., non-lead) validator node, an indication that the plurality of transactions 2702 has been finalized (e.g., from the lead validator node). As discussed above, consensus with respect to the second state data structure can include consensus with respect to the root value of the transaction tree—which includes a representation of the second state data structure—as modified by the plurality of transactions 2702.
In response to receiving the indication of consensus, the ledger transaction system 106 can commit the second state data structure to storage. For example, the ledger transaction system 106, at each computer node of the distributed digital ledger transaction network, can modify the data structures (e.g., the first state data structure) stored at the respective computer node based on the second state data structure. In particular, the ledger transaction system 106 can modify the data structures based on the plurality of transactions 2702 as validated via consensus.
As mentioned above, the ledger transaction system 106 can determine the dependencies among transactions within a plurality of transactions and then apply transaction results based on those dependencies.
For example, as shown in
As further shown in
As illustrated by
The backward dependency graph shows, for a given transaction, the transactions upon which that transaction directly depends as shown by the address dependency graph. To illustrate, the backward dependency graph illustrated in
As shown by
As shown in
In one or more embodiments, the ledger transaction system 106 includes one or more execution managers that each manage execution of one or more of the transactions. The execution manager associated with a given transaction can additionally manage a forward dependency graph and a backward dependency graph specific to that transaction. The execution manager can determine if the transaction has a backward dependency and, if not, can execute the transaction. If a backward dependency exists, the execution manager can wait to execute the transaction until after receiving a broadcast indicating that the transactions upon which the given transaction is forwardly dependent have been executed. Once the broadcast is received, the execution manager can remove the executed transaction from the backward dependency graph (if applicable). Upon determining that the transaction no longer has backward dependencies, the execution manager can execute the transaction. Upon executing a transaction, the associated execution manager can broadcast an indication of the execution to the other execution managers. In one or more embodiments, upon determining that a transaction will fail, the associated execution manager can still send a broadcast to the other execution managers for removal of the transaction from the associated backward dependency graphs.
In this manner, the ledger transaction system 106 provides more flexibility with respect to transaction execution when compared to conventional systems. In particular, the ledger transaction system 106 can flexibly execute and apply transaction results while still achieving the same resulting state data structure based on dependencies amongst the transactions. Additionally, the ledger transaction system 106 operates more efficiently than conventional systems. Indeed, by executing transactions in parallel, the ledger transaction system 106 reduces the amount of time required to execute a plurality of transactions.
E. Custody/Rate Limited Keys
Conventional blockchain systems often restrict access to the digital assets of a user account to the owner of the user account. However, such conventional systems generally provide the owner of a user account with unrestricted access to the digital assets stored therein. This generally poses a security risk as a malicious third party that have obtained access to a user account (e.g., by obtaining the private key associated with that user account) will have unhampered access to the account and corresponding digital assets.
One or more embodiments of the ledger transaction system 106 utilize access limits (e.g., a threshold number of keys from a group of keys or access limited keys) to provide security protection to digital assets stored at user accounts. For example, in one or more embodiments, the ledger transaction system 106 restricts access to the digital assets stored at a user account by generating one or more threshold access requirements (e.g., a threshold number of access keys required to access the account). When a transaction is submitted to utilize the digital assets of the user account, the ledger transaction system 106 can determine whether the threshold access requirements have been satisfied and provide access to the digital assets based on that determination.
In some embodiments, the ledger transaction system 106 can utilize access key limits that restrict how the digital assets of a user account may be used. In particular, the ledger transaction system 106 can use access keys with value key limits (i.e., limits on the value of digital assets that can be accessed via the access keys) and/or rate key limits (i.e., limits on the rate at with digital assets can be used via the access key). In this manner, the ledger transaction system 106 can protect the digital assets of a user account from unwanted access. Further, if such access if achieved, the ledger transaction system 106 can minimize the loss of digital assets achieved by the unwanted access.
In addition to improving security, the ledger transaction system 106 can also improve flexibility. For example, the ledger transaction system 106 can generate a variety of different access key limits for different access keys, such that a user account can user a first access key subject to a first access key limit and a second access key subject to a second access key limit. In this manner, the ledger transaction system 106 can provide protection for each individual access key, while allowing for flexible use of different access keys for different purposes (e.g., allow an untrusted agent to a use a first access key with a low value key limit and allow a trusted agent to use a second access key with a higher value key limit).
For example, the access requirements 2906 can include a threshold number of access keys (where threshold “number” includes a number, percentage, or ratio). For example, the access requirements 2906 can require that a minimum number of users from a group of users 2908 associated with the user account 2902 are associated with the transaction request 2912 to access the digital asset 2904. For example, each of the users can provide a digital signature associated with that user with the transaction request 2912. In one or more embodiments, the minimum number of users required by the ledger transaction system 106 includes all users from the group of users 2908. In some embodiments, the minimum number of users includes only a subset of users from the group of users 2908.
Additionally, the access requirements 2906 can require that a threshold number (i.e., a number, percentage, or ratio) of access keys from a group of access keys 2910 associated with the user account 2902 are associated with the transaction request 2912 to access the digital asset 2904. Indeed, the ledger transaction system 106 can generate one or more access keys to be used in accessing the digital asset 2904. In one or more embodiments, the minimum number of access keys required by the ledger transaction system 106 includes all access keys from the group of access keys 2910 associated with the user account 2902. In some embodiments, the minimum number of access keys includes only a subset of access keys from the group of access keys 2910. In one or more embodiments, the ledger transaction system 106 requires both a minimum number of users from the group of users 2908 and a minimum number of access keys from the group of access keys 2910 to be associated with the transaction request 2912 to access the digital asset 2904.
As mentioned, upon receiving the transaction request 2912 to access the digital asset 2904, the ledger transaction system 106 can determine whether the access requirements 2906 are satisfied. In one or more embodiments, if the access requirements 2906 are not satisfied, the ledger transaction system 106 can reject the transaction request 2912. However, if the access requirements 2906 are satisfied, the ledger transaction system 106 can accept the transaction request 2912 (and execute the corresponding transaction).
As mentioned above and as further showed in
In one or more embodiments, the ledger transaction system 106 can generate access keys based on other access keys. For example, the ledger transaction system 106 can generate one or more access keys (i.e., “sub access keys”) based on the access key 2922 (i.e., a “parent access key”). Accordingly, the ledger transaction system 106 can generate access key limits corresponding to the sub access keys. In one or more embodiments, the access key limits corresponding to a sub access key are more limiting than the access key limits 2920 associated with the parent access key 2922. To illustrate, if the access key limits 2920 limited the total amount or value of the digital asset 2904 available to the parent access key 2922, the ledger transaction system could generate a set of sub access keys, each having access limited to a subset of the total amount or value accessible to the parent access key 2922.
Upon receiving a transaction request 2924 to access the digital asset 2904 using the access key 2922, the ledger transaction system 106 can determine whether the access key limits 2920 associated with the access key 2922 have been met. Indeed, the ledger transaction system 106 can track the activity of the access key 2922 to determine when the access key has reached the limit of its accessibility. In some embodiments, upon determining that the access key limits 2920 have been met, the ledger transaction system 106 can reject the transaction request 2924.
In one or more embodiments, the ledger transaction system utilizes a smart contract (i.e., a module) to handle transactions requests subjected to access limits. Indeed, in some embodiments, ledger transaction system 106 can generate a smart contract that defines the access limits (i.e., the access requirements and/or access key limits) associated with a user account. Upon receiving a transaction request subject to the access limits, the ledger transaction system 106 can use the smart contract to determine whether to accept or reject the transaction request. For example, the ledger transaction system 106 can utilize a smart contract to track the access of digital assets of a user account by a particular access key. When a transaction request that uses the access key is received, the ledger transaction system 106 can then use the smart contract to determine whether or not the access key limits for that access key have already been met.
Thus, by utilizing access limits, the ledger transaction system 106 provides additional security and flexibility relative to conventional systems. For example, by implementing access requirements with respect to digital assets, the ledger transaction system 106 prevents unwanted access to those digital assets. Additionally, by providing access key limits, the ledger transaction system 106 mitigates potential malicious access of digital assets upon a third party obtaining one or more access keys. Moreover, by allowing users to define a variety of different combinations of access limits (e.g., a threshold number of keys, rate limited keys, and/or value limited keys), the ledger transaction system 106 allows users accounts to flexibly allow different degrees of access (e.g., to different agents or for different purposes).
F. Transaction Events
Many conventional systems maintain one or more data repositories that store transactions for individual transactions (e.g., who received assets, who transmitted assets, the values of the assets exchanged, etc.). Upon execution of a transaction, the conventional systems may generate new entries for one or more of these data repositories to store the details of that transaction. The conventional systems may further user these data repositories to locate and provide transaction details.
However, conventional blockchain systems are often inefficient and inaccurate in tracking and reporting transaction details. For example, conventional blockchain systems often employ inefficient methods of providing transaction details in response to a query. To illustrate, in response to receiving a query from a client device for details associated with a particular transaction, many conventional systems provide header (e.g., summary) data for every block of transactions that has been executed. Subsequently, the conventional systems may provide transaction receipts for every transaction within a block identified by the client device as potentially containing the particular transaction. The conventional systems may then provide a list of log entries for a transaction identified from the transaction receipts by the client device as potentially containing the desired details. Accordingly, the conventional systems often utilize a significant amount of computing resources (e.g., processing time and power) to locate and transmit data that does not satisfy the query.
In addition to efficiency concerns, conventional blockchain systems are often inaccurate. In particular, many conventional systems utilize bloom filters to store and provide transaction details. Such bloom filters risk generating false positives when determining whether desired transaction details are included within the data stored therein. Accordingly, the conventional systems may inaccurately respond to a query for transaction details by providing data that is unrelated to the query. In addition, even though conventional systems can search for historical transactions, they do not provide negative proofs to establish the lack of transactions. For example, conventional systems cannot conclusively prove the absence of a transaction touching a particular count. This is a significant shortcoming inasmuch as many account holders within a distributed digital ledger transaction network often seek verification that no events have occurred with regard to digital assets within their accounts.
One or more embodiments of the ledger transaction system 106 utilize transaction events and an event data structure to accurately and efficiently provide transaction event details, including negative proofs establishing that events have not touched user accounts. As mentioned above, the ledger transaction system 106 can generate an event data structure that stores event data corresponding to transaction events. Upon execution of a transaction associated with a user account, the ledger transaction system 106 can generate one or more transaction events within the event data structure. Additionally, the ledger transaction system 106 can modify a count value of a transaction event counter corresponding to the user account. In one or more embodiments, the ledger transaction system 106 maintains a plurality of transaction event counters corresponding to a user account, where each transaction event counter tracks a count value for a particular class of transaction event. The ledger transaction system 106 can utilize the count values of the transaction event counter to provide transaction event data corresponding to transaction events specified in a request. In this manner, the ledger transaction system 106 can accurately and efficiently manage queries for transaction event data.
For example, consider, Ei, as the list of events emitted during the execution of Ti, (stored in an event Merkle tree as described in relation to
Clients can make use of these proofs to access events on a given access path. For example, suppose a client wants to know all events that have ever been emitted on access path A. The client holds a recent quorum certificate at version i. Using Si, the client can make an authenticated query for c, the counter value of A at version i. For j∈0 . . . c the client can make an authenticated query for the event tuple emitted on A with counter j. The client can determine that there is exactly one such event since transaction execution generates events with sequential counter numbers. Therefore, proof that there exists some historical event emitted on A with counter j is sufficient as a proof that that event is the only such event.
This approach allows the client to hold an authenticated subscription to events on access path A. The client can periodically poll to determine if the subscription is up-to-date. For example, a client can use this to maintain a subscription to incoming payment transactions on an address it is watching.
At first glance, events might seem redundant. Instead of querying for the events emitted by a transaction Ti, a client could ask whether the transaction Ti has been included in the digital ledger. However, this approach is error-prone because the inclusion of Ti does not imply successful execution (e.g., it might have run out of gas). In a system where transactions can fail, an event provides evidence not only that a particular transaction has executed but also that it has successfully completed with the intended effect.
As just mentioned, upon execution of a transaction, the ledger transaction system 106 can generate one or more transaction events.
As shown in
In response to execution of the transaction 3002, the ledger transaction system 106 generates the transaction event 3006. As shown in
The event data 3008 can further include the count value of the transaction event counter of the user account after the transaction event (also referred to as the “sequence number”) and details of the transaction event. Examples of transaction event details can include, but are not limited to, the parties involved in the particular transaction event and the value represented by the transaction event (e.g., the value of the digital assets transferred via the transaction 3002). In one or more embodiments, the event data 3008 further includes the height of the transaction 3002 within the transaction tree.
In one or more embodiments, the ledger transaction system 106 generates the transaction event 3006 within an event data structure (e.g., as described above in relation to
In one or more embodiments, the ledger transaction system 106 adds the event data 3008 to the event tree 3010 by storing, within the leaf node corresponding to the transaction event 3006, a hash value corresponding to the event data 3008. For example, the ledger transaction system 106 can apply a hash function to the transaction event details of the event data 3008 and store the resulting hash value within the leaf node corresponding to the transaction event 3006. In some embodiments, the ledger transaction system 106 applies the hash function to the event data 3008 in its entirety and stores the resulting hash value within the leaf node.
In one or more embodiments, after generating the event tree 3010 corresponding to the transaction 3020, the ledger transaction system 106 determines the root value of the event tree 3010. As described above, the ledger transaction system 106 can determine the root value by iteratively combining and hashing node values beginning at the bottom of the event tree 3010 and moving upwards. The ledger transaction system 106 can then store the root value of the event tree 3010 within the transaction tree of the distributed digital ledger transaction network (e.g., as described above in relation to
As shown in
In one or more embodiments, the ledger transaction system 106 can provide the count value of the transaction event counter 3016 upon request. For example, the ledger transaction system 106 (via a validator node or full node) can receive an event count request (e.g., from one of the client devices 112a-112n or from one of the computer nodes 108a-108d). The event count request can include an access path, which includes the address of the user account 3014 and the transaction event counter 3016. In response to receiving the event count request, the ledger transaction system 106 can provide the count value of the transaction event counter.
Because of the different data structures utilized by the ledger transaction system 106, the ledger transaction system 106 can verify the existence of events (or a lack of events) based on the count values of an event counter. Indeed, as mentioned above (e.g., in relation to
In some embodiments, the ledger transaction system 106 can provide event details of the transaction event 3006 from the event data structure upon request. For example, the ledger transaction system 106 can receive a transaction event detail request (e.g., from one of the client devices 112a-112n or from one of the computer nodes 108a-108d). The transaction event detail request can include the count value of the transaction event counter and the access path used to access the transaction event counter. In response to receiving the transaction event detail request, the ledger transaction system 106 can provide the event data 3008 of the transaction event 3006 (e.g., the event details of the transaction event) from the event data structure. In one or more embodiments, the ledger transaction system 106 further provides a Merkle proof corresponding to the transaction event 3006 along with the event data 3008.
In one or more embodiments, the ledger transaction system 106 can provide a set of transaction event data corresponding to a sequence of events. For example, the ledger transaction system 106 can receive a transaction event sequence request for details regarding a sequence of transaction events corresponding to a user account. The transaction event sequence request can include the access path to the transaction event counter as well as a sequence of count values. The sequence of count values can correspond to a sequence of events corresponding to a user account. In response to receiving the transaction event sequence request, the ledger transaction system 106 can provide a set of transaction event data corresponding to the sequence of events.
To provide an example of providing transaction event data in response to a request, in one or more embodiments, the event data structure can include a transaction event index database. The transaction event index database can include a mapping between each transaction event tracked by a particular transaction event counter and the location of the transaction event data corresponding to the transaction events within the event data structure. In particular, the transaction event index database can map each transaction event to the particular transaction that triggered the transaction. Further, the transaction event index database can indicate the event number corresponding to that transaction event out of all transaction events triggered by that transaction.
In one or more embodiments, the transaction event detail request (or transaction event sequence request) can include an access path for the transaction event counter corresponding to the target transaction event as well as the sequence number corresponding to the transaction event. The ledger transaction system 106 can utilize the transaction event index data to identify the location of the transaction event data based on the access path of the transaction event counter and the sequence number of the transaction event. The ledger transaction system 106 can subsequently retrieve and provide the transaction event data from the event data structure.
As illustrated by
Though
As the ledger transaction system 106 continues to execute transactions, the ledger transaction system 106 can generate transaction events and modify count values of the corresponding transaction event counters. For example, as shown in
In response to execution of the transaction 3020, the ledger transaction system 106 generates the transaction event 3022. As mentioned above, in some embodiments, the ledger transaction system 106 generates the transaction event 3022 within the event data structure. In particular, the ledger transaction system 106 can add the event data 3024 of the transaction event 3022 to the event database 3012. Further, the ledger transaction system 106 can add the event data 3024 to an event tree 3026 (e.g., an event Merkle tree). As the transaction event 3022 corresponds to a different transaction (i.e., different from the transaction event 3006), the ledger transaction system 106 adds the event data 3024 to a different event tree (i.e., different from the event tree 3010). The ledger transaction system 106 generates the event tree 3026 based on transaction events corresponding to the transaction 3020 and stores data within the leaf nodes corresponding to those transaction events. As mentioned above, the ledger transaction system 106 can add the event data 3024 to the event tree 3026 by storing, within the leaf node corresponding to the transaction event 3022, a hash value corresponding to the event data 3024. The ledger transaction system 106 can store the root value of the event tree 3026 within the transaction tree of the distributed digital ledger transaction network.
In response to execution of the transaction 3020, the ledger transaction system 106 further modifies the count value of the transaction event counter 3018 of the user account 3014. In particular, the ledger transaction system 106 accesses the transaction event counter 3018 via the state data structure using the corresponding access path. The ledger transaction system 106 then increments the count value of the transaction event counter 3018.
As mentioned above, the ledger transaction system 106 can manage queries for transaction event data. As further mentioned, the ledger transaction system 106 can be implemented in whole, or in part, by any of the individual elements of distributed digital ledger transaction network. For example, while much of the disclosure discusses the ledger transaction system 106 as implemented on one of the computer nodes 108a-108d of the distributed digital ledger transaction network, the ledger transaction system 106 can also be implemented on one or more of the client devices 112a-112n (e.g., as part of the client device). As such, in one or more embodiments, the ledger transaction system 106 (or one or more components thereof) implemented on a client device can detect the occurrence of new transaction events and generate requests for transaction event data corresponding to those transaction events.
As illustrated by
As shown in
Further, as shown in
In some embodiments, however, the ledger transaction system 106 can compare the first count value and the second count value and determine that the first count value and the second count value are the same count value. By determining that the count values are the same, the ledger transaction system 106 can verify that there is an absence transaction events corresponding to the user account between the first time and the second time. In other words, by periodically polling a transaction event counter, the ledger transaction system 106 can provide a negative proof that transaction events of a particular type have not occurred with regard to a particular account.
In one or more embodiments, based on comparing the first count value of the transaction event counter at the first time and the second count value of the transaction event counter at the second time, the ledger transaction system 106 determines or identifies a sequence of count values. In particular, a sequence of count values can include a difference of count values greater than one. A sequence of account values indicates that a sequence of events corresponding to the user account have occurred via the distributed digital ledger transaction network.
In some embodiments, the ledger transaction system 106 can poll for transaction event updates without submitting multiple requests. In particular, the ledger transaction system 106 can submit a request to a computer node or configure a user account of the state data structure to provide a notification whenever a transaction event or sequence of events associated with the user account is generated. In further embodiments, the ledger transaction system 106 can submit a request to a computer node or configure the user account to provide transaction event updates periodically.
In addition to polling for transaction event updates, the ledger transaction system 106 can operate on a client device (or other device on the distributed digital ledger transaction network) to retrieve event details for one or more transaction events associated with a user account.
As shown in
Further, in some embodiments, the ledger transaction system 106 transmits the transaction event detail request 3204 to the same computer node to which the ledger transaction system 106 transmitted the event count request for count values. In particular, in one or more embodiments, the event count request submitted for polling the transaction event counter and the transaction event detail request are part of a combined request to the computer node. For example, a client device can submit a request that indicates if a change in event count is detected the transaction event details should be returned to the client device. In some embodiments, however, the ledger transaction system 106 transmits the transaction event detail request 3204 to a different computer node.
The transaction event detail request 3204 can include an access path 3206 of the transaction event counter corresponding to the user account 3212 and a count value of the transaction event counter. However, as shown in
As shown in
In response to transmitting the transaction event detail request 3204, the ledger transaction system 106 can receive, via a computer node of the distributed digital ledger transaction network, the transaction event data 3214. In particular, as shown in
As shown in
In one or more embodiments, the ledger transaction system 106 receives the transaction event data 3214 from the full node device 3210 (i.e., the same computer node to which the ledger transaction system 106 submitted the transaction event detail request 3204). In some embodiments, however, the ledger transaction system 106 receives the transaction event data 3214 from a different computer node of the distributed digital ledger transaction network. In further embodiments, the ledger transaction system 106 receives the transaction event data 3214 from multiple computer nodes of the distributed digital ledger transaction network (e.g., receives different components of the transaction event data 3214 from different computer nodes).
In one or more embodiments, the ledger transaction system 106 compares the set of transaction event data corresponding to the plurality of events with the sequence of count values 3208. In particular, the ledger transaction system 106 can utilize the comparison to determine satisfaction of the transaction event detail request 3204. For example, based on the comparison, the ledger transaction system 106 can determine whether the plurality of events included in the transaction event data 3214 includes a complete set of the sequence of events associated with the transaction event detail request 3204 or an incomplete set. To illustrate, if the plurality of events is missing data for a transaction event having a sequence number included in the sequence of count values 3208 of the transaction event detail request 3204, the ledger transaction system 106 can determine that the plurality of events is incomplete.
Although the foregoing examples illustrate particular transactions, events, and requests, the ledger transaction system 106 can identify a variety of different events with regard to a variety of different transactions through a variety of different requests. For example, in addition to (or in the alternative to) repeatedly polling a transaction event counter, a client device can monitor a transaction event counter by sending a single call to a computer node to inform the client device when a transaction event counter has changed. Similarly, rather than polling a transaction event counter and then transmitting an event detail request, a client device can send a single call to both monitor a transaction event counter and then return transaction event details upon determining a change to the transaction event counter. Thus, the system can monitor a transaction event counter and (in response) receive transaction event details reflecting a change to the transaction event counter.
By maintaining, at a computer node, transaction event counters that track the occurrence of particular transaction events, the ledger transaction system 106 can provide transaction event data more efficiently than conventional systems. In particular, the ledger transaction system 106 can receive transaction event detail requests that specify the transaction events for which event details should be provided. Accordingly, the ledger transaction system 106 can locate and provide the precise event details requested, reducing the amount of computing resources (e.g., processing time and power) required to respond to a query. By specifying, at a client device, the particular transaction events for which event details are desired when submitting a query, the ledger transaction system 106 avoids utilizing significant amounts of computing resources typically required to analyze the excessive amounts of data received in response to the query.
Further, the ledger transaction system 106 is more accurate than conventional systems. Specifically, by maintaining transaction event counters, the ledger transaction system 106 can more accurately provide, to a client device, updates to the occurrence of transaction events. Indeed, the ledger transaction system 106 avoids providing the false positives that are possible under conventional systems. Further, by polling, at a client device, a transaction event counter corresponding to a user account of a state data structure stored at a computer node, the ledger transaction system 106 can obtain negative proofs and accurately determine whether new transaction events have occurred. Specifically, by determining that a count value has not changed in response to polling the transaction event counter, the ledger transaction system 106 can accurately determine the absence of new events corresponding to a user account.
V. ConsensusA. Overview
As mentioned above, the ledger transaction system 106 can utilize validator node devices of the distributed digital ledger transaction network to implement a consensus protocol that concludes in committing execution results of a transaction block to storage.
As discussed previously, in some embodiments, the ledger transaction system 106 utilizes a modified HotStuff protocol for consensus, as described by M. Yin, D. Malkhi, M. K. Reiter, G. G. Golan, and A. Ittai, “Hotstuff: Bft consensus in the lens of blockchain,” arXiv preprint arXiv:1803.05069 (2018), which is incorporated by reference herein in its entirety. The ledger transaction system 106 can improve on this protocol in a variety of ways. For example, the ledger transaction system 106 the ledger transaction system 106 can vote, at the validator node devices, on the results of executing a transaction block rather than the transaction block itself. By having validators collectively sign the full resulting state of the block (rather than just the sequence of transactions), the ledger transaction system 106 is more resistant to non-determinism bugs. This approach also allows clients to use quorum certificates to authenticate reads from the database.
In addition, the ledger transaction system 106 can utilize a pacemaker that emits explicit timeouts, and validators rely on a quorum of those to move to the next round (without requiring synchronized clocks). Moreover, the ledger transaction system 106 can implement an unpredictable leader election mechanism in which the leader of a round is determined by the proposer of the latest committed block using a verifiable random function. This mechanism limits the window of time in which an adversary can launch an effective DoS attack against a leader. Furthermore, the ledger transaction system 106 uses aggregate signatures that preserve the identity validators who sign quorum certificates. This allows the ledger transaction system 106 to provide incentives to validators that contribute to quorum certificates without requiring a complex threshold key setup.
In addition, as mentioned, the ledger transaction system 106 can provide for pipelining of the consensus protocol. Further, the ledger transaction system 106 can implement security measures that enable the validator node devices to correctly resume the consensus protocol, allowing for stability on the distributed digital ledger transaction network even after all of the computer nodes have crashed. Additionally, the ledger transaction system 106 can utilize smart contracts to manage voting rights among the validator node devices. In this manner, the ledger transaction system 106 can improve the accuracy and efficiency of consensus, as will be discussed in greater detail below.
B. Performing Consensus on Execution Results
Many conventional blockchain systems perform consensus with regard to blocks of transactions. After achieving consensus, the conventional systems utilize computing devices participating in the network to execute the agreed-upon transactions and commit the execution results to storage. This method of post-consensus execution, however, can introduce inaccuracies in the stored execution results. For example, implementing post-consensus execution of transaction blocks assumes that the execution will be deterministic. In other words, the conventional systems often assume that every computer node will obtain the same results by executing the same block of transactions. However, technical bugs or errors in execution can result in execution result differences among the different computer nodes. Accordingly, some computer nodes store different versions of the digital ledger, providing an inaccurate portrayal of the digital ledger across the network.
As mentioned above, one or more embodiments of the ledger transaction system 106 perform consensus on execution results. Indeed,
By achieving consensus on the execution results of transactions, rather than the transactions themselves, the ledger transaction system 106 operates more accurately. Indeed, the ledger transaction system 106 anticipates the possibility of non-deterministic execution of transactions at the validator node devices. Accordingly, the validator node devices only write execution results that have been agreed upon into storage, allowing for a more accurate representation of the digital ledger across the distributed digital ledger transact network.
C. Pipelining Consensus
Additionally, as mentioned above, one or more embodiments of the ledger transaction system 106 integrate methods of pipelining into the consensus process. In particular, the ledger transaction system 106 can implement a contiguous 3-chain commit rule as part of the consensus protocol. In particular, utilizing this approach a block at round n (and its full history of blocks) is committed when the “contiguous 3-chain” commit rule is met. Namely, if there exists a chain of three blocks with respective quorum certificates at contiguous rounds n, as well as subsequent rounds n+1, n+2, then the block at round n and previous linked blocks are committed. The commit rule eventually allows honest validators to commit a block. For instance, suppose a malicious validator hides a quorum certificate that causes a commit of B0. B0 will eventually be committed, but it could take some time. This approach (as part of the byzantine fault tolerance approach) can guarantee that all honest validators will eventually accept a common history up to that block to avoid any possibility of forks.
As shown in
In one or more embodiments, the validator node devices do not expressly vote separately on transaction blocks during a given round of voting. Rather, as discussed above, validator nodes can vote on an authenticated data structure that reflects current and historical transactions and/or states. Thus, by voting on a transaction block during a given round of voting, the validator node devices implicitly vote for the preceding transaction blocks. Indeed, as mentioned above, when voting on a transaction block to reach consensus, the validator node devices can vote on the root value of the transaction tree resulting from execution of the transactions within the transaction block. Accordingly, the validator node devices vote on the entire history of the digital ledger (i.e., the entire transaction tree). This history of the digital ledger inherently includes the execution results obtained from executing the transactions within the previous transaction blocks. Thus, in one or more embodiments, by voting on the second transaction block 3510 during the second round of voting 3506, the validator node devices implicitly vote on the first transaction block 3502. Similarly, by voting on the third transaction block 3512 during the third round of voting 3508, the validator node devices implicitly vote on the second transaction block 3510 and the first transaction block 3502 (and every preceding transaction block).
As shown in
By utilizing multiple rounds of voting before committing state reflecting a transaction block to storage, the ledger transaction system 106 provides security against changes to the transaction block. Indeed, with each round of voting, the agreed upon execution results (and how those execution results modify the transaction tree) become more stable. Specifically, the execution results of a particular transaction block receive stronger confirmation with regard to their validity. Thus, the ledger transaction system 106 can use pipelining to improve safety/accuracy of states (prior to committing states to memory) and prevent the occurrence of hard forks.
D. Safety Upon a System Restart
In one or more embodiments, the ledger transaction system 106 further improves safety of the digital ledger by utilizing consensus restart rules that preserve consensus safety, even against a system reboot. Indeed, the ledger transaction system 106 can reduce the risk of a hard fork, even upon the reboot of all of the honest validator nodes on the distributed digital ledger transaction network.
As shown in
As shown in
To provide an example of the recovery process, in one or more embodiments, the ledger transaction system 106 recovers the consensus state upon system restart. In some embodiments, the ledger transaction system 106 can further recover the stored transaction blocks and quorum certifications mentioned above. The ledger transaction system 106 can then recover the last ledger information recorded in the state data structure. The ledger transaction system 106 can utilize the last ledger information as the root of a newly restarted tree (e.g., state tree). The ledger transaction system 106 can then rebuild the tree from all the transaction blocks stored by the consensus manager in anticipation of a system restart using a given root.
Thus, the validator node devices can continue participating in consensus without violating safety. For example, by having a validator node device store consensus states and load the consensus states upon restart (in accordance with consensus restart rules imposed at each validator node), the ledger transaction system 106 prevents a validator node device voting in a voting round in which the validator node device already participated (i.e., voting on a transaction block twice). Further, the ledger transaction system 106 prevents a validator node device from voting on a transaction block from a previous voting round. The ledger transaction system 106 can also avoid malicious attacks that seek to undermine consensus across validator nodes when restarting. Accordingly, the ledger transaction system 106 can improve (or guarantee) safety, even against the restart of all validator node devices in the distributed digital ledger transaction network.
E. Managing Epochs of Voting Rights
As mentioned above, the ledger transaction system 106 can utilize validator node devices to achieve consensus with regard to transaction blocks. In one or more embodiments, the ledger transaction system 106 implements stake-based voting to determine which computer nodes participate as validator node devices. In one or more embodiments, the ledger transaction system 106 determines which computer nodes participate as validator node devices based on the user accounts of the distributed digital ledger transaction network. For example, in some embodiments, the ledger transaction system 106 provides user accounts that own digital assets (e.g., Coin resources) with votes to choose the validator node devices (i.e., stake-based voting). The ledger transaction system 106 can, in some embodiments, provide votes based on the value of the digital assets held by each account (e.g., more votes for owning digital assets of higher value). The ledger transaction system 106 can maintain a vote index that maps the addresses of potential validator node devices with the number of votes submitted for those validator node devices. In one or more embodiments, the ledger transaction system 106 selects a predetermined number of validator node devices based on the addresses having the highest votes according to the vote index.
In one or more embodiments, upon initialization, the vote index maintained by the ledger transaction system 106 includes a single user account with a number of votes that corresponds to the total value of digital assets (e.g., the total value of the Coin resources) in the distributed digital ledger transaction network. In some embodiments, the single user account is associated with one or more authorized devices. Having all available votes, the authorized devices can select the initial set of validator node devices. As digital assets are transferred to other user accounts, however, those user account obtain votes to select validator node devices.
In one or more embodiments, the ledger transaction system 106 utilizes a smart contract (e.g., a module) to implement and manage the stake-based voting. Indeed, in some embodiments, when a user account votes for validator node devices, the ledger transaction system 106 locks (i.e., disables access to) the digital assets associated with the votes submitted (i.e., “locks” the digital assets). The ledger transaction system 106 can utilize a smart contract to manage the locked digital assets (e.g., an amount or timing of locked digital assets). The ledger transaction system 106 can further utilize the smart contract to provide penalties to user accounts that act maliciously (e.g., by extracting a fee from the locked digital assets associated with user accounts that act maliciously). For example, if a validator node devices violates one or more validator rules, the ledger transaction system 106 can penalize validator node devices that act maliciously (e.g., by withholding locked digital assets of the user account).
Additionally, the ledger transaction system 106 can utilize the smart contract to implement and/or modify a “cool-off” period. Indeed, in one or more embodiments, the ledger transaction system 106 utilizes the validator node devices voted for by user accounts to participate in consensus for one epoch. In some embodiments, the ledger transaction system 106 avoids releasing locked digital assets of user account at the end of an epoch (i.e., when the validator set changes) to discourage malicious behavior near the end of the epoch. Rather, the ledger transaction system 106 implements a “cool-off” period (e.g., one additional epoch) and, at the end of the cool-off period, releases the locked digital assets.
In one or more embodiments, the ledger transaction system 106 can also utilize the smart contract to implement changes to the stake-based voting. Indeed (based on the parameters of the smart contract and consensus of the distributed digital ledger transaction network), the ledger transaction system 106 can implement changes that configure the smart contract to modify the stake-based voting. For example, ledger transaction system 106 can utilize the smart contract to adjust the length of the cool-off period or adjust the penalties extracted from user accounts that have acted maliciously. Although the foregoing description mentions various parameters that the ledger transaction system 106 can manage or modify by smart contract, the ledger transaction system 106 can utilize smart contracts to manage and/or modify various additional features, such as selected validator nodes, the length of an epoch, the number of validator nodes, validator qualifications (e.g., qualifications for user accounts to become validator nodes), validator rules (e.g., rules to determine whether nodes should be penalized), or the value of locked digital assets.
As mentioned above, the ledger transaction system 106 can utilize the selected set of validator node devices to implement a modified HotStuff leader-based consensus protocol. However, in one or more embodiments, the validator node devices can implement a variety of other consensus protocols. For example, the validator node devices can implement a proof-of-work protocol or other proof-of stake protocols.
As mentioned, in one or more embodiments, the ledger transaction system 106 can change the computer nodes on the distributed digital ledger transaction network that participate as validator node devices.
As further mentioned above, in some embodiments a given set of validator node devices is fixed through an epoch. In one or more embodiments, an epoch begins upon execution of a particular transaction (e.g., a “start epoch” transaction) and ends upon committing the execution results of a transaction that agrees on the validator set of the next epoch. In one or more embodiments, upon receiving the transaction 3704, the current set of validator node devices 3708 checks to ensure that the transaction 3704 was sent from a user account having authority to propose a new set of validator node devices. The current set of validator node devices can further check that an epoch has lapsed since the last change to the set of validator node devices. In some embodiments, the ledger transaction system 106 requires the transaction 3704 to satisfy both checks before the set of validator node devices can be changed.
In some embodiments, the ledger transaction system 106 utilizes a smart contract (e.g., a module) to enforce a change in the set of validator node devices at the epoch boundary (instead of afterwards). For example,
Indeed, in one or more embodiments, the ledger transaction system 106 requires at least one validator node device (e.g., the lead validator node device) to submit a transaction (e.g., at a predetermined blockchain time or for a predetermined version of the transaction tree), proposing to accept the validator set change from the smart contract. In some embodiments, the ledger transaction system 106 prevents submission of other proposed transaction blocks until that particular transaction has been committed. In some embodiments, if the transaction proposing the validator set change is rejected, the lead validator node device (or the next lead validator node device) continues to make the same proposal until the change is accepted.
In one or more embodiments, upon changing the set of validator node devices, the ledger transaction system 106 drops (i.e., treats as invalid) all proposed transaction blocks that have not been committed. Indeed, in some embodiments, the ledger transaction system 106 treats the transaction block that included the proposed change to the validator similar to a genesis block. In other words, the ledger transaction system 106 requires that all subsequent transaction block proposals include the transaction block proposing the validator set change as an ancestor block.
In one or more embodiments, the ledger transaction system 106 maintains validator set data that includes data for each validator node device in the set. For example, the ledger transaction system 106 can maintain account information for user accounts associated with the set of validator node devices, the public keys used for signing transaction block proposals, the votes for the validator node devices, and metadata corresponding to the validator node devices (e.g., the IP addresses of the validator node devices, the vote shares of the user accounts associated with the validator node devices, etc.). The ledger transaction system 106 can update this data with each new validator set.
In this manner, the ledger transaction system 106 can flexibly and securely manage and modify parameters for obtaining consensus across the distributed digital ledger transaction network. Indeed, in contrast to conventional blockchain systems, the ledger transaction system 106 can securely manage voting rights (and other consensus parameters) via smart contracts that can change to meet the demands of the distributed digital ledger transaction network and address threats that arise over time.
VI. SynchronizationA. Overview
New computer nodes can join the distributed digital ledger transaction network (or rejoin after having been disconnected) to participate as either a validator node device or a full node device. Upon joining the distributed digital ledger transaction network, a computer node can synchronize with one or more other computer nodes to download relevant data (e.g., the data structures of the distributed digital ledger transaction network). In one or more embodiments, the computer node does not inherently trust the data downloaded from the one or more other computer nodes; therefore, the computer node verifies the data upon download. For example, the computer node can identify the current set of validator node devices and their public keys. The computer node can then obtain the root value of the transaction tree having 2f+1 signatures obtained via consensus. Thus, when downloading the desired data from the one or more other computer nodes, the computer node can further download proof of the data and can verify the downloaded data and proof against the root value of the transaction tree.
One or more embodiments of the ledger transaction system 106 implement various features that improve synchronization. For example, the ledger transaction system 106 can utilize incremental verification to improve the efficiency with which a computer node downloads data. The ledger transaction system 106 can further improve efficiency using parallel synchronization. Additionally, the ledger transaction system 106 can utilize waypoints to guide computer nodes in synchronizing to the correct version/branch of the digital ledger.
B. Utilizing Incremental Verification and Parallel Synchronization
Under many conventional blockchain systems, a computer node downloading data via synchronization with a network may download the data in its entirety and then verify the data. However, upon verification, the computer node may discover that the downloaded data is incorrect. Therefore, the computer node may repeat the download and verification process, downloading the desired data from one or more other computer nodes. The computer node may iteratively repeat this process until the correct data has been downloaded. Thus, the conventional blockchain systems may utilize a significant amount of computing resources (e.g., process power and time), both at the receiving computer node and the transmitting computer nodes, in order for the computer node to receive the desired data.
Additionally, many conventional blockchain systems synchronize to the network, at a computer node, serially in a manner that requires a significant computing time to do so. To illustrate, a computer node may seek to generate a historical representation of the distributed digital ledger transaction (e.g., a representation of account states from the network over a particular period of time). To accomplish this result, conventional systems often download transactions and then execute the transactions, one at a time, to determine the state of the network after the execution of that transaction. Accordingly, the conventional systems require a substantial amount of time to fully synchronize to the network.
One or more embodiments of the ledger transaction system 106 utilize incremental verification at a computer node synchronizing to the distributed digital ledger transaction network to download data more efficiently than conventional systems.
Although the ledger transaction system 106 can utilize incremental verification for any data structure described herein, in relation to
Thus, the ledger transaction system 106 can download data to the computer node 3804 from the data tree 3802 in segments (or portions). The ledger transaction system 106 also downloads, to the computer node 3804, a proof corresponding to each segment (or portion) of downloaded data. Accordingly, after downloading a segment of data and the corresponding proof, the ledger transaction system 106 can verify the downloaded data to determine its accuracy. Based on determining that the downloaded data is accurate, the ledger transaction system 106 can download the next segment of data and its corresponding proof. Moreover, upon verifying the different segments (using the different proofs corresponding to each segment), the computer node 3804 can generate or recreate the authenticated data structure (e.g., by combining the different segments).
In one or more embodiments, based on determining that the downloaded data is inaccurate, the ledger transaction system 106 can identify an additional computer node from which to request the desired data. Thus, the ledger transaction system 106 incrementally downloads data (from various devices) and verifies the data before continuing the download.
In one or more embodiments, the ledger transaction system 106 further utilizes parallel synchronization to improve synchronization efficiency. For example, the ledger transaction system 106 can parallelize the incremental verification discussed above with regards to
As shown in
As further shown in
The ledger transaction system 106 can, however, configure the snapshots in a variety of other ways (i.e., configure how often a state data snapshot is uploaded to the server(s) 3902). In some embodiments, the ledger transaction system 106 uploads state data snapshots based on time (e.g., once a week, every day at noon, at the end of every month, etc.). In some embodiments, the ledger transaction system 106 coordinate the transaction data batches to include transaction data for all of the transactions executed on the distributed digital ledger transaction network in between the state data snapshots. For example, the ledger transaction system 106 can upload a first transaction data batch that includes all transactions between S0 and S1000 and a second transaction data batch that includes all transactions between S1000 and S2000. In sum, the state data snapshots (e.g., state data structures) reflect period states of the distributed digital ledger transaction network
As shown in
Meanwhile, as shown in
Though not shown in
In one or more embodiments, the ledger transaction system 106 determines to download only a portion of the data associated with the distributed digital ledger transaction network to a computer node. For example, the ledger transaction system 106 can determine to download transaction data and state data associated with the last decade to the computer node. Accordingly, the ledger transaction system 106 can identify the state data snapshots that correspond to that time frame and the transaction data batches that include the transactions within those state data snapshots. Thus, the ledger transaction system 106 can enable a computer node to download any segment of the data associated with the distributed digital ledger transaction network independent of the other stored segments (i.e., independent of the other state data snapshots or transaction data batches).
By utilizing incremental verification, the ledger transaction system 106 operates more efficiently than conventional systems to synchronize a computer node to the distributed digital ledger transaction network. Indeed, by downloading and verifying data in segments, the ledger transaction system 106 can catch and respond to inaccuracies earlier in the synchronization process—before the entire set of desired data has been downloaded. Accordingly, the ledger transaction system 106 reduces the amount of computing resources required to synchronize a computer node to the distributed digital ledger transaction network.
Additionally, by utilizing parallel synchronization, the ledger transaction system 106 further improves the efficiency of synchronization. Specifically, the ledger transaction system 106 avoids downloading and verifying the data serially. Thus, the ledger transaction system 106 reduces the amount of computing time required for a computer node to synchronize to the distributed digital ledger transaction network.
C. Utilizing Waypoints for Synchronization
In one or more embodiments, the ledger transaction system 106 utilizes waypoints to facilitate synchronization of computer nodes to the distributed digital ledger transaction network. The ledger transaction system 106 can utilize waypoints to guide synchronization in a variety of circumstances, such as adoption of a genesis block, assisting computer nodes coming back on line, and/or resolving (e.g., generating or preventing) hard forks. For example, the ledger transaction system 106 can utilize waypoints to guide a computer node that has been disconnected from the distributed digital ledger transaction network or a new computer node joining the distributed digital ledger transaction network. The ledger transaction system 106 can utilize waypoints to verify a particular version of the digital ledger that has been agreed upon via the consensus protocol (and thus avoid synchronizing to a different, disputed version of the digital ledger). Thus, utilizing waypoints allows the ledger transaction system 106 to avoid the inaccuracies, inefficiencies, and security concerns that result from disputed versions of the digital ledger (e.g., hard forks or other disputed transactions) in conventional blockchain systems. Waypoints also provide flexibility to allow the distributed digital ledger transaction network to implement transactions and select branches as necessary to address threats or evolving needs of the community.
For example,
The ledger transaction system 106 utilizes the waypoint at point 4004 to provide a state of the distributed digital ledger transaction network to which the computer node can synchronize. In particular, as shown in
Specifically, the ledger transaction system 106 can analyze proposed data structures with the waypoint. For example, the computer node illustrated in
The ledger transaction system 106 provide waypoints to the computer node in a variety of ways. For example, the ledger transaction system 106 can transmit an indication (e.g., a push notification) to the computer node with the waypoint. The ledger transaction system 106 can provide the waypoint in response to a query received from the computer node. In some embodiments, the ledger transaction system 106 provides the waypoint to the computer node via a hexadecimal code that can be copied by the computer node or a digital visual code scannable by the computer node. In further embodiments, the computer node can receive manual input associated with the waypoint (the user providing the input can receive the waypoint in a variety of ways, such as by word of mouth or printed advertisement). In sum, the ledger transaction system 106 can publish the waypoint in a variety of ways to allow computer nodes of the distributed digital ledger transaction network to accurately and efficiently synchronize to a particular version of the digital ledger.
Although
However, in one or more embodiments, the ledger transaction system 106 utilizes waypoints to indicate, to the computer nodes of the distributed digital ledger transaction network, that FTVM transactions should be accepted. Indeed, upon identifying a waypoint associated with an FTVM transaction, a computer node can accept the FTVM transaction and synchronize to the distributed digital ledger transaction network so that the FTVM transaction is included in the data. Specifically, in one or more embodiments, the validator node devices vote to confirm FTVM transactions via the consensus protocol. If an FTVM transaction achieves consensus among the validator node devices, the ledger transaction system 106 can implement the FTVM transaction on the distributed digital ledger transaction network. In one or more embodiments, the FTVM transaction achieves consensus when a threshold number of validator node devices (e.g., 2f+1 validator node devices) have accepted the FTVM transaction.
For example, in one or more embodiments, the ledger transaction system 106 can utilize waypoints to facilitate initialization of the distributed digital ledger transaction network. For example, as shown in
As shown in
For example, as shown in
As shown in
As briefly mentioned above, in one or more embodiments, waypoints are configurable. Indeed, in one or more embodiments, the ledger transaction system 106 generates waypoints based on input (e.g., provided by the authorized device(s) 4110 as described in
A. Overview
As mentioned above, some of the inefficiency, insecurity, and rigidity of conventional systems comes as a result of implementing programming languages. Indeed, conventional systems utilize programming languages that can require excessive processes to implement, introduce opportunities for manipulation, and undermine the ability to flexibly implement different transactions and processes on a blockchain.
In one or more embodiments, the ledger transaction system 106 utilizes a programming language that improves the efficiency, security, and flexibility of implementing systems. For example, as discussed above with reference to
Additionally, as mentioned, the ledger transaction system 106 can utilize a programming language to improve data abstraction and configurability. Specifically, the ledger transaction system 106 can utilize the programming language to define modules and resources associated with user accounts. As mentioned above, the ledger transaction system 106 utilizes a module as a template from which to create one or more resources (i.e., instances of the module). As further mentioned above, a resource corresponding to a particular module is managed by that module (i.e., managed by the attributes and procedures defined within that module) and is generally inaccessible to the procedures defined outside of that module. Accordingly, the ledger transaction system 106 can improve data abstraction by defining modules—including the governing attributes and resources—providing control over the methods used for creating, destroying, and modifying the associated resources. Additionally, the ledger transaction system 106 can utilize the programming language to improve configurability by defining modules that can be generated, updated, and/or exchanged to accommodate changing needs on the distributed digital ledger transaction network.
Further, the ledger transaction system 106 can utilize the programming language to define custom resource types that enforce linearity. As will be discussed in more detail below with regards to
In addition, as described in greater detail below, the ledger transaction system 106 can utilize a programming language that checks reference safety at the bytecode level. Moreover, the ledger transaction system 106 can implement this bytecode verification using an authenticated data structure (e.g., a tree structure). By utilizing a programming language coded on the bytecode level (e.g., without a compiler that introduces opportunities to undermine safety guarantees) together with a tree data structure, the ledger transaction system 106 can significantly improve security and flexibility relative to conventional systems.
B. Utilizing Linear Types and Data Abstraction to Represent Digital Assets
Many conventional blockchain systems utilize a programming language to represent digital assets on a network. However, these programming languages often hamper the flexibility and security of implementing computing devices. For example, many conventional systems rigidly represent digital assets as an integer value within a programming language. Consequently, conventional systems fail to flexibly allow digital assets to be stored in data structures, passed as an argument to a procedure, or returned from a procedure. Additionally, when generating a digital asset, the conventional systems generally hardcode, into the language semantics of the segments of code that define that digital asset, certain scarcity protections that are desirable when managing digital assets. Because these scarcity protections are hardcoded into the language semantics, the conventional systems require manual reimplementation of those scarcity protections when generating a new digital asset. Similarly, when generating a digital asset, conventional systems typically hardcode, into the language semantics, access controls for that digital assets, preventing flexible access control customization.
In addition to flexibility concerns, conventional blockchain systems are also error-prone and insecure. As mentioned, conventional blockchain systems represent digital assets as integer values, which inherently do not behave like assets (e.g., integer values may be copied freely, which is undesirable for some assets). Integer values inherently behave differently than assets; therefore, the conventional systems typically create special methods of handling integer values to imitate handling an asset. To illustrate, many conventional systems track the holdings of digital assets using owner-to-asset map sets. These systems may transfer an asset by invoking procedures that have side effects on these maps. Often, such procedures require two distinct steps: creating a side effect on the sender's side and then checking that the side effect occurred on the receiver's side. The separation of these steps allows for malicious actors to insert unexpected and undesired behavior (e.g., changing a balance between the receiver check and receiver reaction). Accordingly, conventional systems often expose the associated network (and the digital assets stored thereon) to attacks.
One or more embodiments of the ledger transaction system 106 utilize linear data types to more flexibly represent digital assets associated with the distributed digital ledger transaction network. In particular, the ledger transaction system 106 can utilize a programming language to define a digital asset (or a variety of other resources) using semantics associated with a linear data type. The ledger transaction system 106 can then utilize linear typing rules corresponding to the linear data type when managing (e.g., transferring) the digital asset. For example, the linear typing rules can include a first linear typing rule that requires the digital asset to be used a single time (i.e., exactly once) during a transaction and a second linear typing rule that prevents duplicating the digital asset via transaction. In this manner, the ledger transaction system 106 can more flexibly and efficiently manage digital assets on the distributed digital ledger transaction network.
To provide an illustration, the ledger transaction system 106 implements the linear typing rules to control modification of the state data structure of the distributed digital ledger transaction network. In particular, the ledger transaction system 106 can utilize the linear typing rules in executing a transaction. For example, the ledger transaction system 106 can identify a request for a transaction to transfer a digital asset via the distributed digital ledger transaction network from a first user account to a second user account on the state data structure. The ledger transaction system 106 can then determine (e.g., identify) the linear data type of the digital asset within the request for the transaction. Subsequently, the ledger transaction system 106 can execute the transaction utilizing the linear data type by transferring the digital asset from the first user to the second user account on the state data structure subject to the set of linear typing rules corresponding to the linear data type. In one or more embodiments, the digital asset includes a digital currency maintained within the state data structure of the distributed digital ledger transaction network.
As shown in
For example, the transaction script 4202 includes the line 4206 of pseudocode indicating that two inputs are included: the address associated with the user account of the recipient and an unsigned integer representing the number of coins to be transferred to the recipient. In one or more embodiments, the inputs are provided by the client device at the time of submitting the corresponding transaction request. The transaction script 4202 also includes the line 4208 instructing the validator node device 4204 to withdraw a digital asset 4210 (referred to as “coin” in the pseudocode) from a user account (i.e., sender account 4212) associated with the sender of the transaction script 4202. The line 4214 instructs the validator node device 4204 to deposit the digital asset 4210 to a user account associated with an identified payment recipient (i.e., “payee”).
As further shown in
Upon running the load-time bytecode verification, the ledger transaction system 106 can determine that the transaction request associated with the transaction script 4202 violates the linear typing rules corresponding to the linear data type of the digital asset 4210. In particular, the ledger transaction system 106 can determine that the digital asset 4210 is associated with a linear data type within the programming language, and therefore subject to the linear typing rules. The ledger transaction system 106 can further determine that, by attempting to utilize the linear data type (i.e., the digital asset 4210) twice, the transaction request violates the first linear typing rule to utilize the linear data type a single time in a transaction. As shown in
As shown in
Specifically, as shown in
Upon running the load-time bytecode verification, the ledger transaction system 106 can determine that the transaction request associated with the transaction script 4220 violates the linear typing rules corresponding to the linear data type associated with the digital asset 4210. In particular, the ledger transaction system 106 can determine that, by failing to utilize the linear data type, the transaction request violates the first linear typing rule to utilize the linear data type a single time in a transaction (e.g., the “coin” is withdrawn but not used). As shown in
Additionally, as shown in
Upon running the load-time bytecode verification, the ledger transaction system 106 can determine that the transaction request associated with the transaction script 4230 violates the linear typing rules corresponding to the linear data type associated with the digital asset 4210. In particular, the ledger transaction system 106 can determine that, by attempting to duplicate the linear data type, the transaction request violates the second linear typing rule against duplicating linear data types. As shown in
In one or more embodiments, in addition to enforcing linear typing rules, the ledger transaction system 106 provides fungibility for digital assets. Indeed, as mentioned above, a digital asset can include a digital currency. As such, the ledger transaction system 106 can implement methods of dividing and merging digital currency units corresponding to digital assets. It should be noted, however, that the ledger transaction system 106 can provide fungibility for various types of digital assets. In one or more embodiments, the ledger transaction system 106 implements fungibility pursuant to the linear typing rules.
To provide an illustration, in one or more embodiments, the ledger transaction system 106 implements a “Currency” module that utilizes data abstraction to implement fungibility. Accordingly, the ledger transaction system 106 manages the access, creation, and destruction of resources that are created from the Currency module. For simplicity, the following will refer to instances of the Currency module—i.e., resources (e.g., digital assets) associated with the Currency module—as “coins.”
Broadly, the ledger transaction system 106 can use a Currency module to restrict access to the “value” field of a coin and to restrict the ability to allocate new coins. For example, in one or more embodiments, the ledger transaction system 106 prevents incrementing the value field of a coin associated with a user account unless a coin owned by another account has been transferred to the user account via the “deposit” procedure. If the deposit procedure has been invoked, the ledger transaction system 106 can increment the value field of the coin by the value of the deposited coin (i.e., the ledger transaction system 106 adds the value of the owned coin to the value of the coin associated with the user account). As another example, in some embodiments, the ledger transaction system 106 prevents creating a new coin with value n unless the value field of an existing coin is decremented by n via the deposit procedure. Thus, the ledger transaction system 106 can provide fungibility for digital assets while preventing their arbitrary creation.
By using the programming language to represent digital assets as linear data types, the ledger transaction system 106 can manage digital assets more flexibly than conventional systems. In particular, the digital assets can behave like program values. For example, by using linear data types to represent digital assets, the ledger transaction system 106 can store digital assets in data structures, pass the digital assets as arguments to procedures, and return digital assets from procedures. Additionally, the ledger transaction system 106 can utilize a type system to implement flexible scarcity protections that are not available to conventional systems. Indeed, the ledger transaction system 106 can implement custom rules for creating and destroying assets. Further, by using linear data types, the ledger transaction system 106 can generate flexible access controls in the same way as ordinary program values (e.g., using conditional statements, etc.).
Additionally, the ledger transaction system 106 can manage digital assets more securely than conventional systems. Indeed, by representing digital assets as linear data types via the programming language, the ledger transaction system 106 avoids the special methods of handling used by many conventional systems. For example, as mentioned above, the ledger transaction system 106 can pass digital assets as arguments to procedures (i.e., via parameter binding). Using digital assets in such a way requires a single step. Consequently, the ledger transaction system 106 narrows the opportunities for a malicious actor to insert unexpected behavior and makes it easier to write safe code.
C. Utilizing Static and Dynamic Analysis to Determine Reference Safety
Conventional blockchain systems may perform checks on the programming language operating on the network to identify any errors (e.g., bugs) within the code. Moreover, many conventional systems analyze programs submitted for execution on the network to determine whether the programs adhere to reference safety (i.e., the programs always refer to valid memory). Many conventional systems reject programs determined to not adhere to reference safety.
As mentioned above, a number of technical problems exist, however, with regard to ensuring reference safety utilizing conventional blockchain systems. Indeed, under many conventional systems, memory includes a flat array with addresses and has an arbitrary graph shape that is difficult to utilize. This memory structure leads to difficulty in analyzing programs for reference safety (e.g., unless the analysis is done at the source code level). Indeed, conventional systems memory includes arbitrary pointers and it can be inefficient (or impossible) to verify that the pointers refer to valid memory. Additionally, many conventional blockchain systems perform reference safety checks at run-time. Accordingly, such conventional systems often wait until attempting to execute a program before determining whether it is safe for execution.
Though many conventional systems analyze programs for reference safety at the source code level, such systems generally execute programs at the machine code level (i.e., processing programs written in source code using a compiler to generate the corresponding machine code). Using a compiler, however, compromises memory safety because malicious actors can attack or bypass the compiler run on the machine code level.
One or more embodiments of the ledger transaction system 106 utilize a combination of static and dynamic analysis of transaction scripts and modules to more accurately preserve reference safety. In particular, in one or more embodiments, the ledger transaction system 106 receives and executes transaction scripts at the bytecode level. The ledger transaction system 106 can perform load-time bytecode verification to analyze such transaction scripts at the bytecode level, identifying reference safety issues even where a transaction script was written directly in bytecode. In one or more embodiments, the ledger transaction system 106 also performs bytecode verification on modules submitted for storage on the distributed digital ledger transaction network. Additionally, in one or more embodiments, the ledger transaction system 106 utilizes a programming language that references memory using a tree structure memory model. In this manner, the ledger transaction system 106 can more accurately and efficiently analyze for reference safety at the bytecode level, identifying reference safety issues with improved accuracy.
As mentioned above, in one or more embodiments, the ledger transaction system 106 executes transaction scripts at the bytecode level. For example, the ledger transaction system 106 can execute transaction scripts written directly in bytecode. In some embodiments, the ledger transaction system 106 receives transaction scripts written using source code or an intermediate representation (IR), compiles the transaction script into bytecode, and then executes the bytecode. Indeed, the transaction script executed by the ledger transaction system 106—whether the script is written in bytecode or compiled into bytecode—contains a sequence of bytecode operations.
As mentioned above, transaction scripts can invoke one or more procedures from one or more modules. In one or more embodiments, the code defining the procedure of a module also includes a sequence of bytecode operations. Thus, the ledger transaction system 106 maintains execution of bytecode when executing module procedures.
As further described above with regard to
Additionally, the ledger transaction system can utilize the stack-based virtual machine to implement procedure calls (i.e., module procedures invoked by transaction scripts). To illustrate, in one or more embodiments, the ledger transaction system 106 provides a fixed vector of typed local variables to each procedure and stores the input parameters in the vector starting from position zero. The ledger transaction system 106 then loads the input arguments to the procedure call that were pushed on the stack by the caller into the vector of local variables. The ledger transaction system 106 can then utilize a bytecode interpreter to begin executing a sequence of bytecode operations corresponding to the procedure at a zero offset. The ledger transaction system 106 can proceed with execution by executing the bytecode operations in sequence unless a branch operation that causes a jump to a specific offset in the sequence is identified. By the return of the procedure call, the ledger transaction system 106 can place the output values on the stack.
In one or more embodiments, the ledger transaction system 106 can utilize Boolean, arithmetic, equality, and branching operators via the programming language. In some embodiments, the ledger transaction system 106 can utilize bytecode operations for loading constants and copying or moving values stored in a local variable onto the stack and for popping values from the stack into local variables. In further embodiments, the ledger transaction system 106 can implement bytecode operations for creating and dissolving structs and resources (structs and resources will be explained in more detail below). Indeed, the ledger transaction system 106 can utilize values from the stack to generate a struct and then push the struct onto the stack. The ledger transaction system 106 can perform the inverse bytecode operation by utilizing a struct at the top of the stack to push the values stored in the struct onto the stack.
In some embodiments, the ledger transaction system 106 utilizes the programming language to support two types of values: unrestricted and resource. Indeed, the ledger transaction system can support primitive types, such as Booleans, 64-bit unsigned integers, 256-bit account addresses, and fixed-size byte arrays. The ledger transaction system 106 can generate struct types and can further tag the struct type as a resource, generating a resource type. The ledger transaction system 106 can treat all other types, including untagged struct types and primitive types, as unrestricted types. In one or more embodiments, the ledger transaction system 106 implements resources, such as digital assets, as a linear data type using linear semantics provided by the programming language, as is discussed in more detail above with regard to
In one or more embodiments, a variable of resource type is a resource variable, and a variable of unrestricted type is an unrestricted variable. As discussed above, in some embodiments, a resource variable cannot be copied and must always be moved (i.e., using a move operation). Further, variables and fields of resource kind cannot be mutated in some embodiments. By contrast, in one or more embodiments, a variable or field of unrestricted type can be both copied and mutated. In some embodiments, the type of a field of a struct can be either primitive or a struct. However, in some embodiments, an unrestricted struct type may not contain a field with a resource type, ensuring that an unrestricted struct does not result in copying of a nested resource. Resources are discussed in more detail above with reference to
In further embodiments, the ledger transaction system 106 further uses the programming language to implement reference types. The ledger transaction system 106 can classify a reference type as either mutable or immutable. The ledger transaction system 106 can utilize references to global and local variables and to fields of struct variables.
As mentioned above, in one or more embodiments, the ledger transaction system 106 utilizes a combined static-dynamic analysis to enforce reference safety. In particular, the ledger transaction system can statically and dynamically analyze modules submitted for storage on the distributed digital ledger transaction network as well as transaction scripts submitted for execution. In performing the analysis, the ledger transaction system determines whether the transaction or module always refers to valid memory (i.e., never refers to memory that has been freed, never refers to memory that outside the bounds of the memory array, etc.). In one or more embodiments, the ledger transaction system 106 further uses the combined static-dynamic analysis to ensure that, if a live reference is an extension of (or equal to) another live reference in the same scope, that the references reside in variables of immutable reference type.
As shown in
To illustrate, in one or more embodiments, a module or transaction script encodes a collection of tables of entities, such as constants, type signatures, struct definitions, and procedure definitions. The ledger transaction system 106 can utilize the bytecode verifier to perform structural checks to ensure these tables are well-formed. In particular, the bytecode verifier can identify errors that include illegal table indices, duplicate table entries, illegal type signatures (e.g., a reference to a reference), etc. If the structural checks are satisfied, the ledger transaction system 106 can utilize the bytecode verifier to further perform semantic checking on procedure bodies. While performing the semantic checks, the bytecode verifier can identify errors that include incorrect procedure arguments, dangling references to deallocated objects, illegal copy of resources, etc.
In one or more embodiments, the ledger transaction system 106 utilizes the bytecode verifier to implement several phases of semantic verification. For example, in a CFG construction phase, the ledger transaction system 106 can construct a control-flow graph by decomposing the instruction sequence of the module or transaction script into a collection of instruction blocks. In particular, each instruction block can include a contiguous sequence of instructions. Indeed, the set of all instructions included in the transaction script or module can be partitioned among the instruction blocks. Additionally, each instruction block can end with a branch or return instruction. By decomposing the instruction sequence into instruction blocks, the ledger transaction system 106 ensures that branch targets land only at the beginning of an instruction block. In some embodiments, the decomposition can also ensure that the generated blocks are maximal.
The ledger transaction system 106 can additionally use the bytecode verifier to implement a stack checking phase. In particular, the bytecode verifier analyzes the instructions blocks to ensure that a particular invariant is maintained. In one or more embodiments, the invariant requires that, when execution lands at the beginning of an instruction block, the stack height is n (the height of the stack when the corresponding function begins executing) and that the stack height is n or n+1, depending on whether the function does not return or does return an argument, respectively. The bytecode verifier analyzes each instruction block separately, determining the effect of each instruction in the instruction block on the stack height. Indeed, the bytecode verifier determines that the stack height does not go below n (an undesirable result) and is left at either n or n+1 (depending on the final instruction of the block and the return type of the function) at the end of the instruction block.
The ledger transaction system 106 can further utilize the bytecode verifier to implement a type checking phase. In particular, the bytecode verifier can check that each operation and function (including both built-in functions and user-defined procedures) is invoked with arguments of appropriate types. In particular, the operands of an operation are values located either in a local variable or on the stack. In one or more embodiments, the bytecode already provides the types of local variables of a function. In some embodiments, however, the bytecode verifier infers the types of stack values. The bytecode verifier can perform this inference and the type checking of each operation separately for each instruction block. In one or more embodiments, because the stack height at the beginning of each instruction block is n and does not go below n during the execution of the block, the bytecode verifier models the suffix of the stack starting at n for type checking the instructions within the instruction block. Indeed, the bytecode verifier can model this suffix using a stack of types, on which types are pushed and popped as the instruction stream in a block is processed. In one or more embodiments, the type stack and the statically-known types of local variables are enough to type check each instruction.
In one or more embodiments, the ledger transaction system 106 can utilize the bytecode verifier to further analyze the transaction script or module for additional constraints on operations performed on resources. For example, as mentioned above, resource variables and fields generally cannot be copied or updated. In one or more embodiments, the bytecode verifier performs these checks during the type checking phase. In one or more embodiments, the bytecode verifier utilizes borrow tracking at the bytecode level to perform the static, load-time verification.
As shown in
In one or more embodiments, upon determining that a module or transaction script is not memory safe, the ledger transaction system 106 can reject the module or transaction script. Indeed, if the ledger transaction system 106 determines the module or transaction script is not memory safe via bytecode verification, the ledger transaction system 106 can reject the module or transaction script before even attempting to execute the code (i.e., at runtime).
As mentioned above, the ledger transaction system 106 can utilize the programming language to implement a tree structure memory model. More detail regarding the tree structure memory model (e.g., the state tree, the event tree, and the transaction tree) is provided above with regard to
By utilizing a programming language that references memory utilizing a tree structure memory model, the ledger transaction system 106 improves efficiency and security when compared to conventional systems. Indeed, the ledger transaction system 106 can uniquely name each node in the tree structure memory model based on the path from the root of the tree to the node. Consequently, the ledger transaction system 106 can implement the reference safety analysis at the bytecode level rather than being restricted to source code analysis. This improves accuracy in analyzing reference safety and reduces vectors for malicious attacks. Additionally, by performing the bulk of the reference safety analysis statically at load time, the ledger transaction system 106 can identify transaction scripts and modules that are not memory safe before attempting to execute the transaction script or module.
For example,
The series of acts 4400 includes an act 4402 of generating an authenticated data structure. For example, the act 4402 involves generating an authenticated data structure of a distributed digital ledger transaction network, wherein the authenticated data structure comprises a data tree comprising nodes having data representations mapped to entries in a database. In one or more embodiments, the database comprises a state database and the data tree comprises a state tree.
The series of acts 4400 also include an act 4404 of determining expiration of an eviction date associated with a node. For example, the act 4404 involves performing lazy deletion of data from the authenticated data structure by accessing a data representation from a node of the data tree to determine expiration of an eviction date associated with node. In one or more embodiment, the node comprises an account state representation corresponding to the account data of a user account. The ledger transaction system 106 can generate the account state representation by applying a hash function to the account data corresponding to the user account in the state database to generate a hash value for the account data corresponding to the user account; and combining the hash value for the account data with the eviction date associated with the user account to generate the account state representation corresponding to the user account.
In one or more embodiments, the ledger transaction system 106 determines expiration of the eviction date based on at least one of: a rent deposit amount, a time of a last user account access, a time of a transaction that transfers digital assets from the user account, or a time of a transaction that transfers digital assets to the user account.
The series of acts 4400 further includes the act 4406 of deleting one or more entries corresponding to the node. For example, the act 4406 involves performing the lazy deletion of the data from the authenticated data structure by, in response to determining expiration of the eviction date, deleting one or more entries corresponding to the node from the database while maintaining the data representation within the data tree. In one or more embodiments, the one or more entries comprise account data corresponding to the user account.
In one or more embodiments, the series of acts 4400 further include acts surrounding the deletion of the one or more entries corresponding to the node. For example, in one or more embodiments, the acts include deleting the one or more entries corresponding to the node from the database without a transaction event request on the distributed digital ledger transaction network for deleting the one or more entries. In some embodiments, the acts include, prior to deleting the one or more entries corresponding to the node from the database: receiving a request from a client device, the request requiring use of the one or more entries; in response to receiving the request from the client device, accessing the data representation from the node of the data tree to determine expiration of the eviction date; and processing the request as if the one or more entries have been deleted. In further embodiments, the acts include, in response to receiving a transaction that references the user account, accessing the account state representation corresponding to the user account from the state tree to determine expiration of the eviction date and processing the transaction as if the user account had expired.
In some embodiments, the series of acts 4400 further includes acts for reinstating user accounts. For example, in one or more embodiments, the acts include identifying an account reinstatement request associated with the user account, wherein the account reinstatement request comprises proposed account data for the user account; and verifying the proposed account data for the user account based on the account state representation within the state tree. In some embodiments, the acts further include re-caching the proposed account data associated with the user account within the state database of the distributed digital ledger transaction network based on verifying the proposed account data for the user account. In some embodiments, the acts further include updating the eviction date associated with the node based on re-caching the proposed account data associated with the user account.
The series of acts 4500 includes an act 4502 of identifying address identifiers corresponding to a user account. For example, the act 4502 involves generating a request for a transaction between a first user account and a second user account of a distributed digital ledger transaction network by identifying a main public address identifier corresponding to the second user account, a sub-address identifier corresponding to the second user account, and a public encryption key. In one or more embodiments, identifying the main public address identifier corresponding to the second user account, the sub-address identifier corresponding to the second user account, and the public encryption key comprises scanning a digital visual code that encodes the main public address identifier, the sub-address identifier, and the public encryption key.
In one or more embodiments, the ledger transaction system identifies the main public address identifier, the sub-address identifier, and the public encryption key based on at least one of: a telephone number of a user corresponding to the second user account or a user ID of the user.
In some embodiments, the ledger transaction system 106 identifies the main public address identifier, the sub-address identifier, and the public encryption key based on an email address of a user corresponding to the second user account. For example, in some embodiments, identifying the main public address identifier, the sub-address identifier, and the public encryption key comprises: identifying a domain name and personal email identifier from the email address of the user corresponding to the second user account; determining the main public address identifier based on the domain name from the email address; and determining the sub-address identifier based on the personal email identifier from the email address. Indeed, in some embodiments, identifying the main public address identifier, the sub-address identifier, and the public encryption key comprises, in response to providing the personal email identifier from the email address to a remote server corresponding to the domain name, receiving the public encryption key from the remote server corresponding to the domain name.
In one or more embodiments, determining the main public address identifier based on the domain name comprises accessing a DNS record corresponding to the domain name to identify at least one of: the main public address identifier or the public encryption key. In some embodiments, the ledger transaction system 106 further utilizes DNSSEC to validate the main public address identifier or the public encryption key identified by accessing the DNS record corresponding to the domain name. In one or more embodiments, generating the encrypted sub-address comprises applying the public encryption key, determined by accessing the DNS record, to the sub-address identifier determined based on the personal email identifier.
The series of acts 4500 also includes an act 4504 of generating a unique encrypted sub-address. For example, the act 4502 involves generating the request for the transaction between the first user account and the second user account of the distributed digital ledger transaction network by generating an encrypted sub-address unique to the transaction applying the public encryption key to the sub-address identifier. In one or more embodiments, generating the encrypted sub-address unique to the transaction comprises adding a nonce value to the sub-address identifier; and applying the public encryption key to the sub-address identifier with the nonce value.
The series of acts 4500 further includes an act 4506 of submitting the request for the transaction for execution. For example, the act 4506 involves submitting, for execution via the distributed digital ledger transaction network, the request for the transaction between the first user account and the second user account using the main public address identifier and the encrypted sub-address unique to the transaction.
The series of acts 4600 includes an act 4602 of determining a first state data structure. For example, the act 4602 involves determining a first state data structure of a distributed digital ledger transaction network, wherein the first state data structure represents account states of a plurality of user accounts of the distributed digital ledger transaction network.
The series of acts 4600 also includes an act 4604 of identifying a plurality of transactions. For example, the act 4604 involves identifying a plurality of transactions comprising transactions associated with user accounts of the plurality of user accounts.
The series of acts 4606 further includes an act 4606 of performing a preliminary execution of the transactions in parallel. For example, the act 4606 involves performing a preliminary execution of the transactions in parallel relative to the first state data structure to determine a plurality of transaction results and dependencies of the transactions with regard to the user accounts.
In one or more embodiments, the transactions comprise a first transaction and a second transaction. Indeed, in some embodiments, performing the preliminary execution comprises determining a first transaction result reflecting application of the first transaction relative to the first state data structure; determining a second transaction result reflecting application of the second transaction relative to the first state data structure; and determining that the second transaction is not dependent upon the first transaction and the first transaction is not dependent upon the second transaction. In some embodiments, based on determining that the second transaction is not dependent upon the first transaction and the first transaction is not dependent upon the second transaction, the ledger transaction system 106 applies the first transaction result and the second transaction result relative to the first state data structure.
In one or more embodiments, the ledger transaction system 106 generates an intermediate state data structure by applying the first transaction result to the first state data structure. In some embodiments, the transactions further comprise a third transaction and performing the preliminary execution comprises: determining a third transaction result reflecting application of the third transaction relative to the first state data structure; and determining that the third transaction depends on the first transaction. Indeed, in some embodiments, in response to determining that the third transaction depends on the first transaction, the ledger transaction system 106 executes the third transaction against the intermediate state data structure to generate the second state data structure. In one or more embodiments, determining that the third transaction depends on the first transaction comprises determining that the third transaction and the first transaction are associated with a same user account from the user accounts.
Additionally, the series of acts 4600 includes an act 4608 of modifying the first state data structure by applying the transaction results. For example, the act 4608 involves modifying the first state data structure to a second state data structure by applying the plurality of transaction results based on the dependencies of the transactions. In one or more embodiments, the second state data structure is equivalent to executing the plurality of transactions serially against the first state data structure.
In one or more embodiments, the ledger transaction system 106 receives a dependency indicator for the plurality of transactions from a validator node and identifies a first subset of the plurality of transactions and a second subset of the plurality of transactions based on the dependency indicator. Accordingly, performing the preliminary execution of the transactions comprises performing a preliminary execution of the first subset of the plurality of transactions based on the dependency indicator. In some embodiments, the ledger transaction system 106 generates an intermediate state data structure based on transaction results from performing the preliminary execution of the first subset of the plurality of transactions; and generates the second state data structure by executing the second subset of the plurality of transactions relative to the intermediate state data structure.
The series of acts 4700 includes an act 4702 of generating a state data structure. For example, the act 4702 involves generating a state data structure of a distributed digital ledger transaction network, wherein the state data structure comprises account data corresponding to a user account, a transaction event counter corresponding to the user account, and an address of the user account within the state data structure.
The series of acts 4700 also includes an act 4704 of modifying a count value of the transaction event counter. For example, the act 4704 involves, in response to execution of a transaction comprising an event corresponding to the user account of the distributed digital ledger transaction network, modifying a count value of the transaction event counter of the user account within the state data structure.
In one or more embodiments, the state data structure comprises an additional transaction event counter corresponding to the user account, the transaction event counter corresponds to a first transaction event type, and the additional transaction event counter corresponds to a second transaction event type. Accordingly, in some embodiments, modifying the count value of the transaction event counter of the user account comprises: determining that the transaction event corresponds to the first transaction event type; and modifying the count value of the transaction event counter based on determining that the transaction event corresponds to the first transaction event type.
Further, the series of acts 4700 includes an act 4706 of generating a transaction event within an event data structure. For example, the act 4706 involves, in response to execution of a transaction comprising an event corresponding to the user account of the distributed digital ledger transaction network, further generating a transaction event within an event data structure, the transaction event within the event data structure reflecting the address, the count value of the transaction event counter of the user account, and details of the event. In one or more embodiments, the event data structure comprises an event tree reflecting transaction events generated in response to the execution of the transaction. Indeed, in one or more embodiments, the ledger transaction system 106 determines a root value of the event tree reflecting the transaction events corresponding to the transaction; and stores the root value of the event tree in a transaction tree of the distributed digital ledger transaction network.
In one or more embodiments, the series of acts 4700 further includes acts for generating multiple transaction events in response to execution of a transaction. As mentioned above, in one or more embodiments, the state set data structure comprises an additional transaction event counter corresponding to a second transaction event type. Indeed, in some embodiments, the transaction comprises an additional event of the second transaction event type. Accordingly, in one or more embodiments, the ledger transaction system 106 modifies an additional count value of the additional transaction event counter of the user account within the state data structure; and generates an additional transaction event within the event data structure, the additional transaction event within the event data structure reflecting the address, the additional count value of the additional transaction event counter of the user account, and details of the additional event.
In some embodiments, the series of acts 4700 further includes acts for providing data in response to receiving a request. For example, in one or more embodiments, the acts include receiving an event count request from a client device, the event count request comprising a reference to the transaction event counter; and, in response to receiving the event count request from the client device, providing the modified count value of the transaction event counter from the state data structure to the client device. In one or more embodiments, the reference to the transaction event counter comprises an access path that reflects both the address and the transaction event counter. In some embodiments, the acts include receiving a transaction event detail request from a client device, the transaction event detail request comprising the count value of the transaction event counter and an access path comprising the address and the transaction event counter; and, in response to receiving the transaction event detail request, providing details of the event from the event data structure to the client device together with a Merkle proof corresponding to the transaction event.
The series of acts 4800 includes an act 4802 of monitoring a transaction event counter. For example, the act 4802 involves monitoring a transaction event counter corresponding to a user account of a state data structure stored at a computer node of a distributed digital ledger transaction network. In one or more embodiments, based on monitoring the transaction event counter, the ledger transaction system 106 determines the count value of the transaction event counter.
In some embodiments, monitoring the transaction event counter comprises polling the transaction event counter at the computer node. Accordingly, in some embodiments, the ledger transaction system 106 determines the count value of the transaction event counter at a first time; and determines an additional count value of the transaction event counter at a second time. Indeed, in some embodiments, the ledger transaction system 106 verifies an absence of events corresponding to the user account between the first time and the second time by determining that the count value of the transaction event counter at the first time and the additional count value of the transaction event counter at the second time are the same count value.
The series of acts 4800 also includes an act 4804 of transmitting a transaction event detail request for transaction event data. For example, the act 4804 involves transmitting a transaction event detail request for transaction event data from an event data structure stored at one or more computer nodes of the distributed digital ledger transaction network. In some embodiments, the transaction event detail request comprises the count value of the transaction event counter and an access path of the transaction event counter corresponding to the user account within the state data structure. In one or more embodiments, monitoring the transaction event counter and transmitting the transaction event detail request are part of a combined request to the computer node (e.g., the computer node discussed with reference to the act 4602).
Further, the series of acts 4800 includes an act 4806 receiving transaction event data. For example, the act 4806 involves, in response to transmitting the transaction event detail request, receiving, via the one or more computer nodes, transaction event data corresponding to a count value determined from the transaction event counter. In one or more embodiments, the event data structure comprises an event Merkle tree and the state data structure comprises a state Merkle tree. Accordingly, in some embodiments, receiving the transaction event data comprises receiving, from the computer node of the distributed digital ledger transaction network, a Merkle proof in response to transmitting the transaction event detail request.
In one or more embodiments, the series of acts 4800 include acts for receiving transaction event data regarding a sequence of events. For example, as mentioned above, monitoring the transaction event counter can include determining the count value of the transaction event counter at a first time; and determining an additional count value of the transaction event counter at a second time. In some embodiments, based on comparing the count value of the transaction event counter at the first time and the additional count value of the transaction event counter at the second time, the ledger transaction system 106 determines a sequence of count values indicating that a sequence of events corresponding to the user account have occurred via the distributed digital ledger transaction network. Accordingly transmitting the transaction event detail request can comprise transmitting a transaction event sequence request for the sequence of events; and receiving the transaction event data can comprise receiving a set of transaction event data corresponding to a plurality of events. In some embodiments, the acts further include comparing the set of transaction event data corresponding to the plurality of events with the sequence of count values to determine: that the plurality of events are a complete set of the sequence of events; or that the plurality of events set are an incomplete set of the sequence of events.
The series of acts 4900 includes an act 4902 of identifying a request for a transaction to transfer a digital asset. For example, the act 4902 involves identifying a request for a transaction to transfer a digital asset via a distributed digital ledger transaction network from a first user account to a second user account on a state data structure. In one or more embodiments, the digital asset comprises a digital currency maintained within the state data structure of the distributed digital ledger transaction network.
The series of acts 4900 also includes an act 4904 of determining a linear data type of the digital asset. For example, the act 4904 involves determining a linear data type of the digital asset within the request for the transaction.
Further, the series of acts 4900 includes an act 4906 of executing the transaction subject to linear typing rules. For example, the act 4906 involves executing the transaction utilizing the linear data type by transferring the digital asset from the first user account to the second user account on the state data structure subject to linear typing rules corresponding to the linear data type. In one or more embodiments, the linear typing rules are part of a programming language that is utilized to control modification of the state data structure of the distributed digital ledger transaction network. In some embodiments, the linear data type of the digital asset is divisible and mergeable pursuant to the programming language and the linear typing rules.
In some embodiments, the linear typing rules comprises a first linear typing rule to utilize the linear data type exactly once in the transaction. In further embodiments, the linear typing rules comprises a second linear typing rule against duplicating the linear data type.
To illustrate executing transactions subject to the linear typing rules corresponding to a linear data type, in one or more embodiments, the series of acts 4900 include additional acts, such as acts for identifying an additional request for an additional transaction to transfer an additional digital asset represented by the linear data type via the distributed digital ledger transaction network; determining the additional request for the additional transaction utilizes the additional digital asset represented by the linear data type more than once; and rejecting the additional request for the additional transaction based on determining that the linear data type of the additional request for the additional transaction violates the first linear typing rule from the linear typing rules. In some embodiments, the additional acts include identifying an additional request for an additional transaction to transfer an additional digital asset via the distributed digital ledger transaction network from the first user account, wherein the additional request for the additional transaction fails to identify a recipient user account; and rejecting the additional request for the additional transaction as a violation of the first linear typing rule from the linear typing rules.
In one or more embodiments, the ledger transaction system 106 performs a series of acts for applying configurable storage deletion rules. For example, the series of acts can include acts of generating an authenticated data structure of a distributed digital ledger transaction network, wherein the authenticated data structure comprises a data tree comprising nodes mapped to entries in a database; determining a configurable data structure deletion rule corresponding to the computing device; and deleting a portion of the authenticated data structure based on the configurable data structure deletion rule corresponding to the computing device. The series of acts can further include acts of providing options to modify the data structure deletion rules (including options for deleting data corresponding to particular events, times, accounts or transactions); deleting child nodes based on a determination that nodes in a sub-tree are full; generating an authenticated data structure that represents multiple states and deleting portions of the authenticated data structure that represents one of the states; and/or deleting data based on one or more characteristics of the computing device (e.g., whether the device is a validator node or full node).
In some embodiments, the ledger transaction system 106 performs a series of acts for tracking multiple writes in memory. For example, the series of acts can include acts of committing an authenticated state data structure of a distributed digital ledger transaction network to memory, wherein the state data structure comprises a state tree corresponding to a plurality of user accounts of the distributed digital ledger transaction network; identifying a transaction block comprising transactions associated with user accounts of the plurality of user accounts; generating a scratch pad data structure comprising a state data component reflecting modifications to the authenticated state data structure based on the transaction block; and upon obtaining an indication of consensus via the distributed digital ledger transaction network, committing a modified state data structure to memory based on the state data component. The series of acts can further include acts of clarifying that the state data component reflects only a subset of nodes corresponding to a subset of user accounts but includes pointers to the unchanged nodes of the authenticated data structure; identifying additional transactions (e.g., a second transaction and a third transaction); generating the scratch pad data structure to include additional state data components reflecting the additional transactions (e.g., the second transaction and the third transaction) prior to committing to memory; obtaining consensus on some but not all of the transactions stored in the scratch pad; and/or committing only the transactions that achieve consensus to memory.
In one or more embodiments, the ledger transaction system 106 performs a series of acts for separating and storing smart contract code and smart contract data. For example, the series of acts can include acts of identifying a transaction script for modifying a resource stored within a user account of an authenticated data structure of a distributed digital ledger transaction network, wherein: the transaction script comprises a resource identifier, and the resource identifier reflects the resource, a module utilized to generate the resource, and a particular user account storing the module; and based on the resource identifier, executing the transcript script by modifying the resource in accordance with procedures defined by the module. The series of acts can further include acts of clarifying that the module comprises bytecode declaring resource and procedures; clarifying that the resource comprises a data value (e.g., a record that binds named fields to values); storing multiple modules at the same user account; and/or storing multiple different resource types at the same user account. In some embodiments, the module is stored in the same user account as the resource. In further embodiments, the module is stored in a different user account than the user account storing the resource.
In some embodiments, the ledger transaction system 106 performs a series of acts for utilizing resources to delegate account permissions. For example, the series of acts can include acts of generating a permission resource stored within a first user account of an authenticated data structure of a distributed digital ledger transaction network, wherein the permission resource indicates one or more permissions to modify the first user account; executing a first transaction transferring the permissions resource to a second user account of the authenticated data structure; and executing a second transaction initiated by the second user account to modify the first user account based on the second user account having the permissions resource. The series of acts can further include acts of rejecting a transaction from the first user account (for no longer having the permissions resource). In one or more embodiments, the one or more permissions comprises a permission to withdraw digital assets from the user account. In some embodiments, the second user account comprises a cold wallet. In further embodiments, transferring the permissions resource moves the permissions resource to the second user account such that the first user account no longer comprises the permissions resource.
Additionally, in some embodiments, the ledger transaction system 106 performs a series of acts for decoupling account addresses from cryptographic keys (i.e., implementing key rotation features). For example, the series of acts can include acts of generating an authentication key corresponding to a user account of an authenticated data structure of a distributed digital ledger transaction network; identifying a transaction for modifying the authentication key; and upon authenticating the transaction utilizing the authentication key, executing the transaction by generating a new authentication key for the user account. The series of acts can further include acts of utilizing the new authentication key in a second transaction for the first user account; clarifying that the system generates the new authentication key without modifying an address of the user account within the authenticated data structure; and/or modifying the new authentication key to an additional authentication key based on an additional transaction.
Further, in one or more embodiments, the ledger transaction system 106 performs a series of acts for utilizing transaction scripts and interacting with modules and resources. For example, the series of acts can include acts of identifying a transaction comprising a transaction script for modifying a resource stored within a user account of an authenticated data structure of a distributed digital ledger transaction network, wherein: the resource is defined by a module, and the transaction script comprises a call to a procedure defined by the module to modify the resource; and executing the transcript script by modifying the resource in accordance with the procedure defined by the module. The series of acts can further include acts of clarifying modules (data code) and resources (data values); providing example procedures defined by the module, such as withdrawal or deposit procedures; and/or rejecting transactions that seek to modify the resource in a manner that fails to satisfy the procedures defined by the module.
In one or more embodiments, the ledger transaction system 106 performs a series of acts for utilizing smart contracts for performing tasks surrounding the execution of transactions. For example, the series of acts can include acts of defining a transaction execution procedure via a smart contract stored on an authenticated data structure of a distributed digital ledger transaction network; executing a transaction modifying the execution procedure of the smart contract to a new execution procedure; and executing a second transaction in accordance with the new execution procedure. The series of acts can further include acts of clarifying that the transaction execution procedure can include a procedure for validating transactions, deducting gas payments, incrementing sequence numbers, or distributing gas payments; identifying cryptographic keys associated with a subset of devices (e.g., authenticator devices) authorized to modify the transaction execution procedure; and/or executing the transaction modifying the smart contract based on the cryptographic keys.
In some embodiments, the ledger transaction system 106 performs a series of acts for implementing digital asset custody features. For example, the series of acts can include acts of generating access limits of a user account within an authenticated data structure of a distributed digital ledger transaction network, the access limits comprising an access key limit or a threshold number of access keys to access the account; identifying a transaction comprising one or more access keys; and executing the transaction based on determining that the one or more access keys satisfy the access key limit or the threshold number of access keys. The series of acts can further include acts of clarifying that the threshold number of access keys comprises a percentage or number of access keys from a group of access keys; clarifying that the access key limit comprises a value key limit that reflects a threshold value of digital assets accessible by utilizing a corresponding key; clarifying that the access key limit comprises a rate key limit that reflects a threshold value of digital assets accessible within a time period; and/or defining and utilizing sub-keys.
Additionally, in some embodiments, the ledger transaction system 106 performs a series of acts for performing consensus on execution results. For example, the series of acts can include acts of identifying, via a distributed digital ledger transaction network, a transaction block comprising a plurality of transactions; executing the transaction block relative to a state data structure to generate an execution result; and upon determining that a plurality of votes on the execution result from a plurality of validator nodes satisfies a consensus threshold, committing the execution results to storage via a modified state data structure.
Further, in one or more embodiments, the ledger transaction system 106 performs a series of acts for implementing pipelined consensus. For example, the series of acts can include acts of generating a first authenticated data structure for a first state of a distributed digital ledger transaction network upon execution of a first block of transactions; generating a second authenticated data structure for a second state contiguous to the first state upon execution of a second block of transactions; generating a third authenticated data structure for a third state contiguous to the second state upon execution of a third block of transactions; and in response to obtaining consensus on the first authenticated data structure, the second authenticated data structure, and the third authenticated data structure via the distributed digital ledger transaction network, committing the first authenticated data structure to memory.
In some embodiments, the ledger transaction system 106 performs a series of acts for providing safety upon a system restart. For example, the series of acts can include acts of generating a consensus state, at a validator node of a distributed digital ledger transaction network, the consensus state comprising last voted round data and preferred block round data; storing a consensus restart rule at the validator node; and in response to detecting a restart at the validator node, loading the consensus state in accordance with the consensus restart rule.
Additionally, in one or more embodiments, the ledger transaction system 106 performs a series of acts for managing epochs of voting rights. For example, the series of acts can include acts of obtaining consensus corresponding to a first transaction based on votes from a first set of validator nodes of a distributed digital ledger transaction network; identifying a second transaction referencing a module defining parameters for modifying validator nodes; and modifying the first set of validator nodes to a new set of validator nodes of the distributed digital ledger transaction network by executing the second transaction according to the parameters defined by the module, and obtaining consensus on the second transaction based on additional votes from the first set of validator nodes. The series of acts can further include acts of checking to ensure that an epoch defined by the module has passed before modifying the first set of validator nodes; holding digital assets from the first set of validator nodes during the epoch; holding the digital assets from the first set of validator nodes during the epoch and an additional cooling off period; identifying the second set of validator nodes based on votes from computing devices corresponding to user accounts of the distributed digital ledger transaction network; obtaining consensus corresponding to a third (later) transaction based on votes from the second set of validator nodes; and/or modifying one or more additional consensus parameters via an additional transaction. In one or more embodiments, the cooling off period comprises an additional epoch. In some embodiments, the number of votes for selecting the second set of validator nodes is based on digital assets maintained by each user account.
In some embodiments, the ledger transaction system 106 performs a series of acts for utilizing parallel synchronization. For example, the series of acts can include acts of accessing a plurality of state data structures and a plurality of transaction data structures corresponding to a distributed digital ledger transaction network, wherein the plurality of data structures reflect periodic states of the distributed digital ledger transaction network, and the transaction data structures reflect transactions between the period states; and building a historical representation of the distributed digital ledger transaction network by utilizing a plurality of computing devices to analyze the plurality of state data structures and the plurality of transaction data structures in parallel.
In further embodiments, the ledger transaction system 106 performs a series of acts for utilizing incremental verification. For example, the series of acts can include acts of downloading, at a computer node of a distributed digital ledger transaction network, a first portion of an authenticated data structure and a first proof corresponding to the first portion; downloading a second portion of the authenticated data structure and a second proof corresponding to the second portion; and upon verifying the first portion and the second portion based on the first proof and the second proof, generating, at the computer node, the authenticated data structure based on the first portion and the second portion.
In one or more embodiments, the ledger transaction system 106 performs a series of acts for utilizing waypoints to facilitate synchronization. For example, the series of acts can include acts of identifying a proposed data structure of a distributed digital ledger transaction network; determining a waypoint indicating an authenticated data structure of the distributed digital ledger transaction network; and verifying the proposed data structure by comparing the proposed data structure and the waypoint. The series of acts can also include acts of determining that a computer node coming online to the distributed digital ledger transaction network, and wherein verifying the proposed data structure comprises synchronizing the computer node to the current state of the distributed digital ledger transaction network; and/or identifying a second (e.g., invalid) proposed data structure and rejecting the second proposed data structure based on the waypoint. In some embodiments, the waypoint comprises a version reference and a root value of the proposed data structure. In further embodiments, the proposed data structure reflects one or more transactions that violate transaction procedures and further comprising committing the proposed data structure to memory based on the waypoint. In some embodiments, the proposed data structure reflects a genesis block of transactions.
Further, in one or more embodiments, the ledger transaction system 106 performs a series of acts for utilizing static and dynamic analysis to determine reference safety. For example, the series of acts can include acts of identifying a transaction comprising a transaction script for modifying a user account of a tree data structure of a distributed digital ledger transaction network; analyzing the transaction script at the bytecode level to verify reference safety with respect to the tree data structure; and executing the transaction script at the bytecode level to modify the user account of the tree data structure. In one or more embodiments, the transaction script is written using source code or an intermediate representation; and compiling the transaction script into bytecode before analyzing the transaction script to verify reference safety. In some embodiments, the transaction script invokes one or more modules stored at one or more user accounts of the tree data structure. In further embodiments, analyzing the transaction script comprises analyzing a sequence of bytecode operations defined by the one or more modules stored at the one or more user accounts of the tree data structure.
Embodiments of the present disclosure may comprise or utilize a special purpose or general-purpose computer including computer hardware, such as, for example, one or more processors and system memory, as discussed in greater detail below. Embodiments within the scope of the present disclosure also include physical and other computer-readable media for carrying or storing computer-executable instructions and/or data structures. In particular, one or more of the processes described herein may be implemented at least in part as instructions embodied in a non-transitory computer-readable medium and executable by one or more computing devices (e.g., any of the media content access devices described herein). In general, a processor (e.g., a microprocessor) receives instructions, from a non-transitory computer-readable medium, (e.g., a memory, etc.), and executes those instructions, thereby performing one or more processes, including one or more of the processes described herein.
Computer-readable media can be any available media that can be accessed by a general purpose or special purpose computer system. Computer-readable media that store computer-executable instructions are non-transitory computer-readable storage media (devices). Computer-readable media that carry computer-executable instructions are transmission media. Thus, by way of example, and not limitation, embodiments of the disclosure can comprise at least two distinctly different kinds of computer-readable media: non-transitory computer-readable storage media (devices) and transmission media.
Non-transitory computer-readable storage media (devices) includes RAM, ROM, EEPROM, CD-ROM, solid state drives (“SSDs”) (e.g., based on RAM), Flash memory, phase-change memory (“PCM”), other types of memory, other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store desired program code means in the form of computer-executable instructions or data structures and which can be accessed by a general purpose or special purpose computer.
A “network” is defined as one or more data links that enable the transport of electronic data between computer systems and/or modules and/or other electronic devices. When information is transferred or provided over a network or another communications connection (either hardwired, wireless, or a combination of hardwired or wireless) to a computer, the computer properly views the connection as a transmission medium. Transmissions media can include a network and/or data links which can be used to carry desired program code means in the form of computer-executable instructions or data structures and which can be accessed by a general purpose or special purpose computer. Combinations of the above should also be included within the scope of computer-readable media.
Further, upon reaching various computer system components, program code means in the form of computer-executable instructions or data structures can be transferred automatically from transmission media to non-transitory computer-readable storage media (devices) (or vice versa). For example, computer-executable instructions or data structures received over a network or data link can be buffered in RAM within a network interface module (e.g., a “NIC”), and then eventually transferred to computer system RAM and/or to less volatile computer storage media (devices) at a computer system. Thus, it should be understood that non-transitory computer-readable storage media (devices) can be included in computer system components that also (or even primarily) utilize transmission media.
Computer-executable instructions comprise, for example, instructions and data which, when executed by a processor, cause a general-purpose computer, special purpose computer, or special purpose processing device to perform a certain function or group of functions. In some embodiments, computer-executable instructions are executed on a general-purpose computer to turn the general-purpose computer into a special purpose computer implementing elements of the disclosure. The computer executable instructions may be, for example, binaries, intermediate format instructions such as assembly language, or even source code. Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the described features or acts described above. Rather, the described features and acts are disclosed as example forms of implementing the claims.
Those skilled in the art will appreciate that the disclosure may be practiced in network computing environments with many types of computer system configurations, including, personal computers, desktop computers, laptop computers, message processors, hand-held devices, multiprocessor systems, microprocessor-based or programmable consumer electronics, network PCs, minicomputers, mainframe computers, mobile telephones, PDAs, tablets, pagers, routers, switches, and the like. The disclosure may also be practiced in distributed system environments where local and remote computer systems, which are linked (either by hardwired data links, wireless data links, or by a combination of hardwired and wireless data links) through a network, both perform tasks. In a distributed system environment, program modules may be located in both local and remote memory storage devices.
Embodiments of the present disclosure can also be implemented in cloud computing environments. In this description, “cloud computing” is defined as a model for enabling on-demand network access to a shared pool of configurable computing resources. For example, cloud computing can be employed in the marketplace to offer ubiquitous and convenient on-demand access to the shared pool of configurable computing resources. The shared pool of configurable computing resources can be rapidly provisioned via virtualization and released with low management effort or service provider interaction, and then scaled accordingly.
A cloud-computing model can be composed of various characteristics such as, for example, on-demand self-service, broad network access, resource pooling, rapid elasticity, measured service, and so forth. A cloud-computing model can also expose various service models, such as, for example, Software as a Service (“SaaS”), Platform as a Service (“PaaS”), and Infrastructure as a Service (“IaaS”). A cloud-computing model can also be deployed using different deployment models such as private cloud, community cloud, public cloud, hybrid cloud, and so forth. In this description and in the claims, a “cloud-computing environment” is an environment in which cloud computing is employed.
As shown in
In particular embodiments, the processor(s) 5002 includes hardware for executing instructions, such as those making up a computer program. As an example, and not by way of limitation, to execute instructions, the processor(s) 5002 may retrieve (or fetch) the instructions from an internal register, an internal cache, memory 5004, or a storage device 5006 and decode and execute them.
The computing device 5000 includes memory 5004, which is coupled to the processor(s) 5002. The memory 5004 may be used for storing data, metadata, and programs for execution by the processor(s). The memory 5004 may include one or more of volatile and non-volatile memories, such as Random-Access Memory (“RAM”), Read-Only Memory (“ROM”), a solid-state disk (“SSD”), Flash, Phase Change Memory (“PCM”), or other types of data storage. The memory 5004 may be internal or distributed memory.
The computing device 5000 includes a storage device 5006 including storage for storing data or instructions. As an example, and not by way of limitation, the storage device 5006 can include a non-transitory storage medium described above. The storage device 5006 may include a hard disk drive (HDD), flash memory, a Universal Serial Bus (USB) drive or a combination these or other storage devices.
As shown, the computing device 5000 includes one or more I/O interfaces 5008, which are provided to allow a user to provide input to (such as user strokes), receive output from, and otherwise transfer data to and from the computing device 5000. These I/O interfaces 5008 may include a mouse, keypad or a keyboard, a touch screen, camera, optical scanner, network interface, modem, other known I/O devices or a combination of such I/O interfaces 5008. The touch screen may be activated with a stylus or a finger.
The I/O interfaces 5008 may include one or more devices for presenting output to a user, including, but not limited to, a graphics engine, a display (e.g., a display screen), one or more output drivers (e.g., display drivers), one or more audio speakers, and one or more audio drivers. In certain embodiments, I/O interfaces 5008 are configured to provide graphical data to a display for presentation to a user. The graphical data may be representative of one or more graphical user interfaces and/or any other graphical content as may serve a particular implementation.
The computing device 5000 can further include a communication interface 5010. The communication interface 5010 can include hardware, software, or both. The communication interface 5010 provides one or more interfaces for communication (such as, for example, packet-based communication) between the computing device and one or more other computing devices or one or more networks. As an example, and not by way of limitation, communication interface 5010 may include a network interface controller (NIC) or network adapter for communicating with an Ethernet or other wire-based network or a wireless NIC (WNIC) or wireless adapter for communicating with a wireless network, such as a WI-FI. The computing device 5000 can further include a bus 5012. The bus 5012 can include hardware, software, or both that connects components of computing device 5000 to each other.
In the foregoing specification, the invention has been described with reference to specific example embodiments thereof. Various embodiments and aspects of the invention(s) are described with reference to details discussed herein, and the accompanying drawings illustrate the various embodiments. The description above and drawings are illustrative of the invention and are not to be construed as limiting the invention. Numerous specific details are described to provide a thorough understanding of various embodiments of the present invention.
The present invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described embodiments are to be considered in all respects only as illustrative and not restrictive. For example, the methods described herein may be performed with less or more steps/acts or the steps/acts may be performed in differing orders. Additionally, the steps/acts described herein may be repeated or performed in parallel to one another or in parallel to different instances of the same or similar steps/acts. The scope of the invention is, therefore, indicated by the appended claims rather than by the foregoing description. All changes that come within the meaning and range of equivalency of the claims are to be embraced within their scope.
Claims
1. A method comprising:
- generating an authenticated data structure of a distributed digital ledger transaction network, the authenticated data structure comprising a data tree storing data within a plurality of nodes;
- determining a first configurable storage management rule for a computer node of the distributed digital ledger transaction network that is different than a second configurable storage management rule for at least one other computer node of the distributed digital ledger transaction network; and
- maintaining the authenticated data structure at the computer node based on the first configuration storage management rule.
2. The method of claim 1, wherein:
- determining the first configurable storage management rule for the computer node comprises determining a data storage deletion rule for deleting completed subtrees of the data tree; and
- maintaining the authenticated data structure at the computer node based on the first configuration storage management rule comprises: determining that a subtree of the data tree is complete, the subtree comprising a subtree root node and a plurality of child nodes; and deleting the plurality of child nodes of the subtree based on the data storage deletion rule.
3. The method of claim 2, wherein:
- the authenticated data structure further comprises a database, and nodes of the data tree are mapped to entries in the database; and
- maintaining the authenticated data structure at the computer node based on the first configuration storage management rule comprises deleting a plurality of entries in the database that correspond to the plurality of child nodes of the subtree based on the data storage deletion rule.
4. The method of claim 2, wherein generating the authenticated data structure comprising the data tree comprises generating a transaction data structure comprising a transaction tree that includes nodes storing data representative of transactions executed across the distributed digital ledger transaction network.
5. The method of claim 1, wherein
- generating the authenticated data structure comprising the data tree comprises generating a state data structure comprising a state tree that includes nodes storing data representative of user accounts of the distributed digital ledger transaction network; and
- maintaining the authenticated data structure at the computer node based on the first configuration storage management rule comprises: determining a change in state of the distributed digital ledger transaction network; and overwriting the state tree of the state data structure with a subsequent state tree based on determining the change in state.
6. The method of claim 1, wherein:
- generating the authenticated data structure comprising the data tree comprises generating a state data structure comprising a state tree that includes nodes storing data representative of user accounts of the distributed digital ledger transaction network; and
- maintaining the authenticated data structure at the computer node based on the first configuration storage management rule comprises: determining a change in state of the distributed digital ledger transaction network that corresponds to changes to one or more user accounts of the distributed digital ledger transaction network; generating a state tree component comprising one or more nodes that reflect the changes to the one or more user accounts based on the change in state; and associating the one or more nodes of the state tree component with one or more nodes of the state tree.
7. The method of claim 6, wherein associating the one or more nodes of the state tree component with the one or more nodes of the state tree comprises associating the one or more nodes of the state tree component to the one or more nodes of the state tree that correspond to user accounts that remain unchanged after the change in state.
8. The method of claim 7, maintaining the authenticated data structure at the computer node based on the first configuration storage management rule further comprises deleting at least one node of the state tree that corresponds to a user account that changed with the change in state.
9. The method of claim 1, wherein determining the first configurable storage management rule for the computer node comprises determining the first configurable storage management rule based on at least one of a role of the computer node within the distributed digital ledger transaction network, one or more user preferences received via the computer node, or storage capabilities of the computer node.
10. The method of claim 1, further comprising:
- determining a third configurable storage management rule for the computer node of the distributed digital ledger transaction network that is different than the first configurable storage management rule and the second configurable storage management based on a change in user preferences for the computer node or a change in storage capacity of the computer node; and
- maintaining the authenticated data structure at the computer node based on the third configuration storage management rule.
11. A non-transitory computer-readable medium storing instructions thereon that, when executed by at least one processor, cause a computing device to:
- generate an authenticated data structure of a distributed digital ledger transaction network, the authenticated data structure comprising a data tree storing data within a plurality of nodes;
- determine a first configurable storage management rule for a computer node of the distributed digital ledger transaction network that is different than a second configurable storage management rule for at least one other computer node of the distributed digital ledger transaction network; and
- maintain the authenticated data structure at the computer node based on the first configuration storage management rule.
12. The non-transitory computer-readable medium of claim 11, further comprising instructions that, when executed by the at least one processor, cause the computing device to:
- determine the first configurable storage management rule for the computer node by determining a data storage deletion rule for deleting completed subtrees of the data tree; and
- maintain the authenticated data structure at the computer node based on the first configuration storage management rule by: determining that a subtree of the data tree is complete, the subtree comprising a subtree root node and a plurality of child nodes; and deleting the plurality of child nodes of the subtree based on the data storage deletion rule.
13. The non-transitory computer-readable medium of claim 12,
- wherein the authenticated data structure further comprises a database, and nodes of the data tree are mapped to entries in the database; and
- further comprising instructions that, when executed by the at least one processor, cause the computing device to maintain the authenticated data structure at the computer node based on the first configuration storage management rule by deleting a plurality of entries in the database that correspond to the plurality of child nodes of the subtree based on the data storage deletion rule.
14. The non-transitory computer-readable medium of claim 11, further comprising instructions that, when executed by the at least one processor, cause the computing device to:
- generate the authenticated data structure comprising the data tree by generating a state data structure comprising a state tree that includes nodes storing data representative of user accounts of the distributed digital ledger transaction network; and
- maintain the authenticated data structure at the computer node based on the first configuration storage management rule by: determining a change in state of the distributed digital ledger transaction network; and overwriting the state tree of the state data structure with a subsequent state tree based on determining the change in state.
15. The non-transitory computer-readable medium of claim 11, further comprising instructions that, when executed by the at least one processor, cause the computing device to:
- generate the authenticated data structure comprising the data tree by generating a state data structure comprising a state tree that includes nodes storing data representative of user accounts of the distributed digital ledger transaction network; and
- maintain the authenticated data structure at the computer node based on the first configuration storage management rule by: determining a change in state of the distributed digital ledger transaction network that corresponds to changes to one or more user accounts of the distributed digital ledger transaction network; generating a state tree component comprising one or more nodes that reflect the changes to the one or more user accounts based on the change in state; and associating the one or more nodes of the state tree component with one or more nodes of the state tree.
16. The non-transitory computer-readable medium of claim 11, wherein associating the one or more nodes of the state tree component with the one or more nodes of the state tree comprises associating the one or more nodes of the state tree component to the one or more nodes of the state tree that correspond to user accounts that remain unchanged after the change in state.
17. A system comprising:
- at least one processor; and
- at least one non-transitory computer-readable medium storing instructions thereon that, when executed by the at least one processor, cause the system to: generate an authenticated data structure of a distributed digital ledger transaction network, the authenticated data structure comprising a data tree storing data within a plurality of nodes; determine a first configurable storage management rule for a computer node of the distributed digital ledger transaction network that is different than a second configurable storage management rule for at least one other computer node of the distributed digital ledger transaction network; and maintain the authenticated data structure at the computer node based on the first configuration storage management rule.
18. The system of claim 17, further comprising instructions that, when executed by the at least one processor, cause the system to:
- determine the first configurable storage management rule for the computer node by determining a data storage deletion rule for deleting completed subtrees of the data tree; and
- maintain the authenticated data structure at the computer node based on the first configuration storage management rule by: determining that a subtree of the data tree is complete, the subtree comprising a subtree root node and a plurality of child nodes; and deleting the plurality of child nodes of the subtree based on the data storage deletion rule.
19. The system of claim 18,
- wherein the authenticated data structure further comprises a database, and nodes of the data tree are mapped to entries in the database; and
- further comprising instructions that, when executed by the at least one processor, cause the system to maintain the authenticated data structure at the computer node based on the first configuration storage management rule by deleting a plurality of entries in the database that correspond to the plurality of child nodes of the subtree based on the data storage deletion rule.
20. The system of claim 17, further comprising instructions that, when executed by the at least one processor, cause the system to:
- generate the authenticated data structure comprising the data tree by generating a state data structure comprising a state tree that includes nodes storing data representative of user accounts of the distributed digital ledger transaction network; and
- maintain the authenticated data structure at the computer node based on the first configuration storage management rule by: determining a change in state of the distributed digital ledger transaction network; and overwriting the state tree of the state data structure with a subsequent state tree based on determining the change in state.
Type: Application
Filed: Apr 28, 2021
Publication Date: Aug 12, 2021
Inventors: Benjamin D. Maurer (San Francisco, CA), Qinfan Wu (San Bruno, CA)
Application Number: 17/242,891