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

Loading player…

KL Mini Hack 2023: Introduction to Starknet | February 14 | 9:30 PM

Ethereum MalaysiaMon, Oct 9, 2023, 12:00 AM

Starknet is an L2 with Ethereum as a base layer. The goal of Starknet is to provide a scaling solution to Ethereum. Tune in to learn more about Starknet and see how it could be the future of how we transact on the blockchain.

Transcript

I just got yeah okay sorry the sound of the recording was messed up I don't know why if someone did something wrongly sorry let me get back so yeah so this is the current solution and we see that it relies on some economic uh incentive uh which may work or some argument may not work it depends on how you're looking at things but we kind of feel that it's not very at least in my personal bias opinion you kind of feel that it's not very very um trusted yes sure anyone can run a for approval but the Frog pro has to be also a huge machine and what happened if in a chance that um no one is running a fraud proof and someone like someone actually conducted malicious transaction so that is something that could happen okay so uh now let me bring forth the concept of proofs so uh proof of work is something that everyone should be familiar with uh it is currently used in the Bitcoin Network and used in the old the pre-merge ethereum network so what it what it does is that all the miners will compete using their computation power to try to solve a mathematical puzzle so whoever solves like the golden nouns first is able to mine the block and then uh and then you're able to then publish the blog and everyone will will know so the fact that it is hard for them to to solve the puzzle but easy for them for everyone to verify is somewhat like a like a like a concept of a proof so everyone that verifies that the miner has done his job correctly do not need to then really execute the competition again merely they need to compare the hashes and make sure that they're correct so the block hash of the hash or previous block is becomes the hash of the next block and so and so forth so that is some sort like a proof so over here we can see that um the verifier do not need to re-execute uh the the computation anymore and to be able to verify that so this is not exactly a proof but the concept of uh easily verified statement of is it verified proof it's something that we have to keep in mind for for the coming upcoming slides uh yep no questions okay so uh next one next up let's let's talk about uh ZK proofs DK stock proofs so uh I digress a bit there are two kinds of very famous proofs out there which is not as Nar K and stock s-t-a-l-k of for start with.net we are typically looking to stack proofs uh the difference are a bit a bit um how can I say a bit too complex for this one but uh but we can you can we can we can talk more about talk more about in a q a session but uh for now I won't go to that so uh ZK means zero knowledge uh stocks means uh the type of the proof uh the protocol proof protocol that that is implemented here so again uh when people say ZK roll up uh it's actually kind of like a misconception because what actually happens is actually uh there's no zero knowledge involved in a rollout people use proofs just like the concept of this to prove that the execution of all the transactions are done correctly without having to re-execute again so yeah very similar to the proof of work concept so uh okay so let me draw your attention to this diagram here so uh we know from our previous slide that in order to make fast transactions you will need to reduce the amount of participants in in the network so in other words uh in order to produce fast participants a big computer needs to needs to perform the heavy execution and a heavy lifting of every uh transactor come into the network but the big computer is able to then generate a proof to everyone in the blockchain everyone in the network that says that hey my execution is actually correct so everyone over here do not need to re-execute the transition again they just need to trust that they just need to verify that hey this DK stat proof is correct and and I hope you are starting to see how uh house uh ability roll up uh starts to help starts to scale blockchain in in a very um how can I say in a very different way using proofs and uh that you don't need to verify the execution again so here's here's how it goes um the approver these are like a bundled transaction it could be 1000 transactions one minute translation we don't care but the proof is going to batch them all up executing executed um correctly and upon execution executed correctly the proof is able to generate a proof and the proof will then be shared to the verifier in this case the verifier will uh will will only um here verify that uh sorry we will then verify easily very in a very very small uh computation power that the executions are correct and then all the advice is able to excel so in the case of a blockchain what is happening here is that uh once the approver will then take the transactions and output a proof and a state change so uh for example at least to Bob again so Alice uh has at least transferring five ether to the Bob at least we lose five ether and Bob came five meter so uh the state the the new state is then uh published to the level blockchain along with the proof so the smart contract on the ethereum blockchain which is the layer one blockchain that we're talking about we'll then need to verify that hey this proof is correct according to the state update if so uh the smart contract accept and and because all this and because the level blockchain is powered by many many nodes uh across the world uh essentially it is a very decentralized way of uh proving that the execution is correct without having to execute all 1001 million transactions that that is bundled uh in in one in one proof so this this so you can see that this is kind of a roll up right we are rolling up the transactions into one bundle and a proof so you do not need to re-execute the bundle again you just need to trust that the proof is correct using a very mathematical way so um the difference between then between validity proof validity Roll-Ups are sometimes called ZK roll ups and optimistic roll up is that Optimus optimistic overlap is uh it's powered by The Game Theory someone is incentivized to run like a heavy machine to generate for proofs but in uh infinity rollup uh you only need to trust that the proof is is correct and because of math it is a very very highly highly highly unlikely that you are able to generate a false proof so uh any questions so far nope that's good uh okay so uh that's those are introductions of uh how uh a layer 2 ZK technology Works along with how the proof works and how we how we do not need to re-execute everything but we just need to trust that we just need to verify that proof is correct trust is not a good word verify is a better one okay so uh a bit into the ecosystem uh you may have heard of these three terms start wear Stark access.net so what are the differences between the three so start where it's the company behind stockx and stock net uh they do a lot of researchers they are the inventors of the ZK stop growing system uh Friday they are the inventors of the Cairo land uh we I think we will have a Cairo talk tomorrow for those who are interested in writing smart contracts on starnet do kill them out uh sub-provers and so and so forth so they do a lot of research they create products and their mission is to um is to bring scalability and privacy to a blockchain near you so yeah software is a company and stockx and stocknet are the layer 2 solution spawn layer on either ethereum chain so as of now stock net is is currently on Alpha stage that means you can now now you can now write your and test your smart contracts and go lead and uh yeah and stockx is a sub what what I know I know I call a depth that specific chain whereby stock Nets are that specific and we can see that such as dydx or immutable X and they diversify user stuff X to kind of scale their product and allow many many users and transactions to uh to interact with that that and and that transition is also secured by the underlying layer one ethereum chain and again starnet is a general purpose chain you're able to build whatever you want just like how you're able to build whatever you want on the ethereum Chain which with a few benefits such as account fraction which just now we have to talk about uh it's much cheaper gas fee because you don't need to be executed uh and and you're able to form like higher uh more computation intensive process because again you do not need to uh you don't need to burden the the verifier to execute everything uh I will skip this one so this one yeah so uh so the standard ecosystem is actually pretty mature this is actually pretty out all of the slides so I think right now we have three full notes uh one by Juno a goaling uh implementation of the standard client by the dynamite team uh Pathfinder is a Ras based standard client by the equilibrium team and I think that's another one called Papyrus uh I think that I think they're officially by the standard team if I if I recall correctly uh and we also have a transpiler so because Cairo is a new language at first it really um it takes a bit to learn but fortunately the Netherland mine team has created a solid to chiro transpiler it's called WAP so so solidity developers who really want to uh test their depths on the stock net ecosystem is able to utilize swap to transpower their solidity code to Cairo and then you can just deploy it on on the stock net chain uh but it's very highly encouraged that you learn Cairo because down the line definitely transporter will not happen will not have the bad the better performance as when you write raw Cairo code and we also have block Explorer so Voyager is also by the name of my team is something like ether scan button on stock net it allows you to look and explore your journey in in stock net this ecosystem and not to be biased there is also another one by a stock scan but this because this slide is not by me it's also pretty old it's not updated here but yeah so we have two actually we have one more blocks Explorer called view blocks so three blocks explorers three full nodes one transpiler uh it shows that the ecosystem is very bullish on the stem ecosystem yes I mean the community is very bullish on the star ecosystem and uh the contract standardization is done by open Zeppelin because they are very well known for their standards and libraries so they're the one that designs how like an account contract should look like uh because of how flexible the a is someone needs to come up with a standard and open sampling uh does a lot of those have a heavy listing and that is all for my end and I thank you so much everyone I hope you guys have a much better understanding of how stock net scales ethereum and how ZK proofs works and how is it different from optimistic rollups uh I really have time so I think if there's any question just let me know I see that a couple in the slides of Kevin new one with them for me so the first one from CJ uh what kind of dabs would require stock Nets High continuing power to upgrade that are clearly not scalable to this um I think this is a very good good question so one of the depths that I think of are games so people are starting to build games or physics engines on uh on the starnet ecosystem simply because it's very guest intensive to run on the ethereum Chain another one that I can easily think of is options because options involves very very heavy calculations uh like the I think I can't remember the black wood model can't remember the model uh I've kind of like tried to do it before yeah yeah whoever just say that can you say it again got black shells you mean yeah black shorts yes thank you has been a while since I touch option yeah that that that uh model it's a very math intensive uh so those are things that particularly you utilize layer 2 or starnet to perform yeah so um the next question is how's the star X differ from stop Network and uh are they using under lights uh okay stop X it's uh basically the the concept of stock X and Stockton are very similar in the sense that they use the same stock proofs uh they also uh rely on the layer one uh ethereum chain to verify that the proofs are correct the only difference is that stock X is like that specific uh before stock net was launched uh depth uses stunt X to scale their depths so now stock net is launched the plan is for start X to build on top of Stark net as a layer 3 and you're able to customize your your depth in a way that it suits you you it can even include privacy there uh and then you're then able to uh utilize on the layer two uh to to maintain uh or to scale your your chain so it gives you like a customized uh customize that that is scalable because it's now on layer 3 which then relies on layer 2 and layer 2 will then anchor the the proof on layer one so it's a cure it's fast and it's customized yep uh next question from Nicholas uh what are the main issues that is holding back uh what are the main issues uh do you mean JK stocks in general or do you mean uh Roll-Ups like like this like gke roll-ups oh okay uh ZK stocks or snacks uh well uh number one is use cases so there are a lot of industries that are still very slow to adopt such as I think I think recently in Singapore we have this app called we have this project called many zero it involves like um using introducing privacy to the uh to the hospital industry so hospital we know we know are very slow to adult technology so uh one reason why is the slow adoption and the willingness to change this is pretty much a human nature that cannot be helped uh number two uh I would I I would say that um in some cases we'll need even better performance for proof generation uh because in stock in snug sometimes the proof time can take too long which is sometimes not feasible in the internet but you it 100 depends on what what app are you using uh actually I would I would even argue that ZK stocks and ZK stocks are pretty much ready to use it just depends on how and where you want to use it uh the people have been building games applications on top of these Technologies so yeah that would be my argument or S2 Roll-Ups uh basically stockware is very ready to to go uh they have like their main net they have Alpha Min so I guess launch Alpha phase the reason that it's holding them back is decentralization which is nothing there's nothing to do with the underlying zkp Technologies it's more on uh trying to ensure that how do they decentralize uh this sequencer the approval so that it it is um how can I say it's open for all it's open source and so on so forth so these are the small little steps that are in the roadmap and that's why they have this diamond Foundation that will vote for um for what is happening next so in The Snug world uh we I I uh I'm bringing in examples like polygon Hermes scroll and ZK Singh they are trying to a different strategy uh they're trying to be evm compatible so evm that means they have to write circuits that mimics the evm by op codes 100 and those are typically not easy to do because uh it's very uh okay so the proof time is too long and they're they're trying to figure out ways a lot of engineering tricks to make that happen so uh I hope that explains uh the the question it's not a few feet I mean yourself or us again in chat next uh all the stuff I think I'll begin but let me just I think I think I know which question you're referring to so let me read it so it's by CJ how does Star Wars incentivize devs to Port from layer 2 over especially when there's a language variants of Cairo even with a transpiler so that is a great question great great question so uh uh let me throw you an a historical example so when when it didn't first launched people are like moaning and going like oh no I need to learn this solidity so different from my usual uh pro web tool programming like C sharpness something and so on and so forth there are new Concepts that we need to adopt you know there are new things that we need to learn and they are like always hacks so why bother learning it right and but look look at Society now today everyone is fighting to to gain evm compatibility and so and so forth so um so my my belief is that if the language is useful and strong people will definitely adopt it so if stagnet is strong Cairo will definitely be used and uh bear in mind that Cairo is not only used as a smart contract language it is actually a general purpose a programming language that allows you to generate proof and from personal experience it is very very easy to generate a proof using Cairo as compared to other dsls where you need to really change the way you think as a programmer so again let me ask you let me ask you let me ask you uh is already ever going to be your last language that you learn definitely not right so yeah let's let's let yeah I'll leave it at that uh next got it any resources for interested deaths to get started yes there are plenty of resources one is over here github.com edu lots of uh tutorials lots of Hands-On materials for you to test on uh I think this is how I get started as well so I highly recommend you to go there to start the docs the docs here are are also very comprehensive uh yeah so yes it's nice in the introduction dog it really explains everything from a lot of Concepts yeah so these two are a better a good way to get started if not uh there's a Discord group called stock net I can't remember but there's a Discord Group by statnet and people are asking questions over there so if you're facing uh harder questions or you're hitting a wall and the documents documentations are not able to help you uh you are more than welcome to ask your questions there and the helpful comedy will definitely be there to help you uh uh next I really like ZK but it feels like I can't really contribute much and it's quite complete in this case uh to Nicholas uh it really depends on what you mean by complete right there are always constant improvements uh to the GK space they are in need of ZK applications uh so it's a it's a any it's a field that moves very fast uh and it's exciting as well uh history asked in your owner's opinion is not stable enough to encourage deaths to build on top of it with minimal breaking changes in the near future uh that's a very good question uh because I think in the next month or so uh Cairo is going through Cairo Lang is going through an update and they are changing the syntax from a pythonic like syntax to a rust-like syntax so that alone uh shows that there is going to be change to Cairo because it's a very very young language I think not more than two years old but it's definitely worth it for you to quickly grasp the concepts as soon as possible so yeah uh expect changes but every of the changes will only bring forth like a better version of a better version of a developer experience and better version of stuff uh uh can you share some links uh I will if you if I don't uh remind me in the telegram group I will share I'll share them uh one last question as a native developer focusing on Star Knight and ZK Z case uh how long do you think it takes for ZK UVM to actually get implemented uh as it's a relative New Concept and not let us tested um how long for ziki in VM so some might argue that gke VMS are ready like if you ask probably one Hermes they said it's ready although they have a couple of pre-compiles that have not been implemented so uh uh so yeah but implementing zke VMS itself is not very uh useful because you also need to think of how you decentralize the your your your your chain so um so in this case Cairo is ready but now they are moving forward towards like decentralizing the star map layer so that is um a bit tricky and it takes the com it takes the community to form like a consensus uh uh hi whatever ethos does it has the potential as a competitor to stocknet so Aptos has this language called I think move move I mean move yeah it has a very uh I think I think Stana is taking inspiration from Aptos in a sense that it uses this uh acyclic uh a secret graph that so that you're able to compute the transactions they are unrelated parallel in a parallel way so um so yeah uh I don't know much about Aptos but the fact that stock net is drawing inspiration from the move language shows that the move is actually quite has a brilliant idea there uh [Music] uh okay in a fast in a fast in the fastest manner especially the changing on Carlo in a real future oh um sorry we attract yeah uh social media uh definitely the stock net Twitter uh uh the dynamite Twitter because I work there and we are very focused on stock map ecosystem uh yeah and of course this chord the standard is called 100 that is where you get one of the fastest uh thing that's where you get updated the quickest all right uh any more questions uh I just uh maybe uh if you are able to like maybe comment on other Technologies like ZK seeing uh scroll and uh polygon hammers so maybe would it be a okay to just like give a brief overview of what are these uh every L2 doing differently like okay yeah yeah so that they can give us like the idea of like which L2 and why why there's so many other tools and what they're doing differently thanks thanks I think that's a great question and unfortunately for you uh screw is a sponsor and they'll they'll be giving a talk on the 16th of February 10 A.M uh so so but but but I do not I do not want to just leave you there I will try my best to explain although I'm not I won't be as good as them in explaining so um stocknet users a different system they are rewriting therefore they are just forsaking evm whatever so they said let's forget about solidity because it won't be able to allow us to generate like Fast proof and so and so forth let's create our own language Cairo but but this this and this this a lot this requires the desk to learn a new language so what Scrolls the casing and polygon Hermes is doing is that they are they are attempting to bring salinity to uh to the layer 2 Space by generating uh proofs uh that uh from solidity from how can I say evm uh uh evm or transactions so in other words they are trying to make their chain evm compatible by writing a zero ZK evm that is able to generate proofs from whatever code you write in solidity or uh or Viper or whatever evm evm languages so these three have three different approaches I'm not very firmly of ZK Singh uh scroll attempts to mimic the opcode exactly so each op code they have a certain circuit that that mimics it if I'm not mistaken I'm sorry scroll if I say something wrongly you may correct me on the 16th uh polygon Hermes uses a different way whereby they uses micro op codes to to then mimic the entire op code yeah and this is like a high level overview like uh and but down but uh but they are like underlying different Technologies like scroll users hello to with KGG poly model commitment scheme uh I think Hermes uses a combination of snap and stacks and recursive proofs to kind of like generate proofs for ckvn yeah it's getting a bit too Technical and a bit getting out it's getting out of me as well so I will leave it there oh thanks Lachi that's a very good overview thanks thanks I hope that is understandable yeah yeah that that's okay uh like uh for for beginner like me so so I can find that I can read more thanks thanks no problem uh any more questions because we are hitting the 10 pm mark and and perhaps the last question uh because uh this uh just a few months ago there's a talk by Mina protocol and they are using SDK as well so maybe just a very brief overview like whatever is different between like L1 ZK the get-go compared to building on ethereum on L2 okay that's another good question so Mina's approach is very different because Mina into include introduces privacy in a chain so roll ups doesn't have privacy so basically we are just writing a normal smart contract without privacy but Mina it introduces privacy in that chain so uh yeah that's the difference and then they uses this recursive proof to to able to uh shrink their blockchain to like a 22 KB along with uh because it proved to prove that the states and the states previously are are correct uh and Kevin has a nicely uh add-on that uh Mina is also not evm because it is almost impossible if I would say to introduce privacy directly to evm so they have to like kind of like also you have also like a new learn a new language I think it's called snarky JS and uh right yeah and yeah that's that that's what I would say right so maybe uh my understanding is just a different use case for different chains uh yes yes yes I think I think that's a good way to sum it up yep okay thanks thanks you're welcome uh snarky JS type Q SDK a bit more friendly for web to devs so uh I often sorry Mina I often feel that the the fact that typescript feels a bit easier for uh web to devs it's actually a bit of a lie because you still need to think in terms of circuit to program your language your your code so to be honest at some point of time in your life you have seen couple many languages and the syntax is no longer no longer something that you worry about the way you think is something that will heavily affects the productivity of your code so I always feel that DSL is like snarky JS like uh like Circle requires you to rethink how you uh would think how would you think of your normal programming language I think that's a much harder learning curve compared to learning a new language in the different in a different syntax that's my take sorry Mina okay um great uh I will stop recording and I will like to hang on just let me start recording how do I stop recording let me stop share first oh

Automatic transcript — names and jargon may be misspelled.