Editor's Note: This article comes fromBabbitt Information (ID: bitcoin8btc)Editor's Note: This article comes from
Babbitt Information (ID: bitcoin8btc)
So, what exactly is The Graph Protocol? Why do some people call it "the Google of blockchain"? What is the use case of the GRT token? You will find answers to these questions in this article.
introduce
Let's start with the actual definition of The Graph.
introduce
The project was started in late 2017 by three software engineers who were frustrated with the lack of tools in the ethereum ecosystem, making it difficult to build decentralized applications. After several years of work and many iterations, The Graph went live in December 2020.
index
As an infrastructure protocol, The Graph can be tricky to grasp, so before getting into the details, let's try to understand what an index is - the main concept behind The Graph.
index
Essentially, indexes reduce the time it takes to find specific information. A real example is an index in a book. We can find what we want more quickly in the index, rather than walking through the entire book page by page looking for a concept, the index is sorted alphabetically and contains references to the actual pages in the book.
Likewise, in computer science, database indexes are used to achieve the same goal - to reduce search time. Instead of scanning the entire database table multiple times to feed data to an SQL query, indexes can greatly speed up queries by providing fast access to related rows in the table.
For blockchains like Ethereum, indexes are very important. To understand why this happens, let's look at how a typical blockchain is built.
A typical blockchain consists of blocks containing transactions. Blocks are connected to their neighbors and provide a linear, unalterable history of what happened on the blockchain so far.
Because of this design, a naive approach for searching for a specific piece of data (such as a transaction) is to start at block height 1 and search for transactions in all transactions in that block. If no data is found, we go to block height 2 and continue searching.
As you might expect, this process is extremely inefficient. This is also the way why every popular blockchain explorer (e.g. Etherscan) builds their own service to read all the data on the blockchain and store it in a database, where it can be retrieved quickly.
These types of services are often referred to as ingestion services because they basically consume all the data and transform it into a queryable format.
While this approach can often work well, it requires trust in the companies providing the data — not ideal for building fully decentralized and permissionless applications.
The Graph
On top of that, all private crypto companies that don't want to trust other APIs have to build their own extraction services, which creates a lot of redundant work.
This is also why there is a need for a decentralized query protocol for blockchains, and this is where The Graph comes into play.
The Graph aims to be one of the main core infrastructure projects needed to build fully decentralized applications. It focuses on enabling a decentralized web (Web3) query and API layer by removing the trade-offs dApp developers must make today: whether to build high-performance or truly decentralized applications.
The protocol allows querying different networks, such as Ethereum or IPFS, using the query language GraphQL. GraphQL allows specifying the fields we are interested in and the search criteria we want to apply.
Queryable data is organized in subgraphs. A decentralized application can use one or more subgraphs. A subgraph can also be composed of other subgraphs and provide a combined view of data that may be of interest to the application.
The Graph provides an explorer to easily find subgraphs for the most popular protocols like Uniswap, Compound, Balancer or ENS.
The Uniswap subgraph provides access to a lot of useful data, such as the total volume of all trading pairs since the protocol was launched, volume data for each trading pair, and data about specific tokens or transactions.
Now, let's get into the architecture of the Graph protocol.
The Graph Architecture
The easiest way to explain this is to first focus on the different network actors.
Let's start with the indexer.
Indexers are the node operators of The Graph. They can join the network by staking GRT tokens and running The Graph nodes. Their main function is to index related subgraphs. Indexers provide rewards for indexing subgraphs and charge fees for serving queries on those subgraphs. They also set prices for services. To control prices, each indexer competes with other indexers on the basis of ensuring the highest data quality. This basically creates a market for the services provided by indexers.
Consumers query indexers and pay to get data from different subgraphs provided by indexers. Consumers can be end users, other web services or middleware.
Curators are other important network participants. They use their own GRT token to denote which subgraphs are worth indexing. A curator can be a developer who wants to ensure their subgraph is indexed by an indexer, or an end user who finds a particular subgraph valuable and worth indexing. Curators are financially incentivized as they receive rewards proportional to the popularity of a particular subgraph.
Delegators are another network participant. They stake GRT on behalf of the indexer to earn a portion of the indexer's rewards and fees. Delegators do not have to run The Graph nodes.
Finally, there are fishermen (Fishermen) and arbitrators (Arbitrators). They become useful in case of disputes, for example when an indexer provides incorrect data to a consumer.
Now, let's see how network participants cooperate to create a trustless decentralized system.
Assuming a new decentralized exchange has launched, the team behind the project wants to allow other applications to easily access the exchange's historical trading volume and other data points.
To encourage indexers to index new subgraphs, curators must step in and signal flags that new subgraphs are worth indexing.
Here we have 2 options. If the new exchange is a highly anticipated project with high potential, it is likely that already existing curators will step in and use their GRT tokens to signal the usefulness of the new subgraph. If this subgraph becomes popular, curators will receive financial benefits from their signal tokens. If expectations are low for this new exchange, the developers behind the project could become curators themselves and use their GRT to encourage indexers.
Once this happens, the indexer can step in and start indexing subgraphs. This process can take hours or even days, depending on how much data must be indexed.
Once indexing is complete, consumers can start querying subgraphs. Every query sent by a user requires payment in GRT, which is handled by the query engine. The query engine also acts as a transaction engine, making decisions such as which indexer to do business with.
To make this process smoother, The Graph uses payment channels between consumers and indexers. Dispute processing can be initiated if the indexer provides incorrect results.
If you want a deeper understanding of the architecture behind The Graph protocol, you can check out this link here.
Now, it’s time to discuss the GRT token.
GRT Token
GRT is a utility token that plays an important role in the design of The Graph Network. As we mentioned before, Curators use GRT to signal indexable subgraphs. Most importantly, Indexers stake for incentives. In addition, people who own GRT tokens but do not want to become Indexers and manage GRT nodes can become Delegators and get a part of Indexers rewards. Also, consumers pay for their queries in GRT.
The Graph also has a token burning mechanism, and the estimated burning scale is about 1% of the total protocol query fee.
future
The Graph protocol has attracted a lot of interest from VCs, with many well-known companies including Coinbase Ventures participating in its initial offering.
future
The Graph core team aims to further decentralize the protocol by launching on-chain governance (i.e. The Graph Council) in the future.
The protocol currently deployed to the Ethereum mainnet only supports indexing Ethereum, but multi-blockchain support is one of the areas that needs further research.
The Graph is already used by other popular projects like Uniswap, Synthetix, Decentraland, and Aragon.
It looks like The Graph might be one of the missing pieces in the effort to increase dApp decentralization.
Some even called The Graph "Blockchain Google," referring to the similarities between Google indexing websites and The Graph indexing blockchain and decentralized applications.
