KL Mini Hack 2023: Unlearn to Relearn: Ethereum Basics | Sunday, February 12,|2023 | 4:00 PM
Ethereum Malaysia·Mon, Oct 9, 2023, 12:00 AM
Our first talk of the week and we will have WeiHan to walk us through the 101s of Ethereum. Beginner-friendly and quick way to understand Ethereum from a technical perspective.
Transcript
company called node real so um this is joined as one of the core contributors or call deaf for BNB change so yeah very excited I mean just join like one month ago so and I'm a fresh girl so I'm not an expert here I think some of you are definitely more expert than me but nonetheless um let's talk about the session today um the topic is called Nothing Fancy it's all about ethereum Basics and why do I say I learned and written is because I'm pretty sure some of you here are have been in the ethereum ecosystem for quite some time and some of you are not right so for those who are already an expert um I hope this session is still going to be valuable but even though we are talking about Basics by helping you to unlearn and relearn so that you can fill up some certain knowledge Gap that you you didn't know that you didn't know right and definitely for beginners here you'll be a great starting point for you to step into the ethereum ecosystem system and also to know about what's going on what's going on behind the scenes of the ethereum blockchain as a whole all right so yeah without further Ado let's start off with some mean yep so um if you are into the crypto Market or if you own some ethereum or some other cryptos you probably don't feel that well I guess unless you are very good at predicting the market um but yeah nonetheless we're not going to talk about the market today we're just going to talk about the technical side right because we are all Builders here right or we are all going to become a builder here so what we're going to talk about in this session is more about the technical perspective of ethereum so this is a metamask transaction so for those who don't know what is metamask metamask is basically a very well known platform or very well known wallet for people to make transactions right so if you look at the picture here what I'm trying to do it's just very simple I'm sending 0.2 uh if or in this case it's test net if from account to the account one so it looks very simple and it feels very simple as a user but there's a lot of things that going that's going on behind the scenes of by pressing this very simple button and we are going to explore all that so let's start off with one section let me just open the comment section view doors okay yeah so let's start with some just some blockchain Basics right and yeah again it's going just going to be a very basic thing so first off State machine okay so if I were to summarize what is ethereum okay summarize ethereum as a state machine so um and to be more specific ethereum is a transaction based State machine so you might ask why it's a state machine okay let's talk about the word the word the word state state is nothing more than if you are from computer science or any technical background it's basically just like a database you can think of it as a database uh a state is like a database that stores certain data or they store certain persistent data and the term wall State means that this bull state is like a universal state or like a state that is consistent throughout the entire ethereum ecosystem or the ethereum network that's why we call it as a roasted and um you can see there's an arrow here that's Transit from the first bull state to the second world state so in order to transition from one form of wool state or one form of database to another form of database you have transaction to facilitate this change right so to to give more concrete example right so let's say in this boosted like what I say it's just a database or is it it's just stored certain data let's say in this data in this state or in this database it says that italic has 10 if and Elon Musk has five if so you will send a transaction such that um the sender is vitality and the recipient is Elon Musk and the amount is too if so after this transaction is successful you will have a latest version of world state that states that okay retelling now has eight if and Elon Musk now has seven if right so as simple as that this is literally it for ethereum as a blockchain right it's just the change of state so when people say that oh I own 1000 if it's nothing more than just saying that okay uh in this ethereum state in this ethereum worst state I own 1000 if right so you don't physically own the assets but you you own the asset by referencing to the state right okay talk a lot about worsted and let's continue to the second one so if you think about transaction if you think about ethereum as a transaction based State machine that means that every time you send a transaction you up you update the worst date but does it make sense for you to keep updating the worsted from one to another right like after one transaction you you will have a second boosted another transaction third world state right only once transaction I mean one worsted is fascinated by only one single transaction is not efficient because um when you update the world state it will it will take some computational cost computational cost means money so instead of just one single transaction we bundle them into a block right so a block here is nothing more than just a package of transactions it could be a lot of transactions as uh as a as a block right so what it means here is that okay for the first birthday to go to the second world state it will run all the computation from these transactions here right after having after running all this transactions then you have a finalized State then this will become the latest full state right so a block is just a package of transactions so now if we connect everything together you have something like this right because like what I said um you you have multiple roasted at some time right so if you have a chain of worsted something like this it's followed by a chain of blocks so ethereum is nothing more than just a chain of States facilitated by a chain of blocks and hence the word blockchain right so nothing fancy right so this is the high level overview of um blockchain right as a whole now they understand the overview of what's going on behind the I mean um in terms of the high level side let's explore a little bit about each component and the first thing that we're going to explore is wall State what's inside the world state right so inside the real estate we have something called accounts right so accounts if you have your bank accounts what does your bank account do your bank account basically hold some money right so it's it's a thing or it's almost the same so in this case a wall State holds a bunch of accounts and if you look at what what are those accounts accounts are basically mapping of address and account state right so for those who have interacted with metamask or other forms of wallets or at least you have sent a transaction before you have something called like a public address or certain address so it's similar here where you have at your when you own certain account that means that you own the address that links to a account state right and the follow-up question that you guys might have is okay now that I know why it's account I know why it's posted what is account State what is this thing here what is inside the account state so inside the account State there are four things first one is launch second one is balance third is storage hash and the fourth is code hash right this is where things come become a little bit technical slightly more technical okay let's start with the nons so launch is uh it's basically a counter counter means that it can only increment it cannot decrement one two three four five six seven right so nonce is basically included in this account State as a form of mechanism that can prevent double spending so what is double spending um I think you can Google it yourself but um the point here is that um it doesn't allow people to spend their own their token multiple times at once right hence you um hence you have this launch variable right so if you want to know more about what what does loans do in more details definitely you can check it out but to summarize nonce is is a counter variable or a counter that can help to prevent double spending secondly you have uh the normal property called balance right so a balance basically states that okay this particular account holds how many if or how many ethereum right and the third one is storage hash um to summarize it's just a hash of a certain account storage but um if you want to go deeper I can take probably around one to two hours to explain the mechanism behind account storage because it's another huge topic but um you can just think of it as a a reference to your account storage and what we mean by account storage here everything here is bytes right or very low level basically and codash is the same thing as so it basically stores the uh code that can that you can use it to execute certain computation right so for things nons balance storage hash and code hash now that you understand what is account as a whole right let's explore what are the types of accounts typically there are two types of accounts not typically it's actually and yeah actually there are two types of accounts um the first account is called externally owned account eoa the second one is called contract accounts uh CA basically your smart contracts so if you look at the visualization here you can see that I I put this as a I think darker color it means that it technically doesn't exist on it technically means that I mean um for AOE story hash and code hash technically doesn't exist on account State okay I can't say that it thinking doesn't exist uh it exists on account state but um it's just empty value it yeah so but basically it doesn't have any use for eoa so you can think of this as you only have two main uh properties one for account State one is nonce and one is balanced so it's just a simple bank account right that literally just States okay uh what is your balance of this account right so this is UA and eoa most importantly eoa is control by a private key so again for those who have interacted metamask before you will know that if you set up a new account on or new wallet you will need to like and you ask you to you know save your seat face or your private phase or your private key or things like that because if anyone have access to your private key they will have access to your account and they can do whatever that they want with that account right so that's eoa and the second account is called contract account it's basically your typical smart contract account so this smart contract account would have everything that we stated just now we have non-balanced storage and code hash and most importantly here contract account is controlled by evm Foods right so to to put it more precisely um a contract account cannot initiate transaction um a transaction can only be initiated by an eoa and that transaction can do a message call on a contract account and um once you call the contract account you execute the code on stated by the contract account do some computation then update all the storage hash storage data and so on and so forth maybe we'll talk more about it later when I talk about transaction but this is these are the type of accounts that exists on ethereum eoa and contract account a color attraction is getting rid of the need of eoa uh I'm glad you asked because I'm also going to talk about a construction in the upcoming few days but to answer your question um the goal of account attraction in the future is trying to uh eliminate eoa that's the vision but in the short term it's very hard because when you say eliminate UA you're you're eliminating the First cast citizen in the ecosystem that means that you need to make a lot of protocol changes in order to make it happen um we talk more about our culture in the future but um that's the goal that we have it um but it's hard to do it yeah what the differences between seed phrases and private Key C phases is just a way to it's just a more convenient way for people to store their private key I I'm not 100 sure how do you generate C phrases even though I Google it yourself but um there is a way that you can generate seed phrases um such that it will become words right that people can understand because imagine that you have to store your private key it's like very weird looking right zero like uh six e one two three it doesn't have any meaning so if you were to write it down on the paper it's very hard for people to people miss one digit or may miss one character so it's not very user friendly by having a seed phase is is less likely for people to make any mistake and hence that's why I think people um or people in the ecosystem wants to go you see phrases instead of just the the normal uh decimal that you have from the private key or yeah other places yeah that's my understanding but definitely correct me if I'm wrong I'm not I'm I'm not the expert here I'm just sharing my knowledge okay let's continue thanks for the question by the way so quick recap we have talked about a few things we have talked about world state uh we have talked about an account so a worse day is basically um contains a bunch of accounts what is an account an account is a mapping of address to an account State what is inside an account state is non-balanced storage hash and code hash right so you have you have this worsted you can go to another form of worsted by having uh by having by executing blocks of transaction right so this is literally the blockchain basics no not yet we are going to export the next one which is transaction right so what's the transaction right um if you look at um from the ethereum point of view a transaction is basically an instruction signed by the external actor holding a private key to an account right so that means that you as a user you have your own private key you when we say that you have your own private key that means that you you can have you will have access to an account in the world state that means you can submit a transaction such that you can modify the worst date or to be more precise you are modifying the account that exists in the world state right so that's it for selection and there are typically two types of transactions the first reduction is called contract creation and the second transaction is called message call the first type which is contract creation basically means that you are submitting the transaction to create a contract right to create a contract means that you are modifying the worst date such that the world state right now has the new contract account right and the second type is called message call which is basically the same thing you are modifying the worst date such that um your account your eoa account can message an eoa another eoa or another contract account and notice here why I didn't put CA here right and the answer is because like why I say just now transaction must be initiated by an eoa right and that UA will message you call will you give a message call to another to an eoa or to another CA so no matter what if you want to if you want to initialize your contract account to do something you must always start with UA and um when I talk about a construction then we know we will know that why is this bad right or why is this not efficient enough right so but we're just going to leave it as this for now so to summarize there are two type of transactions contract creation and message call and to to look into deeper to look deeper into contract Creation in terms of the world State point of view if um a worth it let's say previous birthday is like uh address one two and so on and so forth and in the second world state or in the newer State you will have a new address right so as simple as that it creates a new mapping and for message call so previously you have an address an account State rate and remember account state contains storage cash and code hash so let's say um in once you initiated the transaction in terms of the message call you would update your storage right so to put it simply a contract creation basically creates a new contract account and a message call basically updates um an account yeah that's all right one is update one another one is create yeah and um yeah that's it for types of transactions and the next one okay evm ethereum virtual machine so um to be very honest I am not 100 expert in evm and um it will probably also take me three hours to explain what's what's going on underneath ebm because it's a really is a very hard topic actually and um so I can't cover everything but I'll attempt to give an overview of what's going on on what is evm right so but yeah it will be quite brief so evm here previously we mentioned that you submit a transaction it can be a message call it can also be a contract creation and then you will modify the worst date to become a newer state it should be asked to my bad but um or how do you execute all these transactions or how do you perform all these codes right or code functions and the answer here is by evm right so looking at this diagram here looks like it looks kind of messy basically it's taking um the storage of the account code of the account you're taking the input data of the transaction you execute perform all the computation then you update the storage right so this is what an evm does right so oops so if you look at the architecture of evm um you you look something like this you have a virtual read only memory so really memory this one stores it's not mistaken it stores the call data's input data meaning the input data if I'm not mistaken and um it will have a second component called machine State and the third component which is the storage right so in the machine State this is where the is the accepting things that that will happen so you have a program counter you have gas stack and memory so for those who are familiar with assembly languages and um yeah assembly languages or low-level languages for especially for those who are in computer science or software engineering then you would feel familiar with this this architecture because it's very similar uh to our com our normal computer architecture that you have right now in your laptop or in your desktop right so um yeah but again um it's very complicated and I I try to to simplify and try to summarize my credit so I'll just leave it at this for now maybe I'll try the next Slide the next few slide I'll try to summarize what's going on if ebm but yeah let's let's skip this first because it's very hard so there's something that is also important in ethereum it's called guess right so before I talk about uh what's going on here in the slide let me just talk about what the why you need guests like people always talk about Guest feed so let's imagine a scenario where you don't have gas right in the ethereum blockchain so if you don't have any gas that means that anyone can spam call the network that means that anyone can spam uh transactions on the network when you have a Spam like let's say a million of transactions sent in just a one one second you would clog out a network that means that the network will become slower or you freeze the network right in computer science term it's called denial or service right or dos so to prevent that from happening we have a concept called gas gas is basically a transaction fee right so previously if you let's say if you don't have any gas attackers can spam call the transaction um expand the transaction because they have no consequences of doing the the spamming but with the introduction of a transaction fee or gas in order for people to spam the network they will have to spend money because every time they make a transaction it will cost some transaction fee so if they want to spend 1 million times they have to spend like let's say 1 million um okay maybe let's say 1 million USD I don't know depending on the price of if so it's not feasible for the attackers to do so hence this is why gas is very useful to prevent like spamming attacks right so now that I understand why do we need gas let's talk about um this um new gas mechanism so you can see here following EIP 5159 okay so for those who don't know what is EIP EIP stands for ethereal Improvement proposal so it's basically um like what it says it's a proposal so that means that every time a community wants to improve the protocol they will send me a proposal and say that okay hey I feel like this architecture is better for uh for the for the ethereum network uh what do you guys think then people discuss and you know um you'll see if this proposal is valid if let's say it's valid then you implement this proposal in the protocol and then hopefully it will become you'll make the protocol become better right so that is what that is what uh EIP is right and 1559 here is basically it's a very special code for this particular proposal right it doesn't have any meaning and yeah it's for you guys to memorize if you guys want to memorize but yeah this is basically EIP so in this proposal um I think publish like I forgot which year but uh basically there are a few types of new gas fields and the first gas field is called base V is determined by the network and it's subsequently burned right so when we say burn gas fee right um oh I think one thing that it might come to your mind is deflation um I'm 100 sure it's um ethereum is inflation need inflationary or deflationary but if you were to burn gas or if you want to burn if or burn money from the entire Supply you are you are basically reducing the supply of of the money in the circulation so if you reduce the supply just economy you are you um the price of the the value of the money will increase right so that's why it's deflation but um um yeah I remember it's quite complicated for ethereum but it's deflationary or the inflationary but just start a check is deflationary because of the burning of Gastly but um I think it's more complicated than that but let me let me just put it as this for now so let's get a busy right you burn this basically of gas and the next one is called Max priority fee so max priority fee is like a tip fee you are basically you are paying the um oh you're basically paying the validator directly so that they can prioritize your transaction right it's like a tip line right if you want your validator to prioritize production to make your transaction faster then you pay them more right and the third one is called Max fee for gas basically it's the maximum guest fee that you are willing to pay right because you wouldn't want to spend all your money on just paying on the guest fee so there's a limit that you want to set such that it will if you exit the the maximum fee that you set then you don't you don't want to perform this transaction yeah so these are the things that uh yeah that's happening in the guest section right so yep okay next one just a summary of evm like what I promise just now right there's a lot of a lot of things happening behind evm literally a lot of things happening I think I spent like three days trying to understand but to summarize you will write a certain start contract right um You can write a smart contract in certain languages like uh solidity this is the most famous one or like I think Viper or other other languages um once you have written this smart contract code it's compiled into byte codes and it's this bytecode can be read and interpreted and executed by evm so when we say executed by evm that means that it's performing some sort of transaction I mean some sort of computation and then you modify the worst date right so this is the summary of evm right but again if you guys are interested into knowing what's going on underneath all these things I can send you a few links and hopefully you won't suffer yeah so next it was evolutionary now it's deflationary yeah thanks thank Nicholas um I remember I mean from hindsight yes but um I think someone did some calculation that states that um it's not it's not just social forward but um maybe next time okay let's not make it complicated because this is ethereum basics all right next um consensus right so um again consensus is also something that um I can take three hours to explain everything but I have very limited time so I'm just going to explain a very high high level overview of what is proof of stick and for those who are interested in the history of ethereum previously it was performed work now it's proof of stick right because of the merch which happened like a few months ago so yeah um yeah now we are we have proof of stick as a conscious algorithm so um this is how it works on the very high level overview it might not be 100 accurate but uh this is the overview so anyone can become a validator validator right so in order to become a validator you basically stick 32 if into a special smart contract so once you stick the 32 if you will become a validated right so what does validity data do is basically you have a certain privilege that you can vote for a certain vote for certain blocks or in this case the term here is called a test yeah or you can also be become a DOT proposer so you have a bunch of valid dictators and these validators or every 12 seconds they would um one of them would become randomly chosen to become a proposal so when you become a Blog proposal you can propose blocks to the network so again a block is basically a bunch of transactions so when we say proposed block is nothing more than just this validator or you yourself you are bundling a bunch of transactions into a block and submitting this um this block to the network right so once you submit the block to the network you get attested by others attested by others means that okay people will check all the other validated to the check uh is this bug valid or this box it is this block legit so let's say if everyone or or more than um or majority of the people or the validators think that okay this is legit then uh they pass your your blog then it will get included in the canonical nickel chain meaning the main chain right so yeah this is a summary but uh there's again there's a lot of things that's going on behind the scenes like uh for Choice rule you know different things uh how do you calculate the rewards and stuff like that but um let's not go into it because it's very complicated so to summarize um this new consensus upgraded or proof of stake ensures that if you want to be malicious you if you want to make any false transaction or you want to change the world State you have to you have to do it by risking your own money because you are sticking the 32 if you right um but yeah that's a summary of this and okay we are reaching the end I think yeah I think I really spent like quite almost 30 minutes so let me just explain about the future of ethereum we have already covered the technical technical parts so let's talk about the future uh with someone else okay now I'm just looking at the comments but yeah let me just continue so um I'm just referencing from vitalik's um roadmap and they have I think six or five um roadmaps that is running on Parallel so let me just explain one by one right so the first one I call the merge so the merch is um like what I said is has been done it has been executed a few months ago and I think they are still trying to improve it but basically this the goal of this the goal of the merge is to transition from proof of work consensus to proof of stake consensus right so yeah I'm just gonna skip it and the next one is called the search so the search is also something that's very interesting um that will happen I think very soon uh by uh with this eip4844 implementation so the search is basically trying to skilled uh entire network so I think the current transaction per second for ethereum is about 12 to 13 seconds per sec 12 to 13 transaction per second if you want to compare it with traditional banking system like or financial system like visa and or Mastercard they have like I think 100 000 transactions per second right so if you want to compete with those traditional web 2 system if you want to uh bomb more people into this ecosystem we want to scale our Network so hence we have the search right and the most I think the the one of the most famous one I mean the most talk about ones or the latest trend is Erp 4844 Pro denting yeah it's also very complicated maybe if we have a session to talk about it uh later I mean in the future yeah but yeah next the scratch I don't know how to pronounce this Scotch Scotch yeah this one is um I think more focused on Mev so me it basically stands for minor extractable value or maximum extractable value it basically to summarize is to prevent uh validated valid dictators from um exploiting the users transactions yeah but yeah you can Google it and watch the videos yourself but it's basically one of the uh it's a very important thing for so that people people don't get exploited people like you us like normal users won't get exploited right so yeah this is and uh the Scout I guess and the next one uh the verge uh the bush basically is uh just referencing from here referring a verifying block should be very easy this is more related to the storage um of the entire networks because if you have set up a full node um on yourself or ethereum node yourself maybe uh Kevin can talk we'll talk about the clients later but if you have set up a note yourself before the requirement to set up a node is very high especially in terms of the storage you will require about 2tb of SSD storage or to be safe I think 40b if not mistaken um so yeah it's like two terabytes it's very huge right so we want to basically reduce the the storage requirement for the for anyone to start their own node and also to um this also includes some um crypto graphic things uh stocks right to to facility of this price it's going to say yes that okay next we have the push this is more like um sweeping up things um we have different things like eip444444 right to um help to simplify a protocol eliminate certain technical debt and also to simplify certain things that it shouldn't be so complicated but yeah you guys can explore about about more of it if you guys want yeah stay expiry this is also something that I'm doing uh in my own work yeah um okay the next one uh the last one the split is to everything else and one of the things that is in this roadmap is account infraction right erc4337 so again uh I think I'll be talking about contraction in the next upcoming few days and it's a very exciting topic because to summarize account attraction can help to improve the user's experience so um that's that right um it's a very interesting thing and for me is um I'm very excited about it so yeah that's pretty much it about the experience roadmap so let's go if and have fun guys okay yeah that's all okay so thank you okay thank you so much uh weihan for a very very interesting talk I I personally really enjoy it and I hope everyone well as well um uh we unfortunately I don't think we have enough time for Q a but I think we have it will be around in the chat to answer your questions if you want but and moving on we will thank you again by the way thank you so much it was a great one uh moving on uh we'll have Kevin Uh Kevin if you would would you mind sharing your screen and uh okay we will talk about our next talk a little bit about Kevin he came in I forgot to introduce now both way and Kevin are are company members of if kale and they have also partake in many many hackathons and and uh I I the reason why like we hunt I think it might find we had a good person to to speak is because it literally started from zero in in the last uh half a year he managed to even land a full-time job as a blockchain engineer which is very inspiring and now we will have Kevin uh death of the engineer to talk about client related stuff I think he's a it's the right guy to do it so Kevin take it away okay uh just give me a second um can you guys see my screen yes yes we can foreign between search so this is the content summary to just keep a good idea of what we've covered so I'll be roughly going through notes and clients types of clients some current mainnet statistics in ethereum why client diversity matters and readable examples of packs and books uh which are somewhat related to client diversity uh last but not least you're featuring a tool from Netherland called search so I was trying to find a nice high level diagram um I found this from uh O'Reilly media I hope just sort of Paints the initial picture of what the network looks like I'm pretty sure everyone knows that um most blockchains uh in this particular case ethereum is a decentralized network and you could just think of it as a like a spider web and within the spider web you have a lot of notes uh there are different types of notes and clients are they are like like notes full nodes archive nodes and so on so that gives you an initial idea of what we'll be covering so nodes can be even in web 2 or traditional Computing it can be somewhat abstract term or in this case it's a any instance of ethereum client that connects to the network it's sort of like a Computing unit so to speak some of the terminologies that you may hear or see or read Are full notes like notes and archive notes so um you could process probably guess from the name so full notes full blockchain data however they do occasionally do prune some some of the data light notes are they just store some of the uh historical block headers um and then they will just sync all the recent transactions which are greatly reduces the storage requirements most notes that uh especially solos validators and mode Runners they would opt to use like nodes simply because they can save money on having a like a two to four TB SSD last or not these archive notes which just stores everything yeah in terms of clients um they are you can basically spread them out in terms of execution layer and constances sorry consensus layer I won't go too deep into this because uh quotation from behind it could I could probably take a couple hours just to explain this uh if I attempt it but yeah just to summarize the section of the Year basically does value this and broadcast transactions and the consensus layer it bundles the transactions from the execution layer PL uh with the additional additional information and bundle up as Beacon blocks um after least after this step if you were to run a validated node um you would actually propose this bundle blocks yeah so I got this from the ethereum.org website so these are some of the execution clients it may be very familiar to most of you especially gef which is the current uh dominant execution client uh coming up next here's another mine base at First Class you can see that these languages are all in different programming languages uh and there's a meaningful reason behind it and you can see the opposity different networks and sync strategies that we just covered briefly um there's one called Snap which I kind of missed out sorry about that so consensus layer which is formerly known as if2 um because after the merge event or the consensus algorithm part of fluid um which the node runs is split into like a different Computing unit so to speak and these are the Lesser known client names uh if you're not uh familiar with it so we have Lighthouse Road staff members prism and techu as you can see these are running on different languages as well and they have their own respective networks which they support foreign do we need you know different funds and how do they even work so this is a simple high level diagram which suggests that um you have your beacon look here which is uh AKA a consensus layer then you execution engine so in the background just to summarize they actually do talk to each other and they pass uh bundle transactions from as I mentioned from the execution layer to the consensus layer and after that it'll do its own thing and uh and send send out the bundle blocks to the network okay so now that we have covered a rough idea of the different clients uh I want to bring attention to some statistics so I just called it pull this out today uh and of course it may not be 100 accurate but uh it's the best that we have that is I have access to uh you can see on my left executing clients so gef is currently at 62 percent uh followed by the the domain Aragon and vessel and you can see that it's showing a red flashing symbol which is not good um on the consensus consensus client it's uh somewhat more help someone healthier as you see is someone more balanced between first and second place um of course you may Wonder person may Wonder um having such a large uh super majority which is what they would call it uh would it cause any issues and see and this is why um it client directly topic comes in so the receipt when it becomes a diversity applies to both execution layer and consensus layers uh imagine if a gaff were to have an e-box um it would actually be a risk multiplier um that's why as I've shown before or different teams and open source projects right in different languages to sort of even up the distribution um the actual goal is to have less than 33 of the market share for any given client in both execution and consensus consensus layer this is simply because the underlying code of the nodes or rather ethereum network is written in a way where um if any client goes above 33 if 10 uh dominance and if any issues were to happen it could result in slashing sorry in slashing which is a way to impose penalty uh that's just of course it's not always 32 if there's some calculations uh that could be somewhere complex as well and other risks also includes inactivity league and rebuilding finality which are I won't be covering here today so coming back to real examples it's always good to have examples um in September of 2016 during a Defcon held in Shanghai there were a few exploits in the get client uh among amongst the exploits were was a denial of service attack which actually slows down this Idol basically the read and write operations um running in Jeff clients and this actually slows down proposing blocks for people who are running gas and thankfully because of client diversity during that time parody was the second highest uh having the second highest market share um so the network was able to continue because charity client was able to continue its own block proposal which is of course essential to the network but it's gaffer to be a support majority and inactivity league would actually occur uh basically it would start sort of imposing penalties and slash until the uh second second largest majority uh who kind of balances out in simplest majority another recent example is the prism deposit wood block present which is one of the clients running under consensus layer so this happened in April 2021 so just to summarize this bug basically allows the prison client to generate invalid deposits uh and this also affects the prism clients to produce blocks and they actually sort of made them talked or not be able to produce values blocks for up to 18 bucks um thankfully uh nobody this was slashed um and there wasn't any gaps in it however the validators that are actually running prism missed two or three attestations uh which caused some minor uh rewards being restart oh so uh as part of the client diversity uh preach so it's good if you were running Geth or you know someone who's running Gap in for testnet or if you were to somehow develop stuff on it it's good to keep have this in mind and switch through lesser known lines for example as I've shown before Netherland is one of them of course you can switch to some of the other languages as long as it's not the main majority today which is gef and this from the clientdiversity.org yes a very Nifty tool you can just choose your current clients and 2B and you'll just suggest you a relevant documentation which you can read up and see how you can switch over so um that's the gist of it of in terms of theory so I'm going to present uh talk about search so search is a tool developed by the never mind team and they open sourced it basically it's a one-click tool setup um to for the network engineering validators of course for if you were a developer or you were just curious um you can still run it um it's because um if you're not doing validation just like me um you can just run the um the execution layer and consistent consensus layer and you can probably hook up three graphs and whatnot it's written in goal so that makes it cost platform because it can be compiled to to Windows Linux and Mac binders um of course okay all right so what does it do so I'm gonna show you in a bit so basically search is just a CRI tool and it just uh based on your desired uh setup and with so it's actually inclined and consist consensus clients it generates a Docker compose script uh if you're not for kids so maybe the docker Docker is basically a containerization on technology which makes it really lightweight for anyone anyone from different os's to run uh basically like little VMS yeah uh of course uh fair warning the tool is still in beta currently is at 0.6 um so it's good to treat this as a test um tool for now both so probably missed this one out let me just uh okay so um of course you would ask what are the test net and mainnet requirements uh of course Mainland would be much heavier but I want to focus on Chestnut so in testnet basically most modern day laptops on desktops you can probably run the test step um for example um you you need 300 GB of SSD um and I believe any basic internet uh would be sufficient so it's really easy to run chestnets however for me in that storm it really depends on the different concepts at the bare minimum you would need at least a Fuji on nuts so okay so um I'll show you how search works in a bit but uh this when you run the Tool uh just run search networks you can see that the current supporter networks includes on shiado which is a test net for gnosis um you have noticed some custom network if you can see of course you have your goal list and mean um if you were to run such clients or you'll spit out the different pairings uh and supported uh clients for different networks so you can see videos from on your right you have to growly the main net and these are the listed execution processors consensus and relative clients okay so um enough is for the talk I'll just show you how easy it is to just get up and running so right here I'm just click cloning from the GitHub people so once that's done um just go into the folder and run the compile so what that does is basically uh depending on your uh whether you're running Windows or Linux or Os you'll just compile to go source files into an executable and once that's done um I'll just change my directory to build and you just run the executable as you can see you have a list of commands here which I previously Twisted sort of printed shot clients networks and all the other um more advanced or detailed commands foreign so next up I'll show the running the CLI command but before that I'll just quickly go through some of the flags so what I'm going to do now it's a I'm basically doing COI I'm specifying my network to be sorry chiado which is the test net because I don't have enough storage on my laptop Dash C basically means that I want my consensus client to be like host and my execution layer to be another mine and philosophian um is you'll be used in some of the um in the Bell data steps if you would want to run the value node it's just your address of your wallet so once you run this command you'll just um I'll go through some of the details in a bit but basically it should just generate your document and as you can see it will say hey um do you want to run run the script and get everything started then wants to say yes he'll do his thing he'll start pulling the respective villages that you have designated and you'll start creating your container [Music] and that's really just it I've highlighted in the video where you can see um you have your consensus and execution continuous and these are the import mappings and some of these normal software information so let me just pull up my terminal um so once it's running the background you can actually just um check out the logs um it's going pretty quickly but I'm just cancel it but um yeah so what what it's doing is the background as you can see is the execution client is uh basically syncing and the order goes from after your execution client is fully synced uh your consensus client will kick off and after that's done um depending if you want to run it as a even as a test validator your validator client will run and hopefully that's easy enough to get everyone kick started just to play around with you know for free or you don't have to stick any real money on it um if you were to try sticking even in testnet I would recommend perhaps starting with CR2 test net um because it's I believe last time check is one over 32 of pest netease or in Shadows Network or test diagnosis yeah and uh okay let me just cover this uh obviously so as I mentioned before um what search actually does is just to um create the you can think of this as like instructions to run your um perspective or Docker containers so on my right you can see that song This runs a execution service in my middle it runs a consensus service or on my right it runs a gallery research um the actual file is quite long but that's the national research um it takes away all these complexity you just tell it what you need you join it for you and you just spread it um um I'm sure some of you may ask may think oh do I have to run this every time I I run my notes so the answer is no this is just the initial setup so let me just show you um oh this is I'll zoom in a bit so this is the actual output from your search CLI um if nothing goes wrong and basically you can just um all you need is really just this Docker compose dot yaml uh and you can just run against this um um when you want to continue your uh when you restart your computer that's uh like I said search is like a one traction unless you change too many parameters related to your um choices of sensation points circumstances points and coming back to his slides so yeah I hope that's unless you know your value of the tool called search by another mind you can um always check out the documentation if I can find it yep so they have uh documentation here if you want to read more into it and there's some the installation guides which is very similar to what I mentioned of course in more detail and uh feel free to contribute to the the GitHub request so everything is open source there's cynical which makes it somewhat easier to have more like rust or Java and stuff like that foreign so um yeah that's that's it for me thank you thank you Kevin uh right away we already have a question so the question is can someone interact with the network if they host a like note like using it with your wallet or custom RPC Etc oh yeah yeah definitely so um um I mean I mean um if you run a note yourself as long as you expose the certain um code mappings let me just quickly show you um so if you look at these fields right um as um I believe it's eight five four five yeah that's it so as long as you expose the respective support mappings for RPC I believe this is the one I'm mistaken you can um interact with your local and do what you need to do yeah so yes you can do that as long as your dog container um is configured correctly foreign nice nice uh thanks a lot Kevin I enjoyed the talk and I hope everyone enjoyed as much as I do uh we do have some time I think Kevin I think Kevin wouldn't mind taking more questions from the crowd uh but if you're shy you can always uh drop it down in the chat and I'll ask on it for you uh I think weihan is still here so questions for both of them are fine as well and if we have no questions I will like to tease a bit about our next event uh if I only can share my screen uh right no if I can only find out uh which which one to share uh so I've already created uh all of our confirmed online talks on Meetup and our share those uh real soon on telegram uh on the if KL Discord telegram group and also on the km hackathon discount book uh do check them out uh the next one will be on the 14th of February 9 pm uh by way hot again uh he's going to talk about account extractors simplified so remember just now among audience we we there was a little discussion about account attraction so that is where uh that is when you want to uh go for to go to uh go to to understand and learn more about construction and of course you can a few you can discuss about that uh in doing the session and right after that uh it's going to be another back-to-back talk at 9 30 p.
m uh it's going to be by me uh introduction to stockmat so stock is a layer 2 skinny solution uh on ethereum so for those who are also asking about how to how do we scale like there was there was a TPS to read the question um stacknet offers one of the solutions to that so two very exciting talks on February 14. and in February 15 we have a chiro talk by one Kang uh Cairo is a language on stock net and we will walk through why and why and why Cairo is important and what's so special about Cairo and on 16th of uh February this is going to be on 10 a.m because of time zone issues we invite scroll scroll is at an alternative to a stock net and whatever L2 schedulers out there so they are running using a ckevm method to perform scaling so again TPS questions this is another one that you want to check it out um back to the questions uh what is by uh uh what is the advantage of using RPC to send transactions retrieve data via OneNote versus providers for example Alchemy and infurah um yeah I'll try to chime in on this so um so you can imagine where sometimes for example um the default or PC provider in metamask um is insurer and of course um you can imagine if everyone were to use the same endpoint you would be somewhat competing with the other requesters and sometimes if you want really really fast submission or transactions um you could possibly think of using your own node or maybe like a hosted node with some of the cloud services so that's one of the main um um motivation most would use that and of course there are more like topics about like um censoring certain transactions from certain addresses uh which I will probably not go into so that's another thing to think about yeah it's just my understanding yeah just let me try and try me on that uh Kevin has touched on censoring uh because ethereum is a public blockchain that aims to be transparent so if you were to rely on infrar infra can can possibly uh reject your transaction and not include your transaction into the block so that's the risk that you may face so by having your own note uh you're guaranteed that this would happen uh there are also many many complicated stuff such as like mvv uh you know you get your transactions Fun Run and stuff like that but again this is a very very uh like another is another topic for another day um perhaps we can invite more speakers to share about those or perhaps Uh Kevin can share about those in the future okay I this is a long one I have one question that's regarding encryption standard of ethereum since Quantum company is getting much more powerful over time all standard cryptography needs to be swapped onto a more content resistance cryptography in the future hence my question is whether a migration to use any type of inclusion method on the ethereum part if it's hard how long of Declaration do you think it can be completed sorry for the long question uh I think I'll take that I think that's a very good question and that is uh behind everyone's mind uh but I've been following a couple of like podcasts and a couple of people are sharing their ideas on this views on this Quantum Computing is getting much more powerful over time but for it to be uh able to um crack like a check 256 algorithm it will take around probably another 50 to 100 years so it seems that everyone is not that anxious and again this is another string of ethereum because the developer Community is always building always looking out for the latest uh Technologies or vulnerabilities as compared to bitcoin developers who are uh who are happy uh by not uh with the stability that they have it the devs are much more eager to adopt adopt and change so yes uh yeah so yes this is something that will happen and if I'm not mistaken uh and with a contraction uh swapping out the hashing algorithm uh will not be too difficult if but there will be backwards compatibility combat compatibility dominating about so It's Tricky but not not impossible it's a it's a too long story answer all right uh excellent uh right so thank you everyone here hi hi hello hey uh hopefully it's not our topic but perhaps you can like share your experience uh your previous experience on like hackathons and stuff like that how you get ideas and stuff like that hopefully it's not our topic this is a great topic uh but but before that let me answer another topic please bear with me another question there's someone okay what if we have a breakthrough algorithms cause of Uncertain now the best organ we have is against Growers algorithm what if someone something is probably as uh Saul's algo against obviously come on Furious uh uh that's a good question unfortunately Nicholas I I I can't I'm not able to answer you but I'm able to point in the right direction there is a group called ethereum if r d in the Discord group that's where the core devs are constantly discussing about the latest protocol designs the population change but uh yes this is a very good question uh I'm not a cryptography cryptographically uh sound or choreography knowledgeable to answer that so yeah apologies for not being able to answer your question yep you're okay so hot yes um okay so back to your question about uh regular ideas and experience so uh again this uh let me stress the the goal of this hackathon the goal of this hackathon is for everyone to get hands-on experience of um hands-on experience on building their first web free uh applications or for the first time but of course it's open for everyone so feel free to join uh we are not we don't expect you to come out like super super fancy innovative ideas uh because this is only a small skill hackathon but if you have just go for it uh ideas we do have a couple of ideas uh there is one idea that uh that that came out that people that people have thought of but no one is building probably I can drop them down in the telegram later so that would help but how do we generate ideas normally uh we just have to how can I say yes that's a good question to be honest how do you how do I come up with ideas normally we it just comes by naturally and we bounce we bounce ideas among our friends or participants so for and we try to probably solve or tackle on uh on current problems such as for example if you think that wallet is uh the wallet ux is horrible we try to come up with a better wallet design and such is why account extraction is strong and account extraction is one of the recommended topics so if you're able to come up with a nice wallet uh who likes to wallet ux that that could be a very good idea uh and we also look at recent trends like what are people building on like ZK it's a zero knowledge is also something that people are building on uh how do you use zero knowledge technology to implement privacy on the public blockchain so that is something that uh you could be looking at but and uh previously um executions are expensive on actually it is still now on layer one but with the Advent of Layer Two uh executions are much cheaper much much cheaper so it opens the doors to a lot of heavy heavy gas expensive which are purely impossible um uh applications or protocols and now they are they're able to we are able to do that on L2 so that are also things that you can look into or some L tools will need uh infrastructures that are not existing on the l2s one common example that many many one has is a it's the name service I think I think everyone used to create like a name service for hackathon and we'll definitely get something like recently I saw that this is a file coin name service which is just like forgive me if I'm if I'm being a bit too harsh on this copy and paste from the ethereum name service and they got I think they made it to the finalists so not not to suggest you to copy and paste name service but uh probably you can look into what uh infrastructures applications that are available on layer one like mainnet but not available on a particular chain like scroll or stuff net because there are two-hour sponsors uh for yeah that's why I'm highlighting them but yeah uh yeah I think these are how we come up with ideas and I hope that's helpful and feel free to admit yourself again should you want to ask more oh I think it's that's a very uh good view of uh what what to expect and stuff like that oh thank you so much thank you so much you're welcome I hope I hope you enjoy the week and hope everyone enjoys uh hacking and building and learning that's the most important thanks once again uh thanks Eric to uh weihan and Kevin as well and to cheat to you as well thanks thanks uh yes thanks yes for sure thanks for speaking and thanks for audience for listening tuning in uh yeah your support means a lot to us okay we got another question uh I want to execute transaction on layer one such as updating on state state but I want to do it back on cheaper can I use L2 so this is a topic a question that will require a long answer I I I'll do that um the thing about Layer Two is that they are not directly interconnected so to say what layer 2 does is that they updates like the state they perform some transactions and then they will publish like the state change on layer one and with a proof depending on if you're optimistic or or validity Roll-Ups they're probably like a proof saying that the state chain is correct so you can think of layer 2 as a blockchain of its own that relies on layer one for uh data available data availability and uh for the uh how can I say the the validity of the of the of the state change I forgot the word yeah I hope that answers the question uh iPhone asks is there a recording for this yes it will be recorded and uploaded to YouTube uh as soon as possible all right I don't see any more questions and again I I encourage everyone to highly highly uh utilize the KL mini hackathon telegram group to look for teams bounce ideas uh and ask questions uh regarding the events regarding the workshops or yeah whatever you whatever you have post it there and a couple of us will go there check and check regularly so to to us yeah uh to help you and uh to make sure that you enjoy the entire week and do not stress out if you do not come up with a brilliant idea because uh number one it's free number two it's all for fun number three learning is the most important uh and again thank you so much and looking forward to all your submissions as Kevin says and I will see you on the 14th of February online so everyone bye-bye have a good one
Automatic transcript — names and jargon may be misspelled.