Skip to content

The Graph deep dive: final piece of the web3 puzzle

Harry Hamburg
Harry Hamburg
20 min read
The Graph deep dive: final piece of the web3 puzzle

What’s the most over-used business analogy?

It would have to be either:

“The Amazon of…”

Or “The Google of…”

And, let’s be honest, most of the time those analogies don’t really fit.

The person who comes up with them is usually trying to manipulate their audience.

They want their audience to associate their product with the exceptional success of Amazon/Google.

It’s a great marketing technique, and it’s been absolutely done to death.

I mean, ever since crypto’s beginning, many, many projects have claimed to be “The Google of blockchain”.

And they are usually nothing at all like Google.

They’re usually just a blockchain that you can use to build other blockchains that all connect to each other – also known as a layer-0.

(For example, Cosmos, Polkadot and Avalanche, which you can find my deep dives on here.)

That’s not what Google got famous for. Google blew up because it was the first really good internet search engine.

And it’s easy to forget just how important that was at the time.

Back when Google came out, the internet was a mess.

It was like a billion-page encyclopaedia that had every entry entered in a random order and no index to help you find what you were looking for.

Then along came Google. You told it the entry you were looking for and it not only told you what page it was on, but it opened the encyclopaedia on that page for you.

It made the internet user friendly.

So a true “Google of blockchain” would do the same thing, but for blockchain.

It would let you search through the billions of transactions on any given blockchain, and it would pull useful information out for you.

That is exactly what the subject of today’s deep dive does.

It’s called The Graph, and as you’re about to see it could be the missing piece of the web3 puzzle.

Let’s take it back to the start

If you’re a regular reader, you’ll be well up to speed on what web3 is, why it’s needed and how it plans to change the world.

If you’re not, of if you just want a refresher, then read the intro to my Filecoin deep dive here.

It covers all of the above and shows how web3 has evolved out of the early internet and the social media world of web2.

So, in terms of where we are with web3: we have the immutable, decentralised network (the blockchain itself). And we have somewhere to store the data it needs to create and use dApps (IPFS).

We’re basically where we were with the internet before Google joined the party in the late 90s.

Web3 is at the “unordered billion-page encyclopaedia with no index” stage.

The underlying structure is there, but using it is not a fun experience.

What we need is something to index and organise all that data.

And that’s exactly what The Graph does.

Here comes that overused analogy

Honestly, The Graph kind of really is “the Google of web3”.

Here’s what it is, summed up in one paragraph, via The Graph:

The Graph Network is a decentralized indexing protocol for organizing blockchain data. Applications use GraphQL to query open APIs called subgraphs, to retrieve data that is indexed on the network. With The Graph, developers can build serverless applications that run entirely on public infrastructure.

And the last sentence in that description is important here. Because that’s one of the main differences between the traditional internet and web3.

Web3 doesn’t use centralised servers owned and controlled by companies. It is decentralised, and public.

Up until The Graph, if you wanted to index and organise blockchain data, you had to run your own server – or trust and pay a company to run one for you.

For example, most people who use Ethereum are familiar with Etherscan.

Etherscan is a block explorer for Ethereum that lets you look up wallets and transaction data.

But Etherscan has to run its own server to do this.

With The Graph, you don’t need to run a server, it’s all decentralised. And it is much, much more powerful than a block explorer.

From reddit user new_old_trash in The Graph subreddit (strange source, I know. But this really is one of the best explanations of The Graph I’ve read):

Simply put, [The Graph is] a mechanism to define a way to roll up contract events into a web-queryable Postgres database.
You define a schema (database tables) + a small WASM [WebAssambly] program, which gets executed for every event you're interested in, which can then save records into those tables. Then you can query the database via GraphQL.
Stuff like Etherscan is just a massive index of the entire blockchain with no special insight into the specific contracts. It can tell you that a contract was created/executed/etc, but not what the contract "means" at a higher semantic level. Whereas The Graph gives you a way to analyze and build up custom structures on top of raw contract events, to make it meaningful to a human. (It should also be added, that there are infinite possible subgraphs that you could create from a given contract – it all depends on what the developer wants to know, in analyzing those contract events across time.)
Instead of having to write your own custom blockchain indexer (tailored to your contracts of interest) and host it yourself on a server, The Graph packages all that functionality up into something that's very easy to define and deploy and query. They handle all the dirty work, you just supply the definitions and a tiny bit of code!
Anybody can take any contract(s), even if you didn't create them, and write a subgraph definition on top of it, to produce whatever kind of analysis/insight you're interested in.

The Graph is already powering many of today’s biggest dApps

To show you how useful it’s already become to web3, I’ll give you one example…

Let’s cast our minds back to last month, when I reported on Arbitrum and the sham of “decentralised governance”.

If you didn’t read the article, I’ll summarise: Arbitrum said it had decentralised its governance, but then when a vote on its treasury didn’t go the way it wanted, it simply ignored the result.

But how were those votes cast, and how did we know the result?

Like many projects, Arbitrum uses a service called snapshot to handle its decentralised voting. And under the hood, snapshot uses The Graph to index, organise and query its data.

Snapshot is fast becoming the standard service for decentralised governance, and it wouldn’t be possible without The Graph. In fact, The Graph even wrote an article about its integration with snapshot.

But, as we’ve already learned, The Graph does this this for any kind of blockchain data, not just voting. Which is why it’s already used by many of today’s top dApps, including:

Uniswap, SushiSwap, Lido, Curve, AAVE, Livepeer, Ethereum Name Service (ENS), and many more.

And even if dApps don’t use The Graph themselves, other developers can use The Graph to index and query their data in their own dApps.

For example, people use The Graph to analyse data from OpenSea – the world’s biggest NFT marketplace.

Which is why, The Graph could prove vital in taking web3 mainstream – just like Google did with the original internet.

So, with that intro out of the way, let’s get onto the deep dive proper…


Related Posts

Members Public

Vitalik, vampires and the birth of Decentralised Finance

Here’s something that could only happen in crypto. A guy gets fired from his job, stumbles on a random reddit post, learns to code… and one year later creates the most important decentralised finance project in history. How important? Well, since its inception in 2018, it’s handled roughly

Vitalik, vampires and the birth of Decentralised Finance
Members Public

Deep dive updates 2024

Members Public

Ergo deep dive: and justice for all

Ergo is a true anomaly: a modern crypto project with actual integrity.

Ergo deep dive: and justice for all