DappCon 2023: Hacking Decentralized RPC With Aqua And Marine - Fedor Kurbatov

DappCon 2023 · September 2023 · 15:04

At DappCon 2023, Fedor Kurbatov presents a talk titled 'Hacking Decentralized RPC With Aqua And Marine,' part of the event's developer track. An RPC endpoint is the interface applications use to read blockchain data and submit transactions, most commonly provided today by a small number of centralized node operators.

Speakers

Topics

From DappCon 2023, hosted by Dappcon Berlin.

Transcript

okay um so yeah uh my name is fer katov I'm from fluence labs and today we are going to discuss the D apps and their dirty little secrets that well they actually use centralized infrastructure and are not fully decentralized um I'll talk a little bit about fluence network uh what it is what is what it is capable of uh uh what possibilities uh does enable developers to uh to do and I'll talk a little bit about F frpc the decentralized RPC solution that uh you can uh use to dry fluence and to

mitigate those uh centralization risks that are associated with centralized RPC providers um as uh Zoe correctly identified in the previous talk um the web 3 is not only about the blockchain it's uh also about like uh General comput but first of all let's talk about D apps so basically a d app is an app which uses blockchain as a back end and uh it needs blockchain nodes to query them with the Json rpcs so and here is the uh usual like the flow uh of uh data that is running from the front end to

the Json RPC provider to the blockchain and uh hosting uh the uh and basically the web free developers have two options so they can either self-host uh the blockchain nodes well which is very difficult and very time consuming or they can use like centralized RPC providers like infura Alchemy quick node and other ones and uh from the like starting point that might be a very uh easy and intuitive way but it has some Kats so uh yes it is convenient it is cost effective um but it has certain

centralization problems well it's a single point of failure for the application uh there is also a deplatforming risk and of course it's introduces significant trust component so you have to trust your uh SAS RPC provider uh more on the uh the platforming risks so those service providers who provide the noes are actually like just normal businesses right that uh they are essentially very similar to web web two platforms so in case if the app has some uh limitations or there is some kind of legal uh Kats those platforms can shut off any application for any reason in

their multi-page ter terms of service contracts and uh this leads us to a conclusion that well uh while uh our web 3 apps uh have those decentralization overhead and added complexity they still pretty much carry uh the complexity and risks associated with the web to platforms so what can we do with uh RPC centralization problem and yeah let's try to drisk uh s rpcs but how can we do that um so in nutshell there are two

basic ways how to do that so the first one is to just make your application aware uh of the fact that well uh there are multiple RPC end points and you can add that logic to your app well or you can use some magic uh decentralized server l an openness platform to handle that for you but more on that later so uh let's explore the first option the option to roll your own Quorum or or fail over solution over multiple RPC end points so what it gives you yep it gives you lots of control um you can write your DF code to handle Quorum for Solutions you can uh make it very complex and in fact it will solve

the problem but it will uh uh really uh cripp your app in the long run so because it's closely it will be closely coupled to your D app code uh you will be uh tied to a specific web 3 SDK uh solution and it's adds lots of complexity to manage so basically you will uh spend a lot of time managing this solution rather than developing your app or you can use a decentralized permissionless open platform well it's also a good solution it gives you a lots of control it is decoupled from your D app so basically you point your D app to the uh simple RPC point and point that

you can run very much more in a much more simple way uh than the blockchain not and basically you're safe so uh what is fluence and where it is in this schema so is centralized serverless compute platform it is riable and trustless uh it is Unstoppable and CIP resistant and it's fa tolerance so basically it's also a compute Marketplace that replicates the cloud stack and it allows you to build decentralized apps in an easy and convenient fashion so you can think fluence as a file coin in compute and uh as the it was correctly

noted like by uh previous presenters uh the web 3 is not only about blockchain it's most of the comput is like general purpose compute it's offchain uh it's non- deterministic and uh uh it is uh the way the comput should be like in uh in most most of the time uh so why fluence uh we think uh of computer infrastructure as a public good like you know internet or crypto and we are trying to build lower cost sers ship resistant and uh no when the lock in uh solution basically where a marketplace where you can find different computer

providers who uh have different offerings and uh have no cost of switching between them we're also trying to build a solution that is uh that has uh zero trust security that is open source and it is permissionless so no kyc and no identity is required to participate in it both from the developer site and compute provider site uh and we think that decentralized serverless compute like is the next generation of Internet Computing so uh originally uh like everyone is tied up to those uh big Web Two platforms and we think that uh it is okay for some for for some period of time for some moment

but ultimately uh we want we think that uh businesses will tend to switch to decentralized serverless Compu platforms because well they uh allow more flexibility and uh creating a centralized computer platform is actually very hard so we need to maintain uh the generalized compute compatibility so it's not only like blockchain not only theistic compute but general purpose compute we need it to be verifiable so um that uh there is a way to verify that the actual computation at taking place and we need to be able to scale so that your code that was deployed into the network uh can

withstand uh certain amount of uh load and uh we actually had some uh really clever Solutions on that and we think that uh the competition for us is like some some something like AWS but not blockchains and smart contracts so we play on the uh general purpose compute field so uh fluence is a decentralized service computer platform it's both developer platform that uh allows you to deploy uh serverless functions and workflows on the network and a compute marketplace where uh the compute providers can uh deploy their resources and make money with uh with us with fluence um if we take a look at the

traditional Cloud stack uh to the traditional Solutions uh that are used by like multip projects we can for instance take a look at AWS uh Solutions like AWS Lambda so uh in our world uh AWS Lambda is Marine it's our uh vas run time that uh allows to execute web assembly files on our Network we have Aqua language that is an analogy to AWS tep functions or Google workflows and we have our CLI and web tooling that is similar to uh ss.com or cloudfire Wrangler so right now we have a live

test net uh we have deployed our decentralized extion protocol aqua and by Q4 this year we are launching our main net verifiable computation and we are on boarding computer providers with us we're also launching Dow uh so this uh whole protocol think is managed uh by the community but what actually is about der risking the rpcs uh so since like fluence is the platform we created a solution to demonstrate the possibilities of a platform it is called f frpc so what is f frpc f frpc is a super communion Showcase of what's possible influence

and it's it will allow you to uh try the network try to developer tooling and actually solve this uh RPC centralization problem problem uh so you simply deploy a uh selfhosted RPC resolver that connects to the network uh connect this to your D app simply by pointing your D app to this R to this single RPC end point config configure a set of RPC providers for instance you can put several INF fur nodes uh points several quick node nodes some some of your own nodes and run different Quorum load balancing or any other or random selection algorithms so that all the

calls from your D app are proxied to into the fluence network and then to those RPC providers and all this with uh really good latency and uh good throughputs and all this is right available right now on fluence test net so you can scan these QR codes it will leave it will lead you to GitHub there is a repository called FR frpc substrate and you can use this Repository as a starting point just to try plins to try this FR frpc and uh basically solve this uh RPC centralization problem for your D app right now you can do it completely free so it's on test net uh

in Q4 this year we are lunch main net so you can like put it into production too um okay so how does it work how does it actually work so there is uh your DF your DF frontend that uh you point to a very simple cell hosted Gateway it's a very simple tool it does not require you to do any complex stuff like running the full uh blockchain node it's a very simple tool that connects to fluence network and uses uh the peers in the fluence network to run consensus I mean to run Quorum or round robin algorithms over several centralized RPC end points and uh in natural it just solves this

RPC Central ation problem for any daab developer um yeah there is also a QR code if you uh missed it on previous slide so short recap so um you can create and operate the centralized RPC solution as a decoupled medal we for your D app it's very simple it's free for now and you can try it um you can also utilize uh fluence centralized feverless Network and open source tooling to uh manage this single point of uh failure or this centralization risks and you you can actually use this example to see how

fluence networks works and you can uh also implement the back end for a d app uh on fluence so if you need if you have some existing code which is running on AWS or uh on some like popular Cloud Solutions you can uh try mitigating that centralization re and also move some uh part of your backand code to our Network um Yep this is probably it uh what else um so if you if you want to learn more about flu fluence you can go to fluence deev there are several uh like manuals and books and intros uh that will get you up to speed with our

platform uh uh you can use aqua language to uh audit share and reuse distributed algorithms uh think of it as uh Amazon step functions where you can call different services and uh orchestrate them so it work together and uh yep so this is basically it uh this is the demo that you can uh that you can uh try to run uh right maybe later this day it's it's very simple so the you can use this command to just install our our latest tooling and uh use the FR frpc substrate

repository that I covered earlier to uh try it and hack along so thank you um we have like our website Discord Telegram and uh the career website so if you're interested in joining our team please take a look uh thank you thank you very much for the quality stuff