The Crazy The Graph: The Google Search Engine for Blockchain

in thegraph •  4 years ago 

Written by the CoinEx Institution, this series of jocular and easy to understand articles will show you everything you need to know about major cryptocurrencies, making you fully prepared before jumping into crypto!

In the early morning of December 18, The Graph, a decentralized data indexing project, announced its mainnet launch. Ten minutes later, Coinbase Pro announced that it had launched its token GRT. Soon major exchanges such as Huobi, OKEx, Kraken and CoinEx, all rushed to list this token, making it one of the most popular projects among exchanges this year. As of 13 o’clock on December 19 (GMT), the price of GRT, The Graph’s token, was $0.57, 19 times more than the public offering price a month ago.

What is The Graph? That is a question you may wonder about, like many others in the circle. After all, this project has remained rarely known by the public before.

With the development of the Ethereum network and the popularity of DeFi, the Ethereum chain is embracing mounting data, which catalyzed the creation of The Graph. In February 2019, Graph Protocol, an information technology and service company, launched a data query project called The Graph, which was built on the GraphQL query language and collected data from the Ethereum network, the Interplanetary File System (IPFS) and other Web3 data sources for indexing and querying. Simply put, The Graph for blockchain is the same as Google for search.

As a decentralized data indexing protocol, The Graph provides everyone with the open API to create and publish index data, serving as more convenient access to blockchain data for developers. The Graph has a vision of building an efficient and decentralized blockchain data index and query API service layer based on the Web3 ecosystem, making DApp data access easier and faster. The principle is to index the blockchain data to generate subgraphs, which allow quick queries of interfaces using the GraphQL language developed by Facebook. (PS: The feature of this language is that it can return results as efficiently as possible in one query request)

Based on the blockchain data layer, The Graph provides efficient decentralized data API services for the DApp ecosystem, functioning as the infrastructure for the entire DeFi and providing data for Uniswap, Zapper, etc. Like Chainlink, The Graph is a key middleware for DApps. According to its official website, The Graph has been adopted by DeFi leaders including Uniswap, Synthetix, Decentraland, and Aragon.

In addition, as official data suggest, The Graph deployed only 1,000 subgraphs at the beginning of 2020, and by the end of the year, the figure has grown to more than 3,400, with subgraphs including UniSwap, Synthetix, KnownOrigin, Aragon and AAVE. In the past six months, The Graph’s user base has increased tenfold by number, with the frequency of queries soaring from 1 billion monthly in June to 10 billion in November, more than 350 million queries per day on average.

How does The Graph work?

The Graph retrieves data on Ethereum based on the description file of the subgraph, which is subgraph manifest. This description file defines the smart contracts and events that the subgraph is interested in as well as how to map event data to the nodes of The Graph and store them.

Once the description file of the subgraph is written, you can use the Graph CLI (command line) to store it in IPFS and inform the online service to start checking the data for this subgraph.

The following process clarifies how a smart contract is processed on Ethereum after the description file is deployed by a subgraph.

  1. DApp sends a transaction with data to the smart contract of Ethereum;
  2. When processing a transaction, the smart contract triggers one or several events;
  3. The Graph node continuously scans new blocks on Ethereum to obtain the data contained in the subgraph;
  4. The Graph node discovers Ethereum events and runs the defined mapping processing function. The mapping file is a WASM module, which creates or updates the entity data of the Graph node that corresponds to the event in Ethereum;
  5. The DApp queries the data obtained by retrieving the Ethereum chain in the Graph node. The node used here is the GraphQL endpoint. It converts GraphQL queries into queries of data stored in its database;
  6. The DApp uses a rich text UI to display the query results to the end user, and so on.

In The Graph network, the entire ecosystem mainly includes consumers, indexers, guides and clients. In these four types of roles, consumers (users) pay fees (either ETH or DAI, but all settled in GRT in the end) for query;

The indexer runs nodes to earn query fees and node rewards;

The curator, which can be a subgraph developer, data consumer, or community member, stores GRT to indicate subgraphs worth indexing;

The principal deposits tokens to the node to earn income.

The total supply of the foundation GRT is 10 billion, and an additional 3% will be issued every year. With the current circulation at 1.245 billion, the total market value has reached 300 million. On October 24, The Graph sold 400 million tokens in 10 minutes at $0.03; what’s more, it has airdropped 800 million tokens to early participants in the network as their rewards.

By the way, here are details about token distribution: 23% for the team, 8% for the nodes, 17% for early supporters, 17% for supporters, and 35% for the community. GRT is distributed to motivate the entire ecosystem and reward participants.

It is worth mentioning that The Graph enjoys a relatively high level of technical implementation and great activity of development on Github. It has 57 repos on Github, including those important such as the node software, command line interface, SDK and project plan. The rest are mostly subgraphs written by project developers. The node software has 2731 commits from 23 contributors. The biggest contributor contributes 586 commits, one of the most active among all blockchain projects.

Moreover, The Graph has also attracted the seed funding from Multicoin, a popular organization, and has already been adopted as a data query engine by many Ethereum DeFi projects. After its launch, GRT has skyrocketed, making it one of the hottest projects of the year; it is beyond doubt that The Graph will occupy a vital place in the encrypted data indexing market in the future.

About CoinEx

As a global and professional cryptocurrency exchange service provider, CoinEx was founded in December 2017 with Bitmain-led investment. It is a subsidiary brand of the ViaBTC Group, which owns the fifth largest BTC mining pool, which is also the largest of BCH mining, in the world.

CoinEx supports perpetual contract, spot, margin trading and other derivatives trading, and its service reaches global users in nearly 100 countries/regions with various languages available, such as Chinese, English, Korean and Russian.

Website: https://www.coinex.com/

Twitter: https://twitter.com/coinexcom

Telegram: https://t.me/CoinExOfficialENG

Click here to register on CoinEx!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!