Waku 🛠Building with Waku
ETHGlobal·Wed, Oct 9, 2024, 12:00 AM
A Waku workshop! Embark on a journey with ETHIndia, where innovation thrives, collaboration knows no bounds, and hierarchies fade into self-sovereign ownership. The most skilled web3 developers, designers and product builders from all around the globe came together for a weekend-long adventure to advance the Ethereum ecosystem at ETHIndia in December of 2023! ----------------- Follow us: https://x.com/ethglobal Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com
Transcript
[Music] hey everyone hey everyone this is Guru uh in this Workshop we'll be looking at how waku is uncompromising web three communications at scale so introducing waku it's a family of robust censorship assistant and private family of communication protocols designed to enable privacy for messaging applications when I say messaging it's not restricted to chat but anything within the space which requires multiple parties to communicate with each other so the six main values of vaku are its private outof the box it's censorship assistant meaning that the network the messages in the network cannot be censored by any centralized stakeholder it's also modular meaning that it can run with any blockchain it's something that complement a blockchain but not a blockchain it's also adaptive uh and can run in any uh device in your mobile phone or in your browser even in a Dap node or a you know big cluster so it's adaptive to any bandwidth and it's also securely scalable we use uh sharding to scale it across multiple uh devices and multiple you know content topics it's also rate limited uh we have a technology called rln which I'll be showcasing in a couple of next slides uh so it's completely decentralized and we are one of those protocols with uh completely decentralized stack of rate limiting talking about the history it all started in 2013 with the ethereum white paper when the Holy Trinity of decentralized web was introduced so ethereum was for consensus swam was for storage in whisper was for generalized messaging but they were not much of dedicated teams building on top of whisper so in 2019 um we started building waku V1 and 2020 waku V1 replaced whisper in the status app so this was was a huge Benchmark because um satus app is one of the well-known Communications app in the web3 space and today waku has evolved into a standard for web3 communication so we have a vibrant ecosystem where we have status who is a web3 messaging app rail gar is a privacy layer built on top of ethereum the graph is also using uh Vu for decentralizing its indexes and a couple of more use cases and xmt is also built on top of vaku for this specific use case which is chat message so the key features of waku are it's adaptive as I mentioned earlier it can C any kind of resource restricted environment so on the left you have clusters which are which have more bandwidth and on the right you have browsers which have very less bandwidth so we have different implementations for each of these uh you know different resources restricted environments and it's also rate limited we have uh rate limiting nullifiers uh which is a truly decentralized Anonymous rate limiting technology with ZK proofs so we have a membership contract on the blockchain which can basically find if Alice is trying to spam your network or if Alice is trying to Dos your network so dos protection is something that we've been working on over the last couple of months and it's also open in permissionless uh Network we are built on top of lip P2P Pub sub so uh Gossip sub so it's a fleet of notes running the pub sub topic architecture so we have a lot of content topics within the waku network so it's basically like users can push messages into any content topic and also subscribe to content topics to retrieve messages so we have three key protocols especially for hackers to Target during eth India the first one is light push which can be used for pushing a data into a Content topic filter can be used for retrieving data from a Content topic and store is basically a temporary storage protocol uh at this point I also wish to um mention that store cannot be is not meant to be exploited it's not something for long-term storage so since vaku is a Communications protocol it's better to use something like ipfs or codex for uh maintaining your long-term storage needs so getting started with waku you have two ways of doing it you can either operate node and contribute to the waku network or you can build on top of vaku so operating a waku node might be a bit off topic for hackers but then um in in simple words we have three different implementations and ways of Hosting your own vaku node you can use our n vaku uh which is available we have binaries available on GitHub and we also have a Docker compost command for you to get started without much friction and we have a Dap node integration as well so you can run your own waku node in a matter of few clicks and building on top of waku is where we focus for hackathons so we have different waku sdks like JS waku which is our JavaScript implementation enaku is a Nim implementation goang implementation we also have rust bindings and C bindings so yeah coming to the resources we have a developer documentation at docs. wu. org so this will be a Holy Grail to get started with waku and it has pretty much all about the protocols and use cases about waku and we also all the code is open source on GitHub so you can find all the examples on GitHub as well and we have examples. w.org where we have like around five or six examp examples that use waku protocols so it's a pretty good place to get some references and all the research articles in rfc's will be available at RFC do.
de so we have all the rfcs available and it's been uh it has repos of over work of over last two or three years so definitely check it out and for E India we have bounties worth $10,000 so the grand prize winner will be bagging $44,000 for the overall best implementation of vaku we also have four different track prices we have uh best network State Goods using waku we have most Innovative project using waku and best privacy Focus project using waku and uh track dedicated for gaming and marketplaces so about the uh bounties uh all the bounties are focused to non- chat projects so we are not really encouraging uh chat projects at this point because we have a lot of chat projects around waku already so some of the example use cases over here will be gaming so we can build games with waku where you make all the game State Communications through waku we can also build decentralized marketplaces where for example if you are building a nft Marketplace that can have elements of vaku and that can decentralize the centralized parts of the currently available marketplaces to a great extent and also State channels is something that a lot of hackers have been building over the last few hackathon so that's an important use case as well and it's basically like you can build anything related to communication ation with waku and you can check out more ideas about waku around 50 ideas that we you know created for hackers to check out at ideas. wu. org you can also scan the QR so also shout out to waku network launch we just launched our network uh a day ago so make sure to tweet it out help us amplify the announcement and come to our booth for getting some swag and yes you can join us on Discord we have some active conversations going on over there uh so after this we'll be building something s simple with waku in the next few minutes so I'll have my uh colleague Sasha joining me so this is the game um let's create a new one so the game has created has been created let's go to and uh join it so now we are joining take some time we are using the uh test Fleet here uh so please expect some D there is a production Fleet with better timing so here it is it says like open and turn let's do this so I'm in the open and type uh top and I do the turn um so as simple as that uh if you continue this will be like a Tik toac to game everyone knows it I won't continue uh so I will show you the code the most important part of it and uh uh and I will introduce you to uh react hooks react hooks have the naming of uh everyone sees a code it's okay yeah uh so uh it's named like simple as v/ react I just install it and first thing that you need to do is to create an obstruction to connect to the network and we call it a Noe and a node that operates over the light protocols is called light node light prot protocols as Guru said just now it's light push filter and store so here we configure the uh the uh the node uh and I advise you to use this default bootstrap which allows you to connect to available nodes in the network so it does a job for you if you want to experiment more you can run your own note and connect to it by using a multi address it's very straightforward uh come to our boost we will help you with some edge cases if you might notice and uh here we mention protocols that we want to use and again these are the light protocols they may be mentioned if you don't mention them here the light protocols by default will be used so this is a whole Trinity of light protocols here um so yeah this is the provider react provider what it does that just puts the substraction into react rendering tree and uh then we just get it um let's say we created the game and uh uh and another thing to mention is that vaku operates over it is unbiased and it is unopinionated so it just takes care of transferring bytes from end points which means that we need to create encoder and decoder to read from this stream of bites and for that we have also a solution which is called uh content pay provider uh it creates a encoder and decoder for us and it puts into the uh the the the context as well so you just take it uh as simple as that and uh what we operate over is a Content topic and content topic is the abstraction that you should be you should familiarize yourself with and it allows you to send something to some particular place it's like a room right now I'm broadcasting some messages to you and it could be like one content topic I may want to broadcast a message to someone here in particular but overall everyone hears it this is how waku Works in a nsh show and uh yeah so we created encoder decoder let's go to the juicy part um so here I'm highlighting the line where we are getting the abstraction from the network and we might do something with this in this particular case we are passing it we are using it to retrieve messages and there are two ways to retrieve messages one way is to retrieve messages at hog this is called filter we essentially subscribe to the stream of messages which are happening after we start the subscription and uh in this line we essentially subscribe to it this is there is a hook it does it for you it will start iterating and it will be keeping updating the messages you just get it um and uh as well as the second way to get the messages is the store and this allows you to get messages which were their exchanged in the network while you were offline so to do that there are three lines so essentially like this um later on we can do some stuff with with with messages we might want to uh combine them together and uh like get only one Lop of messages and then iterate over it this is very straightforward um and okay what we can do else now we have a way to get messages from the past get messages from recent like from now and now we want to send messages right so um to do that there is a hook uh it's called White push and uh uh what it does is that you just throw in it some um yeah here is this line uh you get the push function what it does is that it receives um payload and some time stop what it would do beneath the uh the this abstraction it will create a Proto buff for us which follows the Vu message convention protuff and essentially an entity in the network which is exchanged everywhere this is the language nodes speak to each other and uh you can there is one field Resort for it and which is called um I will show you so please refer to this site if you have any questions or to us of course um and uh yeah let's go so learn here so content topic there is more information about content topic it follows some convention so please don't break it because otherwise the experience might be working might be not no one guarantees uh this is whole uh this is short description of protocols we covered here uh filter store and light push there are some other protocols if you are curious come to us we will educate you on this primitive um and uh the Vu message Vu message is the as I said this is entity in the network this is universal language we speak it consists of content topic the way where we the place where we want to send messages and the payload and payload is what the place where we put our information just bides you can do encryption on top you might do it you might not other things that you might want to consider is to check out the other places in our documentation I showed you right now how to use vaku react hooks but if you want to have like a little bit of more of complexity you might want to do some tricky stuff um I don't know like uh maybe writing it to some database writing to some fancy cache messages like rebroadcasting it maybe using some uh conflict free uh data structures for that maybe better way to use is to uh import the vaku cdk package and vaku cdk package has like roll obstructions which you need to use in order to achieve the goal whatever you want you have in mind and please come to us again we will help you so this is our job today yeah this is pretty much it
Automatic transcript — names and jargon may be misspelled.