Cartesi 🛠Make it rain billions/tx on a Linux VM
ETHGlobal·Mon, Oct 9, 2023, 12:00 AM
Join us for workshop titled, "Make it rain billions/tx on a Linux VM". Some of the most skilled web3 developers, designers and product builders from all around the globe came together for a weekend-long hackathon at ETHGlobal New York 2023. ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com
Transcript
foreign [Music] how it's gonna help people on board more developers and how everything comes together in this Linux environment I guess it's a little bit awkward and strange at first especially because we're so used to evm compatibility solidity and all that good stuff but I'm gonna show you guys there is something else out there as well so today I'm gonna introduce a little bit on how Cortez roll ups work and then I'm gonna show you guys how the interfaces and how to program it for it and at by the end I'm gonna show a few examples of things that have been viewed using Cortez so just as an introduction uh this is a small example of a smart contract already using python inside the cartesia ecosystem and it it is here to just incentivize you to pay attention to several aspects of it by the end of the presentation I'm going to go back to it and I'm going to explain it some of some of the lines that are more important over here so the overview pretty sure you guys are already familiar with the trilemma and what it means for ethereum and what it means to the security of blockchain systems but we all know that we need scalability and we are trying to figure out how to make it work and here I'm gonna show you guys that it is possible to have complex computation and great tooling while developing smart contracts only if you introduce back again a very important concept that we have for getting an operational system so how does criticism make you work Cortez is an application specific roll up so it's an optimistic rule of dedicated to a single dap that means that you have the flexibility to change parameters and change how validation might happen depending on what it makes sense for your application but at the same time it means that you can have it as a layer and solution so right now the current system is evm compatible meaning you can deploy to any evm execution environment so it can be a layer two a layer three uh whatever you think it makes sense uh in the second part of the solution is the fact that instead of uh focusing on the evm itself as a exection environment or wasm or something like that cartesia focused on bringing risk 5 to the fold and what we did is uh create this machine emulator that is deterministic and because the destruction set of risk 5 is very complete it means that you can use any OS on top of it and therefore we chose to go with the Linux of course so how does it feel right it feels like for all these years we've been playing with Flyers to make uh things work in the blockchain ecosystem and when you try to use Cortez it feels like you have the whole to set back uh so it's really it really improves the experience of developing applications and this is how it looks like to actually be building your application it's just a system of Docker containers that builds up to be the Cortez node that you're going to develop for your application meaning that you can just use any language use any tooling any uh any of these things that we're used to have so if you think it's interesting to have a postgres database inside you can have it if you think it's interesting to have a Radice or to import Frameworks such as opencv or large language models we've seen examples doing that and as long as you can properly build your Docker machine you're you're fine so that's what it means right like it becomes very sexy you can even for that one star repo that for some reason it's just so eager to so to be fair and just play a little bit of how it feels um I'm gonna be very generous to the Ethereal Network and let's go with 30 million Milling glass of block size which is already not ideal and if we take just the addition op code which is the least that does something you can have about 10 million transactions 10 million instructions per se per block right um and this is what it takes to put Linux it takes 3.6 million CPU Cycles to boot it so it would never really be feasible even interesting to have Linux on top or ethereal Network it's comparing apples to oranges right it does not make sense they have different um goals and within 13 seconds just to maintain some comparison which is the block time on the Ethereal Network on a laptop such as this one you can have 36 million uh sorry 36 billion instruction Cycles run so that's a lot that's a lot correction guys uh three billion 3.6 billion um and that's how it looks like that little black dot over there it's uh the scale of what ethereum does in 13 seconds compared to a single laptop running a Cortez node for your application so the relapse themselves uh how the architecture looks for people who are familiar with roll apps there's not nothing new here it's more for people who are trying to understand what it means to build a dab using a app chain or application specific roll up so here you have a browser representing some kind of UI and interactions of the user you're still going to be sending transactions to your base layer represented by ethereum over here and this curtiserable as framework it really is the node with some other services that make it feasible and convenient to use such as reading information for an ethereum chain but what you'll be going to be building is this cortizing machine block inside and we package it already ready to use with a HTTP API that will be convenient to make inputs and outputs to the base layer and the tap backhand a little box is why you're going to be coding so you can code it in Python in C sharp C you can coding brain you can use whatever really as long as you can do got and post requests to this API it's going to handle the communication side of things so it really is a Sandbox environment and as you build it you can put anything inside but as long as you remind yourself that it needs to be self-contained it can run on cartesi so back to the code I show you guys in the beginning so this is a very simple smart contract it's not smart at all actually it's an echo python example what it does is whatever it receives as information um just plain text messages it replies back using one of the output methods so if it is a re-request read-only request just like ether East call which is the RPC call you can recreate this report such they're kind of like logs and if you have like actual transactions they're changing transactions you can create these notices and notices are kind of like ethereum events they have a marker proof attached to it so you can go back to the base layer and actually do something about this information finally it's not represented here there is the concept of a vouchers and vouchers are transactions that will be able to be executed in the future so you go on throughout the settlement period execution period of your roll up creating these vouchers after you settle they become executable because they have more worker proofs attached to it so going back here uh you can see in lines uh 18 to 20 that I'm declaring some high level handlers these are the basic handles every cartes application should have uh you can create many more just as routes in an API and these two high levels are the ones that I was talking about before one is for read-only requests the other one is for uh transactional requests the read-only it's really interesting because uh the node manages snapshots of the machine so if you try to change anything on the application it's not going to be saved the machine continuously seen from the last transactional request the same is true if you redrack reject the input so because of the way evm works and it's interesting blockchain systems that you'll be able to handle let's say weird Corner case scenarios so you always have the ability to throw in solidity right and reject the input and still maintain the pristine stage of your smart contract here is the same after handling a transaction it can send a reject a response for the input and the Machine is going to be reverted back as if he never processed transaction in the first place so the idea here is to enable the dabs that will be being developed to be further decentralized not necessarily needing to rely on off-chain computation or data sources and things like that uh also to have a faster development cycle and more concise and comprehensive by expressing more complex Logics by having the ability to import libraries and Frameworks that many people have been building for so long you have the ability to have extra processing power so you can think again that you can use Loops even and things like that and you can leverage the traditional Stacks because sometimes it's just nicer to use and finally as you're developing a new project you gotta know that eventually your project might need new developers and there's a very small pool of developers on web3 right now but it's easier to onboard web 2 developers if you have a framework where they can use the language they already know how to code with of all the pocs so at uh Eastern Lisbon East Global Lisbon we had this hackathon winner chain GPT uh this person was concerned about the uh open source like large language models and what the influence large companies can have on them and she just used a simple example but like what if Coca-Cola managed to mess up with the responses of the model and suddenly you have like 10 year olds questioning like what is a healthy drink and Coca-Cola is like the First Response how do you prove it if it's basically a random in in essence right are you gonna do some statistical analysis how do you prove it reply to your children that kind of response so she was like okay but if you run the inference in uh well um in such an environment where you have validation process you can prove that that is at the moment the response was such so what she did was she imported the OPAC model inside the Cortez machine and ran an example showcasing the power of it and the second one is kind of funny uh basically there is decisions where you can clock in and clock out other factories or government institutions using fingerprint and in Brazil people's are pretty good at hacking this thing between silicone fingers and just bribing the person next to the machine uh it's not really reliable at all so this guy who was just trying to understand how cartesia Works thought it was going to be an interesting experiment to create such an application uh he used opencv inside a machine to do the recognition of the fingerprint itself and at the same time he was a machine learning model that he built to check against forgery and spoofing so with these two models running alongside uh people can scan the fingerprints and I guess optimally in a more private setting send this information and be auditable not good uh if you guys want to know a little bit more about other examples other projects that have been built in using cartesi even games like we have a bunch of games being built uh with uh cartel roll ups you can check rolluplab.io people are sending their projects there and also for uh these hackathon we have such distribution of prizes uh we are track here we're gonna be throughout the whole weekend helping whoever is trying to build with using Cortez um finally pretty soon we're gonna be launching a minute to Honeypot death uh the idea here is to showcase the security of the Roll app so the foundation is going to be depositing uh some amount of money uh periodically increasing the amount of value locked just to ensure uh just to give Insurance to people that there is something out there with a lot of money value unlocked and nobody was able to hack it so they're actually inviting hackers and Security Experts my hats Auto hats uh to just try and steal this money um I'd say this is uh the end of this presentation however I have one more thing for you guys so um it happened a while back some guy was just rolling on Twitter asking what if uh evm evm in this area is the global computer why haven't we seen Doom running on it right and uh Eduardo by the way is it here I thought he was here he came here for a second guys you're gonna see the him around he just said like it uh took a weekend and he put a doom to the Cortez machine so this is actually running right now you can stop by our booth and play a little bit with it and the idea here is just showcase that even uh freaking source code that is like 30 plus years old can be built and uh compiled and run without major efforts on top of such an execution environment now yes I'm hoping for questioning um any doubts okay certainly hard and really winning Wall Street investment world like uh Crossing messaging yeah sorry so those are actually where you like re-speed honestly in of course as he burns so he's asking if there is any way to read the state of networks within the Cortez machine but more specifically you're looking for cross-chain stuff right okay so yes I know so uh the roll up itself is attached to some base layer so you can read the state from there as of course mostly the current um state of the SDK is that you just get the messages that are coming towards your roll ups but the idea is to have something like pre-image uh we are calling actually the hashing device where you couldn't have uh a device inside a Linux machine where you can send it to it any hash related to the base layer and receive as a response the actual data because because you have a proof for it it's possible to do a verification game a dispute game later on so you can read from the base layer you attach to but from others you there is no current solution under development any honors guest says it uh I hope to see you guys around and we are here throughout the whole weekend I'll be happy to help with any questions any issues you have while trying to compile anything thank you guys
Automatic transcript — names and jargon may be misspelled.