Anyone who has ever tried to build decentralized applications (dApps) on the Ethereum blockchain will agree: while blockchains are conceptually quite close to databases, queries to the latest data seem to be a completely different world from queries on blockchains. First, there are notable performance issues when storing data on blockchains. This is largely due to their distributed (decentralized) nature and the variety of consensus protocols. Databases would also be slow if they consisted of a network of nodes in which each node kept a complete copy of the entire database, and each transaction had to be verified by each node. This is why people are experimenting with different approaches to using blockchains as a database, including changing the structure of blockchains..
The Graph approaches the problem in a different way: the project allows for the existence of blockchains in their current form, but offers a way to efficiently index and query the data stored in them using GraphQL.
What is The Graph?
The Graph is an open source decentralized protocol for indexing blockchain data. Developers can create and publish various APIs called subgraphs and execute queries through GraphQL. The platform can be used to quickly search for any data in Ethereum using simple queries. This solves a problem that many other blockchain indexing platforms face..
Blockchain applications have difficulty maintaining properties such as completeness, blockchain reorganization, and security during query execution. All of this makes the query process tedious, but fortunately, The Graph has a workaround for solving the problem. Through “subgraphs”, the project indexes blockchain data that users can access through the GraphQL API. According to the development team, in the future they will make it completely decentralized, with more nodes responsible for maintaining indexing..
How The Graph indexes data?
For example, let’s analyze the process of information indexing in the Ethereum blockchain. The Graph uses a “subgraph manifest”. This is a description of a subgraph containing data on smart contracts, blockchain events and the procedure for matching event data with each other before they are all stored in the platform’s database. Transactions, subgraph manifests, and databases are coordinated according to a specific structure. It all starts with decentralized applications that add data to the Ethereum blockchain using smart contracts.
All this data will contain a record of all events and transactions until the moment when they reached the final result. Graph Node then scans the entire blockchain database, gathers new data, and filters out those that are relevant to the requests that users make. To make indexing easier, it identifies each dataset that answers the questions from the subgraphs.
GraphQL is the link between blockchain data and the application the user wants to provide. But again, it is through Graph Node that users can deliver search queries to the platform. After the whole process, users can finally see the results of their query from their applications. This is essentially how the data query and indexing cycle works. Users can refer to the Graph Explorer to view the subgraphs already in the platform. Each of these subgraphs has a “playground” where users can execute queries through GraphQL.
At the time of this writing, The Graph can support indexing data coming from Ethereum, IPFS and PoA networks. In the future, the platform will support more networks. But right now, the project has more than 2300 subgraphs deployed, which are used by application developers. The track record includes AAVE, Aragon, Balancer, DAOstack, Uniswap, Synthetix and many others. In addition, 3Commas has recently been using The Graph to get balances and prices for Ethereum wallets. Support for displaying staking tokens will be added a little later..
Roles in The Graph ecosystem
Project participants can take on the following roles:
- Consumers. These are the users who pay the indexers for their search queries. At the consumer’s site, there may also be a whole web service or software package associated with The Graph;
- Indexers. These are the hosts that support data indexing;
- Curators. Using GRT tokens (native platform tokens), curators identify information for subgraphs that is important for the platform index;
- Delegators. These are the project participants who delegate their GRT tokens to indexers in order to receive part of the profit for the work of the node;
- Fishermen (or “fishermen”). These are the participants who validate the network’s response to requests;
- Arbitrators – they decide if the indexer is malicious.
Projects in The Graph ecosystem
Through the partnership with Chainlink, subgraph information can now be channeled using Chainlink oracles, creating an even more robust ecosystem where DeFi protocols can leverage on-chain metrics to better define their interactions across their product or platform.
As a reminder, Chainlink is an industry leader in integrating WEB 2.0 data into the WEB 3.0 ecosystem through a robust set of benchmark indices such as cryptocurrency price streams that are used in various fields – decentralized exchanges and decentralized lending..
By partnering with The Graph, Chainlink can send critical on-chain metrics directly to projects in near real-time, reducing delays in delivering critical information that better shape the user experience. Here are some more use cases:
- Using a subgraph to catalog liquidity on the blockchain to calculate and cross-compare slippage on decentralized exchanges;
- Using a subgraph to catalog the average amount of gas consumed per block for each transaction, as well as to calculate the recommended gas fees;
- Using subgraphs as APIs to integrate global real data (offline) into dApps such as game results, user identities, financial assets and so on.
Chorus One is an operational infrastructure that helps users securely increase their digital holdings through staking. Chorus One operates with two separate sets of validation and validation nodes in different geographic regions of the world.
Ethereum Name Service
Ethereum Name Service (ENS) is a system for conveniently identifying addresses on the Ethereum network. It associates a long combination of address characters with an easy-to-remember name. The platform offers a secure and decentralized way to access resources using human readable names. It is a fully distributed domain name provider that allows anyone to buy and manage domains, which means you can send ERC-20 tokens or ETH to something like “realsatoshi.eth” instead of the long chaining of “8e866f012fb8fb …” and so on..
ENS is built on top of Ethereum smart contracts, making it more secure, private and censorship resistant than Internet Domain Name Service (DNS). The ENS team views the Internet naming infrastructure as a fundamental component and therefore must be open, decentralized, community driven and non-profit. On a technical level, ENS can leverage the existing Ethereum ecosystem, which means it is well programmable and can interoperate with other smart contracts..
Bancor Network is the world’s first decentralized liquidity network. In other words, a company that allows you to automatically convert one token to another. This was made possible by the creation of the Bancor Network Token (BNTBTN) smart token. It is a digital currency with a built-in converter that allows you to automatically exchange it for any token in your network right from the client’s wallet.
Aave is an open source lending protocol. This protocol generates percentage tokens called aTokens when a user blocks the ETH collateral in the CDP. Tokens are pegged 1: 1 to the collateral contained in the smart contract.
Aave uses a decentralized credit pool (or DLP) model. Its model was switched from lender-borrower direct mapping to DLP when the project was rebranded from ETHLend to Aave. In the DLP model, the borrower gets funds from a large pool of funds held in reserve, instead of directly matching users in the transaction.
The interest rate on loans and credits is determined algorithmically. It will fluctuate depending on the supply and demand in the market. Users place their collateral in ETH in CDP (Collateralized Debt Position) to withdraw a percentage of the funds as credit. The amount of funds that a user can withdraw depends on LTV or the ratio of the loan to the value of the cryptocurrency.
The 2KEY team has created a social economy that provides a new economic model for online sharing and rewards the various contributors involved in online content dissemination and link exchange. 2KEY uses multi-step tracking technology that allows you to track and record every person involved in the link exchange chain. The protocol also acts as a Layer 2 scaling solution for Ethereum and includes Action Forwarding Contracts (ARCs), which are new proprietary solutions in which 2KEY multistage tracking technology is natively integrated into the blockchain infrastructure..
Each contract executed on the web issues its own ARC package, which acts as its own multi-step Web 3.0 conversion and conversion tracking engine that can also be viewed and interacted with with any ERC-20 compliant client.
I would also like to note that 3Commas also has a product based on The Graph, which allows you to conveniently monitor the balance of addresses in the Ethereum network..
To use this function, select “My exchanges” in the side menu and select “Ethereum Wallet” from the list of exchanges available for adding. Then come up with a wallet name and enter your Ethereum address.
Done! Now in the list of exchanges you can additionally monitor the balance of your Ethereum address. The displayed data will be as relevant as possible, because when developing this function, we used a solution from The Graph.
Given the current hype around the decentralized finance industry, we can conclude how important it is for developers to have free access to blockchain data. Making the process faster and easier for everyone can potentially impact the growth of the DeFi ecosystem, as well as its reliability, security and speed. Until recently, the need to create an information bridge between applications and blockchain data was in demand and The Graph is trying to satisfy it..
By deploying user data-driven smart contracts, The Graph has established itself as an easy-to-use, cost-effective, and fast project. The platform is seen as a promising tool to empower every member of the community, especially those developing more blockchain use cases..