The State of APIs in Web3
ETHCC 6 · July 2023 · 16:52
Krinza Momin examines the difficulty of querying blockchain data and the state of web3 APIs. The speaker considers how APIs provide the data layer needed by decentralized applications.
Speakers
Topics
From ETHCC 6, hosted by Ethereum France.
Transcript
foreign [Music] all right [Music] hi everyone hi okay already um okay so um today we're gonna talk about I mean we were supposed to be talking about the state of the apis but then I realized that we can never not talk about apis without talking about data which is a really interesting point in web 3 space so we're going to start from there first now you know when we really talk about blockchain data even
as we speak right now there might be hundreds and thousands of transactions that might be happening all over the blockchain people might be buying their first nfts or like selling their first nfts or digital assets online or probably like trading crypto and then there are user set which might be interacting with different set of tabs or protocols or different set of Platforms in general right and with all these interactions and all of these activities and all of these transactions that's happening on blockchain it comes with like a lot more data right and I think one of the really interesting pain point in this Spec 3 Space is really the appendence of data which is really weird problem to have because I'm gonna tell you why like quick review
like my name is krinza I the developer relations at anchor we are building decentralized web3 infrastructure I'm going to tell you what that means um you might have seen me around developer Tower a lot uh but before really joining web 3 I was a data scientist so I've built products I've worked with a lot of data and stuff and I think one of the things that really hooked me into this space and like the idea of blockchain is really the fact that anyone can come in and they can make use of the data in whichever and whatever way they want right I mean that's the core promise of web3 that anyone can use the data without having permission or centralized Authority now this wasn't the case in web 2 what really used to happen was like data was always there with companies but they
used to Hash it the sharing of data was considered as like illegal or immoral because that was you that that used to be the policy and one of the things that shifted the entire perspective of the data for me as a data scientist with the fact that okay data is available right so I entered into the space I'm like let's explore and when I started exploring this is the first realization that I had that okay data is available sounds good looks great on paper but it does not readily means that it's accessible as well I in in my head my mental model was like I could query like select all from ethereum and it could give me like CSV
file and blah blah and I was like okay this is not happening like how do we navigate that and then I was like okay like to learn all of this stuff like I'm a Hands-On person so I'm like I need to work with certain group of people right and that's where I meet this team anchor which we're like okay we're building infrastructure there like that's basic stuff we work on data we work on indexing and I was like sounds good let's let's work together um and they had this opening and blah blah I started working um Okay so first things first like data availability does not readily means accessible now the question here is that how do we make sure that this data that we are talking about which is available it exists somewhere in the world it is
on chain like it is somewhere but how do we make sure that it's also accessible to developers not just accessible but it's also scalable to work with it's easier it's faster to query with and I think to answer this question we just have to like go back a little bit and like review the web 3 stack of how data actually travels from the base layer of like the blockchains to the applications where like we are building D5 applications we are building nft applications multi-chain this and that and just there's just a lot of things happening in the system right now all right so the first thing that we have is the chains so that's like a protocol layer that we call it be it ethereum be it polygon be it like
Avalanche Phantom Solana all these chains they consist like they this is where the blockchain starts so it's like okay we have built this blockchain I mean Bitcoin is the father that's the daddy change right now what really happens I think to understand how to like interact with all of these chains and how to read and write data off of it we have to like go back and understand what blockchain is now this is something that I know everyone knows here like I have to like repeat myself but then this is the simplest thing that we have to understand that a blockchain is basically a set of nodes like every blockchain consists of nodes think of notes as like a piece of software that's running on a computer
now every node every computer in the network they store a replica or a copy of the blockchain's entire state so whenever you update the state whenever a transaction happens it updates the state of the blockchain and so every node in the network has to do the same now how do you get the data from the blockchain so to get the data it goes without saying you actually have to enter that Network to read and write data but to enter the network you actually have to spin up nodes now here's an interesting thing like this is the exact same thing with like web 2 and web3 like it boils down to servers and no one likes to run servers
no one wants to deal with servers that's why AWS a big thing and Google cloud is a big thing right now let's say that this is the only thing which gives you the connectivity to the blockchain which is spinning up your own node but then I mean I mean ethereum was actually formed or like founded for all of us like for Developers for projects to run their own nodes and be like the owner of that stuff but then there are some challenges with that so the first challenge is the note syncing takes time because there are just a lot of things going on and you have to maintain all of the states and all of these things it takes time I mean okay let's say you're
building a fun weekend project you're going to spin up one note it's fine but then let's say if you want to build a project for like 10 and thousands of people right you have to add more notes to it you have to sync all of them it will take time it will take resources it's costly as well and then the other thing is like I mean regular Minton is one thing for sure but then nodes can go down anytime and this when when this happens that automatically means that any application any doubt that is being built on that platform or using that rpcs it's gonna go down just like AWS like if AWS shuts down all the applications just go down this is not we want this is this is not
something that we want in web 3 for sure because there's like a lot of risk involved but what if this is how it looks like for Developers for teams to set up a node just this one line and you get connectivity with like ethereum and like 30 000 like 30 different blockchain networks and this is what we are doing so this is basically the RPC endpoint it's kind of an API in itself and this is all you have to do you have to like link this to your heart at like all anything that the proper setup that you're doing you just have to link this this just link and that's it this is what you get as an RPC so we are doing all the maintenance you
don't have to worry about maintenance you don't have to worry about note syncing time expense resources anything we do it for you now I think decentralization has been the focus of web3 but there's one other important aspect of it is that we have to make sure that everything we are doing is also globally distributed AWS right now it's not globally distributed the servers are set up in us like it's one part of the world so if I am uh to making requests right from let's say Dubai or someone else is using the dab like they are making requests from us they're going to get higher throughput
and I don't want to want this thing that this discrimination or this gap for my applications from my network or for my audience how do we do that and this is where anchor does this thing right which is like we make sure that our servers are not only community community owned but it's also globally distributed so we are our servers all around the world we have like 30 different regions that we have set up so this is basically what we do first things first so we provide this connectivity of blockchains to application Builders to builders developers and teams so we have like 30 different blockchain networks that we have onboarded so you can get rpcs test
Nets staff Nets mean that anything it's just one link and you you don't have to set up anything and you don't have to worry about anything so we understand what protocols are what nodes are so once you do like once you start using that link you get data that's one thing like this is how you get data this is how you read and write off of a blockchain but the problem that comes here is that the data you're getting out of the nodes is basically a raw data you can never query like okay High node can you give me uh let's say nfts for my wallet and my friend's wallet and this and that and it will give you something like this is
never gonna happen it's just raw data so how do we make sure that developers are given this accessibility in like much more better way in terms of the ux and like the entire experience of building tabs and this is where apis comes in a higher level interaction point and it it's not working anymore yeah anyway so basically um so what really happens that we came up with this idea of like okay we have these RPC nodes we have these connectivity points but Builders and developers need more from that so we're like okay let's let's figure out what
like most of the dabs what kind of data most of the devs require and we categorized most of the data in like three buckets first was nft Data second was token data and third was like querying data which is like blogs and logs and all of that stuff right nft data why it's like kind of like a soft onboarding tool because everyone owns the nft itself is a soft onboarding tool for like a lot of developers a lot of users a lot of people who are just trying to get into this space like explore this space and then we have total information that we absolutely need for like wallet connections for making sure that you own something for checking the identity and all of that
stuff and then we have query which is like a generalized uh API where you can query like multiple things like events and this and that like blogs and logs and all that stuff like brand new granular data and so the styles are not working which is kind of uh firmware but it's fine um it's fine I think we can oh interesting okay and that's why we built this powerful apis we are calling it Advanced apis and then we have again like why we've built
this it's just making sure the developers are not just giving this connectivity and then okay like okay we have we have done our jobs we want to make sure the developers are also shipping fast and like for that to happen developers need tools and that's what we build again like these are the apis these are the things that we categorize I was like nft data is super important token is super important like ERC tokens yeah 721 and all of that stuff and querying data we're like you get access to like multiple blockchains now I think talking about this multi-chain concept like access to multiple blockchains one of the things that it's it's another problem like when you when we talk about like getting nodes getting data out of a node
it's one thing that you're only getting raw data but one of the other problems is that we have realized that developers wants to interact with more than one blockchain they don't want to interact with just ethereum right so ethereum itself is like hard to manage but then let's say I'm like okay but I want to interact with like because users are interact with interacting with like more than one blockchains right so how do we get access to like all of these data so we made sure this these entry points are multi-chain as well so you with these apis you can get excess of data from across eight different blockchain right now it's just evm but then we're going to add non-evm chains and then test Nets as well
so basically this covers the chain nodes and apis so with apis you get like proper answers so when you say give me nft data or like if like nft data like all of the nfts that are particular address is holding you're gonna get it and like the proper Json format or whatever format you want and this is how you build actual applications on top of data so this is kind of the web 3 stack that not a lot of developers understand it and I think this has been a super important resource like if you're just starting out if you're just exploring and you you're just lost because I was lost at one point I was like how do I query data off of a blockchain because in my head I
would say Okay select all this it didn't work I was like I have no idea where do I query stuff but this is how things work and this is how applications are being built so again uh we are anchored we are building decentralized reps in infrastructure we are supporting 30 plus blockchain networks at this point we are one of the biggest largest providers in this space and then we're making sure that there are Developer tools available and I would really want you all to just scan this code uh it will lend you to this our website I really want you all to like use our product and roast it if that's possible because when Once developer roasted we know how to build stuff like your guys are like guiding
Point like focal point like okay this data it sucks like logos are not formatting and like this is not coming in it's not consistent it's there in that we want this stuff and as a developer relation I think my main focus has been the developer experience I just want to make sure the developers are being given the right tool to make sure they're shipping fast also I don't know how many of you all like are hacking um next week raise your hand no one ocean okay there's no way all right I'm hacking so I'm using that but if you're hugging yeah I am oh cool you want to join my team we have we have space
oh okay fine fine awesome I I would love so if you can use rpcs we have scroll like all of their sponsors we are already supporting them so you can use that and if you feel like oh the user experience could be better in any way with apis or rpcs or anything like just let me know I'll be around Orient if you have any questions I'm happy to take it if we have time we are out of time if you have any questions so like feel free um but yeah um if you have any questions again like you can tweet at me at my Twitter account or just type in a anchor which is a n k r um anyways thank you all for joining
foreign [Music]