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

Loading player…

Starknet Architecture

Web3BridgeWed, Oct 9, 2024, 12:00 AM

Transcript

for e all right so um let's let's get right into I hope everyone can hear me yeah all right so today we want to talk about the St architecture so we want to so what are those that up the St so when you hear the word St you know there are a couple of components that mix it up so we want to at and understand each of those components their R so that when you start hearing s like sequencer or app chain or or you know STW like that like that like that you don't feel that is the St that people are talking about is it different from the ones that we Lear so first the um so an introduction to stayer so stet is a coordinated system so with each component so the components that we have we have sequencers and playing a specific yet interconnected R so each of them they have their rules and the rules are very specific interconnected so although stet hasn't fully decentralized yet so which means that currently St is still a centralized system so it's actively moving towards the go so this understanding of the rule and the inter the betters the in cases OB system so let's have a high level overview of everything so the stockness operation begins when start when the transaction is received by a Gateway so thises as the me now we all know what Ms are right yes so what are yeah where transactions are kept temporarily until they executed okay so it's a it's like a umq it's a of unexecuted transactions so theaction is initially marked as received so which means that when it gets to the me it is marked as what received then the sequencer then incorporates the transaction into the network State and TS it as accepted on L2 final steps involves the proval which executes the operating system new block Cate Pro and submit it to lay verification so this is the simple so we have the Gateway which as the m so and the transactions are you know they are sequenced so you say that sequ that they arranged or they ordered and then they are executed so when they are executed they markers accepted on L2 then the Prov the is now going to generate you know the will first bash and generate the proof the proof will then be submitted to the layer one which is the E now at layer one the layer one will then update the state the layer one is going to update the stage root of of the stack net based on the validity of the proof that is that is sent so the St architecture in Ence St architecture involves multiple components so we have the sequencer which is responsible for receiving transactions it operates similarly to validators in ethereum or Bitcoin so we know what validators are on ethereum right yes sir what are validators on um the uh uh I think execute transaction they the ones that create blocks and uh uh like add those blocks to the blockchain okay so how do they create looks um if you're using um uh proof of stick in uh in ethereum the ex sir that's why it's used on ethereum yes yes so uh they execute the transaction and uh uh so those transaction are batched into blocks then uh they they added to the network and uh is being broadcasted to other notes okay so we know that the way the pro of St works on eum okay let me ask a question what is the uh what the consensus algorithm that is used on on you guys just finished let's see what the consensus Ali hello yeah mechanism I'm saying the algorithm not the me is it are you to like went to of to to touch of the notes in agreement toward the name what yes I've not no I'm not asking of not your name I mean the name of okay okay okay okay like um no I don't think that I that one is that one is yeah the consensus algorithm is is Casper [Music] is Casper Casper friendly finality Gadget about the can you come without Caspa FFG oh wow cper the friendly final gget yeah yeah I that name was so like how like how exactly does it work how it works you said it now you said how it works okay theing to of the exactly oh you know that uh you know we have a validator pools right so validat pools are EV validator you need to have some you need to have the execution client [Music] yes and also you st right yes so then you know there's the Rand out algorithm that is going to randomly select yes randomly select notes yeah yeah so those people are SED you know he going to choose a leader among them and the leader is going to look into the M Pool and it's going to pick transaction pick a block yes he's going to create a block and pick transactions from the me so then the transactions will then be you know it's going to be broadcast to the other um other validators and they going to verify the transaction and you know the two like that like that that's finality Gadget comes in so that's how blocks are produced on layer one so in the layer two on on stet so we use what we call what uh sequencers so the sequencers they are responsible for receiving transactions so we already know that what the gate from here we already know that the gateways that's that's what is serving as our main po right so when the sequencer receives transactions then it's going to um it's going to order those transactions then it's going to produce block so it operates similar to the validat that the Prov so we now you know when you've executed that it now sends the transaction you know he going to now send it to the so the is T generating proofs for the created blocks and transactions so it uses the K virtual machine to run pro programs thereby creating execution tra is necessary for generating stock so which means that it is the pro that now you know the transaction normally it has it has passed so the Prov will now generate the proof for those transactions then on the layer one which is ethereum it post a smart contract that is capable of verifying this stockes the proes are valid the stat the stack state route on layer one is updated so stack state is a comprehensive sshot maintained through mer TR much like in ethereum thises the architecture of the validity Ro and the of each component so for a more in depth look at each component we have freedom so let's look more on the sequencers so they are the back bones of stet network they like the validators the transactions into the system so we have valids Exel at uploading some Network C like Bing and processing transactions to to specialized players this set is somewhat like how eum and bitat CR to miners sequencing like mining demands F2 sources so so for networks like stet and other platform utilizing vs a similar p is dra this networks Outsource transactions process into specialized entities and then verify their work these specialized entities in the cont ofes are called sequencers so instead of pro providing security as miners miners do sequencers provide transaction capacity so they other multiple transactions into a single batch execute them and produce a and submitted to as a single compact Pro known as a in other words just as validators in ethereum and miners in Bitcoin are specialized actors securing the network sequencers in Bas networks are specialized actors that provide transaction capacity so the mechanism allows vality roll up to higher volume of transaction the security of the eum network so if we look at this now we already know that so if you look at this now we already know that um the you know the TPS on ethereum is around 15 15 per seconds so the the sequencers St what makes St to be able to you know um take in as much as over a, transactions per per second so when it takes in those transactions a lot of them and it executes them it orders them produce block execute them then it's not going to take block you know it's going to send it to the Prov the Prov is on K machine which generates the proof the stock proof on those transactions and the stock Pro is then sent to um the layer one right so sequencers must be reliable and highly available so you see that sequencing it collect transaction from users and other executing so these are the things that a sequencer does sequencing sequen so means sequen it sequences so sequencing means ordering of transaction executing means processing of transaction bashing mean grouping of transactions and block production is you know all the transactions that b together toce a block for them so sequencers must be Rel and highly abil so what's meaning of reliability so you say that something is reliable it means it is consistent it is conly good in quality or performance yeah it does not fail it does not it does not fail it does not fail um is that it reliable is just about reliability is just about um like just yes depend can count on it you can count on it thank you very much you can count on it so it is very dependable so then availability also you know it has to be available so as their Ro is critical to the network smooth functioning so they need powerful and well connected machines to perform their Ro effectively as they must process transactions rapidly and continuously so the current road map for stet includes decentralizing so which means that currently the sequencer we have just one sequencer which makes it centralized it is currently centralized so shifting toward we allow more participant to become frequen contribut to the robustness of the network So when you say that a network is robust it means that uh it is it is strong and good condition and it's able to withand adversity that's mean of what Rob so do the do we all understand what is meant by what sequencers [Music] do can hear me yes okay so you just said stet is centralized uh can you okay like sequencers the sequencers on on stet they are currently centralized so centralization is just you know when you have just one thing that is doing it that's just mean of centralization you have one if one entity is is doing something that's that mean it is centralized so which mean that if that particular that entity should fails if it fails then you know the network has failed do you get that so decentral decentralization means a lot of entities are doing it a lot of entities like nobody has the control so everyone keeps their control so and whenever we have a decentralized system like that then there has to be a consensus um mechanism so which mean there has to be a source of Truth there has to be a source of Truth like how do you know if like three people are doing something so there is possibility for disputes or you know one of them can be a bad actor so how do you um how do you resolve conflicts that's where consensus mechanism comes in okay so uh I want to see sequencers as nodes in like the layer one so they are like nodes right sequencers they are not they are like validators do you get they like validators on layer one they like the validators so we said that the sequencers they do four things number one they sequence transactions they do what the sequence transactions what does that mean it means that the order transactions just like validators you know when you have validators you have validators there has to be a leader among them right and it's the leader that is going to Pi up the transactions from the me when it takes up the transactions from the from the me it's going to broadcast this to other ones then they going to verify it and the C penality friendly finality Gadget comes into play so in this case too so the sequencer so it's going to order order the transactions then it's also going to execute those transactions then after that it's going to batch that is group those transactions together and it's also going to produce block so it's the sequencer that is that is uh that is doing all of this work producing block so what does the Prov it just checks the transaction the sequencer is bringing in what you say I said the Prov what what is that work is it like they just check the transactions that the the is going to take in that Lo and it's going to generate the execution TR for it generate the execution tra you know there difference between execution and the execution tra the sequencer it executes the transaction the Prov generates the execution TR the execution tra is used to generate the proof which is sent to layer one so the layer one is going to verify in the layer one you have a smart contract that verifies the proof and if it is true it updates the state of St on the layer one is there something still confusing is there anything confus no no it's fine I I I check more but then I was trying to get the GS of the sequence and and stuff but then I think I get the idea get the whole idea with sequencer being like validators and then and then the pro as checking the um just just a little I don't want to draw the class but why I'm just no what you say like I'm I'm not really getting the whole scope of the sequencer like so like I I still like trying to fit it in but since you said it's like um validator on the ethereum network so I'm just trying to like okay equate them together but then that me that the the I'm justy to wait where the the the Prov now comes like is it like they take the transaction and they start asking there and stuff like that like it's just I'm just it's just playing my head okay okay um let's let's do small small uh sequencer it has just four functions right number one is going to you knows now it will now sequence sequence means it will order the transactions then it's going to execute So when you say that something when you say that you are executing something right executing is just to when you execute a transaction you know there's going to be a state change like if you execute a particular function now yes so you know if it is uh if it is if it R successfully or not and the you know all the differen that it should bring about so that one is execution now execution is different from execution traits execution is you're looking at step by step like the step step by step of um execution is execution tra is about like showing workings it's just like you're in the math class and uh your teacher asks you that x² minus 5x plus 6al Z that you should solve it so ex executing the solution will tell you that what x = to 3 and yals um like xal three or two let's say thatal to or two now execution Trace is going to be that you say uh you know subtract subtract from both sides half the square of half of coefficient of B both sides find the square root of both sides subtract this from both sides like that so that's like execution Trace so the execution Trace is needed to generate the proof so that proof is what is now sent to layer one so the proof is what tells us that correct so that youning everything that the sequenc you don't have to be running it on the layer one it just validates that okay the proof is correct and it updates the states makes sense Mak sense yeah I'm getting it all right thank God so then we now have the Prov where is the sequen okay the Prov so the Prov serves as the second line of verification in nwk so their main Tas is to validate the work of this do you see that their me is to what validate the work of the sequencers when they receive the block produc by the sequencer and to generate proofs that this processes were correctly performed that so what they do is they validate work of theer and generate proof now the duties of a pro include oneing blocks hey sequenc receive words sequence transactions provs receive whats blocks thank you so they receive block so block Prov obtain blocks of processed transactions from sequencers now processing so Prov process this blocks a second time ensuring that all transactions within the block have been correctly handed then proof generation after processing pro has generate a proof of correct transaction processing sending proof to ethereum finally the proof is sent to ethereum network for validation if the proof is correct the ethereum network assets the L of transactions so provs need even more computational power than sequencers because they have to calculate and generate they have to calculate and generate proofs so you know if you look at using that as an example again x - 5x + 6 = 0 so xus it is possible that you can if they ask you to solve it for for it is easier for it to like to Sol you can solve it than to prove that you solve it corre so that's the difference between the sequencer so the sequencer will just solve it and get the final answer but the Prov is going to make sure that okay what the sequencer did is correct then it will not generate a proof of [Music] execution prove of execution so the design of stet relies on these two types of factors sequencers and Prov working in tandem to ensure efficient processing and secure verification of transactions so then talking about optimizing sequen so the relation between andology of either the or is the main to set the state let's disc discuss the optimization of both components so stet utilizing the Cho programming language currently supports only sequential transactions so PL are in place to introduce parallel transactions in the future however as of now the sequencer operate one transaction at a time making it the Bott neck in the system in contrast Prov operate asly and can execute multiple tasks in parallel the use of pro precaution allows for taas distribution across multiple machines making scalability less of an issue for provs so since theous and scalable nature of provs focus in stack has shifted to enhancing the sequenc efficiency so this explains why current development efforts are that is at the sequencing side of the equation so if you tomorrow or next tomorrow that uh stet in the if you see thead map of stet that there is something called transaction parallelization do you understand what it means [Music] now do you understand what it means yes parallelization so which means that currently on the sequen undo or they execute the transactions one after the other like one transaction at a time so but this but the the what's it called the Prov so the Prov because it has recursive proof because it has recursive proof so it means it can you know it can distribute tax and asly prove a particular BL then we have nodes when it comes to defining what nodes do in Bitcoin or E people their as keeping track of transaction nwork is not enely no aors of the network maintain the state of the network such as how much bco each person owns or the current state of a specific smart contract so they accomplished this by presing transactions and presing aord of all transactions but that's a means to an end not the end so in vals and specifically with st some reversed no don't have to to get the state in to eum or Bitcoin St requ toess all transaction to main the of network so there are two main ways to access network State data API Gateway or using the RPC protocol to communicate with the node so operating your own is faster than using a shared arure like Gateway over time start toate apis and withc standard even more beneficial to your own so it's that more people to R inre the resence of network Ser fling which being an in network other lay So currently there are primly three methods for not keep track of the network State can have number one Play transactions number two relying on L2 consensus and number three checking validation on L1 so each type of not set comes with own set of requirements and Trust assumptions so notes that transactions know that transactions require powerful M to track and execute all transactions this no don't have they rely solely on transaction they execute that the state at any given point is valid so this they don't have TR assumtion so they R Sol on transaction execute so that's for the first one they have to rep transaction so notes that rely on L2 consensus so not relying on require less computational power they need sufficient to keep the state but don't need to process lot of transactions so trade here is a trust assumtion cently around sequencer so this not are trusting stock not to disrup the network trust me however consensus mechanism election this not we only need to trust that only B pro validation least so they have the same requirement as an eum and eum light become reality M such a note would be as simple as using a smartphone so the only Chade up is latency who not sent to e every block but intermittently so resting in St of PL are in place to produce proof more frequently even if they are not sent to eum immediately allowing this no to reduce theiry however this development is still a way off the stet system so [Music] conclusion through this chapter we into St structure covering the importance of sequ notes so each has own to play so as we Universe next exploration of before so do we have questions based on these ones yes sir does um does K will use blobs or the tacket sorry use blobs what do tness use blocks sorry I didn't get St do they use blobs like BLS oh okay okay yes they use blobs so they use blobs then I see I'm still trying to understand I understand that the the Prov Rees the block and does a kind of calculation to ensure that all the transaction in the block are have been properly well do or well checked I question well you ask the first question I'm asking if stet use blob blob blob blob yes yes yes so like I'm use BL blob I mean and then like blob will b l o yes so if s use block meaning that each transaction is coming in or will be sent to to to the layer one as as a blob so like it is it like it is when it is before the Prov checks through the block of transactions or confir the transaction that it is now converted to a blog or before it gets to the pro at what point like does it convert it to a Blog before it finally goes on the L1 on the L1 so thank you very much for that question um it shows that you very much what's happening so firstly uh let's understand what what a Blog is um you know we have normally the normal way of transacting is you can make it what call the data we all know what c are right yes sir yes sir so when you now say blob blob uh blob is much more different so in fact the first time the you know blog is like it's blog you can send image you get it's like it's like the data format in which images are are even sent and you know how how big that can be so now let's let's just run through the again you know and let us think if there is pluging in stet where can it where can it be so we know that uh you know there is Gateway which is like the me where the transactions are sent so and the sequencer sequences them and executes them and um you know produce block and the sequer produces block and this block is now sent to the Prov do we get now the Prov that gets the blob that gets the block now that block is now re executed and and the um the you know the execution Trace is used to generate proof now the proof is now sent to layer one before before the is it deor or is it denom yeah I think it's denom for before the denom for so the only way to interact on the layer one is by using what is what call data right so uh the for with the EIP 4 is it 4844 so that's where we have the introduction of blog so with the blog with the blog uh you know layer tws can now send their proofs their proofs to layer one using blob so which separate their own gas fee competition from the uh from the normal users and that reduced the fee that for most of for the chains on layer one and that's the reason on stocket currently the um currently the transactions are very very as as low as a sent for running transactions on on St and that's because of the for or the introduction of 444 which allows use of blocks in sending in communicating with the L1 so you can already see that it is the Prov that is going to be sending it own proofs as as blogs to the one yeah yeah makes sense so that mean that how how does theayer one now confirm that the proval as is correct and I the the have done like this my question now now before the the F now the um um the theayer one has of interacting with lay TW and they do that get transactions or probably let's they get the transactions and then go through the the verified transaction and all the stuff and now instead of transactions they now getting blocks they're not getting proofs like see the proof I have proof tra so do do the layer one also have their own proof tra to be able to to be able to follow up and check and check the the the one also have their like do they have a kind of like move Trace to be able to assertain what to be able to assertain the proof that the that the layer two is sending to them or how like how exactly does the layer one confirm this transaction you know before the layer one have their Checkers they have check validators that validate these transactions and like that but now they receiving proofs that is even Pro so how do they confirm all the transaction that have been proved what if Layer Two is a kind of is a kind of teeth that is's trying to manipulate something and sending it to lay one something like that like so that is where that is where um ZK proof comes in that's so let me I'm going to try to I'm going to be I'm going to try to be slow I think I've been slow actually but what what I just want to say is if I'm going to be saying some things if you don't understand just continue to be asking question I believe it's going to be a net positive um effect or learning experience for everyone uh so yeah when we talk about you know the reason we have stet and other layer tools is so that we can solve a particular problem so there is a problem that we have with um decentralized systems which is that number one we have what we call the blockchain tri the blockchain Tria which is that a blockchain canot not be decentralized secured and right so so it cannot do all of those things now the number we now have ethereum which is decentralized and it has a very big security but it has 15 transactions per seconds as what as the um as the T as it true puts so we now have different ways in which you know you can scale ethereum so there are different ways we now have what we call what the rops as one of the ways in which you can scale ethereum we now have two types of rops we have what call the optimistic Ru up and what we call what the valid Ru up so when you say that something is optimistic you're optimistic that you know you're just optimistic optimistic is like you have an in good um Behavior unless you prove it otherwise so what this mean is that if I want to if I'm giving you money right you are optimistic that the money that I gave you is what is original right unless there is a unless someone tells you that what this money is what is fake that's why you canot start saying that oh because there's no way someone just give you money and you're like this money is fake or something unless you you know you are first Optimist that oh you don't even check most of the money that you collect you collect the money so it's when you now realize that someone tells that this money is fake you now start going back to you know there's going to be a contesting so for optimistic group systems uh for optimistic rollups they usually have the contesting period which is that when a transaction goes on you know you have a particular period for you to contest that this transaction is um is right or wrong or uh there's a fraud case so and it's going to be well when you say that something is Val it means as you are sending the transaction you are also sending the proof that this transaction is what is correct right so for validity roll up just like I mentioned the appr is going to send the proof that the the transaction is correct it's going to send it to a contract layer one and that contract is going to verify that it is true so if it is true it's going to update states of the of Stack net on the layer one contract is going to so if it is not true it will not it will not uh you know you might be thinking about how how is it that how how will it be able to generate prove and all of those question if you have specific question yes yes yes that one is is a lot of a lot of mathematics zero that meing ory so when we say zero knowledge it means that zero knowledge there means that it doesn't reveal any other information apart from the fact that this thing is what is correct it doesn't zero knowledge means that it doesn't take any information about about it the only information that you can only derive from it is the fact that this is correct in fact when you say Cairo you know I think I mentioned when I started taking the Kyo class Cairo is uh you know this one is we say proof of correct execution that's you do with CYO prove of correct and Cairo is a is is a provable programming language which means that when you write a program on Kyo if someone executes that program they can generate proof of correct execution in fact they can generate prove of execution for that program they can generate Pro of execution for that program so when they generate Pro of execution for the program the next person don't need to you know reexecute it you just need to make sure that okay the proof you just need to check that the proof is is correct if you want to understand how everything goes so can I hope everyone can hear me yeah we can hear you now yeah so someone Wasing his hand before okay yes he means that with Cairo programming language there's no need to learn zkps now the technology of the zero knowledge proofs yeah building on ethereum you know you can build on eum at the application layer or you can build on the layer so at the application layer you just learn about solidity and how to WR solidity and the protocol layer how do you even build the solidity itself how you be the architectures and all of those Stu like that so that one is different those are two different things so when you talk about Z Cairo yes Cairo with Cairo you can write provable programs with KY you can write provable programs so it's just like you are the uh you are the consuming end of it because if you now want to understand what happens in Cairo if you want to understand what happens in CYO then you need to you need to learn a lot of things number one you need you need to learn a lot of things the CYO itself what does it do Cairo means CPU algebric intermediate representation so which means that when you write the way KY works is different from the way normal programming languages work when you run normal programming language when you run solid for for example solidity runs on the ethereum virtual machine which is like which is more like uh a virtual manchine like the normal uh which is more like the normal normal computer programs run in binary it's in binary but for Kyo it's different in Cairo it is uh you know when you have CYO you are going to convert the Cairo to what to Sierra Sierra means save intermediate representation so the save intermediate representation what it does is that it makes sure so it's actually K you now have the introduction of sa intermed which means that with save intermediate representation you can when you write a program in Kyu it cannot fail there's nothing like Panic or anything it cannot the program cannot fail that's why when you write your smartone and you build it you have it's going to produce the what the this Sierra and then the car so those ones they cannot F they cannot F so when you have those ones that cannot feel like that that's like the the starting point of of um of your transactions now in the Kyo in the verifier also there are some things that it's also looking at so actually if you want to understand most of those things you need to take the CYO white paper and read the Kyo white paper when you read the Kyo white paper you are going to understand a lot of things about the architecture the it uses the read only model so like you know normal in the normal computer you be able to like read and write but this one you can only read so instead of how do you now write another way so you understand the meaning of in you understand the meaning of uh you have in you have what we have we have in we have oh I forgotten the name of that other one but if you read the K if you want to understand what happens behind the wood like the proof that is generated how does it generate it how does it you know do all of those Stu then you need to go deep into the k for you to understand all of those ones but right now what you need to understand is that when the programs that you write all the programs that you write they are represented as what safe intermediate representation and can be proved so when you run a particular program it generate it's going to run run it and generate the execution tra and that tra is now used what to generate the proof which is sent to um to a contract that verifies it so the way it verifies is that when you send all of in fact the the things that verified here we have going to take the PC like the program count the PC at the beginning the initial State you know all of those all of those s like that so yeah someone is Raising yeah you can someone is Raising and you can talk okay so like now now this like a a little deviation out of the now I that I was trying to write I was trying to just to probably write a simple smart it's it's now done on me that one I don't have a attention telling me when I'm I know so I don't want to use to ask if I can get if I if you can suggest an attention that can be checking my Cod for me like while that's by the way the question to ask is this is there something like REM for CYO that you can use to check your um contract compile it and then deploy it and be able to check out the function because right now as I'm writing the contract I'm just real it's D on me that I have to write the test too in order to be able to test the the contract so like is there a way out that's just the way it has to be for now like I have to just write the contract and then write the test then then please back to the question one please don't forget the exension that would Mar out all cuz I'm my ah I not get the last question no like I'm say don't forget my my question on that you should have suggest an extension that can use in vs code that will show all those red lines W nonsense Mye I'm it's not showing the extension is most likely because you have not set it up yet most like so you know it's just like R also in Rust if if the code that you are writing if it's not connected to the main uh to the main crate to the main this thing it's not going to show you if it is uh it is wrong or right so which means that whatever how I so let's say if let's say um okay let me let me try to present so let's say I um uh so so let's say I create the uh what it called scab new um let's call this St St okay does it matter that I'm using SM for instead of it doesn't matter so you see this leave uh leave. sky here this is like the main entry point of of the contract so if I am writing a contract if you are writing a contract inside this place it should tell you if what you're writing is wrong or not unless if the extension isy sky or you don't have there that's but I'm Nota inside like my I just wrote mode then the name of the file that I'm writing inside so I created a new file and if you have another so let's say that you have something here um you have let's say contracts huh so if you have contracts here and inside this place you now have let's say it's in this place that you have ALC 20 alcy right so you know that normally in this place now you're supposed to have a how does structure work here so and in this place what the name yeah screen is what your screen is poed is ons API I don't get scen oh sorry let me check this it does sometimes what are you guys saying now infinity mirror infinity mirror how about now see yeah we can see your can see okay so you need to have that uh contract in this you have is in this main here that's when if you now you're not writing a function here now start uh that's to start I don't know let me thaty one also at times it doesn't Okay is inst so it's going to it's going to start showing error or just use uh what it called SC build okay so even if I use to create the the project I can use view so use sm4 just follow their own um instruction also just follow their instruction so this one now mod not found this this is supposed to [Music] so yeah okay yeah you're supposed to have P chats I that will be modc doy like the complete name of the of the I don't know okay but something around this actually I'm going to check it's [Music] [Music] see see okay so leave do hold keep still I can't figure this out the reason most likely it doesn't show is is if it's not in scope so that contract is not in scope just find to bring it in scope and and everyone will be fine oh okay so um so let let's look at the transaction versions yeah so understanding transaction St transaction typ to mastering its architecture and capabilities so each transaction type serves a unique purpose and getting a grip on their differences is crucial to for provis stet usage so stet is the backbone so Central to stal is the St operating system car program that F Network so this orres Key activities including one deploying contracts two executing transactions facilitating L1 L2 message message exchanges so in stack terminology protocol level all to to modications in the foundational stet car program ensuring step process so we have transaction types de clear transactions so unique in the ability to introduce new classes leading to potential new smart contract invoke transaction so they call upon an action but can't introduce new ones deploy accounts transactions so designed for setting up smart wallet contracts so declare transactions so these are so transaction are the so me for introducing new smart contracts to stet so you want to you want to deploy a smart contract on stack net then you have to firstly declare the transaction so when you declare it it's going to give you the um class Ash then you can now use that to deploy uh the contract so you that call programming C++ before employing a variable function it's first declared signal to the com exist Ty transaction simar they announce new operation for fure so we have ver Z for one for with and we have version two optimized for contract more contract so here a key distinction to understand between with K developer sent K code theary to breaking it down compar to the compar to which subsequently compar to the Cru difference is that are infallible and always provable whereas in the latest ensures all code compar to S making every transaction do we understand that I believe I have explained it previously right yes we did so no question right when declaring a contract with the latest version developers are essentially announcing C code not just Ro exam the parameters of V2 transaction R measures that ensure the class correspond to the code being dispatched class developers imperative to ensure that the dispatch code allign with the indicated CL so in in essence using the most recent version implies the utilization of the latest declared transaction version so the invoke transaction unlike DEC transaction invoke transaction does add new functions they ask the network to carry out actions so as executing or deploying contract this method Contra with ethereum where a contract can either be deployed byend a transaction having smart contract Factory to deploy it St uses only two only the second method so the universal deployer contract in stet illustrate this idea so utility to deploy contract this mirrors are in C++ a de function is to perform task so in computer science think of how functions operate on C++ aftering the function object you evoke it take action stet invoke transaction work similarly activating pred declared contract of functions so every invoked transaction in stet under goes validates and execute stage what do here am I see Victoria yes sir yes um this CL hash right is it the hash of the uh the module is it the the hash of the mod because I'm trying to understand what the hash to get the class hash okay so when you declare a transaction I when you when you want to deploy a contract right so you are going to declare the the contract so the class Ash the ash is the ash of the contract you know the contract the way the contract is you Ash it you now get the that Ash of the contract is what what is called the CL in this place and there's actually a reason um St is also using um Plus in that case also if you read the Kyo paper you understand okay so when you say the hash of the contract that the whole code was yes so which mean that if you should change have you cannot deploy the same contract twice you cannot declare not deploy you cannot declare the same contracts twice so if you've declared a particular contract before and you not declare that contract again it should give you the same class as and tell you that it has been declared before so if you see already declared contract even if you're not the one that deed it can still deploy it so which makes sense that on stocket if you want to verify a contract you just have to verify the declared Sierra so when you verify just just down you know it applies to applies to everything though on ethereum it makes sense to that when you you know when you verify one contract if it's a factory contract it's going to automatically verify other ones but this one is still it still makes more sense and when you um when you read the k y power so you know the reason why it's using the class as it's using that class as to cont want to call contract okay so in terms of my address my account on bra sent foret that I deploy right so is there a code that has been um set already that addresses yes so that's the now if you now look at this is that deploy account to every look at this every invoked transaction in stet under go validate and what execute stages do you get that shade not sleeping every invoke transaction sh not it can you highlight it is it can you see it yeah yeah thank you you cannot see it no I can see it now this one I can see okay so you know we've talked about declare already right you said that there are three types of transactions declare invoke and what deploy you now okay yes like people are already you want to speak no oh here so the second one is now the invoke so they telling us that every invoke transaction in stack under goes what validate and what execute stages the validate step checks the transactions correctness similar to a syntax or logic check after validation the execute pH processes the transaction and that this twostep process focusing on utilizing existing functionality highlight St transaction strategy you know if you want to want to put invoke transtion and ex now on on eum you want to call Contract you just call it but in stet it uses what we call the native native account abstructure what does thatan since there's no difference there's no there's nothing called externally owned account and something something something so which means everything onet is what is a smart contract account which means that your wallet the wallet that you are making use of on stet is a smart contract so and for smart contract for account contracts they usually have they usually have this validate this execute this execute function they us have it so which that is that execute function you want to to invoke a particular transaction is like you are invoking you are what you are calling you executing your own smart contract your smart contract account is now your smart contract account that will not P the contract for you so it is your smart contract that will now call that account for you do you get so that's how things work in St so deploy account transaction look at this the challenge Ares how do you set up accounts without having one already because you know we've already said it here that you have to viate what and execute when creating your first smart wallet contract deployment fees arise how do you cover this without SM wallet so the solution is deploy account transactions uniquely in stet can accept funds even without an Associated smart wallet so this tra is privot D deployment an account is formally created the validate function checks the proposed deployment address even if it LS foration F if present the Constructor proceeds resulting in account deployment so the method the new account legy and financial so that when you want to do you want to create a new account the first thing you do is you already have an address even though it is not deployed yet you already have an address so you have to send funds into the address first before you can now deploy so conclusion it's to understand each transaction Ty declare transaction stand out for their rule please do you have questions as regards the transactions yes sir we so um just like we in in solidity where we can get a once we once we comp a contract this class as is it is it possible to get the public let's say we compile the the contract through a stre and we comp the contract a and we deploy the contract through a rather is there a place we can get the the the class Ash yes section like we SE is it so actually you declare a contract when you declare a contract you and you when you declare a contract he uh where declare a contract you already see the the AI is already part of the information that see on you can just go to agent no you can just go to Voyager and you get your ebi for that contract from so then uh what is it again then yes there is actually another there's a there's something that you can there's a there can check it there's a CLI command that you can get and AI do you do you get yes sir yes sir Al I was talking about when I'm talking about cont I was talking about maybe say not like a wallet own or it's just maybe a random contract that I write on my own like if if I deploy it like is it possible to retrieve the class as something like that that what I was it give you the class as when you declare it when you declare it go and check the when you go go to the netk to okay because this you can use the let me okay there was there was a c that just wrote a script and it just did npm run deploy Direct and using that script and they not prob they declared it and everything declare and deploy there is declare and deploy if you using STS there is declare and deploy also okay because because inside the scpt probably be the declared and then deployed inside the SCP but the the command they used for the plan was just npm one deploy npm one deploy something like remember but npm something so like but like where I'm going to if say I'm able to write such a SP and deploy the contract where can I go like under which file or something something something can I go that I [Music] get you can get CL CL um get class is it this St this um get Class part so if you should send this request okay this one is let me go so you see that if want to get is transaction lifestyle ccle sorry okay so this one now you can see it gives it the SE program is the S program and it also gives you the AI see this is the API the API of the of the contract so any other question yes sir um okay my I have a question I if you can hear me yeah I can hear you okay um let's say for deploying uh an account on stet is it that we have to deploy for every Network we using let's say I want to work on M I have to deploy the that particular account onet I I want to work on let's say surolia have to deploy the account on surolia or I just deploy it once it's deployed you to deploy it where you want to where you want right okay so no other question so we move to transaction Li I think we've already talked about the right so starts by being sent to a g a note which as the sequen currently is single service valid and then exes transaction in order if validated successfully the status becomes received if not the reject app to State and Mar as accepted on L2 dur this are reverted so then um in the Prov so in the Prov stage the system op on the new block complet Pro and send it to L1 so the following image shows trans flow so we have the you know the validation if the is received evalation pH it is rejected so from here it's either accepted on L2 ored then is either accepted on L1 ored then before explaining each step in in depth let's clarify the status so has two primary status types so we have the finality status and the execution status so the finan status we have received pass validation included accepted on L2 and was added block on L2 and L1 so execution status we have rejected reverted or succeeded so we know rejected rejected from what it called me reverted at the execution side succeeded succeeded so to obtain this information thetion receipt refer to the toing chapter in the stocket book for methods like transaction receipt command in stock line on the first transaction receipt method in the stet by Library we use this tools throughout this chapter all right so nses in not nsis nons what are nons like identifiable digits like a digit to identify transaction in in on ethereum non can mean two things what and what is it can mean the order with which the transaction is being executed I think and also used to um that let me in relation to Pro of work what are no it doesn't automatically deploy once you fund it you still have to still have to deploy it no when you send F to the address what you want to say is when you you know you sent F to it you cannot send F out of it so when you send F when you try to send F out of it it you first deploy it first before it you now send it maybe that was what you maybe that was what you meant but you have to deploy first before okay um nons so in to prove of nons can be you know the n in your wallet the n in your the N that is included into your transaction is going to be the number of transaction that you've performed with that particular wallet added and is used to other transactions non in relation to prove of work you know for work you need to find the BL difficulty right and the difficulty is just solving for the ash of the transaction or the block to have a Sol number of for the to have a particular number of zeros either at the beginning or at the end and in order for you to do that you vary the non's value so youy to get that just so nons in stet initially stet did not incor nones this me that same transaction could be sa multiple times with an identical n leading to duplicate ashes a problem in eum NES not only sequence transactions but also ensure each has a unique Ash similarly St emplo non to assign a to everyaction St on mandate that they may be sequential in other words a CH from account it's not must precisely follow although subraction would allow developers to manage this logic at smart contract level this [Music] piure however is not transaction creation Ser it preparation the sender ques this the account which for truction the truction sends it to sequencer as Network evolves the transaction will broadcasted to multiple sequencers that's when validation step so Che the maximum fee exist ex a minimum fee and the account balance iser than theum the transaction will be sa St function passes if not rejected the sequen rle that's like weeting the same thing so if at the end of this class you don't become a stocket Max like there should be nothing you on receiving the transaction the sequencer so see complicate backend application development potenti causing errors if send mulp transactions then we have accepted on layout so fin status accepted on execution status succeeded so we can see the difference between penality and execution stat so accepted on layer one transaction finality in stet so transaction penality refers to the point at which a transaction is considered irreversible and is no longer susceptible to being reversed or undone is the assurance that ised aled and SEC the Integrity of the transaction and the system let's dive into the transaction both and how they compare so etherum transaction finality the operates on the pro of State consensus mechanism the final part the BL that can't change without sign am number of blogs required to ensure that transaction be R back is called blogs finality to create BLS called finality is considered to be an average of six blocks to reach the final stus given that a new BL is Val each 12 seconds thee of for transaction is 75 seconds so stocket transaction finality St Solution on has a twostep transaction the first step is when gets accepted on Layer Two and second on layer one accepted on Layer Two finality relies on the L2 cons and comes the slight of pollution among to revers accepted the fin contain transaction gets a pro generated the pro is by contract on eum and is at this point is sec invisible to alter or reverse it comparison the main difference betweenness lies in the St of finality and Reliance on consensus mechanisms fin transaction finality becomes increasingly unlikely to be revered as more blocks are added St finality is twof the initial finality L2 speak relies on L2 consensus and car a small of the ultimate finality is lower as it involv generation and validation ofs on E however on SED it provides the same level of security as an transaction so rejected transaction so rejected validation FS rejected so finality status received extion stat rejected so you can see the difference between finality and execution status so handling of rted transaction thetion can Beed due to F execution thetion still be included in a BL and account be Char for the resource consumed received so transaction life so we have the M Pool we have the main pool so if it is valid it is it is received is not valid it is not received it is received but rejected so then here it is succeeded here it is reverted succeeded succeeded [Music] so any question any question any question okay sir um I have question I don't know whether it's relating what to what you just you know explained now um some cod B I see G estimation on their you know on their test before their test script like what is actually you know that gas estimation doing them what can you hear me yeah I can hear you yeah I'm asking in some states like in some um pyro scripts um someine C estim gas you know like I want to ask why do they do that actually what so I look it I me I I'm asking them some test scripts on on Cairo they Define gas estimation like estimated gas okay yeah I want to ask like why why use it like why do they do that because normally even without the gas estimation it will still you know the test will still run all of those things are they are um compiler comp yeah so and I think in some in the latest most of this latest this they not yeah so someone someone is answering it so say said I to understand this building yeah what I was looking for then I talked about in So we also have so bu these are pred operation your Cod common or calculation so we have the foll K steps R checks signature verification B indic test you action is so components and limit K steps choose signature check oh D data availability data availability so data availability is key in blockchain networks especially in layout two solutions like stet so Ros acting as a bridge between eum and offchain cation enabl transaction offchain while maintain security and asset system the focus of lies on scaling compation anded but it's just part of Challenge and dat vital for Effective scill the use of rops which Val more of extion Need for efficient dat avability solution Ares from access and verify data from off chain transactions robil sols for of success disability and performance ofs B becom layer a prime example of the evolution is Celestia theyed this mov byel layer one an exion Focus blockchain e is now inating new e to Shi it Focus towards data avilability so avity in stet state process in stet as most blockchain network is system transition from the state n to State n one by executing a Ser of transactions within a block second case St information state of network the sequen of the the next problem from what happens both the become responsive this will be due to of for some reasons stop responding essentially become St is it potential all Network any state and effectively freeing operations State difference through the of Val and EV one this process is crial to ensure that the network remains operational and can be verified independent of sequ and two Val proof one after the Val proof it toay [Music] one so along with Pro also known as the state difference CH St the last so this includes updates to so look at the way St says it from the vality pro prove that transaction is correct so it also sends the state difference so uh after difference along with the so it's also s the state difference so which is going to be you know the difference they smart contract that stage and all those things have changed all so it's to send those State Defense also data availability and changes in transaction so transmitting changes not by B so what to for data availability are the changes in stat not the new balances this involves capturing each transaction within a valid Al state so consider a simple scenario with three Jimmy and Nick transaction sequest Jimmy to r r and it Sayes sent to layer one to layer one reflect Jimmy has one e less R has full has half an e more and Nick Nick also gains half an e the next changes have both matter for instance if Jimmy and Rose send it back and forth but the end result is Jimmy having having half an more only these n changes are sent to one so this one sends this one to this one so what he's going to do is what Jimmy is going to you know Jimmy so this is it Jimmy send one to this one sent half to this one so which means Jimmy has minus one which means that he sent minus one out Rose received because has already sent 0.5 to another person so you just count as Lo receiv 0.5 and nicked 0.5 so that's the mean of spe difference if this one is still sending R so this one again if this one sends one to this this one sends one two to this and this one sends 0.

5 to this you see that this one that sends one to this received two and then send 0.5 out so 1 minus I be -1 + 2 that's 1us 0.5 so which means that this one is going to beus this be plus 0.5 this one it received one so we have one minus 2 that's minus one plus 0.5 that's 0.

5 that's what we have here so this is the meaning of what state difference this approach means that even with multiple transactions the actual data for can be less if the net State changes minimum in Casey other so no change in the state cost cheapest form of transaction since the C of sending data to data cons the amount of data sent can signicantly impaction on uses to minimize State changes in their transaction there by using the data s transaction cost so reducing data availability cost in St so two main mechanism to reduce data availability cost are currently under implementation so we have the EIP 4844 and the volution so the 4844 is the BL data thetion is the flexibility in data storage you that you can you can see that okay my own data I'm not posting it on ethereum I should you something like that that's my own data should remain on I don't want tost it on and that's to use the cost of your transaction I hope that is clear I hope that is clear so IP 484 a new change now data avability information is sent to one instead of using Cod data information will be sent BLS consequently it should make transactions more so not downside of this appro is only so of chos transaction users can up to post data either to ethereum or Alterna as data availity Comm systems like Celestia or eing da the because of using based on the choosing storage option offchain options are to be cheaper than using 4 so the timeline for en to the support of 4844 is already mul offers a unique advant by providing more and potentially cost of potion requires having a vir Mach not so C vir machine like so stcy plan for extreme so St like any blockchain started empty State and overs to changes [Music] in val Pro to1 so along Pro so by apply the tostr St so that you want to construct in St you just have to go through all the you know add all the difference going to get the stet OS the St OS the last step inside the St inside the sequencer plays a crucial Ro in determining why the state different the outut of the sh and now it interact with the so this one is St Shar sequencer I think I know that this Shar is name of so the St is bed on of so the re main inputs the current state the new block classting comp CL so what changes this so here we have state new blocks classes huh compiled class ashes so this one it gives youur State and new blocks gives you the state difference classes classes compare classes compare classes so the sequen executes numerous transactions and creat blocks when enough blocks acculate the trigger [Music] the toate difference cles the information that the proving the output From the Block this is what get the memory Pages cont so the blockchain writer mod to the direct interaction between there an intermed known as shr is focus Sol oning [Music] the internally shz an externally own account specifically for interacting with this account is Sol for conducting Network so handling Pro and state difference so the actual mod didn't sh that the memory on as so this mod bries the gap between the internal work of and so direct interaction with E the of is directed to the blockchain is this sending from is transed to for storage verification so this is the address of the blockchain which is itself an EA coding resources so see Shar these are I guess it has transmitted to this most likely so there's no there's nothing [Music] again there's nothing inside this one again so you can see no transferred to this so I think this is the new shop two hours [Music] ago this the contract verifier so data avability mod up mode data for poed directly on the up mode posted directly on E Advantage theel cost so validum for validum data is of chain theant is cost Effectiveness LEL guarante up fored cost so STX us uses this then volution mode upcoming you have the ability to to say wherever you want to put it so do we have questions about that no question there's no question sir all right okay sequence has so we've got the sequen so before make sure to check the so three main layers exist in blockchain data availability ordering and extion sequencers evoled within this evolving mod so mostly blockchain like e and task initially blockchain sequen and extion while on for dat so of is for for and extion [Music] however so each of these layers plays a crucial role in achieving con first the data must be available second it needs to be put in a specific order that's the maor of sequen by S sequen the final step done by the sequ to it the system State and keeps all connected C on the same AG okay so introduction to sequence two solutions like RS Au the blockchain so improving scil and efficienc what about transaction is it managed by layer so in two sequency so firsts so to clarify we see sequen as the of taking a group oftion anding other so sequen on stet so we have mad anden performance so it's at least do so mad hand the sequencing process supporting from simple FCF and PGA to comp [Music] like dat structure that un transactions so developers can choose of sub which of multiple so M let choose between twoed Blood Fire and St R both LM their framework so we also option Cho MP consens meths [Music] extion or so this one are [Music] conclusion so this how to get started with Madara okay you can come back to this and read it very well we have the so the sh is shared yes I got it so generated Pro start verifier program new conclusion [Music] so we've talked about no and the different ways in which they can do [Music] so the Pathfinder node Jal papos I think all of them are developed by NE implementing a Pathfinder note 32 gig 1 tab gab [Music] internet out to who they are three and up chains so app chains let you create blockchain design precisely for applications name so this specified blockchain allows function of layer one anday two so layer three blains can exist on top of layer two blains you caners on top of layer more so you can see we have e we have the public stet so on top of the public stet you can build a privacy stet can build another stack has a layer privacy St can specific stet X the Val stack X the rule up so examples of an environment with layer three and layer four in this example there are three options include the public stack net which is a general forens appliation customer L3 systems [Music] byit oftion ofy of advantages due to it modity and flexibility here is an overview of the key benefits so quick hydrations app chains enable protocol changes free you from con of the public for example deoy governance Independence you maintain complete control over future development and improvments the need for centralized governance consensus this enables for example quick of user suggested features so cost efficiency so there are three offer sub substantial cost reductions potentially up to one million times compared to L one making it economically fible to run more complex applications so we have security and other ones so mad the framework for a framework that of mod so theability and security CHF soive control can this congestion exclusively Gran predictable performance and so you have the solidity verifier before explain this chap so quick overview Shar and sharp jobs so Shar is the shared PR so for this program each with unique logic run together a common Pro for all optimizing cost and efficiency but Shar supports comb multiple into one [Music] conf cont sh think of bys the bus driver transort driver only the tickets of the LI at the UPC the forms single for alls in B ver only Pro of program so Shar jobs as sh jobs Les mulle users present their programs for Combined execution so okay so s verifier ver is a layer one smart contract designed to from Shar so Shar verifier contast map not yes so you know there is there is this new what it called there's this new that stet is building is there anyone that knows it no so how many of you have heard about CLE stock you know they released the paper recently so a paper that on C stack so and with that they are building the STW STW so that's going to be much faster than this one to be much faster than this one so you can see that the the the chain with the Innovation is actually the start and it's you just have to like deep dive into the ecosystem and also build on it all right all right so you can see the decentralization is still under construction it's not decentralized yet I that the person that ask me the question like is centralized you're like ah how is stet centralized is is too bad to hear or what the sequencer is still currently centralized and that's not a problem for a lay know the security is on is ethereum so it is there is there there are plans to decentralize so smart contracts you all know what smart contracts are [Music] right yes sir so deployment and interaction so um what's the time we have just 30 minutes left so other said that we should do some a little a little bit of front end integration to to it so yeah stru so do you have any question do you have any question oh I think one has a question who that I'm not seeing your this thing if you have a question just talk okay nobody ask question that's nice that can mean two things it's either you all perfectly or the opposit so which of the two um this say um it's just a matter of time actually it will syn actually so the only way is going to sink is you know practice makes what perfect no you cannot be perfect now how is that possible so practice makes Improvement right so as you are reading and reading and reading and reading but at least uh from what we actually did today e there should be nothing in stet that you don't understand let's let's be truthful to ourselves let's be truthful to ourselves so this is what we are going to do because so I'm just going to allow you the next um 10 minutes to ask any question I just ask any question actually so we are going to use the 10 next 10 minutes to for you to ask any question then um we going to do an introduction to to only do how you can how you can start you know contributing and all of those St like that if you have so if you have any question you can just you can just ask right [Music] now as you guys I don't want to see anything after because the kind of question that you asking not see anything sir it's almost so if you have any question can can ask no questions still should I be going there's no question I'm not I'm not I'm not proed like okay sir um I don't know whether I don't know whether my question is relating to what we do today but I'm just like yes yeah like I'm I feel like I I want to ask actually like what does it take for someone to actually you know say let's say spin up a node on on stet no like run a stet yeah I think everything was you can come back to this where is it that part we skipped you can see that they even put the cost of those and this there [Music] so this notes yes can just come back to this not and start and read it so you can learn the Juno note [Music] Jun the requirement the estimated cost so it's not and yeah good is that the only question from my end well okay no question okay then um so maybe there's going to be mostely yeah yeah how do you know this is going to be our last part you don't know do you know if this is going to be our last class yeah there is most likely going to be another for the front end another for the front end and that's going to be black this normally supposed to yeah okay so we just find a time and we communicate it so for us to to do the front end part and that would be all [Music] so yeah a piece of advice or yeah am just you so just you know just try to like um put yourself out there and the best way for you to put yourself out is by contributing you know and the stet is still the like the best framework the best you know is most rewarding currently that you can contribute to so you should try to explore the stet ecosystem everything about it and you see okay what are those things that you can prove in it if you don't if you don't use it there's no way you be able to say that okay there's this problem somewhere that I need to improve that or I can improve so all the things that you've learned throughout the um through the start of the boot camp just apply them and one thing that you actually need to know is that see it is only if you don't it is only if you don't uh need a up that's when uh that's when you not going to see anything so on stock net even if you don't have a job in fact you might even be better off not having a job that having it's just that job gives you this security and peace of mind so but if you have that Builder mindset yeah stockness is like the most rewarding uh place that you can ever be so and yes you should also you know go on what this patter only dust you know like there is stet and then there's the only do Platform for you just go to just sign up for when you sign up you're going to see different projects there so you know of course before you can start doing and you don't even have to be genius for you to start contributing there you just have to have number one the Curiosity and the willingness to do that's all so so far as you have the Curiosity and the willingness to do go to only dust look for any program look for any what it called look for any look for any uh any project that you can contribute to and look for any issue there tell them that they should assign it to you and one thing about it is that when you when you do that everything like the resources that you need for you to be able to do it they going to provide it for you so you just have to and if you have problem while executing it you can reach out to them you can reach out to your friends and all so those are the ways in which you you know you're going to become going to become know so right now you know I know most of you just finished the webet class and and now you're just finishing the you're just finishing the uh what's it called you're just finishing the the Master Class also so so you should just um what's it called I'm going to stop the recording soon so I can see some so you should just make sure that go to only dust and start contributing there and you going to be rewarded for every uh issue that that you are contributing to okay someone has a question what's that I think I'll just say it after you're done so you stop recording okay

Automatic transcript — names and jargon may be misspelled.