The Graph is an indexing protocol used for querying blockchain data that allows for the creation of decentralized applications. The project was created by three software engineers who were dissatisfied with the tools available to developers in the Ethereum ecosystem. They felt building apps on Ethereum was difficult and time-consuming so they began work on a solution. Three hard years of work later, The Graph was launched.

The graph aims to become the main core infrastructure protocol for building truly decentralized apps. It does this by decentralizing the query and API layers of Web 3 by removing a trade-off that plagues dApp developers.

The trade off? Building an app that is performant, or truly decentralized. This is similar to the issue faced by blockchains with the trilemma (balancing security, decentralization, and scalability).

Many people have called The Graph, the ‘Google of blockchains’. Where does this name come from and what does it mean?

As mentioned, The Graph is an indexing protocol. An index is something used to make things easier and quicker to find. Open up a book and at the back, you’ll see the index. It will tell you what page to go to to find particular information. This makes it so much easier and quicker to find the information you’re looking for. It cuts the “search” time.

How does indexing work?

This indexing concept is leveraged by Google for their search engine. The Google search engine algorithm helps to sort and organize results to make the most relevant links appear as quickly as possible. Other search engines also work like this, but Google is clearly the best at it, which explains its dominance in the search engine space.

This is all computer science. Google has database indexes that are used to achieve the same goal. When a search is made, instead of scanning the whole database multiple times to provide data for a search, indexes are able to reduce this time by linking straight to the most relevant results quickly. The key is then finding that perfect blend of fast searching and accurate results.

Indexes are also important for blockchains. This is where The Graph comes in.

Indexing in a typical blockchain is primitive, due to the very nature of the chain itself. A block is searched and if the data is not found, the search moves linearly to the next block, and so on. This is akin to someone opening up a book at the start and checking every page until they get the information they were looking for.

This is why we have blockchain explorers like Solscan and Etherscan. It’s easy to look up specific transactions regardless of when they occurred. They act as a database of information just like the databases used by Google. They’re called ‘ingestion services’ as they take all of the data, eat it up and then display it in a digestible format. This solves the exact indexing problem we described above. However, some people don’t fully trust the companies, they believe that this is not ideal for building decentralized apps as these explorers are centralized.

What is Graph QL?

This is the language used by Graph to search different blockchains looking for specific pieces of data, by applying certain search criteria.

The searched data is then organized into things called ‘subgraphs’. Subgraphs can be used by apps. Subgraphs can also contain other subgraphs. Each one is easily explorable.

Using this, it’s easy for developers to find the most popular subgraphs of the most popular applications, such as Sushiswap and Uniswap.

Each app’s subgraph will contain key data that is useful for developers.

The Graph Architecture

Indexers: are the people who operate the nodes of the graph. They are able to do this by staking GRT, the native graph token, and running the graph node. Like validators are meant to verify transactions, Indexers are in charge of indexing subgraphs. In return, they earn rewards similar to validators on other networks. Indexers are able to set their own prices, and since anyone can partake this creates a type of marketplace. In our book analogy, these would be people offering to index books.

Consumers: query indexers and in return pay them for their services. The type of consumers includes end-users and web services. In our book analogy, these are readers.

Curators: use GRT tokens to note which subgraphs are worth indexing. Typically these people are developers of applications looking to ensure their work is indexed. These are the authors, publishers, and readers looking to make the reading experience better.

Delegators: stake their GRT tokens on behalf of indexers, and in return earn a percentage of the rewards and fees. They don’t have to run a node, so the barrier to entry is lower.

Fisherman and Arbitrators: are here to resolve disputes and correct mistakes if indexers provide incorrect information.

The GRT token

As mentioned, GRT is the native utility token of The Graph. It is used heavily in the incentives and rewards economy of The Graph infrastructure.

Curators use it to signal the importance of indexing an app. Indexers stake it to run a node. Delegators stake it to capture a piece of the rewards and most importantly, consumers pay for their queries with GRT.