StarkNet is Coming

ETHCC 4 · July 2021 · 28:57

Avihu Levy and Tom Brand introduce StarkNet’s permissionless ZK-rollup design. They describe the Planets alpha on Ropsten and its support for deploying contracts and sending transactions.

Speakers

Topics

From ETHCC 4, hosted by Ethereum France.

Transcript

great um so hi i'm avio i'm head of productive stockwere and today i'm going to talk about building starknet um i will try to cover three different topics um hopefully we'll get and we'll have time to to talk about all of them uh the first one is basically what is net and why you should be building on top of it the second one is maybe the most riskier one but i want to try and show you uh what you can do today on start net there is no need to wait you can start working on start net today and and the third thing that i want to talk about is the start net ecosystem and how you can be part of it and what what exists today

um so maybe let's start with uh what is stark net um so starting this alert to network and what we are trying to achieve with stark net is experience that is very similar to ethereum meaning everyone every developer can deploy general computation general logic smart contract everyone in the network can interact with it permissionlessly all users and all developers of course there is composability in the network so transaction can interact with more than a single contract between contracts and at the same time we don't want to compromise on security and we want to offer obviously a much higher scale

so this is why we are building a zika rollup um and i want to say that startnet is not a theoretical idea or something that we are just planning but it's actually live on testnet today and in a couple of minutes we will actually show a quick demo on what you can do today on uh on the test net but first i want to spend like i don't know what 10 15 minutes to talk about uh start why is darknet and i want to try and cover why it started from a couple of aspects and i want to try i'll i'll split it to a couple of different points or different topics

that users and developers should care um about and i know that i won't cover all those points but please feel free to contact me afterwards and ask about some of those that i didn't cover or those that i did but you want to hear more about so the first the first question or the first topic that comes to mind when we are building some new network is touching the security of this network and this is probably the only slide that i want to mention side chains but i do want to talk about it because especially recently this is something that is more in the headlines and i think the developers and users they when

when it comes to security of sidechains versus scroll ups they want to ask themselves two questions one question is regarding to the latest state suppose i'm a user or a developer and i'm getting some information about the latest state and i want to know or to be able to verify this information with minimum trust so i don't want to to query necessarily some centralized service but i want to able to be able to verify it myself so if you are running on a sidechain if you are if you are running a sidechain you have no other choice rather than uh download all the blocks re-execute each and every transaction and because at the end of the day execute each and every transaction in many side chains like polygon or minus

margin is exactly the same as executing ethereum transaction then if your hardware if your node can do 100 transaction per second in ethereum then there is no reason why it won't be the case the same in sidechain so that means that you are very limited with your ability to verify the state and if polygon runs for example in 1000 tps i just throw some number and yours and your hardware doesn't support more than 100 then you would never be able to verify the latest state um the and and obviously in roll-ups um there is still a challenge there but the situation is much better and why why it's much better in roll-ups because

in a roll-up you always has a commitment to some very recent state on the chain so if we agree to the assumption that you'll get the state somewhere from some node it's a much easier work to think on this later state versus dyslexic commitment sorry and when it comes to a zika roll up then you have even another advantage that you don't have to re-execute either each and every transaction it's enough if you update the storage and verify proofs so there is a very large advantage in syncing a node to the latest state in ezekiel compared to side chains the other difference that i think is very more substantial when it comes to security is uh this of bridging to ethereum

i think at the end of the day most of us agree that most of the volume to most of the value today is created on ethereum and this is the source of truth for many many tokens so the question that users and developers should be asking themselves is how secure is my bridge what is the chance that somebody uh take all the money from the bridge and the simple difference here is that in side chains the bridge is secured by uh by the same mechanism at the best by the same mechanism that uh controls um for example uh the proof of stake algorithm and that's obviously like a list of small number of validators that

now controls not just the order of transaction but also the value that is locked there and that's obviously a very big downside of every side chains and that's what's what rollups are changing because they enable the bridge to be a result of a sequence of correct state transition and when it comes to zika relapse the state transitions are backed up by proof so if you see a commitment to to some state if your bridge is commitment to some state in zika rollup then you know that this state is backed up by proof and valid and there is no number of validators in the world that can change that okay so that was my only slide touching

side chains and security and now i want to focus on some other points that are more relevant when you do the compression between zika roll-ups and optimistic roll-ups and i will talk only about the first point which is uh throughput scale and cost so here i think the two important things to understand are uh the following ones one is related to the previous point that i just made suppose that you want to sync your uh your full node and you want to know the latest state so one main advantage that zika lab says and optimistic coolup doesn't have is that in opt in zika roll-ups you have a proof

at least that at least cover the computation and then the need to know the weakness as a full node that only needs to verify the latest state it's enough for you to receive proofs verify them receive uh the app and update your storage you don't need to re-execute each and every transaction and you don't even need to download all the witness data and in optimistic up on the other hand you need to re-execute each and every transaction otherwise you're not sure that your latest state is valid and that again brings you to the limiting scale of ethereum if your optimistic collapse runs an evm then you're going to execute all the transactions

that you would execute in the serum and you won't get much much scale the more important point and that one is listed here but i will actually try to give some example or two is the one of that that many people are aware of and this point is the one of the level 1 data as a shared resource so you probably know that all rollups shares one shared resource and this resource is the on-chain data or the layout data that they they publish on chain and the throughput of the rollups in general and every roll up separately depends on how much data it's going to publish for every transaction and here i think it's also a very it's a

very very important advantage of zika rollups that you don't need to publish the entire data that brought you to get to this correct result of some computation and because you don't need to do that the amount of data that zika loops will put on chain will be eventually much smaller than the amount of data that will be uh that will be put it on chain by optimistic roll-ups and that means that that it means two things it means that zika robs can come to a much higher throughput and it means that the curl ups can maintain a much lower cost per transaction for users and i think it's often overlooked what can be done with this so i want to

instead of like talking about about the other points that are also mentioned here and also very right i want to talk about especially like this point and show two examples of white matters okay so here's a logo of chain link because yeah it's always good to show a log of chain link but that's not what i want to talk about i do want to talk about one use case that we've seen recently and i think is making a very good point um and this is the use case of oracles so many applications on ethereum modify you probably know that they use oracle prices they use all kind of data from the outside world and it costs a lot of

money and it costs a lot of money and a lot of gas because both this data needs to be on chain this data needs to be stored and many of those applications they would benefit if the oracle prices could contain more oracles instead of 10 signers maybe we want 100 maybe you want the oracle not to be once per hour but we want it once per minute and maybe we wanted to tell us not just about a single market but about 100 different markets and when it comes to dydx which is an application that we are running already today on our sequel oral platform is it was very important to actually tweak and improve their application by enabling more oracle prices now

oracle feed on optimistic call up you still need to put all these data on you and if you wanna have an oracle price that is made of 100 different oracles and you want to compute some function on it you have no other option you have to publish this data on-chain you don't get much scale when it comes to zika roll-up you can avoid putting any data except the final result on chain and this could save a lot and it has like a deeper meaning and i wanna i wanna still try and make the other example as well which is like even even more complex example here is a game that is based on publishing a lot of data which are proofs from users and it's also based on verifying those proofs

and this is like extremely expensive both from the data that is being put on one chain and from the perspective of re-executing computation and i think in both cases like the first example of the oracle crisis and the second example of the dark forest those are both very strong examples of applications that are that we would like to see on ethereum but their scale when both in ethereum and in optimistic collapse is very very poor but when you take them to zika roll up you gain much more scale because you can avoid putting data on chain and because you can avoid do the recomputation and i actually think that um if i'm looking forward then i think that

we will see a lot more uh alert to native applications that we don't even know that that exists today or that could exist today on the serum because the cost only ceremon or any optimistic roll up even are so high that you can't imagine to put them there um i want to focus a little bit on us and what advantage we bring to the table and i think this is a very important slide so they are not just i know that you see only two points but there are actually four points here um so the first thing is uh the first point talking about our production tested software but it actually means two two things one is uh well we are running with starkx that is built on top of cairo already more than one year

we've deployed four different systems that are running in production the fourth one is sorry is being deployed today uh so congratulations for them and for us um and we handle quite a lot of money quite a lot of nfts for quite a lot of time but i think the other point that is hidden here is that those users those few tens of thousands of users are going to also whenever we take star kicks to start net they are going to migrate and bootstrap the network which is a good thing and an advantage of startnet and the other point is probably the strongest point is that it's not just that our provers are very well tested and strong and backed up by good code good software and good science it's also that

basically the proven technology is part of our expertise and this is what we do and this is what we research and that makes it it makes it sure that we'll bring the latest and cutting-edge technology into play i just can give an example and i won't talk about it much uh just two days ago we released some paper named ecfft and basically enables you to do fft faster on some domains that were not so nice until now like for example the domain that is responsible to the ethereum signatures so it's just an example to our strengths there i do want to talk a little bit also about some downside that or at least a question that you might

have in mind which is okay you showed us all these wonderful um points but how easy it is to write code in in your in your system in your zika rollup so the first i want to talk about it a little bit the first thing that i would say is that as we've seen before with some examples there are many many alert to native applications that are not even existing today on ethereum and even the application that exists today they would probably want to change their nature and change their code to enjoy the benefits of the scale from a zika roll-up so maybe they want more oracle prices maybe they want to do computations that so far were prohibited on ethereum so that's why i would imagine that at least the large d5 protocols

they probably want to rethink what their protocol should look like given that data and computation are less of constrained so that i think is important point to make and the other thing is uh that we do understand how important it is to support evm and we have uh a project named warp and i will talk about a little bit more later and it's external project that works on compiling evm to cairo and there will be actually some demonstration very soon um so i think that i'll talk i'll touch it in a couple more slides but most importantly i do want to show you a little bit uh of what you can do today what how is how does our alpha look today so

um yeah what is what is the stark x alpha so start net alpha sorry so um so stagnate alpha basically enables everyone to deploy smart contracts interact with them and see proofs generated based on them i don't i don't know if there is any other network that enables all three there are networks that enables you to write general code and networks that are closed that enable interaction but i think this is the first time that you get all three um it exists already over one month on robsten and what you can do with that so we add more features every day two days ago we added something new which is the ability to uh do layer one layer two interactions

and that also includes putting some token bridge um that you can play with there are a lot of toolings you don't even need to install anything on your computer to play with it um i actually want to show you a quick demo on this computer right now assuming this would work so i want to invite tom uh who is the project product lead on of starcnet to do hopefully a quick demo that will work and we didn't try it before so uh i don't know if it uh we it will be like blind the french keyboard experiment no we changed to english okay can you hear me yeah okay so hi nice to meet you all um basically today you can interact with

starknet but i need to also write from your uh local ide but for the purpose of this demo i will show you a web ide that we have that allows you to write contracts deploy them to startnet and then we can jump to the block explorer to see this contract and how we can interact with it uh through that so hold it for a second um yeah so we'll go to cairo lang and this is the playground can you see something no so basically it's it's it's a playground okay great thank you which allows you to

learn cairo but also lately we added here the ability to deploy contracts directly to startnet so let me just grab an example a contract example from a documentation i'll go here to my and your first contract and let's just yes yes i just copied paste it here and i will try to uh let's deploy it for a second okay so i deployed it now in a minute you were able to see

the address that was generated for it i'm in the transaction i didn't deployed it so we'll go there in a second but i will just do a quick overview of what is start net contract but basically the structure is the same as a solidity contract you have storage variables yes thank you so basically the star the structure i will do a q quick overview of the start net contract but basically the structure is the same as a solidity contract you have storage variables here you have just a variable that returns the balance of this contract but it can also be mappings for example or a mapping of a mapping

like we have in ethereum sorry that i just don't have here the yeah um let's for example have here a mapping of a mapping and then we have functions that operates on this storage in the same as ethereum here for example we have an external functions that allows transactions to call it and we also have a view functions which allows us to to get some data on this state so for example this function which we will use in a minute uh allows to increase the balance of the storage variable that we have here um and this allows us to read it so maybe let's go to the contract that was deployed so here there is a

small bug in the block explorer but it will be fixed hopefully next week um yes so let's see if it was already deployed we'll go to the transaction it isn't waiting to be included in a blog hopefully it will be included a do you have maybe in the meantime any question on that what you can see here yeah um i think if you want to see like more about uh how the how you can use the alpha today and about and learn how to code to it there is a workshop today at four and you can we basically we are sold out for the

workshop but you can come to us afterwards and we see what we can do and so if you are interested to see more about it then i think it's a it's a good opportunity maybe you can do like questions at the end and then i can okay we can interact with it in a minute yeah okay it will be included okay thank you i think it's this one how do i turn the slides yeah thank you okay um so what's next

for starknet um there are the next phase for us is um basically bring stark net to mainnet and the main thing that is currently missing is the composability so right now you can deploy smart contract they exist on the same state you can interact with them you can interact with layer one what we want to add very soon is composability so contracts could call each other um and then obviously some infrastructure that makes it very natural and convenient for everyone to interact with the network and hopefully it will be ready and deploy on mainly by the end of

the year and the last phase universe and that's uh what wasn't mentioned so far basically include the permission of sequencer so that's completely a picture for permissions network where everyone can run a sequencer an approver and basically be an operator of the network yeah the last thing i want to talk about is the stacknet ecosystem so i think it's very very very very very very important for us that as many people and projects and organization will be part of startnet and we already started uh to cooperate and to have others build parts parts of starknet and this is a

partial list that i want to mention but i do want to say that there are many others that are in in the process of getting to this list too so i'll mention some of them uh the team that builds the full notes for starknet is we call it fermion and those are the people that are building today aragon or the tubercus client that is probably known you probably heard the name i think they are now they just started a couple of months ago but are getting very nice tractions in the map of clients of ethereum which i think is good for ethereum um we also have two projects by nethermind one is the warp project that i mentioned

earlier that is the evm to cairo compiler um i think that there will be a demonstration of compilation of standard erc20 contracts very soon the other project is the block explorer that you just saw the voyager one and we also have another project of compilation to cairo from functional language by daniel cronin and marcus nerd and there is also an effort of contract standardization for startnet that is not finalized yet but it most likely will be led by open zeppelin now what you can do as individuals or as developers so as users that want to contribute and join this effort so first thing is almost all the teams that i mentioned previously

are looking for extra people to work on those stuff and others so if you're interested we're very happy to connect you with them um to work on the cool stuff they are building except that there is a and i and we encourage you to be an individual contributor for stargate and that means that i just give some examples of individual contributors some of them from other other projects some of them are just i just um do it on their own uh so there is kobe gurkhan who wrote recently star rope which is a very nice plc written on top of starknet alpha already there is andrea and hemlink with a moon which is a very nice post explaining puzzles in cairo there is perama which is an

anonymous contributor a hero tons of the documentation and tutorials for cairo and francesco chikun wrote recently a chiro debugger and the last thing that i want to mention here on this list is that we are now putting a proposal uh for the maker dao community to have a team building a separate even independent team building maker on top of starknet so that's also a team that will look for more people to join so feel free to reach us afterwards and and ask about any of those things or any other thing that you have in mind um that's it so that's uh that's darknet um i hope you got some answer to your questions but i'm happy

to hear if there are more questions now you can mineral convict the transaction um what do you think is the best layer 2 solution that reddit might will use that what that reddit might use in the future reddit read it yeah yeah okay i can make all kind of speculations i think for uh that's something that i didn't mention but i i i know that is in mind of at least other zika roll-ups as well and is something that we also believe it in some at some point of scale you might want to use to be able to use a solution

that is from one side uh very secure and from the other side can support massive scale and massive scale isn't probably 10 000 users or 100 000 but few millions and when it comes to that to that maybe you want to avoid putting some more larger part of larger portion of the data on chain so if i say my requirements is i want a secure solution and at the same time i want something that doesn't necessarily have to put all data on chain then you probably want to put something like what we call today evolution and i think that alex mentioned previously as a zk porter but any solution that basically enables option data and that's something that we

run on maintenance ethereum for more than a year because we think that's a viable solution as well so i think for very large organizations something in the concept of volition is something that can run on top of stark net you can put offchain data as well as launching data so you can let user choose and then large organizations like reddit this is like the most convenient and secure place for them to be yes any question no all right so thank you thank you you