The Graph learns what and how to index Ethereum data based on subgraph descriptions, known as the subgraph manifest. The subgraph description defines the smart contracts of interest for a subgraph, the events in those contracts to pay attention to, and how to map event data to data that The Graph will store in its database.
A subgraph is defined by a subgraph manifest, which is immutable and stored on IPFS. The immutability is important for having deterministic and reproducible queries for verification and dispute resolution. The GNS performs a much needed role by allowing teams to attach a name to a subgraph, which can then be used to point to consecutive immutable subgraph “versions.”
Indexers must stake Graph Tokens in order to sell their services in the query market. This serves two primary functions:
1) It provides economic security, as the staked GRT can be slashed if Indexers perform their work maliciously. Once GRT is staked, it may only be withdrawn subject to a thawing period, which provides ample opportunity for verification and dispute resolution.
2) It provides a Sybil resistance mechanism. Having fake or low quality Indexers on a given subgraph makes it slower to find quality service providers. For this reason The Graph only wants Indexers who have skin in the game to be discoverable.
The Graph will implement an incentive model pioneered by the team at 0x. It involves collecting a protocol fee on all transactions in the protocol, and then rebating those fees to participants as a function of their proportional stake and proportional fees collected for the network, using the Cobb-Douglas production function.
Curator signaling is the process of depositing GRT into a bonding curve for a subgraph to indicate to Indexers that the subgraph should be indexed.
Indexers can trust the signal because when curators deposit GRT into the bonding curve, they mint curation signal for the respective subgraph, entitling them to a portion of future query fees collected on that subgraph. A rationally self-interested curator should signal GRT toward subgraphs that they predict will generate fees for the network.
Using bonding curves—a type of algorithmic market maker where price is determined by a function—means that the more curation signal are minted, the higher the exchange rate between GRT and curation signal becomes. Thus, successful curators could take profits immediately if they feel that the value of future curation fees has been correctly priced in. Similarly, they should withdraw their GRT if they feel that the market has priced the value of curation signal too high.
Indexer Inflation Reward
This reward is intended to incentivize Indexers to index subgraphs that don’t yet have significant query volume. This helps to solve the bootstrapping problem for new subgraphs, which may not have pre-existing demand to attract Indexers. Each subgraph in the network is allotted a portion of the total network inflation reward, based on the proportional amount of total curation signal that subgraph has. That amount, in turn, is divided between all the Indexers staked on that subgraph proportional to their amount of contributed stake. During the bootstrapping phase, there is an incentive for Indexers to stake but not actually do the work of indexing and serving queries on any subgraphs.There will be an indexer monitoring service which is set via protocol governance. This service has the authority to add Indexers to a blacklist if they are found to be unavailable for serving queries on the subgraphs they are staked on.
Graph Explorer & Graph Name Service
Graph Explorer will be a dApp, built on top of a subgraph that indexes the Graph Protocol smart contracts—including the Graph Name Service (GNS), an on-chain registry of subgraphs. The subgraph, along with other metadata stored in the GNS, allows users of Graph Explorer to get a better sense for the purpose and possible utility of a subgraph in a way that a random string of alphanumeric characters and compiled WASM byte code does not. Rather than simply letting dApps build on multiple separate subgraphs, subgraph composition will allow brand new subgraphs to be built that directly reference entities from existing subgraphs. This reuse of the same subgraphs across many dApps and other subgraphs is one of the core efficiencies that The Graph unlocks.
The Graph Network will utilize state channels with ‘hub and spoke topology’ to minimize trust between the consumer and the Indexer. This means that in order to use The Graph a consumer will need to have a state channel open on-chain with the state channel hub, which is loaded with their preferred stable token or ETH. The Indexers, meanwhile, will also need to have a state channel open with the hub where they can receive GRT. The state channel hub will be collateralized with GRT and be responsible for setting the exchange rate between the payment denomination and GRT so that all micropayments are settled in the same unit of account.
In order for the WAVE Locks construction and indexer staking to be meaningful, there must be an effective verification mechanism that is capable of reproducing the work performed by an Indexer, identifying faults and slashing offending Indexers. In the first phase of The Graph Network, this is handled through an on-chain dispute resolution process, which is decided through arbitration. Fishermen submit disputes along with a bond, as well as an attestation signed by an Indexer. If the Indexer is found to have attested to an incorrect query response, the fisherman receives a portion of the slashed amount as a reward. Conversely, the fisherman’s bond is forfeit if the dispute is unsuccessful. Initially, in the early days there will be a fisherman service where consumers may post attestations, and the Graph will take on the responsibility of verifying query responses and submitting disputes on-chain. Additionally, there will be an arbitration service set via protocol governance, which will act as the sole arbitrator in the dispute resolution