The One Question bounty closes Thursday 10 December.

Join in
We Them Media logo We Them Media Support us

Starknet Fundamentals

The picture loads from YouTube. The player loads only when you press Play. Turn on captions in the player if you need them.

A Web3Bridge instructor teaches an online class on Starknet fundamentals. She explains Starknet as a layer 2 that batches Ethereum transactions using STARK proofs, the life of a transaction from sequencer to prover to verification on layer 1, and how Cairo code compiles to Sierra and Casm. She then demonstrates creating a wallet, deploying an account, bridging funds and reading a block explorer.

Not by We Them Media Channel: Web3Bridge. Published Thursday 23 May 2024.

Titles are the owner’s. It plays from their channel.

Transcript

This transcript may contain errors. This video belongs to Web3Bridge. Letters mark each change of speaker.

These are the speakers’ own words. We have not checked their claims.

0:38 A: Okay, thank you. Let me go back to this one. Okay, all right, so we're talking about fundamentals. And this is what we'll be doing today. We'll be touching on why StarkNet, why Cairo, StarkNet architecture overview, universal deployer, declare versus deploy, invoke versus call, and smart contract versus library. Yeah, so hope we saw that. Hope you can see the slide, please.

1:29 B: Okay.

1:32 A: All right, so starting with StarkNet, anyone here wants to tell me what they think StarkNet is? You've been hearing about StarkNet for some time now. What do you think is StarkNet? So anyone can send in and unmute your mic and speak. So nobody here knows what StarkNet is? Yes, tell me if you can speak. Yeah, so for me, my understanding of StarkNet is that it's a layer 2 solution. That helps Ethereum, that caters to Ethereum's trilemma problem of scalability. So that's what I understand. Okay, thank you very much. All right, so why StarkNet? So StarkNet is a layer 2 network that makes Ethereum transactions faster. Cheaper and more secure using ZK-STARK technology. So StarkNet is a layer 2, and we all know what layer 2 is. It is built on top of a base layer, a layer 1 network. And why do we have layer 2s? Layer 2s are there to help scale layer 1. So StarkNet is here to- help solve the problem of Ethereum, the trilemma issue that Ethereum has. Helps to make transactions faster, cheaper, and more secure. Now, the caveat is StarkNet is using zk-STARK technology to achieve this. How are they doing this? How are they making transactions faster? How are they making transactions cheaper is because they're using the zkStacks technology. This technology helps in batching of transactions, bundling transactions, and generating proofs that are very, very small in size. And because these transactions are being bundled and batched together, it makes the gas fee, the gas cost, very small. It makes the the execution time for the transactions to be faster and cheaper. So think of it as a boosted layer on top of Ethereum optimized for speed and cost. So because of the zkStack technology it uses, it's optimized for speed and cost. So why StarkNet? Why the buzz about StarkNet? Why should we build on StarkNet? What is StarkNet actually doing? So the first thing is that it solves the L1 scaling problem. It solves the L1 scaling problem how? So we all know the current transaction throughput What is the current transaction throughput of Ethereum? For Ethereum? Wait, can you guys hear me?

5:36 C: Yes.

5:40 A: Oh, okay. So what is the current transaction throughput in Ethereum Layer 1? We don't understand. Sorry, I didn't get you. What did you say?

6:12 C: I said I didn't get the question.

6:13 A: You said the current transaction So put TPS. What is the TPS of- what's the current TPS on Ethereum?

6:23 C: Wow.

6:36 A: How many transactions are executed in a block in Ethereum currently? Really, guys, how long does it take for a block to reach finality?

6:59 D: 12 seconds.

7:08 C: 12 seconds.

7:09 A: It takes 12 seconds for a block to reach finality. And how many transactions are included in a block? Okay.

7:26 C: I think, I think it depends actually because some, some transactions might require more gas another transaction. So I, I don't think there's- I don't really think there's like a fixed number because some transactions can take less than-

7:43 A: So what is the transaction throughput now in Ethereum? What is the transaction throughput in Ethereum?

7:50 C: What's what?

7:51 A: What is the transaction throughput in Ethereum?

8:05 C: I didn't, I didn't get it. I didn't get- is it like transaction PoP?

8:08 A: Throughput. Throughput. How many transactions get included in a block per second?

8:29 C: Wow, I think 119. You said 119 per second.

8:36 B: I don't think there's a number for it because the only number I know of is how long it takes the block to reach finality, which is 12 seconds. I don't really think there's like a fixed number because it depends on the complexity.

8:59 A: Do you know what I mean by throughput? What is throughput?

9:02 C: Yeah, I think it's usually 15 to 30 transactions.

9:06 A: It is between what?

9:08 C: 15 to 30 transactions.

9:11 B: Oh, okay.

9:13 A: So now how did you know that? Okay, you guys have work to do. Yes, you guys have work to do. All right, I'll continue. So it solves the L1 scaling problem. What I'm trying to explain here is that- sorry, it takes AMI for every transaction. Who is speaking?

9:45 B: Sorry, it's me. You said something like Topoot, like I couldn't get it. Can you say, type it in the chat?

9:52 C: Actually, in sincerity, um, for me, I don't know for the others, I'm, I'm just hearing about Topoot for the first time.

10:09 A: I mean, for the first time I'm talking about me myself. Read it, go and read it up.

10:25 B: Yes, okay.

10:25 A: So, um, StarkNet solves the L1 scaling problem. How? When a validator propagate a block. At least we, we understand what it means for a validator to propagate a block, right?

10:44 C: Yes.

10:45 A: Okay, okay, cool. So when a validator propagates a block, what does that validator do? The validator verifies different transactions, right, and includes the transaction into the block and then broadcast this block to the other nodes on the Ethereum network so that these nodes will validate this block, right, and make this block included in the chain, right, on a high level. Now, in Ethereum, once a validator has validated a block and broadcast it, other nodes do not include this block into into their net- into the network until they execute, they re-execute all the transactions, the transactions in the block that has been propagated. And, and, and, and once they execute all these transactions and it's the same with what the initial validator that propagated the block is validating, then they include- they accept that block and include it into the network. Now, this is a very time-consuming process and also resource-consuming because each validator, each node, have to re-execute these transactions in the block. Before they are satisfied to include that block into the network. And if they are not satisfied, then the block won't be included into the network. What does StarkNet do? How does StarkNet solve this scaling problem? StarkNet uses- sorry. Darknet uses a ZK stack technology. It uses ZK stack technology in the background. So once a validator propagates a block, executes transactions and validates this transaction, then includes these transactions in a block. The next thing is that this validator sends these transaction bundles to the prover, to the shard prover. This shard prover generates a proof for these transactions that have been bundled. After it generates the proof for the transactions that have been bundled, now that proof is now smaller in size than the block itself. It's just a proof stating that everything in this, in this block have been verified and the transactions are valid and they should be executed. And then what gets sent down to L1 to be verified is the proof What gets sent down to the verifier is the proof. Now the verifier then proves this to be sure that it is valid, and once the verifier proves it and sees that it is valid, the transaction- the block reaches finality in L1. So this is how they solve The L1 scaling problem. Normally it is fast, it takes in more transactions than normal. In layer 1, each transaction needs to be verified, validated by all the validators. But this time around, it is just a small fraction of all the transactions that needs to be validated. And then the nodes As long as the proof generated is valid, the nodes include that block into the network. So let's say if it takes- if it takes- if the proof of one- if to prove one transaction takes 10 minutes, because a proof now has been generated for over 10,000 transactions at once, it's just to prove prove that the information from in that proof is valid. And once the verifier proves it is valid, all the nodes do not need to re-execute the transactions in that block any longer. All they just need to do is run- is verify the proof. As long as the proof is valid, then they add the block into the network. Now this automatically boosts scaling. It helps to, um, to- it helps to increase the throughput of- in this- of the- of transactions. It helps to add, um, what do I say, execute a whole lot of transactions at a very short time in the network because of this system. And then because a whole lot of transactions are being bundled Proven, it significantly reduces the gas cost per transaction in the StarkNet ecosystem. Also, StarkNet uses validity proof. That is what I, I explained, that they use validity proof, and that is why it helps to batch up lots of transactions together and send these transactions at once. to the Layer 1 instead of how Layer 1 does currently, that it just admits 12 to 15, or now that it has sped up, 20 to 30 transactions. Now you can send thousands of transactions at once to Layer 1. And because StarkNet uses validity proof, validity proof makes the transactions- the bundled transaction gets finalized in L1 shorter. than using optimistic rollups. So it takes approximately a maximum of 10 hours for transactions to be finalized on L1, but less than 30 seconds to 45 seconds for transactions to be finalized on L2. Also, why StarkNet? StackNet uses stack and not snack. So StackNet uses the ZK stack technology and not snack. Now I want you to get to understand this. In this concept of ZK stack for StackNet, we're not saying that the basis of this ZK stack is for Reduction of the size of proofs. It is not about privacy in this context. It is not about privacy. It is about proof size, reducing proof size. So I want you to see it this way. Just as you have a file in your computer, a folder in your computer that has different files in it, And then you zip that folder. Zipping that folder compresses the folder and reduces the size, right, to a very, very little amount. That is what is going on here. That is what the tech, the Vicky Star, is doing here, is compressing the size of the truth to a very, very tiny size, unlike how the proof was supposed to be when you generate a proof that is validating, that is proving thousands of transactions at once. So the zk-SNARK technology here reduces the size of the proof to a very small size, and that is why, that is what is going on here.

19:20 E: Yes.

19:20 A: When you hear me say zk-STARK for StarkNet, I am not just talking about privacy, I am talking about proof size. Please, thank you. So StarkNet uses STARK and not SNARK.

19:34 E: Why?

19:36 A: We all know- we- do we know what STARK and SNARK are? Oh, thank you, Nefisa. Okay, do we know what stats and stats are?

19:54 B: No.

19:58 A: You don't know? Yes, I have a small idea. You said you have a small idea? Guys, speak out now.

20:15 C: What is it? Yes, like I read about it somewhere.

20:18 A: Okay, okay, cool. All right, so, um, that's why I'm using stacks and not stacks, because for stacks you need a trusted setup. You need, you need a trusted setup. Snacks are naturally smaller in size than stacks. I think snacks get as low as 288 bytes, while stacks can get as low as 400 bytes, 400 kilobytes. But with snacks, you have to continue, you have to pull Countless times. You have to continue iterating over that proof countless times before the verifier can accept that the prover knows what he's doing. While for STARK, there is no trusted setup, so you don't need to do the back and forth of continually proving that you know this. So for STARK, I want to prove to you guys that I know, um, I know, um, Wetri Bridge. And then to prove to you guys that I know Wetri Bridge, you guys are the verifier, I am the prover. And then you will ask me, um, which state is Wetri Bridge situated at? And then I'll tell you Lagos. Then you ask again, Uh, which area in Lagos is Wetri Bridge situated at? Then I'll tell you Ikorodu. Then you ask again. Like, we can continue doing that back and forth, back and forth, back and forth, back and forth, till you get satisfied that I truly know where Wetri Bridge is situated at without really telling you which is where Wetri Bridge is. But I'll tell you, I know where it is. Now that is for snap, and these proofs are very, very small in size because it's a back and forth thing. Now for stack, there's no trusted setup. You don't need to do this back and forth, back and forth, back and forth. It is just to prove your- that you know it, and once the verifier verifies that it is true, it's done. Now, with Stacks, there is a future advantage of it being quantum resistant. So that means when the quantum computer starts being in use and invoked, the quantum computer cannot, cannot break through a computation that was done, a proof done using Stacks. So that is just the- those are the benefits of using Stacks. StackNet is also optimized for zkTech. So just like I tried explaining here, that StackNet in this context, using zkTech is for reduction of file size, and the reduction of file size automatically means faster transaction time, faster verification time, and cheaper gas consumption. Also, why StarkNet? StarkNet has a powerful programming language. And what is the powerful programming language StarkNet uses? It uses Chialisp. has been deeply inspired by Rust. Also, with StarkNet, you can withdraw your assets in L1 in less than 10 hours. So if your transactions, your assets are within the L2 network, you can actually transfer to another account and withdraw within 30 seconds. Well, if you are trying to withdraw your assets in L1, you'd have to wait for approximately at the max 10 hours. But now the times have been slower. I've done transactions that I was able to withdraw my assets in less than 3 hours, less than 4 hours. I can- in L1, so it has been worked upon. But then if you are trying to do some bridging and you do some swapping, the bridging client and swap client can make the transaction take some time, but a maximum of 10 hours and your asset gets into finality. And then 7, there's no trusted setup. There is no need for a trusted setup because we are using zkStack technology and not technology. Okay, so next, Wi-Fi. So before I start Wi-Fi, is there any question? Is there any question?

25:49 B: Can you hear me?

25:54 A: Yes, I can hear you.

25:55 B: So what's the difference between SNARK and SPARK?

25:59 A: So SNARKs are something- suffix non-interactive arguments of knowledge. So What SNARKs are is that they are small sizes of proofs generated to prove the authenticity or the validity of something that a prover is trying to send to the verifier. So with SNARKs, they are small sizes and you need a trusted setup. This trusted setup can be anything. Created just to be- to trust that whatever is going on here is actually valid, is actually true. And with SNARKs, the prover needs to generate- can generate different types of proofs just to prove to the verifier that this information that I'm trying to let you know. I know, I truly know it, I truly have this information. But with zkStack, zkStacks are much larger in size than SNARKs, but then you don't need a trusted setup. It's just a one-time, um, tool. You generate the trace as a tool, you generate the execution trace and sends to the verifier, and then the verifier verifies the proof you just generated. And once the proof satisfies the condition, once the verifier sees that the proof is valid, it is correct, it gives the same output as expected, then it works with it. And if it doesn't, then it denies. it plans the proof that was sent. And then with Stacks, Stacks have the advantage of being quantum resistant. So when quantum computers come in, those super mighty blazing fast and whatever computers coming, coming to the- coming to vogue, those type of computers still cannot hack a ZK-SNARK proof, unlike a ZK-SNARK. Although this has not been- this has not been proven because we've not seen a quantum computer yet, right? And there's no quantum computer that has tried to reverse the ZK-SNARK stack. But that is the idea. That is how the stack was used to be quantum resistant. So you'd have to do some more research on ZK stacks and SNARK, I think. Yeah, this place will give you So many explanations of what it means. Like, in the littlest of- in the tiniest way, or the most simple way that you can understand what it means, that's it now. But with the little I've explained, do you, like, get the difference?

29:45 B: Yes, yes, I'm a bit clear now. Thank you.

29:51 A: Oh, okay, thank you. So what is this? Okay, who cares now. Thank you so much, Emmanuel. Can you guys hear me clearly or am I breaking?

30:06 B: No, you're not. Um, I think the network-

30:12 A: oh, okay, thank you. So, um, is that- does anyone have any other question? Yeah, I, I do. So you were talking about-

30:26 D: you're talking about like a programming language that Leapstack uses? Yes, I don't quite-

30:34 A: That's it.

30:36 D: Yeah.

30:36 A: Okay, something like that. That uses Pyro programming language.

30:49 C: Yeah, thank you, thank you.

30:50 A: Yes, you're welcome. So Cairo- Cairo is in the same family of Rust, and it has been heavily, heavily inspired by Rust. So if you learn Cairo, you are as well learning Rust. And if you, if you, you just It's just the difference is that Cairo is executed using its own VM, its own virtual machine. So that is the difference. It is used for the Cairo VM. But everything when it comes to syntax and how ownership is being handled in Rust, it is the same with Rust. So Cairo is like 95% Rust. So if you know Cairo, then you are- you can as well say you know Rust. And if you know Rust, then Cairo will be a walkover for you to learn. Okay, so, um, is that okay with you, Maxim? Any other question? Yes, yes, it's okay with me. All right, thank you. Okay, so why Cairo? So Cairo is a programming language that creates programmable programs. It runs on its own virtual machine or the Cairo VM. Now when we say Cairo creates provable programs, what do I mean by that? Just like I explained that we use the zkStack technology in StarkNet. The zkStack technology, what does it do is that it helps us to prove the validity of a transaction or Yes, of a transaction, right? So Cairo helps you also create provable programs. Unlike other programming languages that just help us to create programs that run on the front end and stuff, you don't need to prove these programs. But with Cairo, you are able to prove these programs. behind the scenes. The validity of the program, the output of the program are proven using CAIRO in the CAIRO VM. Now, why is CAIRO using CAIRO VM and not zkEVM or the EVM? And why do we say it is an L2, right? Someone has that question, right? Like, when we say it's an L2, it's because it is EVM compatible, right? So why is this one using its own VM and not even like a UK EVM? Does anyone- is anyone asking that question? Sorry, can you come again? So I was saying with Cairo, Cairo uses the Cairo VM. Cairo code is executed using the Cairo VM, not the pvm. And so I was asking, has anyone thought about that, or is anyone asking that question. Why is he using a Cairo VM when it is said that StarkNet is a layer 2 on Ethereum? Is it not supposed to be EVM compatible? So I'm asking, does- is anyone asking this question?

34:50 B: Yeah, I think, uh, maybe because it's using zero-knowledge proofs, maybe that's why. It's not compatible.

35:02 A: Okay, okay, okay, cool, cool, cool. All right, yeah, so Chiro runs on Chiro VM, so Chiro codes are being executed using the Chiro virtual machine because it cannot run on EVM because it is not Solidity. The EVM only executes Solidity code. And Solidity code can only be executed in an EVM, in the EVM, the Ethereum Virtual Machine, or any zkEVM, or any adaptation of the EVM. Now, Cairo is also Rust Inspired, like I said. Cairo can be used outside StaffMate. So with Cairo, you have the liberty of writing your normal Cairo program, that is your normal JavaScript code, JavaScript function, Python function, C++ program. You can write your normal code with Cairo. And also you can write smart contracts with Cairo. So just like your Solidity- Solidity is only used for smart contracts. You cannot write any other program with Solidity that is not a smart contract. Am I, am I right? Are you getting me? Yes.

36:47 C: Yes, yes, yes.

36:48 A: Yeah, so with Cairo you can write both smart contracts and your normal program with Cairo. So for now, Cairo smart contracts are only used on the StarkNet ecosystem alone.

37:09 B: For now.

37:11 A: As at now. Also, Cairo uses zkTech behind the scenes, but you don't need to know what zk is. But under the hood, Cairo uses zkTech because Cairo creates provable programs. With Cairo, you verify without re-execution. What I mean here is when I was explaining how the nodes validate the block and then add the block to the network, in the normal layer 1, they have to validate, execute all the transactions in that block before- if they arrive at the same thing that the block proposer was proposing, then they include it in their network. And if not, they do not include it. So with Cairo, using the, the tool, it verifies without re-execution. That means these nodes do not need to run all the transactions in that block anymore. All they need is the proof that was generated by the proposal after he propagated the block and ran the- and sent to the shard prover to prove the transactions in this block. Once that proof is generated, that is all they need. And once they can validate that proof and it returns the same output that the verifier- that the prover actually stated, then they include it into their block. So this proof is actually written in Cairo syntax. So the SHAPE prover is actually written in Cairo syntax, and that is why they verify without re-execution.

39:11 B: The-

39:12 A: oh, sorry, verify without re-execution, I mean that for the node, they do not need to rerun each transaction in the block. And what do they use? They use this proof, and this proof is actually written in Cairo. That's what I was trying to say. Also, Cairo prevents cheating and malfunction because of the tech powering Cairo. This is the indicator behind cheating. A prover cannot generate a malicious true and sent to you and it would work with Cairo. As long as the, the truth is malicious, is not true, it is not going to get validated. So using Solidity, you don't- it doesn't do all this. Solidity only writes your code and sends it. It doesn't check for anything. It doesn't make all the security checks behind the scenes, doesn't do all the things that Cairo helps you do.

40:23 B: So yes, that's Cairo.

40:29 A: All right, so going to StarkNet architecture, so before I start, any question, any confusion? No. Okay, so the StarkNet architecture. StarkNet operation begins when a transaction is received by a gateway, which serves as the main pool. This stage could also be managed by the system. The transaction is initially marked as received. The sequencer then incorporates the transaction into the network state and tags it as accepted on L2. The final step involves the prover, which executes the operating system on the new block. Calculate its proof and submit it to layer 1 for verification. So what is this they saying? How do you start? How does a transaction get executed on StarkNet? The beginning is that someone, maybe you, Matthew, Victoria, Kemi, you initiate a transaction in Startnet. So what happens? The first thing that happens is that the transaction you initiated goes to the memory pool. From the mempool, the sequencer picks up this transaction, picks up Kemi's transaction picks up Matthew's transaction, picks up Victoria's transaction, picks up all your transactions, executes these transactions, and validates these transactions. After that, adds it to the block. Now once the sequencer picks up your transaction on On the StarkNet, um, what do you call this thing? You would see it later. You would see it show received. That means your transaction has been received. After that, after that, the transaction will be included into The block. Once your transaction has been included into the block, that means your transaction has reached finality on L2. Remember, if your transaction has been included into the block, it means that your transaction has been finalized, right, on the normal L1 or a normal blockchain network. But this is an L2. So once the transaction has been included into the block, it will show you in the scan that your transaction has been accepted on L2. Now, if that transaction has nothing to do with asset transfer, like moving your tokens from one chain to another, from L2 to L1. If it is some other thing, you can start working and interacting with that transaction, or whatever. If it is a smart contract you deployed, you can start interacting with it. If it's a coin you moved from one wallet to another wallet still on that L2, you can start interacting with it. But if you are moving your tokens Now from the L2 to the L1, at this point where it says accepted on L2, it has only reached finality on StarkNet, but it has not reached finality on Ethereum. You wouldn't be able to withdraw your assets from L1 as at this point until it reaches finality. So when you see accepted on L2, The next step is that the transaction is sent from the sequencer to the prover. This prover, now I told you, is a smart contract on StarkNet that is written in Cairo, right? This prover generates the proof, calculates the size for this block that has been propagated and sent by the sequencer. Once it has done that, it will submit the proof that it generated to L1 for verification. Submitting it to L1 for verification, what happens there is that there is another smart contract that has been deployed on Ethereum Layer 1 that does verification. So all this proof and verification is not done by human beings. It is done by the smart contracts that have already been programmed and written and deployed. So the layer 2 has a smart contract that proves that these transactions from layer 2 are valid and needs to reach finality on layer 1. Then the smart contract on layer 1 verifies this proof that has been generated by the server from layer 2. And once this verification is done and the proof has been seen as valid, the next thing is that the transaction gets finalized on L1. And that is what happened when you initiate a transaction on StarkNet. That is the entire lifecycle of the transaction. It moves to the mempool, then gets added to the block by sequencer, and then gets sent to the shard prover that proves the transaction, and then the proof And generates a proof, and then that proof is sent down to the verifier on layer 1, and then the layer 1 verifies the validity of the proof. And once the proof is seen to be valid, then the, the proof is then added to the block on layer 1, and then it reaches finality. Okay, what's going on? So hope this, hope this was clear, right? What I just explained. I hope you are able to understand what I mean.

48:00 C: So I have a question.

48:06 E: Yes, yes.

48:06 A: Okay, thank you. So Mary, yeah, you have a question. So what you're saying is if I'm doing a transaction from StarkNet 3 in one day, I have to wait for 10 hours before I get my funds or something? Yeah, so if you are sending your your assets, if you have assets in Layer 2, right, in StarkNet. Let's say you have some ETH or you have some USDC in Layer 2 in StarkNet. If you want to use this USDC or this ETH in your MetaMask, you want to move it from your StarkNet wallet to your Ethereum wallet, You would have to wait for approximately 10 hours, a maximum of 10 hours, so that that transaction gets included into the block on layer 1 and reaches finality. It is when it reaches finality, um, that is when you can withdraw your funds. from your Ethereum wallet. That is when you will even see the funds get deposited into your Ethereum wallet. Yeah, so that's what happens. But if you are doing something else aside assets, aside assets, maybe you are deploying a smart contract and others on it to help, so it gets executed immediately and you can start interacting with it. If you are trying to move your assets from one wallet to another wallet still within the StarkNet ecosystem, in less than 30 seconds it moves and then it reflects in the other wallet. But if you are trying to move it to an L- an Ethereum wallet, that is when it takes a maximum of 10 hours to get completed. Okay, thank you. You're welcome. All right, so .NET components. Oops, I wanted to show you guys something. Let me see, maybe it will help. Um, um, this. Yeah. Okay, yes, this. So can you see this playlist, guys?

50:53 B: Yes.

50:58 A: Can you see the playlist? Okay, so now this is This is what happens in a transaction. So these are the gateways. You know what they are, right? Like your wallet providers. So on, on Ethereum, you have your MetaMask, right? You have your Coinbase, you have your Trust Wallet. In StarkNet, these are gateways. So wherever the client or whatever client or dApp you are using to interact, either smart contract, either decentralized application built on StarkNet, or wallet, or whatever it is. These are the gateways. This means your access- this gives you access to perform actions and transactions and interact on the blockchain. So those are the gateways. So whatever you have- wallet, dApp, or whatever. So now once you try and make a transaction from your wallet, it gets sent to the sequencer. The sequencer receives the transaction. Make another transaction, it gets sent. Make another transaction, it gets sent. And until you bundle all the transactions within this block. Once this block is, is filled up, what it does is that it moves this block, sends it to the prover. Now at this point, this is where the transaction has been received. And once they are added here, that means the sequencer has executed the transaction and have seen that the transaction is valid. It gets added here. At this point, on your- on the scan, what you will see is that your transaction has been received because it is still here. So it will show you the transaction has been Once the block- other transactions have been added and then the block is completed, the sequencer moves the block to the prover. Once the block has left this place and has been sent to the prover, you see this accepted on L2 on the scan. That means that transaction you made has been included in a block and has reached finality on StarkNet. Once this block is sent here, this prover will generate a proof for this block and all the transactions within this block. It will generate one proof. Once it generates the proof, it sends the proof to the verifier. Now this part, everything happening here, this is L2. You can see this is L2, StarkNet. Here is L1, Ethereum. So once it generates this proof, it sends it down to the verifier. And once it sends it to the verifier and the verifier verifies 5, 6, 2. Then the, the, the, the proof is then added. And once this proof is added, it automatically means that all these transactions that were bundled up here have been accepted on L1 and have reached finality. And once that has happened, it's sent to the StarkNet fork. The StarkNet Core here is a data availability layer, like a smart contract for StarkNet. What it does is that it updates the state of StarkNet. So when this transaction has been sent here, it will change the state of this, of this, of this StarkNet. here and add these current transactions to the state, and then the state will be different. So if transaction count- let's say there's a variable called transaction count in this smart contract. If it was 1,000 and the transactions that were bundled here were 100, once it reaches finality, it changes the state of the variable transaction count from 1,000 to 1,100 here. And this is where your data availability layer is. This core is where when you do- when you're working with your front end, you're using StarkNet.js, or in normal Ethereum, you use WAGMI, you use Ethers.js. This particular place is where that dApp is reading the information from and writing to. So this particular contract is where you can read and write from. Okay, did we get that?

56:31 C: Yes.

56:34 A: You can just use emojis. Okay, thank you very much. So I just wanted to explain explain it very well so you understand, you have a visual representation of what's going on. Okay, so TacNet components. So the first thing is the sequencer. What does the sequencer do? The sequencer validates transactions, executes these transactions, and bundles the transactions into blocks. We also have the shard prover. What does the shard prover do? It generates validity proofs for StarkNet and StarkX. So talking about StarkNet and StarkX, StarkNet is like a project under a mother company called Stackware. So Stackware is a mother company, is a company that is situated in Israel that is building StarkNet and also building StarkEx. Now StarkNet is the network, is the blockchain ecosystem, is a layer 2 on Ethereum. StarkWare is a company that is Managing this project. StackX is a decentralized exchanger made by Stackway. So you can call it counter- you can liken this to something like Binance and the likes, but this is a decentralized exchanger. It's not like Binance that is So that shared prover, that prover, this shard prover generates validity proof for both StarkNet transactions and StarkEx transactions. So every transaction, everybody that has been swapping, that's been exchanging their tokens on StarkEx, all those transactions And these prover generates validity proof for you and also then generates validity proof for every transaction that has happened on StarkNet. Next is the verifier. Like I said, the verifier is an L1 smart contract living on the Ethereum blockchain that verifies the proof that has been sent by the shard. Next is the StarkNet Core. The StarkNet Core is the data availability layer that holds the information, the current state of the blockchain. It's an L1 smart contract that stores changes to the global state. Then the full node. Full node provides dApps with blockchain data from DA. So the full nodes are what gives you access to read and write to the StarkNet Core. The StarkNet Core, like I said, is a smart contract that holds the state of the blockchain, the global state of the blockchain. So every information that has been written to the to the contract, or that you can- yes, that's been written to the contract. This curve holds these data. This pool node gives you access to read this information from this smart contract. So this is what is actually happening behind the scenes. When you are reading and writing to blockchain, you are not just reading and writing to the blockchain. What is the blockchain in this point? You are actually reading from a smart contract that has been deployed on the blockchain and writing to that smart contract. Now it is on L1. Why, why is it not reading from the L2? Because this holds the current state of every thing on the StarkNet ecosystem. It must reach finality on L1. Everything done on StarkNet must reach finality on L1. So this smart contract holds the true state of the StarkNet ecosystem. then all the transactions. So it is expected that the full node will read from this particular L1 smart contract. So when you are building your frontend, your dApp, know at the back of your mind that you are actually reading from here. That is what is actually happening behind the scenes.

62:13 B: Okay.

62:17 A: So StarkNet nodes. StarkNet nodes are what you have on L2. L2 holds the sequencer, holds the toolbar, holds the full node that gives you access to the data availability layer where you can write and read from for your dApp that you're building. Then what is on L1 for StarkNet. We have the verifier and we have the StarkNet Core. The StarkNet Core, like I said, is the smart contract that holds the current state, all the changes made to the global state of this- of the StarkNet Core contract. All right, any question at this point? Okay, so the next thing you need to understand is- okay, the next thing we need to understand is the difference between declaring and deploying. Unlike your Solidity smart contracts, For your Shredded Solidity smart contract, you don't need to declare it. You just deploy the smart contract straight to the blockchain. With StarkNet smart contracts, you have to declare the contract first before you can deploy. Now, declaring smart contracts. When you declare your smart contract, you register your serial code on L2, also known as a contract platform. Now, what is SIRA? SIRA is to Cairo- I'm trying to look for something common for us. Cira is compiled like, like what? Like what Babel is to JSX. We know that, right? Those that do frontend or work with JavaScript, you've seen something called Babel before, right? Yeah, yeah, yeah. So, so I, I would say Terra is to Cairo what, um, Babel is to JavaScript or TypeScript. So Terra is a compiler, simple and short, is a compiler. Every programming language that is high level needs to have a compiler. What is the work of compiler, guys? What is the work of compiler? Like, this is simple computer science, simple computer- every programmer has decided to become a programmer. This is the simple thing you should know when you're learning any programming language. What is the work of a compiler? I don't want Emmanuel or Victoria or Mary or Matthew to answer. I want someone else, and I don't want Kenneth to answer. I need someone else. What is the work of a compiler? Convert high-level code to machine code. Thank you. All right, so that is what is going on here. That is what Sira is doing. Remember, we are trying to execute contracts. What is executing this contract is the VM, is the virtual machine, either EVM or Cairo VM. They are all virtual machines. And what are virtual machines? Virtual machines are simply Computers, exactly computers that are in the cloud or wherever you think they are, but are not physical. They are virtual. And what does the computer do? It takes in input and gives you an output, right? It processes data, it takes in input, gives you an output. It has a CPU that does all this compilation. Now, Like a VM is more like a virtual CPU that takes in information, does the processing of the information, and gives you an output, stores the information, and all those things that you know in your normal computer application of what the CPU does. That is what the VM does. And then you remember that 2 Right. For the computer to understand you, it doesn't understand this alphabet that you would write. It doesn't understand this English. It uses something called machine language, right? And it's this machine language that the computer understands. So everything you write on the computer, every English and everything you write that makes You understand what you are reading or writing. Has to get compiled down to what the computer understands, because the computer doesn't understand declaring smart contracts. The machine doesn't understand this language. What the machine understands are bytes, zeros and ones. So it needs a compiler to compile it down to what the computer understands. And that is what Siwa is doing here. Not fully. What Siwa is doing is- Pyro is a very- even at its low level, it's still a high-level language. Why is it a high-level language? A high-level language because it is- it has abstracted a whole lot of things to make it code readable to humans, to make the code human-readable. As long as the code gets extremely human-readable, it now gets extremely high-level. So the more human-readable the code is, the more high-level it is, and the more far it is from what the computer would understand. And that is why the compiler is needed to break down this high-level code that is human-readable and understandable to what the computer can understand. So Sierra here compiles down your Cairo code to something called KASM. KASM is Cairo Assembly. The assembly is what the computer reads. So when you deploy your smart contract, what it does is that the code you wrote in your smart contract gets compiled down to Scirra, and then Scirra stores it on L2. Now, this is also known as a contract class. So what it does is just like your normal object-oriented programming. When you have a class, the class gives you an instance, right? Or it gives you like a skeleton, right, of anything you're trying to do. It gives you like a skeleton. Then when you want to work with it, You create an instance of that skeleton and tweak it to however you want it to be. If you want it to be a female flesh or a male flesh, or you want it to be something else, the class has already given you the majority of the properties of whatever it is that's particular. Object. So you can use that class to do- to produce as many instances as you want from that class instead of generating those instances every time you try to, to do something that is exactly that thing. So all I'm trying to say is that with Solidity, you don't deploy a class If you build a token smart contract now and you deploy, it will just get deployed straight up. Maybe you made a mistake in the- in maybe the- what would I use? Made a mistake in the- maybe the name. You didn't want to use that name and you want to change the name to another name, then you deploy another one. It will still deploy afresh everything that you want, that you just, you just tend to redeploy. As long as you make different corrections and all, you keep on deploying, it keeps on creating new projects on the blockchain. taking up space on the blockchain. But with this declaration, it declares a smart contract that is like an object. So once you want to deploy, it will check if there was something that has been like a skeleton that has already been declared before. It will use that particular skeleton to generate the new instance of what you want to deploy and then deploy it. So if you are trying to deploy a token smart contract and the logic you wrote was what someone has written before exactly, If you try to deploy, it will declare first. Once you declare, it will read through it. If it has exactly something like that before that's been declared as a contract class, it will refer you to that particular contract class, give you the hash of that contract class, and tell you to use that particular contract hash to deploy your contract. So it saves space and saves unnecessary re-execution of code, storage of code on the blockchain. So the contract class does not have any internal storage and can be used as a library or blueprint in which an instance can be deployed, like I said. So just like live groups, your normal Solidity, they do not have internal storage. They can just be used to- in your function logic to create a- to perform an action that will create a state change or not. That is what the contract class is. It's mostly like a library because it does not change the state. It does not hold- have any storage in it. It does not change the state. All you just do is that it is declared and you can just use it as a skeleton to deploy large different hundreds of contracts All you just need to do is to change the contract to suit whatever you need it to be. If it's a token contract, it will always use the same contract class. If it's an NFT contract, it will always use the same contract class. The only difference is that once you deploy this NFT, they all have their different contract addresses. They won't share the same contract address. because they are different tokens. The only thing they have similar is their logic and implementation, and so the contract class will be the same. But the name, the symbol, the supply, and all those things are different, so the contract address will be different. Yeah, so deploying. For deploying a smart contract on StarkNet, there is something called the universal deployer. So the universal deployer is a smart contract that deploys other smart contracts. It possesses only one selector known as deploy contract. So what it does is It deploys smart contracts. And how does it deploy this smart contract? It uses the contract class, the hash of the contract class that you declared before, and then the constructor arguments. If the, the implementation you wrote has constructor before you declare the class, Then you pass in the constructor argument into the selector with the class hash, and then it will deploy the contract for you. So if you are trying to deploy a token, just like OpenZeppelin now has the format- Uh, yeah, yes. on the YouTube channel. YouTube, uh, yeah, YouTube of the webpage. So like I was saying, just like OpenZeppelin has a standard for tokens, if you all go to use the OpenZeppelin token contract What does he expect from you in your smart contract? He just expects you to call- to create a constructor and pass in the arguments, right? Pass in the name of the token, the symbol of the token, the decimal. Then expect you to call a mint function because all those functions that you need to write in your smart contract have already been written in the OpenZeppelin contract. you are just inheriting it and using some of the functions. Now, that act of you writing the constructor arguments, that is what is going on here when you are trying to deploy on StarkNet, passing in all the constructor arguments. and then the contract class. So, um, Mary, Emmanuel, Adji, Victoria, they can all use the same contract class.

78:29 D: Using-

78:30 A: likening it to Solidity, we can see they are all using the same OpenZeppelin ERC-20 smart contract. Then Emmanuel will pass his own different taking details into the constructor. Mary passes her own, um, uh, Adi passes his own, Victoria passes her own. But mind you, the 4 of them are using the same contract class. The difference now is in the constructor. Once you send it and you send the constructor argument, the contract gets deployed. An instance of that class gets deployed with all the information you set in it. And that is what the Universal Deployer does. Universal Deployer is a smart contract that deploys other smart contracts. So you send the argument to the contract, it only has this function. Once this argument is sent to the contract, it triggers this function. This function compiles all these things and deploys the contract for you. So that is the work of the universal deployer, and this is how smart contract deployment is done on StarkNet.

79:52 B: Cool.

79:57 A: So we have different transaction types on StarkNet. Deploy account. Deploy account is a transaction type that helps you to deploy a smart contract account. So just like in Ethereum, you can just go to your MetaMask and create a new MetaMask wallet. With StarkNet, once you create a new Wallet address. You have to deploy that wallet address. You can't use it just like that. It has to be deployed because with StarkNet, all the accounts, the addresses on StarkNet are smart contract addresses. So they have a contract, they have a smart contract written For that, that wallet is a smart contract- that address, sorry, is a smart contract deployed on the blockchain. So once you deploy it, it becomes live. You can then receive and transfer out tokens. Declare, declare, like you all know, is to create a contract class Whereby it registers the serial code of your smart contract and then generates a contract class for you. Invoke- what invoke does is that invoke executes write functions. With invoke, you can make state changes, you can make global changes to the blockchain. Invoke consumes gas, so it needs gas for invoke type of transaction to be successful. Then call- call is actually not a transaction because call is a read-only, um, method. So it doesn't change the global state, it doesn't require gas. You are only reading From it. Transaction is only valid when it changes the state of, of the blockchain and takes gas and consumes gas.

82:21 C: Sorry.

82:22 A: So when you are saying- when you, when you are, when you see a call method, it is more like a read-only method. It doesn't take gas. It doesn't consume gas, sorry, and it doesn't change the state of the blockchain, so it is not valid as a transaction type. Yes, deploy contract is a transaction type because once you deploy the contract, you would then need to withdraw it. change to the blockchain, that contract will become live on the blockchain. People can interact with that contract. You can go and write as long as- As long as- To the state of your blockchain, it is a transaction. Yeah. So why it is not listed here, the deploy contract is not listed here as a transaction type, is because this is not like a, um, all this you see here, they are methods in the Cairo. They are methods, but there's no deploy contract method. We have a universal deployer. It is a smart contract on its own that helps. It is not like a method you can just call on the low-level platform, so that is why it is not included here as a transaction type.

84:06 C: Okay, so any questions, any confusion before we go into Sorry, sorry, can you please explain, um, this deploy contracts again?

84:24 A: Deploy contract or deploy account? No, deploy account.

84:29 D: The one-

84:30 C: no, no, no, the other one.

84:33 A: Universal Deployer? Yes. Universal Deployer is a smart contract that helps you to deploy other smart contracts. So it has been deployed by StarkNet itself to the network. So every smart contract you are trying to deploy would behind the scenes actually be deployed by this universal deployer. So it is a smart contract that is solely designed for deploying every other smart contract on StarkNet network. So what it does is that it takes in the contract class hash and it takes in the constructor arguments, and then it gets deployed. And once it deploys it, you will get an instance instance of your contract class deployed on the blockchain. So I know it is very- it is confusing now, but once you have a hands-on session on deploying, you will understand why it is this way. You would see how it takes in the contract class and the constructor has been And how it gets deployed. So it is very, very different from Solidity deployment where you just deploy without calling a contract class- without declaring, sorry. In Cairo, with Darknet, you have to declare first before you deploy. Okay, yes, Emmanuel, yes, it does. All accounts on StackNet are smart contract accounts, so it abstracts, um, the account that StackNet uses account abstraction. Like fully the whole depth of account abstraction. They have abstracted accounts for you. Okay, thank you.

87:05 C: That was the question I wanted to ask.

87:06 A: Yes, yes, you're welcome. Okay, so, um, the next thing we are to So I'm to show you guys how to practical on how to start get started on Startnet. The first thing, the first gateway before interacting with any network is to have a wallet. So for Startnet. Currently, we have two wallet providers that you can use. We have Agent Wallet and Bravos. Agent Wallet is agent.xyz, and we have Bravos. B-R-A-A-D-O-S. Then all these wallet types have Chrome extensions that you can install on your browser, just like your MetaMask. So you can go ahead and install Argent or Bravo, anyone works. So once you install it, you know the next thing to do, you create your- you generate a seed phrase for you to create your password, just exactly like your MetaMask. So, okay, so I think I don't have anyone on this application, so let me, let me, let's, let's do it. So I'll be installing the Bravo Chrome extension. Then also I'll do same for arching. Okay, so let's create an agent wallet. So create a new wallet. If you don't have an old wallet to restore, you create a new wallet. You agree. So enter a password to protect your wallet. Okay, so now choose. Okay, this is a different- this is a new feature. Which type of account would you like to create? You can always add additional accounts later. So if you want to add a smart account, it requires your email address, you know, due to factor authentication. You can import your accounts to Identity Mobile app. Recovery when seed phrase is lost is coming soon. Nice. So let's go with a standard account. You can work with anyone. So your wallet is ready, finished. So let's see the wallet now. My wallet has been created on mainnet. I have 0.00 and says to fill my recovery So I don't have any Ethereum, I don't have any Binance. So the next thing that I need to do is to deploy this account. So let's go back again. The good thing with this, um, Argent wallet is that you can actually deploy a smart contract with this address wallet. So you can come here, pass in the information, and then get it deployed. Although I've not done it before, so I'm not sure how it works, but it does. You can actually declare your contract and deploy here instead of the other method where you have to type in the CLI code for declaring and then type in CLI code for deploying. Yeah, so let's try to deploy. So here, I think this is the place for smart contract. So here, okay, so this is the place where you add your, your code. Code, your smart contract code, select the network you want to deploy to, and then you declare. After that, you come here, you pass in the contract hash, select the network, and deploy. So you can use it to declare and deploy your smart contract. So I'm trying to see where- so to upgrade to smart account, you must deploy this account before upgrading to smart account. So I'm trying to look for where the deployment is. So if you qualify for the airdrop, you can, you can check the wallet address if it qualifies for the StarkNet airdrop. Okay, I'm trying to So look forward to deploy the account. Let me switch to the area. Okay, let's, let's fund. You can get test ETH from different- So to request testnet tokens, you all know how to do that. Just copy your wallet address and paste. And I want to fund it with TAC. So now I have 20 stack in my wallet. So Uh, why is it hard to find this? This place, deployment. So let me come to Bravo, create a new wallet, password. So I switch to the Sepolia network.

98:06 B: Okay, cool.

98:14 A: So I copy this address and I want to send from this wallet. To this address, I'll send ten tokens. Okay, so it's saying it includes a one-time activation code. Activation fee. So once you have your wallet, you have to activate it also. Let me see this. Okay, let's confirm. Okay, so it has, it has actually sent. One thing with, um, smart accounts, smart wallet accounts, if you can perform some transactions on the account, it automatically gets deployed and verified. So let's see here, we should have- yeah, we have 10 stacks. So I'm trying to see where to deploy, but it seems they've changed the process. I really can't find it. But then once you've been able to perform a transaction on that wallet address, it would automatically get deployed. Okay, okay. So here you can see that this account is not deployed. For this, they set up your account on-chain. So for Bravos, I clicked on these settings and then it showed not deployed, set up your account on-chain. So this is going to deploy this account now on StarkNet Sepolia. So my account has been successfully deployed. Now I can see the version of this, my wallet, and now I can perform the diverse transactions. Now you can see the value of the stack has added. Before it was showing 0. Because it wasn't deployed. So here we deploy the Bravo's account. So let's, let's try to troubleshoot this agent. So you can see that it is not deployed, so it's not fetching information about this contract address for us because it is not deployed. Hi guys, see with me. So yes, you can ask your question. Has anybody been able to find it?

102:49 C: I think Argent automatically deploys it.

102:58 A: I'm not very sure, but mine is not showing any error. Okay. If you want to sign in-

103:39 B: Excuse me. Yes.

103:44 C: We are looking for the deploy accounts button, right?

103:47 A: Yes, on admin. Yes, I found my own.

103:54 C: When I click on the accounts The account? Yes.

104:01 A: Like this?

104:03 C: This is not the way to put it here.

104:09 A: Is it on Argent or Bravos?

104:13 C: Argent.

104:15 A: Okay, so I click on the account.

104:23 C: The, this, um, the settings icon, top right, the settings icon, the settings icon, yes, the arrow on the account one.

104:39 A: Okay, it's not bringing. Yes, I don't- it's supposed to be somewhere here, but if you guys have If you, if, um, so you all have, when you click on that arrow, does it show you the option to deploy your account? You can just send a reaction.

105:02 C: Um, when you click on your agent wallet and check the top left corner, if you click on the account, click on the account one, it If you take it to where you deposit the account, then you can now accept or reject the transaction.

105:19 A: Yeah.

105:21 C: At the top left corner, yes, click on it.

105:27 A: This one?

105:28 C: Yes, there should be 3 arrows. I don't know why you are not seeing it on your own. Okay, yeah, 3. Yeah, yes, yes.

105:39 A: Click what? This one? So what should I do?

105:44 C: Deploy account on my own. After I account, then deploy account, then connect and collapse. Okay, I can see, I can see it somewhere.

105:56 A: Something is, something is wrong. So sometimes when you're wondering to do this, you can easily do this. Go and clear local storage. There are some times that the wallet can misbehave, and sometimes clearing local storage- although I don't think there's any chance for it to crash by now. So you can clear local storage in case you have I'm so sorry about that, guys. Please, what was the last thing you heard me say?

107:58 C: Okay, the last thing you said was, uh, whenever you're having issues with your wallet, you can always clear local storage and see.

108:09 A: Okay, so if you If you can see the deploy wallet showing, please go ahead and deploy your wallet.

108:22 C: Excuse me, ma'am. Yes, yeah, I observed that when I deploy this, um, wallet now, then I now later went back to go and check if I would- if I'm going to, um, see the button. So it is once you deploy it now, you won't be able to see that button again. That's what I observed.

108:43 A: Yes, once you've deployed it, you won't- it won't, um, give you the option.

108:50 C: The deploy button will change.

108:51 A: Yeah, yeah. Maybe that's what's happening here. Yeah, but it shows that the account has not been deployed. It still shows the account has not been deployed. So I think something is off with this.

109:08 D: Um, please, the quick one.

109:10 A: Um, if you can check the contract address.

109:20 D: So on-chain here, mine is fine here. Yes, mine is like this.

109:25 A: Oh, good. Okay, this is deployed.

109:47 E: Okay, it is deployed.

109:47 A: So I know once you perform a transaction on that network to that particular address or account, it sometimes Agent will automatically deploy that account so that it can hold the token or send tokens. All right, so we have this deployed, and because it's deployed now, you can see the various, um, methods available. The code, the class code is free. You can see the API for this smart wallet account. This is the API that was used to create that. This is the API that gives you, um, like access to the smart contract that was deployed. This is the read and the write functions. You can read and you can write, and other options are available, methods available, the transactions that have gone through this, um, account. So remember, I did- it's called the deploy account. What I actually did, remember, I did not deploy this agent account. Right? What I did was to, um, transfer. I transferred from the faucet that I bought to another account, but it seems for that to happen, it automatically deployed the account and then also call the transfer function. So yeah, that is how to create your account on StarkNet. Either use Argent or use Bravos and also get your faucet. That is how you get your faucet. Now if you want to bridge your assets from one chain to another chain on StarkNet, you have different bridges, but the most common bridge I use is StarkGate. I think it's starkgate.io. So we start with- I hope I'm still connected. Okay, guys, can you hear me? Okay, so with StackGate, StackGate helps you to bridge your StarkNet tokens from StarkNet to Ethereum. I don't know why, maybe I just get the link here. Okay, so stackgate.starknet.io. So with startgate.startnet.io, you can bridge your token. So, oh, you can also bridge Sepolia token. So nice, nice. So with this, you have to bridge, you have to connect your wallet. So the first thing you will need an Ethereum wallet, either MetaMask or so. So before we do this, let us swap so that we'll have some ETH in our possession. So to swap There are also different swaps on StarkNet, but the most popular one, most used, is, um, JediSwap or Equivo Protocol. So I normally use JediSwap like all the time. So with JediSwap, you can swap your tokens from Stark tokens to ETH, to any other token. Available on the network, and it happens very, very fast. And also, if you want to check the scan, you use stackscan.co or you use Voyager. So Voyager For StarkScan, helps you to view the block- the blockchain. The StarkNet Explorer gives you- yeah, the StarkNet Explorer that helps you. Yeah, voyager.online. So this particular contract address If you can see here, you see something called class hash, right? This class hash was what has been deployed- has been declared, sorry, it has been declared before. So every contract that will be deployed will use this same similar class hash to get deployed on Argent. From agent. So I'll try to do something here. So Sepolia. So this is Sepolia. I'll paste the contact address. So you see, it does the same thing, and see, it shows me the value of stack I have in my wallet and the value in dollars and all the transactions. that they deploy. Remember I told you that we have 3 transaction types? We have deploy account, we have invoke, we have declare. So you can see this type showing here as deploy account because we deployed a smart contract account. Now because we, we, we made a write function Function, we send tokens from this account to another account. It's called the invoke type. So guys, do you do you see how? You see where all these are used. You now understand what I mean by transaction type now. Okay, thank you. Yeah, so Voyager Voyager dot online. It's a block explorer for StarkNet that helps you to see all the transactions that happened on StarkNet ecosystem. You can also query the transactions that happened on a particular smart contract address. All right, so JB Swap. So I want to connect my address here. Wallet. So let me see, does this support, um, does this support Let me see if it supports testnet. Oh cool, they support testnet. So let's connect and want to swap from- what is going on? So you can see I connected StarkNet to Julia. Okay, so it's still loading. I think because it's testnet. Okay, instead of wasting so much time here, let me just use- so Okay, so I'll connect my wallet.

121:21 B: Okay.

121:21 A: All right, so I want to swap some stuff. I want to swap to ETH. Wow, I don't know what's going on. Just keep loading. I think they are having some downtime. Yeah, there are different protocols on that stacknet. There's Equibot, there's JellySwap. I think there's Nostr also available. So I want to swap some stack. I want to swap to Yeah. Last swap, right? Same. I don't know why I did this swap. Can you guys see my screen? You can mute or unmute.

123:06 C: Yes, yes, yes, yes, yes.

123:07 A: Wow, I still don't know what's happening here. Oops, I don't know what's going on with these guys. This is even the worst. Could we see the network? Okay, mainnet. Okay, so I think it was reading poorly before, so I want to have that to I want to fasten for tack, give me 0.003, then I confirm. Okay, this is going nice. I can see the dart seam, 0.003. Okay, so the transaction has been submitted. Let's open this scan. So you can see here, how do I do this? Okay, so at this point it is showing not received. Because that was when I just initiated the transaction. At this point, you can see it is received. That means- what does it mean based on what I've been explaining, guys? When you see received, what does it mean? Somebody could unmute and speak.

125:43 D: Say it's probably included in a block.

125:54 A: Yes, the sequencer has included it in the block. Then here, okay, this is new. Pending is new. I've not seen this before. I think just recent. So here the sequencer has It kicks off the transaction from the mempool. It is executing the transaction and validating that transaction. Once it is done, it moves it to the block. From here, it sends it to the prover. And once it has sent the transaction to the prover, that means it has reached finality on Elrond. And that's why you see it is accepted on L2. The next thing is for the transaction to get accepted on L1. Why is this thing blocking me? The next thing is for this transaction to get accepted on L1, and this is going to take some time before it gets accepted on L1. But let's check my wallet now. So you can see now I have $10 worth of Ethereum added, or $11 worth of Ethereum added to my wallet. So that is how you swap. Now to bridge, I'll use Start Gift. To bridge. I connect to start this. So now I've connected my Starknet wallet. It's asking me to connect my Ethereum wallet because when you want to Between different layers, so I'm going to connect this one. Let's just follow. Ah, let me connect MetaMask first. I don't know why that is wasting time. Okay, so it has connected my MetaMask wallet. So it is showing what I have in my MetaMask and showing what I have in my StarkNet wallet. But now, because I want to send from StarkNet to MetaMask, I'm going to click withdraw. If I want to send from Ethereum to StarkNet, I'm going to use deposit. When I use withdraw, it moves the ETH. So how much do I have?

129:41 C: 0.004.

129:51 A: I want to move it to Ethereum, then I click transfer. So once I sign this transaction, once I sign this transaction, it automatically starts processing. And then it's going to wait for ten hours at the max before you can see like on my MetaMask account. So here, this is this is how to bridge, how to swap your tokens, how to create your wallet, get your. And then finally, yes, Victoria, go ahead.

130:45 B: Yes, yes. So you say it takes 10 hours for it to reflect on your MetaMask. So does that mean that like it takes 10 hours for this bridge entirely to be completed? Is that not much?

130:56 A: Yes, if you are, if you are bridging, right? If you have a StarkNet wallet to your Ethereum wallet, it's going to take that long because it is sending to L1, and for every L1 transaction, before you see the option Before you see the option that the transaction has been accepted on L1, it takes time because it will bundle different transactions together first. After bundling all these transactions together, all the transactions have already been executed on, on Layer 2. Then it will generate a proof. For this transaction. When it generates the proof, it will send to the verifier on L1. Once L1 has verified that proof, then the transaction can reach finality. So that is what you get. But this is way faster than optimistic rollup. If you're using optimistic rollup, you know that it takes 1 week. It takes 7 days, 7 to 8 days before the transaction reaches finality. So you have to wait 7 to 8 days before you can access your funds on L1 if you are using Optimistic Rollup.

132:31 B: So because this, this one is using zk, right? So you just wait for the proof, then verifies it.

132:53 A: Exactly.

132:54 B: But Optimistic Rollup, you have to wait for-

132:57 A: So your stack tokens to like Binance or MetaMask, you would have to wait for some time. Most time, maximum it takes is 10 hours. Sometimes it takes 3 hours, 4 hours. The max, at max, it takes 10 hours, especially if you are using bridge. But if you are sending directly from this wallet to maybe your Binance Tapnet wallet, it takes at max 3 hours, 4 hours to get completed finally to But they are using a bridge, like, to bridge from this to this. Sometimes it takes up to 10 hours because once it reaches finality, the bridge itself has to do some confirmation before they release the token to your wallet. Yeah, so yeah, that is it. So Yes, so, okay.

134:01 D: Yeah, it's related to what Victoria is asking. Are you talking about, um, withdraw or deposit?

134:13 B: Withdraw.

134:18 D: Okay, so withdraw is one that takes time, but But the deposit is faster, right?

134:27 A: You know, I've not tried depositing before from Ethereum to StarkNet.

134:34 D: So I just tried the Sepolia deposit and the amount has reflected in my Argent wallet already.

134:44 A: Immediately, right? Okay, so that means sending from L1 to L2 is very, very possible, very, very fast. But then from L2 to L1, that's where it takes time because of the technologies used. So I really don't know, I've not tried it before and I've not- so I've not tried to even Research or figure out why L1 to L2 is that fast. But I think I'm going to do that now. Yeah, so that is it. And finally, Victoria, you had another question, right? Yeah, I had another question.

135:45 B: No, like, I just wanted to confirm if bridges on L1 work the same way on L2, where it's like an external party that does the bridge for you. You're not really doing it on-chain or something like that. It doesn't work the same way, like the way it works on L1.

136:01 A: Yeah, so I, I really don't understand what they But sometimes when I think about bridge, I feel like once you bridge, it maybe moves the tokens from your wallet and sends to the address of the bridge. Then from the address of the bridge, it moves the token you are trying to bridge and the network you are trying to bridge and sends to your address. But some Some others, full of thoughts. Some others, it says that once you bridge, it freezes the assets in your wallet in that network and then tops up the assets in your wallet in the network you're trying to bridge to. Yeah, I've not researched into bridges because I'm not really interested in bridges, but It shall happen that way. Something like that happens. It has to be somewhere, someone that receives that token and send the token you need in the network you need to you. So it's not, it's not like it will automatically convert the token to the, to the, from StarkNet to Polygon. Unless a team or some researchers decide to build something like that that can convert a token from one token to- from ETH in StarkNet to ETH in Ethereum. Well, as long as that has not been done, it will always send this To another address, and then from that, it will always be like a middleman kind of activity.

138:00 B: That makes sense. That's also the same theory I had in my head. So makes sense.

138:09 A: So, um, the next thing we are left to do is to do The wallet interaction.

138:21 C: Sorry, I have a question.

138:23 A: Okay, go ahead.

138:25 C: Yeah, so, um, can you import an account like on this Argent now? I don't know if I can import an existing account that, for instance, I have another Argent wallet elsewhere, because like on MetaMask you can import an account that you have somewhere. Into a particular wallet. So I don't know, could do it here.

138:51 A: So I think you can do it this way. Okay, do you mean import an address or import an account? Oh, now I get what you're saying.

139:21 C: Yeah.

139:23 A: Let me- I know when you installed the agent, it will ask you to import existing accounts or create new accounts. So if you are trying to import an existing account, I don't think it is going to work here. I don't think it's going to work here when you create a new account. You would have to go-

139:53 C: Yeah, I actually tried to import just during this class because I once installed the agent on my phone. So I tried to import, and- but it was asking me to use my passphrase.

140:15 A: Okay.

140:16 C: That means that if I use my passphrase- yes, that means if I'm using my passphrase, then it's entirely the account I'm importing. That means I cannot add another account because I think I don't know, maybe they are, they are just different anyway from, um, the L1. I think they are different from the L1 actually.

140:40 A: Like, what do you mean?

140:43 C: Yes, okay, um, yes, okay. If, um, I was- if I had used my passphrase, right, upon creating a wallet on my system, I use a passphrase and I'm bringing in the entire wallet, um, I had. So that means I cannot have like an account 2 or account 3. It's only going to be just that one. Well, you know, for instance, on MetaMask, you can import accounts and then you're going to have different accounts. Like you're going to have account 1, account 2, account 3, and so on.

141:23 A: I don't know if you understand. Okay, I get you. Yeah, I don't know. And again, I know that if you are importing a wallet address, it's just that wallet you can import. You can, you can create other addresses, but you cannot, you cannot have 2 instances of a wallet in one wallet. So yes, yeah, yeah, yeah, yeah, yeah. So if you mean the address, like using private key for a particular address, you just add that address to this new wallet. I don't know how that works.

142:16 C: Okay, and again, I mean, when I, um, registered the agent on my phone, I was asked to use my email address and all those things.

142:29 A: So if you are using smart account, ask you for email.

142:37 C: Oh, oh, oh, okay.

142:39 A: But the smart account The standard account is a normal account.

142:58 B: Yes.

142:58 D: Um, all right, uh, please, a quick one. I want to clarify if, um, contracts are deployed through addresses.

143:13 B: Yes.

143:13 D: Because the reason I'm asking is, so say I want to deploy a contract on StarkNet and I want to do it with my, you know, through my address because I obviously have to pay gas fee and all. And, uh, so I'm wondering how, how, uh, how this, um, how this is going to be, how this is structured. For instance, I noticed just now that you created another wallet. Another, another wallet, yes. Inside the same account in your agent. So you have 2 addresses there. So say you have gas fee on account address A You don't have gas fee on address B, but then I- we've not seen how to separate either of these addresses since they are both combined by the same passphrase. So, so I'm just curious.

144:14 A: There's private key for each address.

144:19 D: Okay.

144:21 A: So this is, this is account 2. If I go to security, uh, yes, this is a normal repository. You can see export private key. Fantastic, thank you. For this account too, you can export private key. For account 1, it has its own private key. Yeah, so that's, that is it. That is how you separate the different addresses and interact with them. So, um, the next thing, the final thing is, um, is to interact with the smart contract. I'm trying to find a smart contract, but Goldie is no longer there. But I deployed the contract recently. I don't know which address I used. Let's just do a search. You'll see something to interact with. Okay, so these are different. Okay, so this is an invoke function. Let's see which- this doesn't look like a smart contract. So I'm trying to look for the smart contract. Hope this is not me. I'm seeing something with my laptop. Okay, let's do this. Okay, this seems to be a smart contract with some breakdown, right? So So, oh, this is- this looks like a wallet. So to interact with this, if you want to read, let's say get name and query. So the name is an agent account. So this person actually just deployed. So maybe it's one of us. From the class that has done this. So these are the different formatting you can use to read the information. Then get owner. This is the owner of the account. Different ways to read the information. So if you want to write, to write you need to connect to your- connect your wallet. So after connecting your wallet I don't think you can write anything because this is a- this is someone else's wallet. But let's see, let's see if we can change owner.

149:43 B: Yeah.

149:58 A: Let's see, you can change owner, but then the signature is the problem. Not going to work, but let's see. You see, this transaction is not executed. It's an agent-only self. So only self means only the wallet, the address of that wallet, that can perform this transaction. Okay, so, um, uh, I'm trying to see if there's another wallet, another smart contract address I can Sorry, guys. I'm just trying to get a contract I can use. Let me just quickly check my addresses.

152:14 D: I've sent her an ERC-20 address to the chat.

152:20 A: Is it a StarkNet smart contract address?

152:23 D: Sepolia, yeah. Sepolia StarkNet.

152:37 C: Cool.

152:37 A: Cool, cool, cool. Okay, so we all know how to read. Name is token, symbol, there's a 20 total supply. Ah, whatever it is, the zeros are too much. Yeah, decimals 18. Okay, so let's write to this contract. There's no, there's no means. So if there's no means, then, then there's nothing you can do much. So I want to approve this contract, just 10 to 60, just in case we have the token. So next step, I can't approve this contract, so let me approve another address. I think something is wrong with this, with this address.

155:15 C: What's up, Rachel?

155:25 A: Seriously, what's up? Okay, I think it's this. Um, I hope I remember this password. Oh, I think it's this one. Okay, sorry for the whole- um, ah, no, it's not this one. Okay, finally. All right, so this was the sample contract we I used for a class like some weeks ago. All right, so let's try to write to this contract. So we're trying to move What you need to address.

157:27 C: Wow.

157:28 A: Oh, different network. What do you mean by different networks connected? This is the foliar and this is what- oh, this is mainnet. Okay, let's copy this and Try again. Or rather, let me copy this and put here. Something is wrong. Something is seriously wrong.

158:48 D: You entered the URL, you entered the URL, the address.

158:56 C: What?

158:56 D: You enter the full URL.

158:58 A: Thank you, thank you so much. Okay, I don't know what is going on today.

159:28 D: I've sent another AROC.

159:31 A: Okay. Okay, so I want to, want to append this second. Oh, okay, cool. So this is how to write to a smart contract. This is how you interact with it. It's just similar to your Etherscan. But for staffnet, you use either Staffscan or Voyager. staffscan.co or voyager.online. Now you can see everything about the contract. So if you are trying to, if you are trying to get your API, if you are trying to do some frontend integration, you just click on class code/history. It will show you the API and you can copy this API and then add it to your JSON file and start interacting with it the normal way you do with ethers.js or WAGMI or Vite. And here you can see the bytecode, what was sent down to the EVM, and the different function selectors of All the functions, events, and everything listed here. So that is basically it. The fundamentals of staff net in Cairo. Is there any question, any confusion? Yes, yes.

162:49 D: So for the front-end bits, are we, um, StackNet has its own library, right? We're not using it.

163:27 A: Yeah. Okay, so the next question you can ask before you attempt your question.

163:31 B: Okay, so on agents, I just noticed that it's a different way of creating a test account. Like when I wanted to create this Sepolia account for Argent, I had to like create a separate address entirely. But for Bravos, I just- I can just use the same address. What I just need to do is just change the network. But when I change network for Argent, I have to like create a new Sepolia address. So is that how it is? Do you know why they do it like that?

164:07 A: I really don't know why they do it that way, but you have to deploy the contract on Sepolia again. But the thing I know is that as long as you have that particular wallet Both whatever, um, testnet or whatever you want to use, you can see access that exact same wallet address. All you just have to do is send tokens in that network, either it's Sepolia or it's Welly. Send tokens to that network and you can see it appear What is that? Can you hold on? You see it appear on your Argent wallet. So when I was trying to import- wow, what's going on? I was trying to import a mainnet account which I had the Sepolia account for. I used to use it the Polygon account for something thinking it was mainnet, but I realized it wasn't mainnet. So what I did was to send mainnet funds to the account. Immediately I sent mainnet funds to the account, uh, I cleared my local storage. You remember how I showed you guys the Clear your local storage. Immediately I cleared my local storage, all the accounts were imported, both the mainnet, Sepolia. All the accounts that had tokens in them got imported into the address. Yeah, so that is what I did. But for Bravo, immediately it imports you, if you import it in Sepolia, you'll see If you import on mainnet, you'll see on Sepolia. So just the different functionalities of the wallet. You work with anyone that is more comfortable for you.

166:29 B: Okay, that makes sense. Just allow Sharon to talk.

166:42 A: Can you ask your question? Can you ask your question?

166:55 C: It seems he's not actually active on Discord.

167:02 A: Oh. Okay, who is next? Anyone else?

167:14 C: Yeah, yes, yes. Um, though, uh, my question is not particularly concerning the class, but, uh, I, I learned that, um, there's going to be another airdrop on StarkNet, so I don't know, um, you can be eligible just by holding STAK tokens, so I don't know how true is that or how to go about it. That's my question.

167:43 A: Yeah, so I thought so, but I'm not sure yet. But I heard that there'll be other airdrops, and I know that I saw an announcement before that they are preparing for another airdrop. So like what made us- we both- and I got the last time, but yes, it's because we did open source contributions to StarkNet projects. Like I was explaining yesterday, there was a particular project I contributed to that was listed on Electric Capital. I didn't know about it, so I got some tokens through that project for the StarkNet airdrop without knowing that the project actually made me get tokens until I used my GitHub account to check. And then I was able to see that my GitHub account qualified for the StarkNet airdrop through open source contribution. contribution to that project. Then other, other people that got, some got because of their hosting of events, hosting of events, organizing stuff. Grant. So there's always a form. There was actually a form then to fill that they sent out to everybody to fill. So based on whatever it is you are doing in certain ecosystem, you fill the form, you paste your wallet address, you send proofs of what you've done. So you send proofs of the event, links to the pictures, the reports and all that, and it was the StarkNet airdrop when it came. Then others got the airdrop because they contributed to a project on Electric Capital that is not even in StarkNet ecosystem at all. Polkadot, Ethereum, Optimism. Then some got the airdrop for staking. So if you stake some amount of ETH, then, uh, as long as it is not- your stake was before, I think, November 2023, yeah, you got qualified for this. So as long as you are doing one of any of these things I mentioned, you'll be eligible for the airdrop. But if there's truly a StarkNet airdrop like the last one, they'll always send out a form for you to fill, uh, with your wallet address and something, or they'll always let you know the, the process involved. So the, the second one they did was for people that do all these DeFi things, that farm, go to different projects and, you know, do create liquidity, contribute to liquidity, do some- yeah, so all those actions. So the second airdrop was for those people. And so I know as long as you have been one of these things, people you would qualify for the airdrop. But the most important one is if you are really at your dev, you are contributing to open source. Open source kind of airdrop is always unexpected, actually.

171:47 C: All right. Thank you.

171:48 A: I hope you are okay, Dan. Yeah, you're welcome. So yes, yes, yes. All right, go ahead. My question, my question is on this contribution that you talked about, because right now I don't think I've contributed to any such notifications in any way.

172:09 C: So does that mean, uh, or any Yes, you have to contribute. Oh, how can you look for a good job?

172:27 A: Yes, you have to start contributing to projects.

172:32 C: So that is a- like, that's only those you talked about?

172:36 A: Yes, yeah, only those is actually the best because You know that you will get paid. You can contribute to projects that have Solidity or JavaScript. You mustn't only contribute to projects with Cairo, and you can also contribute to projects with Okay. So that will prompt you, will push you to learn Cairo fast. This- at that point, you are learning Cairo not just because you got the scholarship to learn Cairo from start, but you are learning Cairo because you have something to do immediately and you need to do it. So you will learn it fast. Faster than normal. So yes, don't feel like because you don't know it now you cannot contribute. You can learn it on the go while contributing. And also, you can also contribute to Solidity projects or JavaScript projects, projects in the programming language that you are most comfortable with. Okay, so Michael.

174:03 E: So thank you. I was thinking about the contribution, what's all building on StarkNet. Does this also count like if I build a project on Stark Network? and I probably deploy it, does that also count that I've done something on StarkNet?

174:29 A: Yes, it actually counts that you've done something on StarkNet. Also, they will ask you to- there's a GitHub repo that has all the projects from everybody that have deployed projects on StarkNet, so they always update you, they always most need for new people that just deployed their project on StarkNet to add that project to that GitHub repo. So they can track like 90% of the projects that have been deployed on StarkNet. So when there's any need for airdrop or some application, they can easily check each you have been part of the ecosystem and have been doing some things in the ecosystem.

175:26 E: Yeah, I am. So this, this deployment, does it have to be on the mainnet or it can also be on the testnet?

175:34 A: No, on testnet. Up to now I haven't done even one deployment on the mainnet. deployment on mainnet, but I have to do one now. I have one project I need to deploy on mainnet, but I want you to know that I've been participating for the past 9 to 10 months now, but I don't have one deployment on mainnet, so it doesn't- that is not reactive.

176:02 E: Thank you. All right.

176:09 A: Yes, thank you, thank you.

176:13 C: Uh, um, so this is just an opinion, you know, this question.

176:17 D: So I want to find out what you think the, uh, learning curve is like from, you know, moving from Solidity to Cairo.

176:26 A: The learning curve. The major thing is the level of your knowledge on Solidity. If it is very, very grounded, if you know the fundamentals very well, it is the same thing with smart contracts on darknet. It's the same, um, The difference is the programming language, but the concept of a smart contract is the same. There's a constructor, the constructor has parameters. If you are importing, this is how you import. This is the concept of inheritance, is the concept of, um, what do you call it, libraries. This is the concept of, um, let's say, what do you call it, Um, like inheritance. What is that other word?

177:30 C: Interfaces.

177:31 A: Interfaces. Same concept of interface that is trait in Cairo, the same thing. So the only diff- the good thing with Solidity is that it is typed, so you're already used to a typed programming language. Same with Cairo. Cairo is also typed. So the difference is just the syntax, but the foundation, the fundamental, the application of everything is the same in the smart contract. So your Solidity knowledge, if it is sound enough, then it will be very easy for you to switch to Cairo. So it is not so steep, but I learned Cairo within a week. I was not so good, but I was able to write and deploy contracts within a week based on leveraging on my Solidity knowledge. So don't think it's too hard, it's not so hard like that.

178:38 C: Thank you, thank you, thank you.

178:42 A: You're welcome.

178:43 E: So sorry, can I quickly also ask a question?

178:47 A: Okay, I'm coming. So currently contacts on StarkNet are not yet verified. There is no- there's not yet, um, um, how do I put this, uh, not like figured out. They're not yet not added that method yet. I already asked Voyager, how do I get contracts verified? And the support they have for verified contracts are contracts that have used a very high compiler type. So for now, verification of contract is not something serious here to attack. Also, you can, you can still fetch the ABI without verifying the contract. Now, that is the major thing most of us need to verify contracts for, to be able to see the ABI and to be able to see the logic, the implementation of the contract. But currently it's just here. deployment. There's no verification yet, but they are already working on adding verifications now to smart contracts. So maybe in the next 2 weeks to 1 month, that feature will be, will be workable. So, um, Michael, please.

180:19 E: Yeah, thank you. You were talking about The fact that you learned Cairo in a week, so I wanted to ask, do I need Rust knowledge before I can learn Cairo? I can just pick Cairo on my own, on its own, and just run with it?

180:36 A: Yes, you can pick Cairo on its own and run with it. So most of us didn't learn Rust. I didn't learn Rust, so I just started learning Cairo. And the learning curve for Cairo helps me to understand ROS. So it doesn't matter whether you know ROS or you don't know ROS. If you know ROS, that means you already know Cairo. You just start writing. But if you don't know ROS, then just learn Cairo. Once you've learned Cairo, it's almost as the same as saying you've learned ROS. Yeah, so that is it. Any other question? All right, thank you guys so much. I hope you guys learned a lot from this session, and I just hope whatever I've said, you got at least 50% of it. The other facilitators would guide you guys through, so you'll be deeper dived into the staff medical system. So please, um, an assessment link will be sent later to just assess your learning. Try to fill it up. I haven't done it yet because I was very, very late to the class. So yes, hola.

182:05 D: Yes, a quick one before you leave.

182:08 C: Please, can you share your, uh, social media handle so we can connect?

182:12 A: Okay, so my Twitter is@@-

182:18 C: Sorry, sorry, ma. Um, I don't know if we can get the slide you used for this class.

182:24 A: Yes, I'm going to share the slides. Are you people in a Discord channel or an organized channel? For your scores.

182:33 C: Oh, no, for now.

182:37 A: Okay, so the admin, Sam, will share the slides and the assessment links to your emails also. Yes, the video will be uploaded on YouTube. But I don't know, that will be by Sam, the admin. All right guys, have a nice one. Enjoy the rest of your evening. Bye.

More from this hub

Something wrong, or a video you want off this page? Write to wethem.xyz@gmail.com and it is fixed or taken down within 48 hours.