New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Cartesi 🛠️ Make it rain billions/tx on a Linux VM - Gabriel Barros

ETHGlobalMon, Oct 9, 2023, 12:00 AM

Join Gabriel Barros from Cartesi for a workshop titled "Make it rain billions/tx on a Linux VM". Learn how Cartesi Rollups works and how RISCV enables billion CPU cycles over ETH infrastructure. Stop worrying about Solidity and expand on what's currently possible by writing Python dApps using a fully fledged Linux VM. Thank you to everyone who joined us for ETHGlobal Paris 2023! Paris is the city of light and birthplace of many revolutions. Therefore we were thrilled to be back in one of the most buzzing and free-spirited cities in Europe for ETHGlobal Paris 2023. A lot has changed in the European ecosystem since the last time we hosted a hackathon in 2019. ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

foreign [Music] I'm gonna give you a quick overview of cortezi how it came to be and a little bit of how the Roll-Ups itself Works what is the basic infrastructure that so makes it possible and I'm gonna show you a few projects that's been built to using Cortez in other hackathons such as this one so as Nick Peak this is a python code it's kind of like a script at this point but it's basically a cartesite app already this step is Echo um a smart contract so it will be the equivalent of having a solidity contract that whatever it receives it replies back as an interior event but here you can see that we're importing python libraries we are using HTTP requests and how the that is that possible Right um so Cartesian here I feel like this kind of public we don't need to explain the trilemma again and what AGM brought to us basically ethereum brought some very interesting properties but it came at a cost of scalability and evm itself it's a really good machine to embody the necessities of the constraints of a blockchain but at the same time it limits our content capability so meaning that even if you buy some magical reason managed to get much more output from the evm is still constrained by the Format of the machine itself so the idea is what if we can have complex computations and blockchain security guarantees and still add great tooling to it so basically what if we can have web 2 um the web to ecosystem going back towards the the blockchain so the basis for that is two pieces first Curtis is application specific meaning that you can deploy this on top of any other network or on top of any other roll up it can be a zero knowledge roll up after we set for a lab as long as evm compatible this could be applied on top so it's technically is a layer and solution and the second one is the risk 5 deterministic machine because of this uh platform processor which is an open source competitor to some sort to some extent to Intel Med uh you can have on OS so meaning you can have Linux back and in this in this way basically you're enabling the uh the ability of having JavaScript python sqlite databases any of the other framework and tooling that we're used to to support our applications because the Cartesian machine itself is deterministic meaning you can do interact interactive fraud proofs back on the base layer that you chose to deploy so to be more visual this is what it looks like to be coding for the evm or consistent right now you have a very good player and sets of pliers but that's it right if you need to nail you cannot really do it that properly and Cortez is trying to bring back all the tooling that we used to have so and that really looks like this your cortezidaff at the end of day is a darker build you you basically do your recipe your Docker file you build a Docker image bundle that to the cartasia node now you've created a node that is specific to your dap meaning you now have your application specific rollout and that's what it feels yeah you can have your favorite language you can use complex libraries to do things that we just take for granted like for instance logarithm uh you can have all these other Frameworks a engine that one star repo that sometimes just coming so handy which and I you really use that with solidity really right so and here is like an attempt to compare what it means to code in such platform when compared to ECM so being very generous to the ethereum network right now you can have a maximum of 30 million gas per block and the less expenses useful up code would be add a subtraction which costs free gas so we're looking at 10 million instructions for a block that's being very generous right and to put Linux and we know this because we have all the inspections here it's kind of small to read it's about 36 million instruction Cycles so that's just Linux booting and being ready to do whatever you program it to and just to be fair then we limited the Cartesian machine to 13 seconds execution which would be the average block time right and in 13 seconds on a laptop such as this one you can have 3.7 billion instructions being executed so the power that it brings back is very huge and it's even difficult to grasp so here's the image that helps you with that that little black box over there is the 10 million structures of evm compared to the 33.7 billion ones of a 13 second execution on Cortez so how is the relapse itself right an overall architecture here for people who are not familiarized things don't change so much I realize now the the why contracts didn't work too much but basically you're gonna have let me see if my pointer here works yeah you still have your connection with the Json RPC here because it's still a roll up so to sort of send your uh committing your information your community your information to the chain uh as for the input as for the roll up so you don't have the inverse of the data availability and then your no the note that you build here Representatives Cortez reluxe framework will you'll be digesting this information and that might be you as a validator that might be at the user as well trying to verify whether or not you're doing something wrong and as it digests it can create new outputs they'll go back to the ethereum chain so it might be for instance and just the the marker route for the the state for the the state of the machine or maybe like new transactions that we'll do like withdrawals for instance and inside I chose to make a little bit of a highlight of these HTTP relive server here so this is still a machine Linux doesn't know what the it is doing inside there right so to deal with the drives to deal with the low level communication of halting the machine getting a new draft inputting the information that came uh in this new digest from the chain then how did the machine that again getting this binary information of the output Drive interpreting it and putting it as an output to the ethereum chain for instance will be too much so we created a abstraction we created this API address API it's four endpoints the documentation you can read in 30 seconds and just by hitting these endpoints you can have an abstraction of how to input information and output information into the chain so then what all you need to do as a developer is really choose your language communicate through this API and there you go you can have a smart contract in the shape that you like it can even be like a micro service I don't know what for but if you choose to do so it could so talk is cheap let's go back to that code no trying to explain every little bitty Nitty Gritty detail here but to this side to the left side we created this uh Little Helper tool it's similar to what Forge have been trying to do so you can sign transactions easily and calls contracts for now we just create this custom one and with this you can send payloads as input or as a ethereum calls to certain extent and you can read all the outputs here notices we call them notices because yes just One Singular difference from the steering events if Theory events are not provable if I give you a payload for ethereum event it doesn't mean anything without the Hazardous attraction and really you you only means something if you go through the chain and verify they actually creates the output right and notice have uh merkelproof attached to it so as long as you have the state the root tree of the Merkel democrinization of the machine being committed to the chain from that uh marker Roots you can create the local proof for anything the machine creates such as the notice so you can prove notices on chain and here is just listing the new notices created at Disney park and here's the thing so this program here should do the echo thing I was talking about right so from there like I was saying before you import with class because they're gonna be you're gonna be doing rest rest requests uh you get it from the environment variables we already put it there for easy for you and we have two top level handlers here you can create as many uh endpoints as you wish but these two tab levels here are obligatory why because just like ethereum evm there is two states of how to run the machine there's one that will change the state of the blockchain and there is one where you're just trying to digest information from it so it's ephemeral so if you've got inspect State here as your request type it means that no matter how much change you do to the machine it always gonna all of it is gonna be throw throw away just like in a hypervisor and VMS and if you got Advantage you really should be careful with whatever you're doing because however you stop the machine there it's gonna be the stage that the machine will be for the next transaction so this is still cold right if you throw and you lose your process there is no way for you to restart this that is kind of like um self-destruction a contract or putting in a bad State just the like the parody wallet hack and the only last thing I think it's worth mentioning more specifically is that every time you get these new requests you should reply back what was the final state of the whole processing so you should go back and say status accept if you say status reject or you don't reply for a long time the hypervisor quote unquote hypervisor will understand that something went wrong and it will tag the transaction as a as a reverse so to speak and if we revert back the machine so here in this case uh we would get the information here we would unroll the Json file the Json request if we get to the advanced stage uh top Handler we didn't register anyone any other Handler just this Global one here you see like I'm getting the payload I'm just creating a new notice with the same payload because it's supposed to just be a echo and finally I just go to slash notice with that payload I'm creating it you can call it as many times as you wish return the accepting I was talking about before and you close your loop it's an infinite Loop program in this in this in this in this case so you're always waiting here at finish so finish is a special endpoint that will hold a machine you don't need to do anything else especially because this machine is deterministic and single threaded you don't need to be managing this uh these scenarios this Edge case scenarios so the idea here is really like you can photo decentralize your apps because sometimes the apps are not so decentralized because they lack CPU power or they lack the expression capability of putting there all the rule sets all the necessary Corner cases handlings and everything you can of course then Express more complex and logic and this extra processing power lets you leverage the traditional Stacks that we had before and it also as a new project you should be thinking sometimes that the pool the talent pool for a web three people is really short so maybe you can get started with two three people but as your project grows you need to hire more people and it's way easier to tap into the web to uh Talent rule so it's easier for them to be onboarded with such technology so let's sing it in box so I collected two examples here from previous um hackathons and attempts of building things with cartesia and one of them was just at East Lisbon East Global Lisbon just before and she was actually a a track winner a Tracker track finalist and what she did was a to put a llm inside a catechism machine so she could have verifiability on the outputs produced by the llm her concern was kids very soon we'll be using Changi PT in likewise tools to be learning about things just like Google and at some point they might be crushing something like okay I'm gonna run a marathon why should I be drinking to maintain myself hydrated right and then she wants to avoid a scenario where it goes like oh you should drink Coca-Cola or you shouldn't drink beer and not having the proof that this is happening and not having where to start to backtrack and see where did in this case Coca-Cola influenced the llm model to be producing such a propaganda instead of its responses so she created this um how to say sandboxed own chain version of llms that can have a diverse fallibility the second one is a curious one so this guy he wanted to uh intervene in the situation of clocking and clocking out into government offices so it happens in many places but especially in Brazil these guys they find ways around the system to not be there take longer Vacations or be late every day and still show on the system that they are there by using silicone fingers or by driving the guy that's supposed to ensure that nothing's going on wrong with the machine so what he did is to fold it and here what I like about this example is just what he could use not exactly the example he used opencv to do the Biometrics so he can identify the digital uh the fingerprint of people and he used a machine learning model to avoid the spoofing of the information so he can detect whether or not there was silicone fingers is or reuse of images and things like that and that was all running on chain me actually off chain but being proved on chain here we have this uh Community website a rolluplab.io there's several examples using cortezidaire uh it might trigger your curiosity there's things from dials to games it's really a cool resource and it's Lobo here we are track as well so we have up to ten thousand dollars of prize pool and uh I hope I can see you there I'm gonna be at the booth uh me with my friends I'm gonna give you all the support that you need one final announcement is that uh we are launching on Main ads next month uh probably with a Honeypot app so the foundation is supporting this uh initiative where they are gonna be putting money inside the staff just as a target for hacker as an auto developers to try to steal it as a Showcase of the security and the verifiability of the rollout framework I thank you for being here uh this is being this has been nice it's always really good to be at East level talking to interesting people but before I go I have one more thing so um a few months ago this guy went to a Twitter to say if a theory is the world computer why haven't we seen the Doom running on it like huh how so right and one of our collaborators core developer Eduardo's he actually took it on and he put Doom to run the Cartesian machine if you want to check it out we are running actually a leaderboard downstairs at a booth he can play there there's four apps and stuff thank you again guys [Applause] does anybody have questions at 1% um first of all my first question will be how do you handle a great ability I forget the ability yeah in a roll up I mean you know cartesia roll up once you deploy the the first smart track the dab yes how do you upgrade or do you need to up right now for sure I feel like we are kind of liking 2016 2017 a serious situation how we deal with uh upgradability for cartagia as well but we at release uh one layer out in abstraction so we have more recourse so one of the things that we already support is uh when you deploy uh your Dap You Can enable it to be upgradable or not on the smart contracts deployed on the Chain so like ethereum places and there it can really uh just point towards a new cortizing machine so really like changing everything just like a proxy would uh it's still a question like what happens to the data are you upgrading from a another one that you messed with like did you open like the Cortez machine to stay with the data change the code and bundle it and release it again or it's really open because where this is so many possibilities it's still up for the page like what is the best practice of how to be more clear transparent with the community as you do it but you really can do a lot like there's no singular answer for now it doesn't yeah so will you be here during the agathon so that we can ask you questions about uh how to develop deploy this yeah besides me there are two other technical people here congratulations on the talk thank you are you recording the high scores of the doom on Che no not so far I mean indirectly because of the pull-ups but the leaderboard itself is not like a singular contract with everything there no no really it was more like a demo for each level would have ability for that sorry should have a bounty for that oh it's true true we should negotiate a good price and get it done any more questions hello um quick thing what wallets are supported all how it does the wallet interaction flow look sorry I didn't hear everything yeah the wallet that you support and what does the wallet interaction flow look because this is very sort of tooling around building the sort of payloads of smart contracts actually how do you how do they integrate a front-end to something like this for example oh okay so so far it's really like just like ethereum uh all the inputs go through the chain so that much doesn't change so technically everything is very customized uh there is no like hard hat or ethers for Cartesian so in that sense there is like the graphical and rest API connecting directly to the node so I can have easier access to the information just like you would for ethereal node and that could feed in a front and then like all the inputs they are just signed transactions to a Syrian so there is no change there um is like the kittens machine um like locked for example in the example you showed that it is requesting uh data from an API yeah right so if I imagine okay I can call any API I would be able to change the state inside the machine or is it like an AUX and you can only call no that API is just an abstraction to the communication with a check that's the only API you can call that will be talking to the outside everything else is sandboxed even the API itself is running inside that machine it's just really an abstraction okay thank you he's given another round of applause for Gabriel thank you thank you [Applause]

Automatic transcript — names and jargon may be misspelled.