WAKU Workshop 1
ETHRome 2023 · December 2023 · 21:33
At ETHRome 2023, contributors from the Waku project introduce its family of decentralised peer-to-peer messaging protocols, built for censorship resistance, privacy and secure scaling, and trace its roots to Whisper in the original Ethereum vision. Engineer Sasha then walks through JS Waku, message and content topics, relay, light push and filter, and rate limiting nullifiers for spam protection, as a hands-on start for hackathon builders.
Speakers
Topics
From ETHRome 2023, hosted by Urbe.eth.
Transcript
[Music] hey everyone uh good evening so I'm Guru from waku I'm one of the co-contributors for the waku project and I'll be giving you an overview about what we are building and what waku is so waku protocol we are trying to uncompromised at scale without compromising facts like scalability and level of decentralization and stuff so what is waku waku is a family of peer-to-peer communication protocols uh which are decentralized and you know into the web three ethos so why waku we have the following five important ethos for building waku
the first one being censorship resistance where no government or no governing Authority can censor a particular information from being delivered into the uh you know uh people and then we it's decentralized it's also privacy preserving we make sure that the whole architecture and the specifications are uh privacy preserving and it's securely scalable which is our Novelties when compared to a lot of other Communications protocols available in the market so we have a you know dedicated uh technology called Allin which is uh which we are using to make it securely scalable and about a history uh in 2013 when ethereum paper was um you know introduced we had three
things in the ethereum tri triology the first one being ethereum itself for consensus and the second one being um whisper for messaging and also swarm for storage so uh you know around along the years we've forgot about whisper and swarm and we've been uh bullish on ethereum but uh I think whisper is a Holy Grail to the whole web3 technology as a whole and until 2019 they were no dedicated teams working on uh building with whisper so there were a very few uh projects that were using whisper and status was one of them and in 2020 uh vaku V1 replaced whisper in the status app so status app was using uh whisper for a couple of
years and then vaku V1 uh gave it a lot of other enhancements in terms of performance scalability and stuff and in 2021 we introduced JS Baku which is the you know client Side Library which uses JavaScript and also go waku right now 2023 waku has evolved into a public good infrastructure project and being used by a couple of um web3 gen in the communication space so the model is oprandi for web for waku is we are building a public goods infra at this point so we don't have any cap capitalistic mindset as of now and it's a public good infra a bit before
yeah and it's completely open source we are using the MIT plus Apache license so it's open source and we have a set of U you know rfc's for technical specifications so you can scan the QR code and go through all the rfc's that we've been working on for the last couple of years there have been years of research into it and rfcs are one of the proofs which exhibit our research and um RFC specify waku protocols and also in include security considerations so it has you know all the edge case scenarios of the protocol and everything related to waku so about e room we have two Workshops the first one being uh build on waku which is today and then the
second one would be uh you know Workshop where you can operate your own waku node which will be for tomorrow and we also have a curated set of ideas for hackers to build on uh you're not restricted to these ideas but then uh here are some Inspirations that you can use for building your own project at this hackathon and about the sdks we have a couple of sdks like JS vaku if you're a JS developer you also have go waku enaku C bindings rust bindings and stuff so you can find a documentation by scanning this QR code it's just docs. wu. org uh so today we'll be having uh one of our Engineers from the JS waku team who will be giving you Hands-On demo about using
JS waku and also building a small MVP out of it so Sasha hello I'm Sasha um not to forget to mention we have this beautiful cheat sheet for hackers at our boost at the entrance uh so please come and um yeah so what is GS waku so this is implementation of waku for browser environment and we have uh three pillers of it one is create vaku app which you can use to boot would strap any re uh GS application just a CLI tool we also have built some Hooks and components for uh react application specifically which is
uh done by uh waku react package and we also have a cdk package which is should be used for some advanced stuff if you want to achieve such as uh retrieving some storage messages from storage Etc so what is vaku message vaku message follows some specific U uh template and there are only two main fields on it this is a protuff of of vaku message which is relayed over the vaku network there are two uh main pillars of it is payload and content topic payload is just an array of bytes which you can put anything you want to uh I don't remember what is maximum
size of it but there there is this opportunity and content topic content topic is uh a topic under which messages are exchanged and should be perceived like a room as we are right now in a room and we are communicating and there are some messages circulating around in this room um other fields are for more advanced stuff so you can familiarize by going to the dog site so content topics uh not to get lost with some definitions there is uh two topics in the system content topics and pop sub topics pop sub topics should perceived like should be perceived like an application Nam
space where you exchange messages for your particular application so let's say you have an email client built on top of it it has its own dedicated pop sub topic and some servers are listening to it notes in the network and content topic is more of a stream of data within this application just to give you a an understanding of these um ideas so another important part of Wu is a spam protection which we are working right now really hard this is achieved in our Network by using rate limitting nullifier R for short and uh what it does it helps Network to perceive
resources and uh once we set it up we can say what maximum amount of messages can be sent per second per someone and if they send more than this by default Network sles them and they are not participating in the Network anymore so this is a good feature it is under uh it is under uh active working and is alive on SEO for now um so what are waku protocols a backbone of waku is a relay protocol uh by the way you can refer to them in RFC do.org site so uh to read more uh this is the main protocol we have is
relay it is a backbone of the network and this is a gossiping sub uh gossips up essentially so whereas there are nodes connected to each other and they follow some rules where they exchange messages within the network uh there are also protocols implemented for light clients light clients are uh mobile phones browser tabs Etc where there are not many resources in the network on their device so there are two protocols for it light push and filter light push is for the economical push to the network of messages and filter is a way to listen to the messages on some particular content topic uh also there is a protocol to
retrieve some messages from which happened before so this is a store protoc protol which we have and uh some nodes May implement it or may not it's depending on node operator and what it does is just allows you to query Network for messages from the back in time and uh since waku message itself is just a blob of bites it can be anything you can send your messages privately or openly everyone can read them but it's up to you to introduce some encryption and for that we have a we addressed it and we have some packages which facilitate it you can use it for uh some encryption of your messages so that people can see it
on the network but cannot read only you can decrypt it and uh today I will show you some examples first example is uh a web chat and there are some protocols implemented I will show you how to bootstrap this example and how to use it essentially it uses store protocol to query messages from before it uses light push to send messages in a economical way let's say filter protocol to listen to messages from the network and there are some Discovery properties shown there there is a second example I might not show it today but you can refer to it from our repository what it says is that how you can do end to end encryption and how relay works and uh uh to speak more of echo
system of waku uh as were mentioned before by Guru we have three main clients which are implemented in JavaScript go and n and uh based on this we built some C bindings and thrust bindings as well as some adapters for nodejs so essentially we covered a lot of U use cases you might use in this hakon so and particular use cases of waku uh could be anything like you can use it for chat message application you can use it for signature verification or something you can use it for syncing game state of your decentralized game or something opportunities are endless your
crazy ideas are welcome and uh if you have questions you can scan this QR code and shoot questions or you can just shoot them them right now uh these application by the way is built by waku it's built by one of the uh hackers we have so um yeah that's uh pretty much it now I will follow with follow up with some questions if you have if you know I will go on to showing you how to bootstrap an application in JS waku which probably more beneficial yeah okay so everyone agrees with that yeah um so to bootstrap an application you
can just open your terminal and do npx uh create okay I see you is it good enough more should be good enough right cool so npx create um I don't remember so where it is yeah npx create uh Wu switch up in
create no not this one so sorry for you this one where was it yeah let's say yarn I think yes so we can create some application by doing so right now it does download the package for creation creating okay missing arguments Project Director Ed so I can set up it in some
waku up folder so right now it asks me what kind of application I want I will show you right now web chat application uh it can be anything so you you're welcome to discover other opportunities for it there are use cases shown in this application so I will select only web chat so right now it does uh install this web chat application into web app folder VAB folder I'm sorry it is installing some npm packages we can wait yeah so it did this in 63 seconds not
bad so what we can do is we can go to this application waku up and uh essentially this is just uh uh application front end application so what we can do is start Hing with this so I you should trust us uh good enough so this is the application I've been mentioning we can actually even start running it so I can do npm start so yeah that's going around on Port 300
3003 okay this is the wrong wrong one yeah yep here it is we going to run it's probably building still yeah it's still building um cool so here it is this is web chat application you can exchange messages in here uh um here I sent a message whoever can visit uh the uh a site examples. w.org
webchat this is a hosted web chat example so here you can see my message being sent to it um yeah so it shows you some useful metrics you can go you can go and find in the network in the code I'm sorry and it shows a state of a network so this particular application discovered 30 noes in the network which from which it connected to seven notes I'm sorry you probably don't see is it better so it discover discovered 30 notes it connected to seven so essentially what this application did when I sent a message it sent a message to seven notes in the network and this messages propagated this message forward
to which they were connected to and what we have here is eventual delivery so my another tab is connected to only three nodes here and it got a message still so and it might be some other notes from other sides of the net of the of the world so we don't control it at all and U speaking of code I will show you some code here um this is react application as I mentioned and we implemented a particular package for usefulness of your hacking so you can just install it and in uh this file it's shown how you
can create a node it pro it uses a light node provider light node is the node that uses light protocols uh like light push and filter you set it up with protocols that you want to use actually by default it will use only those two but if you want you can add store and uh yeah it adds it to into react context and you just can go somewhere where the message is sent like let's say here you can um receive messages so there are some hooks implemented on react vaku and you can just import them and use this Hook is for use filter is for filter
protocol you store for store protocol and essentially what these two lines are doing is that in the first line you subscribe to messages and you retrieve them in the second line you just fetch them from the network um I will show you some other example as well so um let me Shut It Down yeah good enough so if you follow to a site which
is called examples. vacu.org as I said you'll be redirected to the to a repository we have with other with all examples which I shown you by the create vaku app uh npm package here are these examples and you can just start using them or you can visit them by following to this um URL and um I'm sorry this no this one this yeah this one if you are not using react it's not a problem you can just go into using plain JavaScript and you
building your own obstruction to uh any other Frameworks like spel whatever and um it you for that you would want to use a cdk package which I mentioned waku cdk and it exports a bunch of stuff but main one is this one create light note essentially what it does it creates an entry point to a network it is an object through which you can communicate with the network you create this note abstraction you can start it whenever you want to and uh you can subscribe to some messages from this uh like uh yeah so uh you can subscribe to some messages
from here somewhere yeah yeah here so you set it up with a callback and whatever whenever you receive a message you're going to have it here and you can do whatever you want essentially um I think this is good enough for you to start hacking if you have any questions come to our boost and we will help you with payer programming session with other advices or use cases so that's pretty much it yeah also to mention we have a couple of bounties for the hackathon uh we have a total Bounty size of $188,000 so on spot we giving out for
$4,500 and then we have $14,000 uh up for Grants after the hackathon so the first price would be uh $1,500 and the second one would be uh $1,000 and the third one being $500 so yeah please come and hit us up at the booth we have some swags for grabs and we are also looking forward for the Chit Chats um you can also discuss ideas along you know to us before the hakatan starts we have some specific use cases that we are looking at so if you guys are ready to hack on those use cases we'd be pretty much excited to help it so thank [Applause] you
am
Related talks
- Logos: a technology stack for cypherpunks
- Permissionless P2P with The Waku Network
- Censorship resistant storage network powered by Decentralized Durability Engine
- ZK Hack Montréal: Risc Zero - Boundless On-chain Execution using Proven Off-chain Coprocessing
- Build Your First ZK App with Noir
- How to Build Private Smart Contracts on Aztec for Solidity Developers
- Building the Data Layer for Ethereum's Institutional Era
- Demystifying Ethereum Assembly by Joshua Riley | Devcon Bogotá
- Péter Szilágyi - Decentralization: origins vs. reality
