Starknet, gaming application on layer 2 | Guiltygyoza, Topology | ETHTaipei 2023
ETHTaipei·Mon, Oct 9, 2023, 12:00 AM
Transcript
best talk will be happening soon it's about to start hey so guilty gyoza is one of the earliest and best known and best builder in the dark net ecosystem with great experience of decentralized gaming applications so we are glad to have guilty the co-founder of topology to give us a talk about and experiential fogs welcome guilty hello everyone good afternoon I'm kyoti gyoza you can call me by GG or call me by guilty and I am a co-founder of topology we build experimental games on start net today I'm here to talk about starknet to talk about Cairo and to talk about the experiments that we did um the talk will be uh divided into two parts part one will be about the ecosystem at large I think Taiwanese developers are less familiar with Stark net and Cairo VM so uh yeah I wanted to give an introduction to all of you here and part two will be about the experiments that we did since the Genesis of the company so it's part one start the ecosystem on the left that is the logo of starknet on the right is the logo of Cairo so what is darknet Stark net is the ZK roll up that settles stock proof on ethereum and those proofs of the proof of State diffs of the ZK roll up itself starkney currently is undergoing something called Regenesis which means it's upgrading its VM from Cairo 0 to Chiron one is a major upgrade and the entire progress is Guided by Stark net foundation so they're originally developed at a company called starkware but they are forced him ahead trying to decentralize the development of the ecosystem and Cairo is the programming language for writing provable program using the stock proof system Cairo won so Cairo zero is the old language which is known as something very difficult to learn it has the facade of looking like python but it's actually very low level which is a little bit painful to write but it's much higher level than circum if you write circum Cairo is already a higher level language than circum but Chiron one is becoming rust-like so if you like rust Cairo one will look very familiar to you uh not only with rust one being looking like rust it introduces an intermediate representation layer called uh Sierra Sierra is the part that is close to the Stark proof system so that you can write Cairo as a very high level programming language just like writing rust Cairo is also the name for the VM this is called Cairo VM or Cairo CPU uh question obviously would be why Stockton why Cairo why don't just you know build on the work computer that is ethereum well so one of the first reasons will be if you're strange you would want to maybe try a stark net and one of the things about um ethereum is that solidity feels like a web programming language it's quite familiar to people but um Cairo was low level so it was painful to learn and write so you almost have to be strange and almost an outcast of the sort of the um you know the the uh popular culture to wanting to explore Cairo in the first place that makes you a strange strange person but well we like strangeness one of the things about starknet is that because Cairo was so difficult to learn it's it was a filter to the kind of people that enter the ecosystems everyone looks strange everyone looks um like they're thinking in very different ways than the sort of the majority of people in the in the rest of the evm ecosystems uh there was a just like a meme about all the strangeness of people uh there used to be a Lisbon hackathon in uh about the Stark technology and um I think they rented a whole building Seaside of Lisbon and there's like bed bugs and people smoke a lot and do like Age of Empire tournaments and while hacking away you know account abstractions and you know play sessions that can allow you to play unchain game without signing transactions every time uh it's a it's a it's a we're a bunch of people and a lot of French as well strangely because stockware was uh stockware is a rally company and they happen to be very close to French I think culture and language and so a lot of weird French people I mean French people are kind of strange in the first place but it's even Stranger In Stark net um one of the earliest things that we did in the starting ecosystem was a bit strange too so on the left we did this physics simulation in the Cairo VM on Stark net this is October 14 2021 uh as you can see this is simulating uh two rigid bodies constrained by a spring right it's like a junior high school physics but we were able to write the numerical simulation of this physics system in Cairo and run it on chain so that when you sort of when you um call The View function of the contract you get the entire simulation back and you can visualize on the front end on the right this is November 11 2021 with the mnist but in Cairo VM on starknet so it's like a two layer deep neural network uh relu activation and it's able to recognize like emness digits with like 90 93 accuracy and we were able to transform this Hydro watch model into a bunch of chiral contracts and put it on chain so you essentially have an untrained inference ml model inference like it's a toy model uh number two reason why Stockton and Cairo is you are a masochist um it's a stark Nets talling beforehand was written in Python it's super slow right so like you would write a contract and the testing the testing runs like five minutes ten minutes and it's it's almost like painful um another thing about about pain in our ecosystem is that the language is very much alive and early so imagine ethereum but in 2015 solidity is fast iterating version after version release after release so every time there's a update on the Cairo version you are afraid because it breaks your program it breaks all the abstractions and testing that you've made um but that's the fun in itself other reasons include you liking rust so I personally don't have a Affinity to work broad programming languages um but I like rust in in terms of sort of the control it gives you as a programmer one analogy I like to use is that a lot of the high-level programming languages feels like automatic transmission but like rust feels like manual transmission a lot of control and responsibility but that gives you power as a programmer so if you like rust you'll probably like Hiro one another reason is you think long term so I think there's the notion that ZK uh prove has more potential long term over fraud proof over to the game theory based Solutions so if you think long term about sort of the implication of ZK permeating in our society then this is the place to be this this is where a lot of cryptographers hang out and they think about how to do recursive proof and so on and so forth uh last one is you want to participate in shaping a new Computing Paradigm so what's what what is the program after all what is ZK um analogy I like to use is that um imagine I run a program and I want to convince you that I run it honestly how would you how would you verify me right one reason one way is to rerun the program yourself and check if they match so that's I do one unit of work and you do one unit of work and the answer match then you trust me now ZK proof basically allows me to do 1 000 units of work so then you do 0.001 unit of work but you can still trust me because it's basically no way to cheat with the zkp technology and so that's that shifted the responsibility right on the verification side you do uh 0.001 workload to verify the correctness and you know we know later one blockchain is expensive so let's put the verification on layer one and let's put the proving elsewhere let's make the blockchain modulus and Outsourcing stuff to other ecosystems that's the modular blockchain thesis after all uh if you want to come to Stark and ecosystem there is a bunch of Open Source projects so uh just to go through them very quickly Kakarot is a Type 3 zkevm written in Cairo completely beerus is a rust-based like client for starknet Madera is a rust-based sequencer based on substrate the substrate framework there is a project run by Lambda class which is an open source that Powerhouse and they're making a Sierra to mlir compiler this basically means with this you can run Cairo on any x86 machines and so you can run stock approval programs basically on any machines on Earth garaga is a pairing library in Cairo so to put it simply with this you can verify stock proof on start net that's pretty powerful thing and last one is this is a Cairo but in French French people are weird and they have a repo of Cairo One data structures and algorithms it's like you know the best way to learn a programming language is to do something about it right it's like the best way to learn language is to go to the country and live there same thing so if you want to run Cairo maybe go to these repos and start contributing to them by doing this you learn a language um and all these projects are uh sort of collected under this repo it's a keep Stark net strange keep that Stark net that's strange it's a strange ecosystem and we Embrace that spirit uh okay um I didn't know this this didn't load but if you want to learn Cairo I proposed a two-step process first of all go through Stark links if you know Russ there's something called rustling it's the rust tutorial sort of canonical tutorial uh there's something equivalent called Stark links GitHub you search uh Stark link Cairo 101 you'll be able to find it it's an interactive tutorial I think after going through that tutorial you basically understand all the basic things you need to know to start speaking Cairo number two is to this is bad and number two is to build something and tweet so there's some we have um this culture that if you make something on Stark net you tweet about it and everyone will retweet it so this is I I think the best way to learn Cairo is to go through tutorials and make something with it okay uh is there a way that I think this okay sorry uh yeah so um this is darkling uh or what it looks like on your terminals it's a terminal based tutorial and um this guy is our ecosystem leader um it's a it's a crazy Israeli guy and whatever whatever you do the first question he asks is did you tweet because if you tweet he will retweet and the rest of the ecosystem will just retweet and celebrate the strangeness of things okay so part two we want to talk about our experimental Fox fog stands for fully Unchained game um we started to do this in 2021 obviously dog Forest uh uh was the OG of fog and I think recently fog has slowly becoming a category among the investors sphere which is a very good thing that means more resource and attention but we want to talk about our experiments because I think this inspires people why it's interesting to build on a new ecosystem uh so this is a recap of Isaac which is a three body problem experiment that we did last summer three body problem it's a Sci-Fi story about three sons and about a civilization that just dies over and over again you know by getting burned by the sun you know crash into a sun Etc so we made this three body problem fully Unchained game on Stark net where we have current contracts literally simulating a three-body physics problem in a small contract and players have to work together to solve the problem etc etc uh this was last summer TPS wasn't great and was unstable so we had to Pivot so this is mumu okay so MooMoo is an experiment about digital chemistry so these are sort of formulas that you can synthesize emojis after emojis and you want to build a pipeline that transmits emojis from uh you know the source to destination if you play factorial you kind of know about building production lines that transform things and Achieve objectives this is a simulation game like factorial uh we have players playing this game and try to get high score and this is the leaderboard we can see a huge difference between top players and entry players we felt that Mumu is something bigger something's about something bigger we want to find what's the bigger thing so we went on a journey to making shoshin shoshin is beginner's mind in Japanese this is a game about making Minds to battle other Minds okay so the process looks like this you design a mine and the minds provide intent you know what he wants to do it thinks about things and this intent drives the body you know body responds to intent and it moves around and then you have physics that simulates how these bodies interact with each other in the environment um what's blockchain about this everything is Unchained here so the execution of the mind is in a small contract the intent is processed in a small contract bodies are represented as small contracts and physics is run in purely in smart contracts uh so core game Loop pretty simple you as a player design and submit the mind and then the Cairo VM executes the falling Loop which is very simple step one you have perceptibles you know things in an environment that the Mind perceives and these perceptibles would mingle with the mind which produces the intent right so like you basically your mind process about the environment and your mind produces what it wants to do step two is intent and body mingles the body moves around and then there's physics stimulation and then physics simulation happen which calculates where everyone is what everyone is doing in the scene and then you have housekeeping which is calculating you know how much HP you have how much stamina you have if anyone is dying Etc and finally after everything being computed in the Cairo VM we render the entire fight on the front end so you see the fight visually just to go through the details a little bit uh perceptibles basically means what is to be perceived in the environment right so there's about yourself and the opponent and either about yourself or opponent you can perceive about where you are that's X Y the velocity vxvy acceleration xay HealthPoint stamina what's what state of the body is in what counter of the body it's like animation animation counter okay so after perceptible we go to the Mind stage where the mind you know perceives the environment and makes this decision mine is in our current implementation uh very much inspired by the uh Bobby engelbert's idea in GDC 17 called hierarchical Finance day machine and behavior tree it's like a way in the game industry to build NPCs non-playable characters so in our uh implementation every mind is represented as a finite State machine where the state transition rule is a binary tree so for example I am in the weight mental state right so if I am in the white mental state uh basically my thoughts go as follows if my opponent is vulnerable then I want to exploit that I go to the attack mode otherwise I stay in my weight mode right so this is sort of describes a sort of the part of the decision making that happens in the mind as part of the binary tree so we implemented this as a library in Cairo you have essentially like an abstract syntax tree where every node is a operator except for children children's are constants or table lookups values and we have four care implementation done by Greg which is our one of our esteemed teammates and he also did the Cairo wasn't thing single-handedly so color wasn't basically means we can run Cairo VM in wasm in browser so you can you can do off-chain things before going on chain basically running exact same VM but the off chain uh okay so after the mind we go to the body right so the body is your playable character right so imagine the mind being what the racing driver thinks in an F1 race the body is the race car which what car you're driving uh each body is a playable character right so think about uh Super Smash Bros or think about uh you know uh King of Fighters you have a universe of playable characters to choose from these are the bodies each body is represented as a finance day machine just like if you know Unreal Engine this is similar to anime State machine in Unreal Engine now moving on to the physics side so this is what simple physics engine do okay simple and business engine basically estimates what every physics uh you know a physics body is in the environment so it protects where everything is and handles collision and so on and so forth I'm going to fast forward to early footages this is sort of internal play test footages so this is how you design a mind you sort of design Define the mental states that your agent can be in you design the state transition rules uh you sort of handmade every condition sort of what goes into the mind and we have a uh we have a gameplay here so you now you see a female character sort of timing perfectly his lashes against the male character uh so that he's exploiting the vulnerability frame every time uh this is a phaser.js integration by one of our colleague nonsense uh who also built the camera control so you have essentially camera following where everyone is in the scene uh this is another gameplay where um the male character perfectly blocks the opponent's attack every single time um and again this is just replay everything is computed in Cairo VM okay uh this is to the our interface provided for you to debug your agent okay so our current Focus uh first of all is to improve the accessibility uh right now it's a little bit rough internal play testing step two is to re-architect everything in Cairo one so as I mentioned Stark is undergoing Regenesis Cairo zero to Cairo one and we have to rewrite everything in Kyron one which is a very good thing because we get to think about architecture from scratch and do it in a more beautiful way after all beautiful code is safe code this is just to show that the Mind crunching is actually the most resource consuming part so we gotta optimize that part uh another idea is to do application specific VM so this idea that our application is not just an application it is an application for you to program behavior on top so it's like our application is the platform in itself and when you want your platform to be programmable you think about putting a VM in it right so we think about implementing a social in Isa instruction set with the social VM so that we can support different kinds of minds and bodies and you know game rules and maps that you play in uh all on the same VM the application specific VM uh last thing is just to do client-side proving so uh you we want to prove a lot of things off chain and submit proofs maybe recursively on change so you can verify it and this way we can scale shoshin to much more interesting agent behavior and much longer fights more interesting physics and so on and so forth uh last but not least we are undergoing a character concept redesign so what you saw was a Fiverr artist prototyping the art this is uh the Artist guagua as uh in the audience that we're collaborating with we are redesigning the entire character set from scratch um hope you like it the style and this is it this is shoshin uh if you're interested in the game or interested in talking to us feel free to scan the QR code and join the waitlist where we have a couple strange questions for you and if we like your answer we'll talk to you thank you [Applause] any questions uh is the Cairo One VM prover open source so I think that Stockton Foundation announced the proof of being open sourced but I think it's in progress and I think there's there's actually a open source initiative try to reverse engineering the stock prover and to provide like GPU accelerated approval and so on I think ZK Tech at the end of the day is something that needs to be open source otherwise you can't trust it so it's only a matter of soon or late any questions okay so know so I have a questions have you ever think about go back to ethereum well I I think I think the blockchain now is becoming um like in the Merry-Go-Round situation right so you have the evm traveling to different countries and becoming parts of different blockchains and you have the sequence you're traveling around consensus mechanism traveling around um well start first of all Stark is a layer two on ethereum so it's like we're in the greater ethereum City just not the not the city itself but the greater neighborhood um yeah and I think that um you know just like video games so video games talk about being cross-platform you want to be able to play fortnite on your mobile on PS4 you know on different game console I think same for uh uh online applications eventually things have to go cross-platform so users don't have to care which chain they're on this is just obvious but I think to us it's more important to choose where we enter so that we scale to other ecosystem later [Music] one uh thank uh thanks very much for the presentation and the fully on train game is a very uh exciting uh concept but in the reality now it's like especially for the gaming sector in the web 2 it's still Library centralized uh you need a lot of like experienced developers to build a really interesting games it's like different compared to the D5 whatever it's a simple interaction between uh user so for the game it's a very highly you need to have a very I don't know just like I'm curious how I like it's a very interesting idea about the reality how long do you think it takes for like the infrastructure and also for like developers to be able to really create kind of games for the unchain thank you very much great um so I have two thoughts to this um do I need to repeat the question um sure I can repeat the question so I think the question was game development is a complex process so even if we make unchain game fully open and decentralized there's still relatively few people in the world that knows how to do games so how is that helping and you know where does the future hold for fully launching games I have two thoughts so number one um I think Unity is a pretty easy game engine to adopt if you if you if you can suffer The Foundry you know all the you know all the Tooling in the evm ecosystem I think Unity is a pretty pretty easy tooling to pick up to make simple games and now there are a lot of efforts into integrating blockchain with unity uh not just entities but also how do you synchronize state from blockchain to into the unity client and so on and so forth so I think that's an entry um definitely check out check out lattice and mud if you haven't heard they're in the optimism ecosystem closer to the ethereum city lattice as an lattice mod is mud used to be multi-user dungeon maybe 50 years ago but mud is is a term that they use to call their uh on-chain game framework for the evm my second and my second thought is um I think blockchain is a new medium and so whatever games win out on blockchain is going to look completely different one Whatever games we know um and so it's it probably will start with something strange and and lit and Tiny and almost uh uh uh sort of conspicuous so uh I think our mentality is whenever people say let's do Unchained CS well let's do on-chain Starcraft we think that's not the way to go um it's just not the way to go this medium is not built for that kind of craft but this medium is good for something we don't know yet and if you like Risk if you like danger come to the frontier and do something here this wide open design space any other questions I'm wondering what is the target gamer for the fully Unchained game since it looks like the right now when you need to play when you are playing a full engine game the the the like relax you need to have the ability to maybe write some code or you need to know maybe ZK so I'm wondering what is the target gamer right now for the foreign game and and will it be able to build a full action again for for retail oh sorry can you repeat the second question oh my second question is that do you think there is a way or a chance to build a Foley I'm changing for the retail Gamers Maybe not today but maybe in the future for the regular Gamers right yeah really good yeah yeah um well
Automatic transcript — names and jargon may be misspelled.