Taking The Graph and Pocket Network as examples, how does decentralized data computation infrastructure work?
Source: The Block Annual Research Report
Compiled by: Ice River Web3 Lab
The future of Web3 will rely on a distributed, secure, and immutable data layer that spans multiple blockchains. However, Web3 faces three key challenges:
1) How to effectively transfer data from the blockchain to applications;
2) How to conveniently access data across multiple blockchains;
3) How to do A and B in a decentralized manner.
In a decentralized web architecture, a reliable node infrastructure is crucial for decentralized computing. A decentralized computing network can be divided into three general components:
1. Applications. These are any software that submits API requests (e.g., queries, relays) that will be routed to any public or encrypted database nodes.
2. Nodes. These are distributed servers that provide functionalities such as storing database indexes, sending session information to applications, servicing API requests submitted by applications, and storing account balances and work reports.
3. Network Layer. The ecosystem that maintains the decentralized protocol, including governance, protocol rules, involved participants, and the economic games they participate in.
As shown in the figure below, relay or index nodes sit between applications and blockchain nodes (or other decentralized server networks), retrieving data from them. After processing the data from blockchain nodes, they send the relevant information to centralized or decentralized application servers.
Next, we will explain how decentralized computing infrastructure works through two case studies: The Graph and Pocket Network.
The Graph: Decentralized Indexing and Querying
Web3 applications can query data from the blockchain by filtering or searching. Since blockchains store data and process state transitions, this process can be slow and computationally intensive, but they do not index the data. Indexing makes it faster to find relevant data and reduces computational requirements.
Before The Graph emerged, dapp developers would build their own database indexes for their users and clients. However, this practice stored indexed data in centralized databases (rather than distributed nodes), reducing the credibility of the dapp.
For many teams, building their own indexing servers is also redundant. In The Graph, subgraphs show what data to store and how to store it. Although the project's subgraphs are typically defined by project developers, anyone can freely define these subgraphs.
Next, Graph nodes store that data in database indexes (creating service subgraphs), continuously scanning for event changes on relevant blockchains (e.g., Ethereum blockchain) and updating the data accordingly.
Then, applications can access cross-chain data indexes through the endpoints generated by GraphQL queries, potentially accessing data via a unified query language. Index nodes were initially owned and operated by The Graph, but earlier this year, ten projects began migrating from hosted services to The Graph's decentralized mainnet.
Ultimately, The Graph aims to realize its vision of a fully decentralized data economy. In this economic model, the Graph protocol will define rules that anyone can use to run or query a Graph node.
While providing service guarantees, how does The Graph decentralize its anonymous suppliers? It all comes down to the network layer. The Graph has a network structure similar to other decentralized computing solutions, with the following four characteristics:
Supply (data providers) and demand (applications, users) meet in an open market.
Suppliers participate in an economic game designed to ensure service guarantees (staking tokens).
Supplier performance is checked by some mechanism (through cryptographic proofs or "fishermen" checking the quality of their work and being rewarded for correctly reporting misconduct).
If suppliers are found to have failed in their duties, they will face some degree of penalty (losing part of the tokens they hold or not being selected to participate in revenue-generating services).
Graph utilizes a work token model, in which Graph node providers receive GRT for indexing data defined by subgraph listings. This model introduces economic incentives for service quality, as indexers may lose job opportunities or be penalized (lose tokens) for providing incorrect data.
The Graph's network layer or "query market" includes four main participants. The token incentive mechanisms for these participants are designed to ensure high-quality service and provide token utility.
Developers. These entities define subgraphs. Currently, they are usually the developers of a given protocol, creating subgraphs for the data of that protocol. However, theoretically, anyone can create subgraphs for data from public blockchains. Currently, developers need to pay for user requests.
Ultimately, The Graph envisions that when layer two solutions are widely implemented in Web3 wallets, end users will pay for their own queries.
Indexers. These entities earn GRT from work provided by The Graph network. Their work includes indexing blockchain data on each subgraph listing's Graph node. Indexer income (as well as delegator income) comes from rewards for indexing work. The collective query fees of the protocol are distributed to indexers (and delegators) in proportion to GRT, and they also receive indexing rewards from 3% annual inflation of GRT.
Curators. These entities indicate which subgraphs display better quality, so indexers know which subgraph nodes need indexing. Any developer can launch subgraphs using decentralized blockchain data, so The Graph network needs these participants to identify useful contributors.
Curators signal to indexers by marking GRT behind specific subgraphs. For their services, they earn a portion of the query fees generated from the subgraphs they signal. This share is determined by a bonding curve that rewards based on the early signaling time of curators, creating a prediction market where curators can guess the future popularity of subgraphs.
Delegators. These entities delegate GRT to indexers and share the indexing rewards and query fees earned by indexers, which are set by indexers. The interests of delegators are limited by the GRT interests of the indexers. This creates incentives for both parties.
Delegators earn more by delegating to the "best" indexers (those indexing the most important subgraphs as determined by curators). Indexers earn more by "winning" the funds of delegators, incentivizing indexers to fairly share their earnings with delegators.
Currently, there are 7,306 representatives, 2,266 curators, and 160 indexers in The Graph network. The Graph is an example of how the network layer can successfully operate a decentralized computing network without a centralized entity in charge. It demonstrates a working decentralized solution that brings data from the blockchain to applications and conveniently accesses data across multiple blockchains through a unified query language.
Pocket: Solving the Node Incentive Problem
Like The Graph, Pocket also has applications, nodes, and a network layer. Perhaps the main difference is that Pocket focuses on solving a specific problem that limits the growth potential of Web3: the node incentive problem.
On the other hand, The Graph compares itself to a "Google in Web3," aiming to organize blockchain information worldwide to make it universally accessible and useful. For decentralized networks to thrive, a reliable node infrastructure is necessary. However, it is unrealistic for developers to both host their own full nodes and provide backend support for their applications.
As a result, Web3 developers heavily rely on centralized solutions, leading to centralization risks such as single points of failure, security risks, and privacy invasions. Currently, there is a lack of reliable node infrastructure run by third parties.
One reason for the lack of full nodes run by individuals and companies is the absence of native relay node incentives (other reasons include the complexity and inconvenience of setup). To address this issue, Pocket Network encourages individuals and companies to deploy and run full nodes for any blockchain with application needs.
Through a combination of token incentives, cryptographic proofs, and pseudo-random selection algorithms, Pocket can create a reliable decentralized relay network where developers can access cross-chain data with higher security and lower costs.
Again, the question arises: how does Pocket provide service guarantees through a decentralized network of service providers that we do not know? Trust is reestablished through the decentralized network layer, although the rules and incentive schemes differ from those of The Graph.
The main difference with Pocket is that it uses a session model, which does not rely on nodes that store indexed data like those in The Graph network. Pocket nodes have three functions: providing session information to the applications that contact them, servicing relay requests sent by applications, and storing information about the state of the Pocket network to allocate work and verify work reports.
Sessions are the mechanism the network uses to regulate interactions between applications and nodes. They are a data structure that uses data about the state of the Pocket network stored in nodes to pseudo-randomly pair applications with a set of up to five nodes in each chain to provide services paid for by the applications.
The two key roles in the Pocket network are applications and relay nodes, which are also validators and block producers of the Pocket blockchain (a Tendermint-based database that ensures consensus about infrastructure supply between applications and nodes).
Nodes are rewarded based on the number of requests they service during a session. Each relay (e.g., a MetaMask call to get balance, fetch transaction history, send transactions, query smart contracts) is serviced by nodes and verified by the protocol, generating 0.01 POKT. The rewards for each verified relay will be split as follows:
1) 89% to service nodes
2) 10% to Pocket DAO
3) 1% to block producers
Ultimately, Pocket Network will address the same core issues as The Graph: how to efficiently bring blockchain data into applications, conveniently access cross-chain data, and decentralize these processes. However, the scope differs, with Pocket focusing more on becoming a unified cross-chain API through node incentives, while The Graph focuses on becoming a unified search engine for blockchain data.
In centralized blockchain infrastructure technology, all we need to access blockchain data is to connect to a blockchain node. These nodes can be distributed across decentralized networks of individuals and companies, like The Graph and Pocket Network, or owned and operated by central entities (like Infura and Alchemy). To illustrate the differences, see the chart below.
For blockchain data, the main difference between centralized and decentralized portals is that companies are responsible for maintaining the operation of nodes------all their operations can be grouped into a "corporate layer." In addition to providing access to complete archival node data, participants in the corporate layer can also decide to set up database indexes to facilitate queries involving filtering or searching.
Like any centralized computing network, this setup has certain benefits and costs. On the benefits side, centralized solutions can make data networks easier to implement, develop, and maintain. For example, over the years, Alchemy and Infura have been able to develop and release various tools to facilitate prototyping and development.
However, this brings various forms of security risks and single points of failure. For instance, Infura's Ethereum infrastructure experienced a major outage last year, causing delays in ETH and ERC-20 token price feeds for popular services, including MetaMask. It also led to major crypto exchanges, including Binance and Bithumb, temporarily disabling ETH and ERC-20 token withdrawals.
Infura stated that the root cause could be traced back to several components in its Ethereum infrastructure that were locked into an old version of the Geth client. Post-analysis sparked debates about Ethereum's decentralization and the over-reliance on centralized blockchain infrastructure providers.
That said, we note that Infura and Alchemy do not own or control the underlying blockchain data but act as centralized portals for decentralized data.
If needed, we can use another centralized or decentralized infrastructure provider to access the same data. Alternatively, we can build our own full nodes to serve ourselves. One can make a comparison with internet service providers------if Comcast goes down, we can switch to another internet service provider to access the internet.
Discussion
Based on the pros and cons involved, centralized and decentralized infrastructure solutions may play different roles in the next iteration of Web3. For example, if a certain part of a project requires advanced prototyping and development tools. In this case, centralized solutions like Alchemy or Infura may be well-suited for those parts.
If other parts of the project pursue trustlessness and security, then decentralized solutions like The Graph or Pocket Network may be well-suited for those parts. The prospect is a new web, much of which is based on distributed, secure, and immutable blockchain databases, communicating through centralized and decentralized infrastructures.
Next, let’s explore how some decentralized blockchain infrastructures are gaining traction by analyzing the numbers and drivers behind the recent surge in Pocket Network's network activity and revenue. By maintaining nearly 100% uptime, we can see how these decentralized data providers support the growing Web3 economy.
Case Study:
Network Activity
To study Pocket's usage and growth before 2021, we first focus on the average daily relays. Relays are simply application requests to any public database node. The following chart plots the average daily relay volume from January to November 2021 at four-day intervals.
Pocket Network has witnessed tremendous growth in usage this year, particularly with explosive growth in network activity starting in October. What are the main drivers? First, in February this year, Pocket Network announced that they would begin providing Ethereum infrastructure for Fuse, a platform for building decentralized payment systems.
As an Ethereum sidechain, Fuse requires a stable and well-functioning Fuse-Ethereum bridge. By integrating with Pocket, Fuse can further decentralize the platform, increase user privacy, and reduce the costs and efficiencies of running its own Ethereum nodes.
Subsequently, in August, Pocket announced support for the xDai chain, another Ethereum sidechain that supports the xDai stablecoin bridged from Dai on Ethereum. One of the main use cases for xDai is to enable fast and low-cost transactions in the MMO space conquest game Dark Forest. Similarly, by integrating with Pocket, xDai can increase decentralization while "outsourcing" their Ethereum infrastructure needs.
Recently, after Pocket announced it would handle Harmony RPC traffic, network activity surged starting in October. Harmony is a layer 1 blockchain that can serve as an Ethereum-interoperable layer 2 scaling solution by using random state sharding, allowing secure block confirmations at low costs and high speeds.
At that time, Harmony network's API calls surged from 50 million to 100 million as they attempted to reroute traffic through a scalable and decentralized API. Now, developers can create Harmony RPC endpoints from Pocket's front-end API portal to use in their dapps. These Pocket-driven endpoints provide additional layers of resilience, reliability, and privacy for dapps.
In the Pocket network, application stakes are registered as entry points for applications in the network. Applications lock POKT into a binding within the network to receive throughput allocations executed through network nodes. The rules of that binding are determined by the monetary policy and protocol rules set by Pocket DAO.
As shown in the chart below, the amount of POKT applications use to reserve relay requests has grown more steadily since the beginning of this year.
The daily relay request reserve equals the number of POKT staked by applications multiplied by 40. We can then see that applications have "paid" (invested enough POKT) to reserve nearly 1 billion relays daily while using about 160 million, or 16% of the reserve. However, this is not surprising, as applications should have a backup buffer to cope with surges in network activity.
Ultimately, assuming these held tokens deplete the relay request reserve, this approximately 1 billion relays will be paid as "revenue" to relay providers, Pocket DAO, and POKT block producers. Now let’s analyze these earnings and rewards in more detail.
Revenue and Returns
To convert relays into revenue, simply multiply the number of relays by 0.01 (the amount of POKT generated per relay) and the POKT price. The following chart shows the monthly revenue of POKT in 2021, based on average daily access points and monthly POKT prices. Price data can be obtained from April to November.
From May to July, network activity decreased, coinciding with a general decline in Ethereum network and crypto market activity. However, it is clear that after establishing endpoints connected to the Harmony network, Pocket's revenue surged significantly that quarter.
We can also look at how much POKT is earned by dividing the number of relays per relay node by the total number of relay nodes and multiplying by 0.89 (from the 89% distributed to service nodes, Pocket DAO, 10%, and 1% to block producers). The chart below shows the average daily rewards per validating node from January 1, 2021, to November 8, 2021, at four-day intervals.
At the beginning of this year, POKT nodes received more daily rewards as there were fewer nodes in the network. The chart below shows the number of active validating nodes in the network from January 1 to November 8, at four-day intervals.
So far this year, the number of active validating nodes has increased more than 15 times, from just over 600 nodes to over 9,000 nodes today. This month, the average daily reward per validating node has soared to 161 POKT (~$118 at $0.73/POKT) per node daily, up over 300% from the previous year's average POKT rewards per node in the network (assuming each node holds a minimum of 15,150 POKT).
In the long run, these rewards may not necessarily be sustainable. Attractive returns may attract more node providers, further diluting total validator rewards and POKT rewards paid through supply dilution (0.01 POKT generated per relay). Additionally, there is the question of whether rewards paid through supply dilution should be considered revenue.
On one hand, they do represent the real demand for Pocket's services. On the other hand, each time work is performed on the Pocket network, the stakes of applications and nodes are diluted. At November's peak, this would equate to an annual increase of approximately $412 million in market capitalization.
That said, Pocket DAO may vote to reduce new POKT issuance in the near future. Furthermore, despite these impressive numbers, Pocket Network still only handles a small fraction of the traffic of its centralized competitors, with Infura alone servicing over 2.4 billion Ethereum relays in a single day in 2020.
Given the vast addressable market and the successful integration of protocols like Harmony with Pocket, we may see more protocols rerouting and decentralizing their traffic through the Pocket network to prevent or address issues arising from reliance on centralized blockchain infrastructure. Whether this decentralized infrastructure can support a Web3 economy with billions of dapp users will depend on the resilience of node and network technologies and their ideal antifragility.