On Account Abstracted, Automated, and Serverless Web3 with Gelato by Luis Schliesske (@gitpusha)

ETHDubai 2023 · 16 Mar 2023 · 29:44

Luis Schliesske discusses account abstraction, automation and serverless Web3 with Gelato, including Gelato Relay and 1balance.

Speakers

Topics

From ETHDubai 2023, hosted by DeFi Dubai.

Transcript

hello hello everybody is this yeah this thing works all right cool slides are up all right uh let's talk about serverless decentralized web3 backends with gelato who here knows gelato hands up please anybody yeah a couple couple of folks all right cool so the agenda for this talk is first I will talk about back-end architecture of web free apps today and then I will talk about how to decentralize your depth backend using gelato automate to large relay and serverless web3 functions so let's talk about back-end

architecture of web 3 apps today most developers starting out in the space sort of have this hopes and dreams that they never have to touch back ends again they never have to do devops again they just have to build smart contracts and connect them to their front end to their dab UI and that's it and it's true in some sense smart contracts can be can do back-end things uh but it's definitely not enough the problem is that smart contract alone as backends are not powerful enough smart contracts cannot self-execute their business logic they always require an external entity to send a transaction to them to call a function to propose

data all these things a smart contract always needs an external entity for a user sending a transaction a bot sending a transaction whatever an oracle sending and transaction gelato really are sending a transaction it's always the same and also blockchains are pretty isolated they cannot really talk to the outside world so conventional Tech backends you know they have a access to a rich Lake of data from web 2 apis all over the place smart contracts don't they can talk to everything on chain but that's pretty much it and there's a lot of cool stuff on chain but there's a lot more cool stuff off chain so yeah that's a problem with your user experience onboarding experience in general also needs help usually from backends to surface Rich data and in

general smart contracts as a backend is like not a good idea alone because they're like compared to Modern databases they you know they can't do SQL they can't do graphql yeah you can build stuff on top like sub graphs and so on like do all of these things but smart contracts alone can't do them so yeah um that's why actually um what ends up happening as you grow your smart contract sort of app you start building these back-end components and as your project grows and so on these become more and more and eventually actually your project looks now like a web 2 project again like you have this huge back-end these huge servers with AWS you have your micro Services your your rabbitmq you do

blockchain indexing you maybe if you want to send transactions have to store private keys in a cloud you have to make sure that's secure um yeah and if you see yourself successful enough you will also see yourself become the villain here because eventually you'll just turn into a Google or whatever right so so that's clearly a problem because we need these back-ends we have two technology is good it's there for a reason but it has to be decentralized as well a simple example from one of our spinner projects Iraqis Finance this does automated liquidity management decentralized Market making on universal V3 so it basically rebalances token liquidity around the price on University for concentrated liquidity management

and it has these smart contracts that are super cool has a front end but in the back end there's so much stuff happening like there's off-chain data and compute price data being fetched volatility data volume data you know data on when to rebalance liquidity you have all these indices of token prices aprs uh not just for the backend but also for the UI for analytics and then you have automation right like you need to automatically rebalance uh the pool that's the whole point of of Iraqis using gelato for example um yeah so so the the problem here is that uh basically I mean first of all it's a problem because you need to manage and scale all of these server resources

right so that's very costly very time consuming you have to manage the quirks of blockchain so you have to deal with different rpcs on different networks all with varying degrees of stability they can go down they can throttle you all of these things you have to handle that trust me it's quite complex then you need to pay all these RPC providers or run the nodes yourself everywhere in a scalable manner supporting I don't know hopefully thousands of users then when you expand to a new network you have to replicate everything for every Network and you have to deal with the quirks of every Network again it's if you need to send transactions you have to store private Keys you have to top them up you have to make sure it's secure

and say even if you are like a 10x engineer and you do that all of that is easy for you you still haven't really achieved anything because you'll just become the centralized point of failure of your own decentralized application so if you deploy application needs like a big back end which most useful applications simply do um then it's not a good idea if you're the only one running this back end because guess what if your backend us down your application malfunctions we lose all of the nice availability properties of ethereum and so on so yeah you don't want to do that so how to decentralize your backend using gelato first of all what is gelato gelato is

web freeze decentralized backend we are empowering Builders to augment their smart contracts to create reliable user-friendly scalable web3 apps without and that's important without sacrificing decentralization or censorship resistance although everything is always on a spectrum right so we're definitely not perfect here yet there and we want to get better every day so uh basically you see the stack here as before you have your front end you have your smart contracts and now you have what we call serverless web3 so basically all of your backend things that I mentioned earlier like transaction automation smart contract automation relaying of gasless transactions uh web3 functions so connecting off-chain data

with on-chain data all of this can be you write the logic you write the rules the business logic but you deploy it on gelato Network a decentralized network of nodes that are hosting this code for you and that are running this code for you and for data storage we're also experimenting with decentralized text so we do offer ipfs I also personally would love to look into our weave but we also have sort of modern SQL databases and so on that you can access in this backend you can think of this as sort of like an AWS Lambda but on web3 Rails so how does gelato work um basically you write your code and you write you know what data is to be processed what

data is to be validated what when it should be sent on chain to automate or to do whatever and this validation logic is run in a decentralized network we're soon also adding consensus mechanisms to have more security there and then once your code says hey please take this data and execute it please take this data and call my smart contract put data on chain whatever it's dispatched to a decentralized network of executors we call them that are basically very specialized client software we wrote that is extremely performant and getting thousands of transactions pushed to many different chains in minutes and from there we're entering the on-chain entry point of the gelato

protocol to larger protocols just as heads of smart contracts that basically you can think of it as slas like service level agreements that make sure that this gelato network of bots fulfills the conditions of the application that you are building and then from there we go to your Target contract for example pancake swap uses us or make a dial and we call the function that you need to be called we post the data that you want to be posted and and that's it so let's dive a bit deeper into automates that's the OG gelato thing that we sort of invented back in 2019 a smart contract automation protocol and it's really an end-to-end automation service that basically lets you define on-chain conditions

that should trigger transactions to certain smart contracts and gelato will then execute your function with the data and at the time that that you want there's also a nice monitoring alerting system to alert you about executions and everything and a very I think to be honest best in the industry easy to use interface where it's like technically you can go completely without code you just paste your smart contract address the API and you can start automating functions with a click of a mouse button yeah so there's a lot of use cases that have used this over the last two years for example in the yield farming section we have beefy Finance Harvest all of these guys that have used this for

automatically harvesting vaults prediction markets have used this uh there's a whole sort of weird corner of the internet that uses gelato for rebasing alcohol stable coins om for example did that then automated no top-ups there like optimism uses us maker uses us for nft Lending zedron uses the the Automation and super fluid as well does it for automated money management yeah so by now there's more than 300 projects using this stuff and over 2 million automated transactions and gelato has established itself as the number one automation service in web3 um yeah let's talk about relay that's

what we built after we built the Automation and that's uh um I mean you can think of it very simply as a very scalable transaction execution engine so for example cross chain Bridges like connects uh uses this to send thousands of transactions tens tens of thousands of transactions per day and as a developer it's like a simple to use SDK and API like like you would use in a normal web 2 backend and you don't have to worry and deal with all of the nastiness of transaction life cycle management like nonsense reorgs all of these things are abstracted away from you you just send what you want to send on Shane and gelato does it for you and in that timely and reliable manner it also enables something called account abstraction with any smart contract

wallet and you you might know gasless transactions so transactions where you don't have to pay for the gas that's also built with gelato relay and we have a gasless wanted SDK for that I will talk a bit about that later and I also have a workshop on that at 5 pm today bonus slides yay account abstraction uh it's just clickbait to be honest uh had to put in the in the talk but come to my workshop there I will show you a bit about gelato and account abstraction but for now I won't dwell on this all right last but not least our most recent release out of the gelato industry is the web weapery functions

what we call decentralized Cloud functions we experimented with that last year and released it last year and basically that's taking gelato to its next step by not just relying on on-shain data but also connecting your decentralized application with the world of off-chain apis anything really that you want to find on the internet you can use it process it and post it in your smart contracts so yeah let's talk about weapery functions um web3 functions are decentralized Cloud functions that enable developers to connect their smart contracts to off-chain data it ensures in the network that the data is accurate you can write these things

we call validators or verifiers that sort of Define your custom Logic for data validation and you can run off-chain computation and execute transactions from inside your web free functions on many blockchains so again it's somewhat like AWS Lambda but it comes with so many cool off-the-shelf things like easy transaction execution easy multi-chain data fetching all of these things uh in like this much code so it's really great uh you can send notifications um to monitor your application and then index and store data so I could totally see people dumping a lot of data from apis or from the blockchain into graphql database or something for dashboarding analytics all of these things you have like literally

it's General stuff so you can completely customary Define what you want to want to do with it um web free functions work like so you just have to write your web3 function which is a typescript file deploy to ipfs and from there gelato nodes will index it pick it up and run it for you and inside your file you can call any arbitrary web 2 API HTTP apis everything and you can also easily send transactions on chain with data from these apis again routing them with a larger protocol to your Target contract and doing whatever you want with that so some of the key features are it's typescript support with a Sandbox Dino

runtime there's a really great RPC provider abstractions we provide that make you know all these sort of blockchain data fetching and transaction sending across chain insanely easy you get access to secrets so you can have secret API keys on there it starts securely you can have private uh web3 function code or public ones in function State Management which basically means you get access to persistence in there like you can access a red sdbe do all sorts of things you can dump data into a SQL database uh yeah it has a very flexible paper usage pricing auto scaling all of this stuff that you know from the public cloud high scalability and one of the cool

quirks is you can actually spawn your web3 function Runner from your smart contract like you can emit a smart contract event and that thing will pick it up and do something and you know call back into the smart contract or whatever you want to do with it so this is truly truly this coupling this marrying of web 2 with web 3 combining the two yeah here's some code don't worry it's not that much uh yeah we got the web 3 functions SDK and it's really just this web3 function Runner and this thing is called um you can configure how and when it's called can be event based and here in this example we simply fetch data from a public Sports data provider

and we want to post the result of a football game on chain I don't know maybe for a betting debt or something right prediction Market um yeah so typical typescript you just fetch the data from you the API you instantiate the contract you you serialize the payload for the smart contract call and off you go you just return your object you say it can be executed and now your web3 function will use the gelato Network to post the data to your smart contract that's it basically so it's super easy to get started and you don't have to run any servers yourself you don't have to hire people to be 24 7 on patreon duty

gelato does this for you yeah so use cases dynamic dynamic nfts that change Based on off-chain data actually we you might have seen on Twitter we have a Freeman if Dubai nft I will share the link later in this presentation and later in my workshop I will also show you how the UI and the minting and everything works uh yeah so stay tuned for that you can leverage tax aggregators for automated token swap so you can talk to the one inch API for example Periscope apis that's usually super useful uh to I don't know for example a lot of yield protocols first always integrated with uni swap when they did rebalances because they didn't

have access in automation to off-chain data but now they can use Vonage for example instead of uni swap to have more efficient swaps automated swaps in the yield farming protocol you can leverage Bridge aggregators like Levi again any API really you can use to automate your smart contracts on or do whatever you would you want with it resolve rewards events like sports you can use chat gbt and post stuff on lens we did that already with corollao and yeah you can do multi-chain nft limit orders or whatever like The World is Yours at this point so yeah one balance bonus lights uh yeah so um

a lot of pain usually when you want to maintain an application especially when it's multi-chain is paying for the gas making sure that you have the right currencies at all times like you you're ether's depleting quickly you want to top it up you have to bridge it over from your company wallet blah blah horrible stuff we built this one balance system which is a multi-chain payment system we released it last year and very simply you just deposit UCC on polygon for example and now your usdc can be used to pay for all of your applications transactions on all the chains so you can top up UCC and you know gelato relay will execute transactions for you on ethereum on polygon your web3 functions all of this is paid for from a single balance no matter what you want to do across all of

the chains so that's really removing a lot of friction for developers and you can also use the same system to pay for your gelato API usage service users all of it so literally the goal here is to have one balance one token you there will be more options but for now as you see on polygon and that's it from there you can pay for transactions Services everything so yeah our mission is to get as close as possible to ethereum security uh for that we will launch the gel staking and slashing soon most likely next month already and uh yeah that's basically normal stuff right we have a bunch of node operators in the network we're adding more as we speak it's still permission at this stage but eventually it will be

permissionless and you can just join the network by staking the minimum stake uh and yeah that's launching soon we also want to have further security and decentralization in the network by uh we're already talking to the guys from eigenlayer to basically get more restaking to get more stake on gelato Network as well to to have more skin in the game for these node operators and last but not least we're also researching zero knowledge proofs at the moment for our web3 functions so that eventually we can also have uh basically verified compute outputs um uh yeah that should also make it easy to agree on data that was generated off-chain and verified on chain uh yeah that's the the ecosystem uh that

gelato has as you might know we've been live for almost three years and since then uh yeah we have been we have deployed to basically every evm chain and we have been used by many many projects uh in the aggregator system for example Instagram uh started using gelato already two years ago um if you've been on pancake swap or a quick swap or spooky swap they're all using gelato for limit orders um yeah uh zedron uses automation synthetics uses gelato automation uh beefy Finance you're in finance all these guys have used gelato automation connexuses layer 0 and multi-chain have all used gelato Automation and and Connex relaying as well

um makers used it yeah you know we have to update this chart quite a lot usually but that should be pretty up to date so this stuff is production ready it's better tested so you can go you know to production immediately and and don't have to worry about downtime or something like that yeah make sure to join my workshop later on it's about account abstraction and web free functions and I will show you how to gaslessly mint and AI generated East Dubai NFC it's a lot of passwords and it's at 5 pm in track 5 which is upstairs it's a bit hard to find so yeah it's up the revolving stairs there at 5 pm and you will get an AI

jpeg uh yeah again the agenda for the workshop is cementing a dynamic nft it will use account abstraction with pre-auth and so on so it's like a crazy cool user experience you just have to sign in with your social or metamask click two buttons and you get your nft and the nft is then using a web free function in the background that talks to open AI Dali and basically updates the metadata for the nft to post an AI generated image so all of this I'll show you the code how it's done and it's surprisingly little code actually yeah most importantly make sure to build on gelato if you're a developer visit gelato Network slash Developers

join our Discord over here is the QR code and yeah I'm good Porsche although sadly I don't push that much good these days anymore but but yeah make sure to follow us on Twitter and uh yeah thanks for coming and now if you guys want to you can already mint your nft here just go to this if Dubai nft.web.app that's the nft that I got AI generated and it's a free mint it's gasless you don't have to pay anything and you get your nft although we hacked this together yesterday and it's not optimized and we are throttling

the AI so uh the the AI calls the API calls and it's pretty slow if a lot of people mint at the same time you might have to wait like 10 or 15 minutes for your image to show up on openc and openc is also a bit buggy there but but yeah anyways just do it anyway cool yeah that's it so be gentle sorry be gentle you say they can't if too many people try to mentalize things just go go for it but you might have to wait for it it'll say it'll show the gelato logo and then reveal soon and then in the back end it will be the web free function okay that talks to open Ai and and gets an image generated and then posts this on chain into the nft smart contract yeah so we have up to like 10 minutes

for questions uh there's got to be a lot of questions about the gelato network uh if you want to raise your hand we'll leave this slide up too but uh raise your hand if you have any questions for Lewis and I'll come around and let you use the microphone anyone all right so is there a free tier of the service where developers could try out ideas on gelato before paying uh yeah I mean normally we try to always have a feature a free tier um so just uh come to our Discord our telegram let us know what you want to do whether it's automate or something like that by the way we're all on test Nets

as well so we are girly Mumbai all these test Nets on some of them like web free functions for example we pay for all of your testnet transactions also on Gurley literally had to buy some girly with eth recently to do that so so yeah you should be able to get started without paying anything so there's no cost for a developer to go and start playing around with uh the test net uh deploying an app to test Nets on gelato right sorry I didn't quite catch that there's no major cost for a developer to start deploying their apps on the Tesla on gelato no uh yeah all the infrastructure is already deployed right that's the whole point you don't have to write or deploy any infrastructure you just have to deploy your smart contract so yeah

that that's the only cost you have other than your hours that you're you know coding this up but that's it we have a question over here yeah hi it's Elia from plasma so uh for me um your product is looks more like a B2B now like for from developers to developers right just to optimize some contract interaction so what do you think about the market like b2c when the users can use the gelato to optimize any like abstractions or processes that they don't usually like you know the G5 saver optimize some of the defy processes what do you think about going gelata to this market and build some more nice UI and ux for the end user

so it's a very good question and gelato indeed is what I call like business to developer um and yeah so we we have you know sometimes we've done things on the user interface level as well like we did work with Ava two years ago and we had this automated Health effector Management so other users were able together with gelato on a UI configure an automation where the health Factor would automatically be pushed up again by reusing their collateral and so on but we actually decommissioned that um and and uh and we we had at some point a UI for this automated liquidity Management on uniswab and suddenly there

was like one billion tvl in there and we like what the like this is not infrastructure so we spun it out into a separate project where there's people taking care of that now in general like I think what D5 save and so on do is amazing cool automation I'm not that interested in going to the end user level yet at least I'm more interested in back-end Technologies and so on there's a lot to do there still so so yeah probably not not anytime soon all right another question back here unless you had a follow-up yeah hi uh I just wanted to understand that uh what will be the advantages in terms of speed and price uh of using gelato as compared to just using a Cron

job that is querying the chain data and doing so sorry I don't understand that I think there's like a bad echo or something in the room can you maybe repeat the question yeah uh am I audible now like can you understand slightly yeah but let's let's go let's go uh I'm just asking what will be the advantages in terms of speed and price precisely of using gelato as compared to let's say I have a Cron job that is squaring the on-chain data and just uh giving the events or like doing whatever back end work I want basically your question is uh basically you're a back-end developer you can just write your own Crown drops and so on why would you use gelato rights exactly okay cool yeah so uh I had a couple of slides of

on that in the beginning but basically I mean first of all uh so that you sleep better at night right uh what if your crown drop goes down or whatever what if your server goes down you have to be woken up by pager Duty and fix it so that's a no-brainer like you don't have to do that anymore and then most importantly really it's if you are building like a series where three application you want it to be decentralized you don't want to be the single point of failure of that right so gelato is a network of nodes it's not just us running these nodes we also have staking facilities many other node operators that are joining the network running these nodes so even if gelato the company shuts business in five years or so there'll still be others to service the network and your

application will never have downtime right that's that's the the idea uh cool just a quick follow-up on that so as you said like let's say if my cron or like whatever job I have on gelato gets skip so you're saying that the other nodes that are having the job they will be able to verify that a job got script and they'll do it automatically that's why I won't be needed on pager Duty or anything like that I'm sorry mates the Acoustics are so bad I can't understand any of that it's too much Echo yeah so if the Cron job doesn't get skipped on gelato

it's because the other nodes can verify sorry verify what that the job got skipped that the job happened yeah I didn't get that I'll have him come up and talk to you afterwards uh no worries do we have any other questions in the room and by the way guys if you have questions I'm going to be there at the entrance uh feel free to talk to me I'm happy to answer more questions there I'll let him come down now we'll save you from this but uh yeah everyone uh come see Louis ask him questions gelato is amazing I'm interested in the databases and thank you for coming yeah

yeah [Applause]