How to build Web3 communication in your protocol (EPNS)
ETHCC 5 · July 2022 · 25:49
Harsh Rajat demonstrates adding web3 communication to a protocol with EPNS. The workshop examines notifications, use cases and the experience of both users and developers.
Speakers
Topics
From ETHCC 5, hosted by Ethereum France.
Transcript
service epns for short all right we'll re-doodle awesome so again we hey everyone uh this is harsh from ethereum push notification service eps for short uh this is going to be a talk and a little bit of workshop uh so what we are going to cover like why communication matters what it is uh then how to do the web 3 notif i always put 10 minutes but it's 10 minutes or more uh what is the future and uh then we'll have time for some q a if you want to
so let's get to it like the what and the y we always start with good vibes so here it goes [Music] all right awesome all right so uh what what is the missing piece of f3 that we are trying to solve uh well uh
it's actually communication or the lack of it uh just think about it everything starts with notification in our day-to-day life we get up in the morning we look at our phones and we have all the notifications from our important email our important work thing paypal venmo payments amazon delivery any social media we do or even something as personal as talking on whatsapp uh but yeah that's just uh web 2.0 uh when you come to web 3.0 web 3.0 cannot notify users and therefore cannot communicate out we usually take indirect approaches to do that like twitter or discord which again results in a very uh extreme critical info drop
for example if you're in d5 your loans will get liquidated if you are on governance governance proposals will be missed and uh if you have a ens domain that will expire and so on and so forth so yeah uh let's elaborate that further so who all of you are part of a dao ah awesome daoists so uh yeah so those uh just imagine those are not able to talk you are talking on discord and most of the time we have seen that problem uh getting surfaced again and again uh discords get hacked uh plus there's a voter apathy uh when we are talking or when we are moving governance proposals uh we don't
get to know about it important proposals are missed and again that's because there's a lack of communication no one is communicating to your wallet address uh there's a lack of direct conversation as well so that's something like the dao can massively improve on by adopting a webkey native communication layer uh let's move to d5 anyone in d5 celsius okay oh sorry dude but yeah so yeah the d5 it basically fails to notify um just think about it we have our loans on d5 and they get liquidated and we as a wallet address data our usernames we don't get to know about
that uh it never happens in a web 2 world like we go on a vacation and we come back and the bank has foreclosed our house and says like sorry you were on a holiday and we cannot reach you but with d5 that's the real real possibility uh then we can move on to some other uh non-serious but still critical issues like the farming epochs uh they come and go and we are not notified so we often miss those rewards out the interest changed in d5 we missed that out and let's go to an ft and metaverse so who all are millionaires over here or have nfts future millionaires okay
awesome so just just imagine like nfts and metaverse like there's no way for metaverse communication to happen very recently decentral and uh did a new year party not very recently though but uh what they did was they had a zoom call and they had a new new year party in the metaphors that wouldn't have happened if they would be using a web3 communication layer uh that way they are just talking to wallets nobody has to be on zoom call and it just results in a better experience and ft re-bids just think about it like we as collectors we get nfts from uh people who create them we like them but whenever they launch a new
collection we miss that out and that's because again there's no communication there that's uh making sure that we as wallet address we can interact i mean a tldr is like when we are on twitter we talk to each other through twitter usernames when we are on whatsapp we talk to each other through whatsapp usernames that are phone numbers when we are on web3 we have a shared username that's our wallet address and that is where we should talk or communicate on notify which of course brings to us like the solution uh well we basically saw this problem back in 2020 and we build the solution out in hackmany 2020. the solution is of course to create a decentralized communication protocol
using which any smart contract any dap any backend they can just send notifications that are tied to user wallet addresses these notifications of course needed to be multi-chain like covering all web free even evm non-evm uh they needed to be gasless because when you're sending communications when you're talking to each other you of course are not going to do it for transactions and these uh communications they also needed to come from open network just like how ethereum does it ethereum data is exposed to all the crypto wallets so the crypto wallets of your choice can tap into your data and can show it out to you and you can interact with it and that is exactly what epns does but for communication it
gives you open gasless multi-chain network which any crypto wallet can just tap into and can show all the notifications that are tied to your wallet address and more uh of course more is chat but yeah so that's epns uh let's try to see if we can do or send a web3 notif and mets or less i actually were going around a lot of examples so we basically support everything you can send notifications from subgraph you can send notification from a backend you can send notification from adapt but over here we are just going to see how to send notification uh from a basic app so
right now i am just going to go to our staging site which is staging.epns.io uh as i said any crypto wallet can just uh if they tap into the network they can show these notifications out uh for this demo we have our chrome extension that is tapping into the network or listening to the network and can show the notifications out uh we also have our mobile app but any other crypto wallets can also do it so the first thing as a developer i need to do is create my channel channel basically allows me to send notifications out and it also enables you as a wallet address to basically opt into the channel so you guys are not getting spammed in web3 uh
of course if you want to opt in you just go to channels and uh i'm logged into my wallet address so i can just opt in uh of course i've done this demo countless times so everything is opt out but yeah there's our opt-in if i opt out of something again this is gasless for the user because the user doesn't really have to pay gas for receiving communications and what's happening in the background is that the ip7 went to signed json payload is getting to the push nodes and the push nodes are validating everything out and based on that they're indexing everything out so yeah um i as a wallet address have my own channel i'm subscribed to my own channel
so we'll just see how to send the notifications out i can also delegate my uh channel or i can also add more wallets which can send notifications from my channel over here i'm just going to put a notification type of targeted uh we do several type of notifications it can be subset it can be uh broadcast as well and yeah to send a notification let me just enter my wallet address uh notifications basically are content independent that means that the json payload defines what the notification will be and because of that we can do so many cool things we can add images
youtube things ctas or in the future even encrypted notifications so let me send a notification out i actually found a very cool tweet from kevin so we are just going to load that tweet in and we are going to send this image as a notification again he is just talking about dows and like how hard it is to uh get the dow working uh tell epns so uh over here i am going to enable media i'm going to put the media url it shows me a little preview i'll also say no more
or fw and uh yeah i've put in my address and this is a target notification so as soon as i send notification in the background the notifications are getting uploaded to ipfs the json payload is getting uh generated uh getting signed by ip712 and then getting sent uh directly to the push nodes uh in a while the push nodes picks it up the push nodes then basically validates everything and if everything looks good the push nodes will send a notification out to me so it might take some time because of course when i'm doing the demo the internet will not be very very fruitful
but hopefully before the end of the demo we you can see the notification it's usually real time i of course tested it out a lot before doing the demo so you can see how the notifications look but yeah that's in the dap you can see the same thing in the chrome extension as well and in the mobile app or anywhere where the crypto wallets are there or the crypto wallets have adopted the epns out so yeah that's how to do web3 notifs we support so many type of notifications we or also support sub graph notifications if you want to do that just go to docs.tpns.io you can follow uh what to add in your
subgraph to trigger those notifications out we also do back-end notifications for all the uh defy loan liquidations that are not on chain events so yeah everything is practically covered and yeah oh so let's move on to what is the future so yeah it all starts with notifications but notifications are just a mean to build some very cool applications after notifications whatsapp was built after notification facetime video was built after notifications discord and everything just got so much better so much social and that's what we see in future of web3 as well uh our vision is
to be the de facto web 3 communication protocol so kind of ethereum is a misnomer over here now but yeah the vision is that you as an ethereum user can even talk to a solana user in the solana wallet or in the ethereum wallet and a solana service or ethereum service can even send notification to you no matter if you are checking your wallet on solana or if you are checking your wallet on finance or ethereum or polygon or anywhere else okay uh alpha time so as i said it's all it all starts with notification but that's not the end it actually is a mean to achieving something really really
cool uh we teased about this when we launched on in january on ethereum mainnet but yeah a little alpha the chat is almost done it's coming your way it's uh web3 native and it supports group it supports images it supports uh sending payments and of course it's again content independent that means you as a user you as developer can put in new content types or new cips that's what we call them chat improvement proposals and once it goes through the community it will keep on getting adopted and that's how we are going to build a communication based web
tree notification and communication layer uh all right again uh thanks for uh attending the workshop if you can call it a workshop but yeah if you're a dev go to docs.epns.io and you can find everything about how to develop this right these are some of our build ideas in case you want to scan the qr code i'll give you guys some time and yeah time for q a awesome product do you have an sdk if you want to encode the notifications into your app yes so we have a sdk like we have a
javascript sdk and we have a scaffold also you can find it in our github repo uh just go to epns.io scroll down and you can go to the github people and you can find all the examples again docs.epns.io also covers a lot of the examples and as a as a user of notifications i need to approve any message that comes my way yes so you approve the services or the users that's like the first intent that you need to opt in uh the reason to do that is because you know i left my privacy setting of telegram as off and the morning the next morning i got up i saw how horrible it is if you don't opt
in to everything so that's why it's a permissionless protocol but it's dependent on the user permission if you opt-in to any channel or any service they can send you push notifications if you don't then it kind of follows the twitter model where it goes to your spam box cool awesome yeah question if you can elaborate a bit on the security and privacy of this platform like i don't know do you use signatures or who guarantees the integrity of the sender and the receiver is the same message or
what are the privacy consequences got it got it so yeah uh the way we approach privacy is two-tiered the first year is just sending a plain notification out so what we realized was like uh you as a wallet address your blockchain data is already available publicly so what you are doing is you are just converting it to a human form or the protocols are doing it is just converting it to human readable form and sending it out in that case they don't have to encrypt it out but in the cases like chat or in the cases where you know uh the privacy is important we do support encryption and the encryption is again uh content
independent which means that we assign a type to each encryption right now we support public and private key encryption decryption but we are going towards uh pgp plus public and private key encryption decryption and uh as long as uh the push nodes or the cip improvement proposal keeps on rolling the encryption type can be defined and uh the encryption standard can be updated but yeah that's how we uh ensure that if a message is encrypted only then only you as a user who have access to the private key or the wallet in which you have imported your private key can decrypt it out thank you for the talk
um what are some of the limitations that you're experiencing i don't know whether scalability and also i mean just the amount of data that's required to maintain the network and the number of users that you have got it so we are building uh our validated roads right now so it's a really really awesome question uh in terms of scalability like the thing that we want to achieve is near uh real time speed and that's what we are working on of course uh when you are looking at blockchain or when you're sending a notification from a smart contract to another smart contract then it's dependent on the transaction speed of the network uh but yeah in terms of uh off chain notifications it's almost real time
and that's that's the way we are uh going to go about it uh it is challenging because you know we are going to implement sharding to make sure these notifications or if a billion of uh notifications and chats flew out it is challenging to you know get that mark right but i think because we had uh a good amount of time to uh learn about this and to work with a lot of protocols to understand this i think we are almost almost there of course i cannot say we are there yet till we release the elf out but i think we are almost there thanks for the talk really cool um i'm sure i can find the answers in github if
i really dig but i'm kind of excited and wanting to know what the flexibility of your back-end sdk is so um is it entirely possible to dynamically update uh a list of wallets that you're sending messages to and then uh you have examples of compiling on-chain and off-chain data for unique messages to each one of those wallets that you're targeting yes yes so as i said like the if you want to do like a bare-bones gs sdk we have that but we also have this scaffold which kind of is a very advanced version of the sdk so you it teaches you like uh how to make sure that if the users are
dynamic or if you want to send them different notifications out you can do that uh we also have examples over there uh about uh what we are doing with rv and what we are doing with uni swap so with unit swap what you described is exactly what we are doing where in unison v3 if the lp pool falls out of range for you then only you get the notification that you are not earning the fee so yeah uh check it out in the worst case scenario uh you don't find the documentation just hop into our discord like our devs are there 24x7 so they can help you or just tag me so yeah can you talk about uh who's paying for
what good question all right so um the vision is like as a user you guys never have to pay uh right now because we created this thing and we are we just launched it out so of course the services are not paying as well but in the future the users or the token holders they have the option to flip a switch at that point uh the services will pay a fees which will be a monthly sas based fees and the chat uses the super users of the chat they will also have the option to upgrade their account kind of like what telegram does and all of those things they will accrue to the protocol and the idea is that because
this is a web3 protocol managed by the token holders so those token holders will be able to take a part of the fee while another part of the fee goes to all the crypto wallets that have integrated therefore you know making it a win-win for every player in the ecosystem sorry back again um the uh can you talk about some of the user experiences for the like recipients in some of those projects like ave and sushi swap like what are the what are the users actually experiencing how are they engaging got it so uh i mean we do have uh seen a lot of tweets coming out from user time
and time again about their loan liquidations getting saved uh personally i've seen uh people tweeting that we saved the ens domain name from expiring because we work with uh ens as well so yeah it keeps on flowing uh right now on twitter like people who just keep on saying that you know this was something which was very needed and uh epns was able to uh do the right thing at the same time i would like to emphasize that because this is a communication layer and what we thought was that the application or the protocol knows what best they want to communicate with the user so because of that the experience has been overall very very positive because the protocol
knows about these problems and when we first started we went to these protocols and they were like yes this is a known problem and this is the notification that we want to do so it's basically from the protocol to the user and because they understand the user more so because of that it usually results in a very positive experience rather than thinking about the question in terms of like higher level customer experience and like feedback i was more sort of asking about the the actual user experience in terms of like application design and how they're interacting with epns um what is it got it so yeah uh i think uh what we are doing is we are listening to the users again this is a new primitive
that we created or invented so we need to listen to the users to identify the problem like one of the problem the user said was that they don't want to download the mobile app so then we created uh chrome extensions then the other problem is that you know right now we were focused on services and now we are focusing on crypto wallets to adopt us so again that's a friction point for the user because the user doesn't want to have the chrome extension they want notifications to come directly to their wallet address and that is actually our vision as well that for the ux of web3 to improve all of this needs to be just a communication middleware and the crypto wallets adopt uh us so that uh the
the user experience becomes better and better so answer is we listen to people on discord on twitter and we try to identify the problem and try to work it out and uh i think till now we have done a good job so yeah so just to be clear like if you wanted to integrate this now the each uh say they're interacting with like some staking pools or something and we want to send some personalized messages to prompt them um each one would have to download the epns app onto their mobile device to receive the notifications is that correct or do you already have like sdks to be able to integrate into for example if we had a mobile app then we could start to push notifications throughout we have the series like and in fact uh
from the previous hackathon we started encouraging developers to adopt this notification directly uh in the ui of their dap as well so we have that also available over here i wanted to show like a fork of unit swap and how to do it but yeah this is uh this is something you can do on your dab as well or on your mobile app as well so yeah the sdks are available to make sure that this is as open and as composable as it can get awesome thanks awesome all right
awesome thanks everyone for coming in and uh i'll be outside in case you have any more questions