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

ETHGlobalWed, Oct 9, 2024, 12:00 AM

Join us for a workshop titled, "Make it rain billions/tx on a Linux VM". From November 17-19 2023, ETHGlobal welcomed developers from around the globe to take part in shaping the future of Ethereum at ETHGlobal Istanbul. Over $600,000 USD in prizes were given away at the prestige Istanbul Congress Center... thanks for an amazing weekend hackers! ----------------- Follow us: https://x.com/ETHGlobal?s=20 Check us out: https://ethglobal.com/ Email us at: hello@ethglobal.com

Transcript

[Music] today I want to talk to you guys about cesi and how we can have a billion CPU cycles for transaction and what does it even mean right like how can this be possible and why is it useful for us I want to make also like a statement of why we need content scalability and how this is possible through the usage of what we had before for so many years in software industry de uh the development of the software industry so the agenda for the presentation today I'm going to go quickly over what is cesi I'm going to give a a quick intro to CES rollups uh a little bit of how the architecture looks like uh the external interfaces you're going to be integrating with if you're using coresi and what is the role of Linux there and finally I'm I'm going to show a little bit of other uh what other projects uh have done with caresi just to Showcase a little bit of what's possible so to begin as a quick oh sorry a quick sneak peek of uh a simple smart contact using python uh I know it's a little bit too much right now uh to just grasp at once but I just want you guys to have an idea of what's going to make sense pretty soon basically here we have a a echo python application meaning whatever you send to it it replies back nothing too much the idea is just to show the usage of the API and to your side uh it is a python application and you see you're just using basic um libraries you're just doing basic post requests and that is all you need to create a smart contract right now okay moving on to cesi so we have the Great trilemma that everybody's so used to by now I guess and that's why we having layer twos uh ethereum was great to gra to give us uh compability over uh with a lot of security and decentralization but we are lacking so much on the scalability point of view and roll up brings a new narrative The Narrative of using ethereum as a judge not as the world computer anymore not as much and Cortez moves It Forward asking what if we can have the great security guarantees and the centralization of ethereum but with great tooling and bringing back the complex computations that we used to have in the web to world and to have that we have a two-part solution some people are already used to this uh you have application specific in one side of it meaning you have your own little Network per dap so for people who are not familiar ethereum is a a general Network meaning every application is sharing the resources of the network and many rollups go that way as well but you can do a rollup per dap meaning you won't have the resources limitations you won't be sharing these resources among all the applications that want to interact with each other and that is good because it gives us freedom to do the second part of the solution which is not to reuse the evm execution environment for the newer applications instead to use what we are used to have like in this case we are using risk 5 think of it as a open source for processors so it is a instruction set that is as complete as Intel AMD you can run an OS on top of it and we are running Linux of course so what this solution comes when these two things com to together basically what you have is a Linux server as a rollup in a way and this is what it looks like um you go back to understanding and really like seeing how evm tooling is just like playing with Flyers trying to do every kind of task you can accomplish much using the flyer but it is not the best way to resolve all kinds of issues and he when you use cesi you go back to having the full tool set you have all the IDS the bugers security tools developed for so long all the other Li lies and Frameworks and you don't need to be reconstructing everything that other developers have been building and distributing for free for so long and to build a Dap on cesi really is to just do a darker build so you have the emulator of cesia already being U baked in into one of the images and you're using risk five as the base whatever you produce as binary here can be uh assembled together with the cesium machine and you can run that it's just that simple so what happens is you'll feel like um ethereum is not looking towards solidity as much anymore we've been seeing at a projects looking to have assembly looking towards having other languages as well because everybody is starting to understand we also need contents scalability we need to be able to express more coding less and if you have an OS That Couldn't it couldn't be more close to to it than by using an OS because now uh you can really reuse all the tools and libraries Frameworks again that has been built uh for so long uh for the web to ecosystem so in order to have a somewhat of a comparison and to make sense of this we're going to take uh one ethereum block and at most and we're going to be be very generous with ethereum here you can have 30 million gas um on a single block paying extra for that but you can have it and the least uh expensive but still useful up code is AD you cannot have a full transaction with ad instructions but if you could you would have 10 million instructions being executed in a single block okay what does it take to boot Linux to build Linux with much more complex instructions you need 36 million CP few Cycles so you're never really booing or verifying uh Linux on chain and people might even ask what's the point right but besides the point is what does it how does it hinder us from doing extra um interesting things if this not even on the picture and by using the block as a comparison we can say the block is an average 13 seconds and on a laptop like such as the one I'm using right now you can run three billion CPU Cycles 3.7 CPU cycles of the cesi machine emulator so this is a very difficult uh kind of comparison to make just by hearing these numbers so here's a graph for you guys the black dot over there is how many CPU Cycles it can have on a single block on uh on ethereum and the full square is the computation size of 13 seconds on this emulator so it really gives you so much more when you can start rethinking how to build apps AS application specific and also it gives you much more because you can just import the work of the whole Community instead of replaying things all over again so the architecture how is the cesan rups itself it's not that different from water what rovs and um the architecture of the web fre ecosystem so you have basically let me see if I can yeah you have basically here a browser you're going to still have your Json RPC connection be to with uh ethereum chain or some other uh layer to if you're deploying on top of them and these are for the input so data availability you're going to have some cesia framework rollups framework here as a node and what you're building really is just the heart of it here I'm calling like a cm the cesing machine and to facilitate this uh we already baked in uh roll up API inside so to integrate uh your contract to integrate your code basically you're doing rest API calls it's nothing more much more than that and to query things to execute opponent uh you can have two apis here uh you have a rest API for uh Emeral requests think of it as ethereum call or static call so from the outside you can execute the machine and inspect its state and you have a graphical uh API to query all three types of outputs the machine creates that can be uh actionable on the base layer later so going back to the code right yes go ahead oh yes um it won't it will be an nicing call you still need to go through um the window of um dispute window yeah can I write something on contract yeah what is yes yes you should sorry can I meet aen yes you can you can let's say because the CES rollup is still going to be uh represented on the Chain as a contract itself right so it can execute anything as any other contract on the Bas layer would I want to you have two ways let's say you already have a token Factory somewhere uh or the your erc20 one is already out there and you're just calling the M function then it's just that transaction right that after settlement can be executed or you can deploy a whole new contract as well the gas these are all layer one things uh when when you go back to the context of the these Layer Two this application specific it's up to the implementation of the application itself so there is no concept for Gess here not directly make sense so for instance you're still going to be paying uh gas as layer one inputs just for the data but you're not going to be paying for the execution itself oh you can you can you can but then private ke you shouldn't you shouldn't put a private key there because then this is transparent right this is a framework here so everybody who is participating on the D basically should ideally be running the note as well not just uh trusting a third party by then everybody has access to the private key as well so it's really like there is a contract here on the Bas layer let me see if I can yeah on the Bas layer that represents the whole roll up the consensus and everything and from this contract it can execute transactions from that address that's going to be the alas of it and then uh by the consensus it can create any kind of transaction so through the computation if the computation it can be a python code saying do send some ether to somebody that thing is going to go through settlement and eventually it's actionable you can call on the contract saying hey I have here we call it vouchers I have here a voucher I'm want to claim the voucher so it becomes an a transaction like you prep the transaction and then someone need to sign it um no yeah from the external side yes somebody's still signing it other people might think of it like as theiner oh the validator node always doing the checkpoint uh it might be just the user if it is is a game they want to take their money out it might be the user they got the voucher and sign the transaction out but it still need to be validated by the consensus right yeah we have a mro proofs of the validity of the of the voucher so onto the code you're going to see something similar to that on the left side we have a mini curl uh that we created to facilitate things think of it as the MV cast The Forge cast I mean um and we are sending up aad hello and we getting a new notice and notices are just ethereum events that are provable uh different from the ethereum events that you cannot really prove anything about them people just know they are true because they're running the node themselves these notices they come with a mker proof okay and on your right side you have the code fast forwarding cuz I we use some of the time for the questions uh what you're going to see is like we have two main states of execution of the contract of the machine itself we are telling you through the framework in which state you are if you were receiving a request in an inspect state it means you're going to be reverting back you cannot change the state it's like ethereum call you can mess with the the storage it's not going to be there it's going to be rolled back and there is the advance State because this is an input it's going to be executed as Advance state so you enroll the request uh Jone uh body you inspect the thing you see that it is a request type of Advance State you go to the Handler so a the top level Handler uh you can Implement as many as you wish it it really is it really feels like an API and then you're going to go to the function over there line six there at line 7 we are getting the payload we just received and copy into a new notice that's going to be created and finally we hit the endpoint notice and just by hitting this endpoint it's going to be creating this event I was talking about and you don't need to do anything else you just see that the response was 200 just like an name like any rest API if it it's 200 you return accept and here's one of the uh nicest features of the framework because you're dealing with with this API if you were to call in 25 24 uh finish without being accept status it means you're throwing it's like you're reverting your whole transaction just like you would on AVM so that me that gives you a easy way from any kind of language to control the state of the machine are you progressing did was anything wrong with this input and you can't process it so you always have a good state of the machine going forward but it was a simp as just integrating with the r API instead of having to learn all the languages oh two minutes guys so to go to go over you can further decentralize your deps uh Express a more complex logic um without making your code more complex it's easier in the future when you have a successful project to even more new developers from the web to ecosystem because they're going to know the language already about the PCS really quickly I'd love to talk much more about them but uh Eisman this lady um wanted to do a verifiable chat TPT and she ported a Stanford alaka model inside the ctis machine and she proved that you can have verifiable prompts uh and the outputs um running by run this on the CZ machine and the second guy he created a system uh it was a proof of concept to have biometric uh check in and check out for instance like as in a workplace and what he does here there's two things that are interesting first one is he uses open CV uh very common framework for computer vision uh he just needed to import it and he can verify that that's the fingerprint of a person a specific person and also he used a machine learn model that he trained to um test whether or not the fingerprint was spoofed you can check much more at this uh rollup lab site there's many projects that have been built for CES so far at here we are going to have like 10,000 price pool first place 5,000 uh oh typo there guys oh that was the idea sound sorry 5,000 price full and um there was a few more things I I wanted to discuss with you but I guess I can't so I don't have much time anymore I wish to see you guys out there I'm going to be at the table or the recharge station there you should get a massage there guys it's really good thank [Applause] you

Automatic transcript — names and jargon may be misspelled.