The Graph (GRT) is a project that seeks to build a data indexing system for the blockchains that are connected to its protocol, thus allowing rapid and structured access to said data so that they can be used in decentralized applications (dApps).
Ehe decentralized protocol The Graph, is a protocol built on tecnología blockchain which has the purpose of serving as a data indexer on other block chains. This in order to build a decentralized database that optimizes access to the information contained in said blockchain. In this way, other projects that need this information at a given time can access the required information in a much more efficient and faster way.
To achieve this, The Graph has built an entire infrastructure supported by two remarkable technologies: Ethereum (ETH) e IPFS. The first allows the creation of a network of interoperable nodes to which information transactions are associated together with a native token for the platform. While the second enables the creation of a network of nodes to store information in a decentralized, secure and high-speed manner. In this way, The Graph opens up to developers of dApps access to a platform that speeds up their requests for information and helps them to develop a cross-chain interaction system very easily.
History of TheGraph
The story of The Graph began in 2017 when Yaniv Tal, co-founder and CEO of the project, developed a data indexing protocol aimed at making blockchain data easier to access. After three years of work, The Graph became a reality with the launch of its mainnet in December 2020.
Since then, The Graph has become the informative pillar of blockchain projects of the magnitude of AAVE, Uniswap, Synthetix, Aragon, Decentraland, Mintbase, Gnosis, PoolTogether, DODO, UMA, Audious, Enzyme, among others. In addition to having more than 160 indexers and almost 7.500 delegators, The Graph is a project with great potential, something that can be seen with its volume of requests: more than 1.500 million queries per day during 2021.
How does TheGraph work?
The Graph is built on a proprietary network of nodes closely linked to the Ethereum network. The broad idea is simple: have nodes that work as collectors of information from different blockchains. This stored information can then be accessed through an API that allows dApp developers to obtain the data they require more efficiently.
These types of networks are not uncommon in the blockchain world, in fact, projects like ChainLink They do something very similar, only instead of indexing information from other blockchains, ChainLink does it through services that are not connected to the blockchain world, and that information is not as detailed. In any case, the basic operation of The Graph and ChainLink network is similar: both are networks that access, process, store and serve information from external services for third parties.
In this case, The Graph has a fairly large network, with more than 160 indexing nodes (December 2021), more than 7.400 delegators and more than 2.200 curators. All this network allows The Graph to carry out its work as expected, and to deploy all the services for which it has been created. However What do each of these nodes do? What is your role and what other functions exist within The Graph?
Nodes within The Graph
Like any decentralized blockchain network, The Graph has a series of public nodes that are responsible for doing different jobs, namely:
Indexers
Indexing nodes are an essential part of how The Graph works. The job of these nodes is to hold a stake of Graph Tokens (GRT) and provide the most important service on the network: indexing and processing queries made on the network.
Each indexing node has the task of participating in one or more subgraphs within The Graph. These "subgraphs" they are actually the space to index and organize the information of a certain blockchain. In this way, indexers lend computational power to process all this information and maintain a rapidly accessible database to offer answers to network users. Staking allows holders of index nodes to earn rewards for their work.
However, there is an important point to this, and that is that GRT rewards are locked for a period of time within the network. The reason for this is to prevent indexing nodes from connecting and disconnecting looking to gain an advantage in the indexing process.
Curators
The curators are the ones who classify which subgraphs are of high quality and, from there, they create a priority tree, which the indexers follow to carry out their work. That is, its main function is to point out which subgraphs deserve to be indexed within the network by the indexers. This classification is made taking into account a series of criteria such as the relevance of the blockchain, tokens and query requests within the network for a specific subgraph.
The start-up of a curator node requires a staking within the network to be able to carry out said work.
Delegates
Delegators are not actually nodes within the network, but rather people who have decided to delegate their stake to indexers to contribute to network security without having to manage a node themselves. In other words, a delegator is a holder of GRT tokens that injects liquidity into an indexer to allow it a greater share of power within the network.
How Nodes Work in The Graph
Now that we know the participants in the network, it's time to find out how they work to make The Graph fulfill its mission. To achieve this, the project has used well-known technologies in the development world, such as PostgreSQL (a database), GraphQL (a language for queries and querying data for APIs) and IPFS. Thus we are left with the following topology of the network:
- Indexers: which are the nodes of the network and that use Proof of Stake to maintain a secure operation of the network.
- Curators: which are secondary nodes, which use Proof of Stake to analyze the subgraphs and their quality, and then assign their indexing priority.
- Delegators: people who use the network to inject liquidity and prevent third parties from attacking it.
Start of work
The work begins with the curators who, although they are secondary, have the task of analyzing which subgraphs are really useful for the network. Once the curators have decided that a subgraph is valuable, they mark it for indexing.
That is where the work of the indexing nodes begins. The software on these nodes enables a database (centralized in the indexer) using PostgreSQL. The idea of this database is to speed up (cache) to access the indexed information in a much more efficient and diverse way than performing an on-chain search. This does not mean in any case that The Graph is centralized, only that it uses a means to achieve a goal, and it is something that is widely used in blockchain. For example, a block explorer does not actually perform on-chain searches, but instead does so against a database whose data has been retrieved from the blockchain. This allows you to search for transactions by block number, hash, TXID, address, and even transaction content.
Indexers classify this information and add it to their database. And, in the event that this data is excessive, expensive to maintain by its own means or simply a more global and uncensored access is wanted, the entire database is replicated through IPFS. In any case, the indexers have analyzed the subgraph information and are ready to receive queries and respond quickly. Since indexers rely on staking for their work, delegators can inject more liquidity into certain indexers by seeking profit on the capital injected. In any case, the union of indexers and delegators seeks one thing: to strengthen the security of the Proof of Stake that makes The Graph work.
Responses to data queries
With the network up and running, a user or developer can use The Graph API to perform queries for their application. For example, the developer creates a dApp that stores data on top of Ethereum. Said dApp interacts with the network and its users through transactions and events. And all this translates into information that is stored in the Ethereum blockchain.
All that information stored in Ethereum is then processed by The Graph network. This is because there is a subgraph on the network that requires the storage of that developer's dApp information. Taking the required information, The Graph nodes put it into their database, ready for a quick response. Thus, when the dApp requires indexed information, instead of making a request (query) to the Ethereum network, they make it to The Graph network. This query is performed by using the GraphQL language. In this way, the indexing nodes receive the information request, perform the search in their database (PostgreSQL) and send a response to the dApp. Finally, the dApp displays the requested data to the user and the operation cycle is finished.
You may wonder why not make the request directly to Ethereum? The answer is that it is expensive, complex to implement and very slow. For example, searching for transaction information in Ethereum (directly on-chain) requires doing it block by block, transaction by transaction. For this reason, block explorers (and The Graph) take the shortcut of using a database (such as MySQL, MariaDB or PostgeSQL) as the speed of these solutions is superior.
Also, the cost of a trade on Ethereum (in terms of gas) is much higher than on The Graph. Hence, this project is presented as a much more optimal solution for this type of solution.
How much do you know, cryptonuta?
Does The Graph really facilitate cross-chain data access?TRUE!
The Graph works as a huge database that stores all the information of the blockchains connected to it, allowing developers to have a pool of information that they can access directly, without having to implement functions for those blockchains separately. Thanks to this, The Graph simplifies and facilitates data access for decentralized applications.
The Graph Native Token, GRT
GRT is the native token of The Graph ecosystem. It is an ERC-20 token, whose smart contracts can be viewed at this link. This token has been created to have a total supply of 10 billion tokens. In addition, it has the peculiarity that the token is issued as a reward for indexers and curators. But, at the same time, it burns when it is used for queries within the network. This means that the inflation of the token is counteracted, and the intention of this is to revalue the token in favor of the investors and participants within the project.
The role of the GRT token is fundamental to the network's PoS protocol staking system. Something in which indexers, curators and delegators are fundamental pieces. Additionally, the GRT token helps decentralize the network by keeping the power of the network shared among multiple participants. On the other hand, it allows maintaining a high level of quality in the information provided by the network. This thanks to the incentives and fines for correctly curating the subgraphs created for the network.
Conclusions
The Graph is a blockchain project with a great idea as it opens up new possibilities within blockchain technology. In addition, it allows dApps and blockchain to interoperate with each other, quickly and cheaply. Without a doubt, at this point, The Graph stands out as a promising project. Especially if we understand that the future of this technology lies in the best integration of the different existing ecosystems.
However, there is still a long way to go and The Graph is evolving to take us into that future. A future where sending value and exchanging information between blockchains is easy, transparent and frictionless.