DAO-controlled decentralized frontends
EthPrague 2024 · 1 Jun 2024 · 16:51
Pavel Losev, who works at ENS and was previously a backend developer at Fleek, explains why decentralized frontends matter after DNS hijacks and cloud outages hit DeFi interfaces. He compares hosting websites on IPFS, Arweave or Swarm behind an ENS name, outlines the risks of IPNS, cloud deploy services and updates signed with a single private key, and shows how a DAO can control frontend deployments with a multisig wallet, ending with a live demo of a tool he built.
Speakers
Topics
From EthPrague 2024, hosted by ETHPrague.
Transcript
[Music] um okay okay hello my name is pav uh today I'm going to talk about Del's control decentralized front ends uh here so the content of the stock uh first we're going to just oops um it's not showing um it's not mine yeah here it is okay uh so today we're going to talk about uh Central web infrastructure and the
problems that come with it um look at decentralized front ends and how to set them up compare different approaches uh of how you can do that and at the end I'm going to show live demo of the to I build that lets you set up a decentralized website and if we have some time left Maybe do a QA uh so a little about me I'm Pavo uh I work at enss before that I work at Fleek as a backend developer I have a passion for decentralized Technologies uh that give more freedom to developers and users and uh decrease the uh Alliance on Central authorities I also do some open source stuff here's my GitHub uh so let's uh remember about uh the issues caused by C INF so
in defi there was always been exploits most of them were smart contract based but uh there also ones that were surfaced based on frontend um in just in the recent few years there was was a number of attacks uh on DNS where defi projects had their DNS compromised or the register got uh social engineer got attack with the Social Engineering also years ago there was an outage U at AWS and it impacted huge amount of websites including one of them that was DX which is a DEX U they hosted their front on AWS so they suffered the outage
as well so how can we avoid all these issues and uh minimize the risks uh of stuff breaking and uh leading that to your stuff breaking uh we can move stuff to Global networks uh first of all uh we should move move our files to Global networks um and host them there our websites there primarily uh some of them are like ipfs air weave there's also swarm use any storage layer you want and uh if possible not rely on DNS because it's really Central the register can just take your name and close it and do anything you want uh they won't with it use a blockchain powered nameing system
for example inss there is others as well but NS is the most popular and the most common one and uh later I'll disc discuss about uh putting a multi wallet on top of a domain uh so yeah that's it and on the right just like you can see that uh like a website using an ipfs uh ID and also like an in domain setup so let's compare the centralized centralized networks uh and how in the context of front end so this frontend is website just files they're hosted by peers across a network of anybody who just copies your website and also like
uh hosts it each uh piece of content is verifiable because it has an unique ID that ipfs or air gives them so you can always just locally download the front end and verify that the website is legit because uh Condon ID used on the on the website production website is the same so it means they're all good uh you can also open uh device website through a number of gateways there's no Reliance on just DNS you can open it through NS Gateway through any of the ipfs gateways gateways and so on like the only Central part here is the Gateway but the content is always distributed and always decentralized and anyone can replicate it and help you host the website uh and
you can do it as well like you can just set it up on multiple servers independent from each other but uh it's pretty hard to do on Central servers because like if you want to do distributed uh hosting you're probably going to use a CDN or some sort which is usually corporate it's like owned by AWS or some other CDN company so they manage your stuff like you don't have control over it you can just decide to remove it or anything like that uh it's also mutable obviously uh and you can't verify directly like there's no HH mechanism built in to uh DNS or HTP like you would have to I don't know uh download the website to compute the maybe MD uh sh
hash and then just compare it but it would be not reliable and there's no replication built in like uh unless you maybe set up some kind of a vad balancer or some sort maybe it would work but it's like not as straightforward as with ipfs where you just import the cond ID and uh it just works so let's go through some of the approaches of how you can set up a dis inter website uh the first common is uh using some kind of a cloud service then uh an ipns that would connect to nns name for gex APNs is just like a mutable pointer to ipfs which lets you uh have like a mutable content uh which would point to immutable content so this way you could uh only
update your ens once your domain to point to your website and never worry about it again and the cloud service with the deploy and build a website for you but this approach comes with the numbers of risks uh first of all is uh that ipns requires you to have a private key uh to update it uh and maybe you could lose it accidentally or somebody could steal it but the biggest issue with it is a tiny network uh like unlike ipfs which is like has nodes all over the world ipns is like offered by like two companies I think and like nobody make sure that your BNS files stay on the network so it really slow and may take like a few hours for Network to
propagate and also of course the cloud service that you reason is obviously centralized because there's no way to like have a decentralized back end like that that would build the website for you um you don't have control of the over the infrastructure in that case and you also have to trust that uh the cloud service stores of the keys securely in encrypted form and so on and it could also maybe compromise uh yours since uh you store the private key of it as well second approach we could just ditch both ipns and the cloud service and just update it directly through some kind of xci script or I don't know a local script that just runs the
transaction and like builds it manually but I don't recommend doing that it's like super risky because uh first of all uh you could accidentally do some stupid and just uh break yours and make it point to something else uh if you use a c provider some somehow maybe like they could be just a compromise of the of the private key somebody could steal it and so on um but like there is one thing that you could do like make it a little better you could set up a different owner and manager so that uh the owner of the domain uh would be different from the manager manager is the address that uh uh basically manages the the N name and um when you have a
manager um you could uh split the access and uh only manager would have access to upd the name but you then you would still to have have to have a private key somewhere of it and uh if somebody steals it they also take all your E from the manager uh and the issue with the just updatings directly would be also High Network fees because it happens on the main net will probably cost like around five bucks and like if you have a Blog with a few updating it every time and paying five bucks is a little bit of a stretch and also yeah the private key is going to be might be potentially stolen or something that's going to happen to it so what if we just uh take all the good parts from
those approaches and remove the bad parts and we could do this with the mulig we could connect TNS to like mul wallet for example safe in in short multi is just a wallet that is connected to a few other external wallets and each of them has to sign um a transaction for it to get approved so this removes a problem with a where the private key of a wallet would be get compromised and thens would be compromised and so on there's no such thing because uh in save you have to have multiple parties to approve the transaction so it removes this uh risk so how this could this work uh there would be like a delegate address delegate is a a special type of
address in safe that doesn't have access to the the main it only can propose transactions so hello I'm proposing updating NS to point the new version of the app and then uh safe owner just say like hello yes sure um or they can just say no I don't want to uh and reject the update of the website so in case for example delegate gets compromised uh nothing's going to happen you just remove the delegate from the list of delegates and uh reject the transaction and set up a new one so yeah this is it and uh also in context of uh Dows you could Implement a mechanism where front would be updated based on the vots safe another multi 60
Implement modules for dlls uh safe has a governor model and based on that um you could for example Implement a mechanism where based on votes for example uh 50% uh of votes say yes to the update to the updates then the website will be updated automatically so yes I haven't seen anybody using it like only like a few defi projects manually update frontend based on dou decision but that's very rare so I would like to present my own project it's called blumen Uh it solves this issue with the difficulties of updating your dis website and also integrates with the MC so you can set up
this whole thing just like with one command and uh it will just work and uh basically how it would work is uh you would have a delegate that would uh offer a transaction to the safe and then the safe would just approve it ands would be updated and also it supports multiplo PS providers so you don't have to reupload it all the time okay and now it's going to be the web demo um okay here it is so here's the command probably not probably nothing is visible here little better not really so here I just uh deploy uh hello world on uh my blue
demo death uh Ono network with the save and now just deploying uh f f well whatever um I don't know what I'm going to do what might be no it's not not dead but I mean I can show we just tested before the talk uh um there was this yes before the talk with this it so with another piece of content it updated DNS from here from uh from here yes so pretend that this worked like um so yeah here it updated the NS uh with the IP hash and uh you can see it here in the records if you
open it it should load I hope yay there is yes so yeah this is the demo it's all done through the Mig you can see here it's just Mig and the transaction was proposed by delegate which you can see here so yes it's all distributed there is no Central party that would uh be able to like hijack anything so yeah this is it and uh if a moment so if you want to test it yourself uh
here's the link to the Ripple um I'm also on some social networks and foraster and uh if you have any questions please let me know raise your hand and that's it for the talk and beforehand if you want to ask a question use a microphone phone so we'll hear you um sorry could you reiterate what's the difference between uh your tool and ipns uh sorry uh you didn't use it uh right uh my tool doesn't use ipns because ipns would require you to store
the private key somewhere which is not nice and it it's also really slow so uh there's no like no benefit to it that much to be honest uh my tool doesn't use ipn it just directly updates ipfs yeah you would have to pay the gas but um there is a safe mode T that um actually execu the transaction so ipns is not used at all it's just direct ipfs updates okay thanks and uh so is your tool free to use uh yes it's completely free it doesn't rely on any service it's just a CLI that just reps a few ethereum apis uh and like has Integrations for providers and that's it like there's no server involved mhm okay no l or anything and so far in the presentation
we talked or you talk about um let's say uh keeping the website online yeah and uh and how how's that um on on the pr privacy front end uh on those Solutions um to uh to what extent do they maintain the privacy of the say service or the the hosting party uh I mean the website is hosted publicly by public noes they usually have some kind of like identifier uh I'll show one of my sles has ation with it's here like uh to the left like you can see like this is just arbitrary random uh services that have like their own ID and you can see their host name yeah it's not really private in the sense I guess it's all public
it's public infrastructure so uh that's the point the whole point is that like uh anyone can host any website and anyone who wants it can replicate and uh just will contribute to the network and Inc increase performance of the website increase uh decentralization so like if one of the noes goes down two others got your back okay thanks thank you so um bloomen uploads to IBS what are the current uh providers that you support uh we have filebase which works only on paid plan because they disabled upload the websites because people abused it to believe in uh there's a
three storage uh you can also use your own opinion API if it implements the spec and there's also Gateway 3 which works the best right now because it immediately shows up like in the content because but storage now is very sluggish but Gateway 3 when you uploaded it the website is immediately available available so yeah those are awesome thank you thank you anybody else no so I guess that's it or yeah [Applause] that's um
[Music]