Exploring Tangible Use Cases of the Cartesi VM
14 Nov 2023 · 35:03
The Rollup's ecosystem report, hosted by Andy and Robbie Klages, walks through practical applications built on the Cartesi Virtual Machine, a Linux-based execution environment for Ethereum. It covers verifiable onchain games, token exchanges, and how developers can scale ERC-20 applications on Cartesi's infrastructure, situating the project within the broader modular, rollup-centric scaling landscape.
Topics
Transcript
[Music] yo what is going on hi rollers welcome back to the rollup Channel today very special guests with us from Cy we got Max EOS head of ecosystem growth and we've got not head of ecosystem growth No not head but but he's growing the ecosystem and we've got Gabriel who is the advocate of Developers did I what's up what's up what's up cool man so we're gonna be talking about cartey today cartey if you guys aren't aware is pioneering the Linux VM amongst this this VM narrative where there's all
these virtual machines all of them are scaling ethereum carte is bringing bringing Linux to ethereum and our previous video talked about why that's so important what are some of the some of the like Visionary elements that it unlocks and then we're we're going to be talking much more practically today about examples use cases like basically talking about what is going on at cartey on cartey right now and then we'll we'll help Inspire some new ideas about what else can be built on top of Cy so before we we dig into what is some some of the applications built on top of cartei now uh could we do a quick intro uh Max like what what does your day-to-day look like
and uh what is it like growing the ecosystem of cartesi yeah um I think my day-to-day is is kind of differs from from dayto day to be honest there's not one specific routine but uh I think it's a mix between like um I basically trying to grow the ecosystem trying to find like people building on cesia something Gabrielle is also very focused on uh trying to do um find integration so to kind to kind of complement and expand what our technology can already do maybe make it easier or make make it more powerful in certain ways um and a bunch of like uh research and Community Building work as well like uh for example I'm hosting community community calls uh you know focused on onine games
trying to inv invite guest speakers and so it's it's a mix of a lot of different things um and it's yeah it's super interesting so I'm glad to be here yeah good to have you on Gabriel yeah so uh similarly to to Max there is no welldefined I guess but uh where we diverge is like um I focus like uh trying building tutorials their communication going to the events and helping developers actually get their hand study trying to help them through all the errors they have when they're coding uh but also like trying to understand how we can make it better so I can give better feedback to the core developers and really grow the the core Tech of cesi
towards something that makes sense for for people who have been trying to build with it yeah and that's why like these these opportunities like this one are so nice because it's where I can get in touch with people and grab that grab that knowledge yeah definitely so like you guys are the two people to reach out to if anyone has questions about Ki and you're thinking about building something we we'll get into plenty of ideas of stuff that that you could build and these guys are the are the guys to answer any questions that you have on that Journey so let let's bring the slides up uh here I think we got them right here and we can uh we can we can start going through some of these these
experiments that have been going on CY as well as some of these use cases um I think it is important and I saw this in one of the slides to give a quick recap about the Linux VM uh and and I think you guys you guys have that in store so go ahead and uh take it away yeah awesome thanks Robbie so um yeah we prepared a couple slides just to make it a bit more Visual and we can uh dive a bit deeper into some of the stuff we've seen seen people build in the past uh but indeed as you said uh maybe a quick recap of cartesia as well for anyone new here um basically what we're focusing on is building uh basically infrastructure for app specific rollups which you know kind of changes the game
in terms of like how applications uh are are deployed and how to interact with each other but basically gives every application the full power of a full VM a full CPU so you're not competing with others for Block space as you would on a shared layer like ethereum and you know that means that you know on ethereum for example you will have you know kind of spikes in gas prices depending on you know utilization of the network so if some you know cool nft uh drops you know maybe that will affect every other application so even if you have like you know a game where you need to just make a move on a chess board you will be impacted as well so having your own sort of application specific rollups mitigates those those
risks right um it it provides predictability for developers which is sort of needed especially if we want to sort of get adoption from you know a broader set of developers that aren't web3 native um the other side of the the deal which I think is also major is or probably the big the big deal that we're sort of selling right is this expressive general purpose VM right so instead of being restricted to the ethereum virtual machine which is great for certain things you know once we move to the rollup level we can actually play around with execution environments and we can change things around uh and what cartasi really wanted to do is basically bring a
virtual machine that basically looks like a traditional computer like a PC right um and that that can run an operating system potentially you know unmodified out of the box wuntu operating system for for example so Linux in this case but it can it could be anything um and the way that we do this is is we emulate uh risk five which is an instruction set architecture a CPU that is you know an open source uh instruction set architecture we we basically emulate it in a deterministic way to remove you know all variants possible um and um and then that yeah that basically allows you to to boot an operating system on top and and and to run entally full programs right in a
verifiable manner so programs that would traditionally one run on a PC you could run them here uh on on something like cesia uh with with some small small changes modifications but the big idea is really that um I Gabrielle do you have any things to add any spice to add here I I would I would go further and say like with almost no change at all uh as long as a CPU bound computation and um and you you you want to know like you're inside the blockchain ecosystem still so there's going to be some specific apis you need to consume and read from other than that it's just like a a server a Linux server on rops yeah that's crazy I guess without like the
internet connection or you have to find ways to like feed in yeah exactly um but yeah cool um Robbie if you have any questions let let let me know otherwise I'll we can move on um yeah so these are sort of the this the use so as you can imagine you could run anything on this like that would run on a traditional PC so kind of like going into a specific use case is already narrowing the scope a bit it's like a really general purpose environment but these are sort of things that we've seen people build on this general purpose sort of VM and infrastructure right um from you know verifiable AI inference complex defi
verifiable software all the way to onchain gaming which is super cool in my opinion which I've been following as well a lot um and yeah I think we can just just get started from from there um with with an example so some of these projects were built during hackathons some of them are uh still in development are being built actively so it's a mix of different different things but these are really some that that that that greatly that that really showcase the capabilities really well so um this project is called chain GPT and um The Main Idea here is basically to do verifiable inference so you can actually you know with
blockchains or with verifiable compute you could take you know a large language model or an AI model and put it into the VM and run it and feed it an input so ask a question to it a bit like how you would ask a question to chat GPT and uh the model will will or the after running that that model it'll feed out feed you an output right a response and running it in a verifiable way allows you to um prove that the certain model was used and a certain input was used to generate that output um and what's really cool here is that someone was able to build this in very short in a very short amount of time by using using an existing model um Stanford alpaka large language model which is a bit smaller
than you know chat GPT but could run on a you know it could run on a computer um but but yeah the amount of like the the speed at which you can iterate and build on top of something like this is crazy um yeah I don't know Gabriel you have anything uh the only thing I would like to add is like uh the idea of the uh the original developer of the project it was to have uh accountability for models so right now there's a lot of um um how do to say a lot of entropy to the process so if you send something to chpt for instance right now and send it like again it's going to give you slightly different answers uh you can still make them accountable for certain things but
they can always play the car like uh we don't know what happened that time or something so the idea was like okay imagine like in the future this is going to be a technology more integrated with our day-to-day and there's like kids and kids use Google in the future they're going to be using this stuff and then they say hey I'm going to go to a marathon what is a good drink that I could have that would be the best for the marathon activity and then the the model says like oh Coca-Cola or something like that how can you prove later that he actually did misinform your kid you know like that's not really nice and uh although we don't necessarily think this could be like
this everywhere but at least schools the the tooling that the schools use could have this kind of uh verifiability so that's the cool stuff about this like things you don't really think like why do I need a larger language model instead of blockchain right yeah there's reasons for that a quick question here like one of the things that popped into my head about like when you're verifying like this Pro this prompt generates this output I if there's a link between those then it it's then I I could start to think about like what about what what if we go in reverse like what if you give me an output like could this generate
the input and uh I as as optimistic crups I I won't say necessarily so but you can definitely do uh we what we've been calling like dehing or pre-image um what it means is print an output that it was already generated not a random output that came into your mind but like it was already generated yes you can search through the blockchain to find what was the input that was uh The Prompt for that thing for sure very cool because I'm already starting to see like these templates of of inputs and if you could take like an output and then you could you could reverse engineer The Prompt uh or like find the
prompt that generated that output you could then make tweaks and adjustments and make make it like uh so that you have almost like a on toone correspondence of inputs and outputs and uh yeah you you could start to like adjust it based on your your particular use case for sure with verifiable Compu you can do that that that kind of stuff yeah that's why you put AI on blockchain exactly yeah so this one was pretty wild was um yeah I think the person won the the or was made it to the finals fin it's cool um so maybe more from a defi lens um this is a project called DCA monster
and uh obviously you know having app specific rups you can do more complex stuff so you can actually mix together different Primitives and there's you know like the token streaming primitive is quite interesting you can stream payments obviously the amm Primitive is is like kind of foundational to defi right um and and this person uh uh decided to mix both together and said hey what do we have an amm where it can token stream like purchases and sales right and and that basically gives me sort of a a perfect dollar cost averaging like uh protocol right that is permissionless that you know basically where streams are interacting with each other um and yeah this is just the start like you could go even crazier but I think this people understand like amm
and and token streaming I believe or so it's it's a very good um way I think way way to understand how how all this works so so the person I think rewrote an amm in in Python was it Gabrielle and token streaming as well um so you know you could leverage like existing codebase you had to rewrite them he rewrote them in different languages that are compatible with cesia um yeah so I think this one is quite interesting you could go a step further maybe even where you know maybe you have a matching engine or something I don't know if you would want to use a matching engine on am in an amm model necessarily but noce matching engines written in
like Python and other uh uh languages uh that you could leverage for example if you want to do like a I think I think he created a new instrument and a new way of doing things because uh if you have like uh like this perfect averaging thing like I I just have the interest of doing this swap here over a period of time I'm basically providing liquidity and then you can like start interacting with this in different ways some people probably going to do there go go there for instant swap but then that is not possible in the current market right now like you have to have these Bots constantly checking the order book and trying to do whatever was your strategy
but with this you can just leave your order open there and you know it's doing exactly what you're supposed to be and that opens opportunity for external players external to the system to stop providing liquidity making um uh other trade uh strategies with different exchanges it's crazy the amount of things that starts to emerge from from this stuff just because you you comol these two things and what what are the languages that are compatible with cartei I'd say anything that runs on a normal computer and then people often hackathon uh approach approaches like oh
so can I use solidity I'm like yeah you can but then like what's the point now right like now you have this Ferrari and you want to play Hot Wheels I don't know so so your recommendation is like python uh you can use JavaScript typescript uh if you want to do things uh more lower level you can go back to C++ and uh and see but for sure rust and go supported really is it's it's a server like you pick and choose cool awesome um so this is ultra chess this is a an onchain game um and the the key
idea here is that you know any executable uh could become an nft and could run in a verifiable way so actually instead of having a traditional chess game where humans play against each other in this game um you can actually upload your own Bots uh to compete against each other right so you could have bot versus bot tournaments that are verified you know that are on chain essentially right and the cool thing here is that there's already a ton of uh chest spots that exist right you can see on the right hand side like Alpha zero Leela commoto stockfish which are you know very known chess engines and you know using a sort of a risk 5 VM with Linux allows uh you know this developer to actually uh tap
into all these existing Bots right to to just kind of like incentivize competition potentially also incentivize the um you know further Improvement of bots because there there could be a monetary component right where uh people you know wage your money on certain Games Etc could purchase the nfts so it's it's just an interesting mix of like Ai and gaming but putting that on chain making that verifiable yeah this one is crazy sweet um carton Nicks Gabrielle you want to you want to take this one uh yeah um this one was uh
a bit a bit weird when I heard first heard about the proposition here but you have NYX Building Systems um basically um think of it like uh like npm packages and stuff like AP get uh whenever you're using these things uh often the the developer just build uh the project for you and distribute it using these sources and N uh tries to uh do reproducible uh verifiable builds in a sense like you have like signatures and hashes about stuff but it's still not perfect and whenever you try to replay it it might give you a slightly different output and here's where things gets to be inter
interesting like you have cesia machine which is a Linux environment so I can run anything so you can run NYX and now if you run NYX inside cesia machine you're definitely going to have a reproducible build uh build that is actually verifiable as well so this can Improvement improve the the quality and security of Internet overall so for instance uh as Firefox for instance uh distributes not only the Firefox browser but the engine inside they can say hey this is the the build this is the the source and we know we have here the like the signatures of x amount of players uh like let's say Google does it too or Microsoft and they also verified the the
build and you can trust that that thing wasn't like by some chance uh somebody hacked Firefox servers and used their key to just sign a build and put a troj on horse inside of the of the of the software so you again it it's it feels too weird when you talk about something like Firefox because it's too big but dayto day we install so many little tools to make a projects possible that you don't really care too much about the security but we should we've seen so many issues like with python repositories with npm repositories being taken over and this kind of thing can actually improve a lot at least the concept right and then it can be applied
with blockchain technology yeah I this one is a bit abstract for um I I I I need a bit of time to to fully grasp it um but I I think for me what what what made it a bit clearer was like you know when you want to download stuff you you basically trust the website that you're downloaded on you maybe maybe you trust the mirror because you you have to download it from mirror or whatever uh so so actually how do you verify that what you're downloading is the original source code right and that's where stuff like nycks come into comes into play and maybe also where cartesia can take that to another level um this is great uh bugas is also sort of in this verifiable software category and um the key idea is really just doing um
you know how you have like bug bug uh Bounty platforms where you submit uh you know how you how you cracked the uh a certain code base uh and then you know the developer who who who who um submitted the initial Bounty will pay you some money uh you have to basically trust that that that that developer or company or project will pay you the Bounty that you deserve um with something like bugless or like Cartesian General you can in theory have you could have ways to basically prove that you were able to um um you know crack that system hack that system uh by submitting uh the exploit um yeah and then you can you can
basically automatically get the money so it's kind of like this permissionless way of doing uh you anyone can just submit things that they want to test and people can submit the ways in which they were able to crack those systems and automatically receive payouts if if certain conditions are met um yeah think of it uh like the ultra chess example you had like the AI Bots playing each other but here instead of being a chess game uh what you do is like you created some sort of send boox and you create conditions for that so for instance it can be evm itself and you say like ah uh you can and not like change the amount of the balances of people because you don't have the key of these people so if you can do it that means you cracked
something so by the end of the the the run you can just do these checks and see what uh things you had as a guarantee and if you break any of these guarantees the software is checking it right so by the end of the execution he knows for sure that you found something wrong with the software and or or you made it unresponsive that's a possibility as well and therefore you need to receive the the Bounty you don't need to wait for some human to verify your code it's crazy yeah it's crazy sweet um
cryptopolis um so this is yeah basically bringing um Sim City on chain making it or making it verifiable right uh again taking in you know an existing code base and and you know just porting it um yeah crypto oh but that there is a crypto economy around it too man so so first thing uh what what what did ctei help Danilo here uh he could just Port the game uh the game was originally written in C uh in C and was ported to C++ in 2008 and made free software so he just got the engine like as it basically as it was on 80 something 90 something
when they first released it and he just ran now he did some smaller modifications on the apis of the game meaning the external like keyboard and mouse and Screen stuff um not changing the gaming logic any at all and added a layer of crypto incentives to it so basically to to start the game you have to deposit some money and you have to develop uh your city and this the basically the internal money of the city has now aaring to the deposit money but everybody's playing the game as well so in a way if you forget about the game it's like you're trying to steal everybody's everybody's else's money but when it comes to the game you really
want to develop the best the your country so you can have the most money inside your government so whenever you're trying to do make withdraw you you had more money than what you deposit earlier so he created like this adversario cryptoeconomics to the game that makes everything more exciting actually yo where can I go play this uh he made a this uh a Tas net deployment uh you can start bugging him on Discord like hey Danilo drop your stuff you're doing for cazi and just like just deploy this game man that's Epic I really liked it man and it was a finalist on East Global online
true that was awesome I think this might be one of the last ones but um at least from this this presentation deck but yeah it's it's Doom right like the famous um game it's obviously always like oh will it run Doom well yeah so something like like Cy can run basically verify right um you know using the inputs of the the keyboard it can basically replay the game at any time and and check if if the score that you claim to have received is is the right one or not so you basically have verifiable Doom um which also yeah is super sick and this you could apply to basically any like sort of game retro game uh you know it's a bit easier on
the single player side right now uh you know we have there's a framework being built that makes it easy to just sort of Port existing G games and make them verifiable uh and obviously Doom is sort of one of the first ones that we we demoed but could be much Brad for anybody interested in playing that uh I actually up um put a versale app just with everything necessary to play you can play it on your browser right now uh you just go to world- arcade. ver. F it's just uh the developer sites they gave you for free and right now you can just play verifiable do which is crazy man you play it on your browser we sum up allio inputs and then send it to the
to the blockchain uh what it does it's um it's basically replay everything inside the gaming engine uh on the cesia machine and verify that you got the same scores the same amount of kills and stuff uh what what it's interesting that it can be done in the future is basically um uh compensation for for like maybe prizes for uh speed runs right now speedruns are basically screen recording but with this kind of stuff you can really like just replay the whole game as it was played earlier it's crazy yeah it's SM and yeah I mean I think that's it we have a page where we put most uh
projects so if someone wants to check uh go dive deeper into like the the repositories the descriptions there's way more sort of uh experimentation going on on the website and on Discord as well so that's that's it from the the presentation side Robbie any uh thoughts I hope we didn't bombard you with too much uh no this was great this is like so much inspiration about like what we're gonna see in the future and like what what we can do on chain and why so I think my my question is around like like when you're running something like Doom or or any onchain game there's so many trans transactions that that end up going through the
blockchain so all of that transaction throughput ends up going onchain and like my classical like 30 IQ like understanding of transaction throughput is that you have like the scalability trilemma right so you have like speed cost and security and for running something something like Doom like there's a lot of speed and there's a very low cost of running transactions are you guys so are you guys making tradeoffs like with security or is there like some other way to think about scalability than the scalability
trilemma um I don't say there is a trade off exactly I think that's uh true to every rollup um and it's it becomes especially true for application specific rollups what you have is a uh kind of like a it's cryptoeconomics incentivizing people in a way that maintains everything secure so as we play a a rollup if you go for instance for optimism or a what you see is like for now yes you have a main node there but eventually you should have like bu nodes and effectively what you see is like reproducing whatever main it already is many knows verifying
everything but with application specific rollups it basically create these clicks where only the interested parties are together right let's say we start playing a game we are only three uh so only we are really uh running the rollups but then here's when things started getting interesting so if you just look at this scenario right now you'd say okay so you compromise Security in order to have more speed um it depends even how you put it because you can say compromise decentralization in this case um but then security how the security goes here right but then for sure you have the the the the throughput to deal with the with
the application right however different from this uh a layer one at work we don't need to go for a majority consensus what what happens is let's say I I went a game against you guys and uh there's a lot of money on the table you to say that maybe you won and split the money with Max uh behind the scenes I in a majority game I would be like screwed right however I can really just go back to ethereum and use ethereum as a judge and say hey I actually won and here's the proof and then it would enforce even though I was a minority and here's where crypto economics come in play you probably have
something to lose so if you know ethereum is there to always like protect me and at the same time you have something to lose if you lose the dispute on on chain then you likely are not GNA do anything wrong unless there is a mistake on your software but but not maliciously right yeah so in that sense uh you gain back the security and the decentralization kind of starts become more distribution so distributed computing really only clicks of people interested in that computation should be running it there is no necessity for like everybody to go for that and still permission less so that means like okay now I talked about a table game with you
here but is what if it is like a ever running application like DCA monster for instance maybe I'm making some trades I'm interested but then like next week I'm not I can just get out of that right so people can get in and out and maybe you can even add more layers of incentivization where okay maybe I'm not playing with DCA monster but I'm verifying here and there like on and off and if I see something wrong I dispute the original validators to get some um price out of that that's how I guess um most rollups and spe most specifically the application specific ones get to be this um how does say this bridge between
what what is web two and what is web 3 yeah that makes sense and and you can pick and choose which environments to verify or validate yep yep and those environments those those are applications that are built on their their own rollup environment exactly exactly so the DAP now it's not some buy codes you're sending to to the chain anymore the DAP is the r itself like to run the rollup in a decentralized fashion meaning you're not pinging some AWS server you're actually downloading like for instance a darker image and running it on your machine it's like a a whole node um but then there was H one point you
touched that was interesting and still like a I guess a mission for the whole Community to solve which is the transaction data itself so for instance Doom is a very simple game and it was really uh simple to make the input small even for large sessions of uh gaming gaming play but what if it is really like heavy data stuff uh what if you're trying to do some data analysis on chain for some reason then it becomes an issue again and we still haven't figured it out that that really clearly many projects are are tackling the data availability problem and still not solved I guess and that's where we are at right now mostly CPU
scaling I mean there some availability stuff too like you yeah but I mean like as a rollup Tech itself yeah true that's true well we figured it out was the CPU scaling part of it cool stay tuned for the next video we'll talk more about data availability uh and some more of the technical elements of Cy awesome was great than for coming on guys this is fun yeah thanks for having us