How can I get the provenance of a digital artwork, NFT, from the blockchain? Who owned this NFT before me? What was the price it traded at before? What is the historic price of a coin/token that was traded on the blockchain? What other data is there and how can I query it without having a PhD in distributed systems? In this session we learn about the data on blockchains, how it is structured and how we can access it. We are using an open source technology called [The Graph](https://thegraph.com) and learn how Subgraphs can index blockchain data and how we can easily query it.
We experienced another blockchain hype wave this year, beyond just decentralised finance. Suddenly the whole world was buzzing about digital art on the blockchain, namely NFTs. Art teachers were calling their friends in crypto asking how they can mint an NFT, artists and creators started doing NFT drops to their fans, Beeple sells for a whopping $69.3M, the list goes on and on. The voices who said that decentralised finance, DeFi, will disrupt the entire financial industry are getting louder and louder. Not to mention the brave forecasters who predict that we will see the “summer of layer 2” and the next big thing will be decentralised autonomous organisations, DAOs, who aim to revolutionise how we all work together.
Behind all the hype and buzzwords are systems and data. Systems consisting of a set of smart contracts which form a so called protocol. And these protocols are generating a lot of data which is stored on the blockchain for ever. Very interesting data actually. Here are some examples:
- One of the reasons why NFTs hyped that much is because of the provenance: The cryptographically secured origin of digital piece of artwork as well as its history of owners. For every NFT, this data is stored on the blockchain and anyone can query it.
- For decentralised finance, every trade is recorded on the blockchain which provides us with detailed information about historical prices of different tokens or coins.
- And the organisation of DAOs with their proposals, ballots and votes is also publicly queryable.
In this session we quickly refresh the fundamentals of smart contracts and how they emit data and why this data is not easily accessible. Then we look at some existing smart contracts which data is indexed with The Graph and how we can query it. And finally we look at the possibility to index data from smart contracts that are not indexed yet.
Ablauf der Session
- Refresher how blockchains and smart contracts work
- The problem of data accessibility in blockchains
- The solution of indexing such data with Subgraphs
- Introduction on how to query Subgraphs
- Hands-on: How to query Subgraphs
- Introduction on how to write Subgraphs
- Hands-on: How to write Subgraphs
- Questions and answers
- Data scientists and data enthusiasts who want to learn more about querying and indexing blockchain data.
- Technical skills: Until the hands-on part, the session should be understandable by curious non-technical persons and they are explicitly warmly welcome. That said, to query subgraphs one should have basic knowledge of GraphQL, although this knowledge could be acquired ad-hoc during the session. To write subgraphs, a good understanding of Solidity is needed and also programming skills in TypeScript.