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

Loading player…

State of Layer 2 - Sandeep Nailwal

ETHGlobalSat, Oct 9, 2021, 12:00 AM

Sandeep Nailwal of Matic gives an overview of the Layer 2 ecosystem.

Transcript

bring about the state of lair to hot hot topic um and sandeep co-founder and ceo of matic is going to take us through all of that so very exciting sandeep are you there ready testing testing so perfect yeah okay okay so okay so i can't share my screen could you give me the right to share yeah looks like we'll just uh okay i think i hope my screen is visible and we're good to go oh yeah okay so yeah as simona said that very hot hot topic right now uh you know where exactly is layer 2 and you know what exactly is happening in the space especially with the with the crazy gas fees uh you know on the ethereum uh minute so primarily like uh the approach or the agenda for the overall discussion would be to you know have a look at the higher level parameters on which all like a layer twos like layer twos are evaluated and then uh you know kind of i would like to go through uh the individual categories that what all layer two approaches uh are being tried out currently and which all projects are uh kind of uh you know uh are kind of following those approach and you know what is current status uh in in some of those right so as this this is which should be as per my you know current understanding and i might uh have missed naming a few projects here and there it is completely unintentional okay so so let's uh first uh get into that you know what are the primary like uh parameters for like identifying layer 2 so you know one of the biggest thing that you would always come across is the data availability by the data availability uh i mean that like when the off chain execution layer 2 chain execution right something that is being executed of ethereum main chain so uh you know the primary question for any layer to approach is where the data is being stored right so uh like and that's one of the key identifiers for for layer two so for example uh you know solutions like uh you know plasma or validum or like any simple side chains they would be storing the data off chain that means the data is being stored by an off-chain mechanism and those mechanisms can also differ in in their approaches so for example for optimistic roll-ups which is which are kind of very hot right now for them the data is actually stored on chain that means the transaction data transaction data is actually stored on chain so those are the kind of primary uh you know like uh like differences in terms of the data availability of approach right second uh thing is uh which is very critical is that how are disputes or frauds detected or prevented uh you know in the sense that let's say you are you are having uh you know hundred thousand dollars on the side chain or you know let's say the or the layer two has one billion dollar in in the total value on the side chain uh on the on the layer two and then uh you know like the layer two actors decide to uh do something uh you know fraudulent or some some some particular person using the or some particular user tries to defraud the layer 2 and tries to cash out uh you know more funds than they own on the layer 2 from the layer 1 that is the ethereum mentioned that how do you solve those disputes how how does the you know frauds uh kind of detected and you know kind of mitigated in that sense so that is also like the second big idea for judging a layer two right so in that sense like i found a very good uh this thing like this was a very good uh post from starkware uh where they uh you know kind of differentiated for for uh you know differentiated between uh validity proofs and and forward proof so you know fault proof is nothing but fraud proof essentially so and then on the on the on the y axis they have uh the data whether the data is on chain or data is kept off chain and on the on the x axis you can see that whether it's a uh like validity proof for for proof and then they have mentioned about which you know where you can identify a particular approach so for example plasma so your data of the layer two that means the whatever transactions are being executed the data is being kept off chain by for a single operator plasma or like you know a single operator plasma like maybe like optical like omisego uh there the the data is being stored by the uh you know single operator whoever is running or a few parties that are running optimistic uh like uh sorry omisego uh plasma in case of for example matic have uh like you know 100 plus validators who would be running that plasma right so they are storing the data and you would yeah many would ask that what is the need of a multi-operator plasma right so like example of misago where a few people would be running or like a single operator would be running the you know the side chain where the transactions are happening versus automatic so the the the the answer lies in the data availability right so when we have uh like uh you know we since the plasma is storing data off chain in this scenario the data availability is being ensured like formatting why we feel that it's a better approach and and you know this can be debatable and you know have been debated endlessly but for us the we solve the data availability by building a robust pos uh you know set of operators instead of one operator running it which can go down or can censor your transactions here you have a 100 plus validators running the plasma over a pos state right so that's that's one way of uh you know thinking about it similarly for example optimistic roll ups as i explained so there they use fraud proofs and then i'll come to what is the difference between validity proofs and fault proofs also like fraud proves also but optimistic roll up so data is as i said the data is stored on chain because you actually store all the transaction call data on to ethereum and then since the transaction data is on ethereum the fraud detection uh or like you know is is much easier because you know you're storing the transaction all data and the state route and then if somebody wants wanted to uh sort of withdraw more than what they are owed and then there will be a challenge period of let's say from one day to seven days within those within that challenge period somebody could come and you know based on the existing data they can try to challenge that transaction right so so that's that's what uh like you know that's what happened with let's say optimistic proof optimistic rollups similarly uh another category of these fraud detection detection or prevention is uh you know validity proofs so in case of fraud proofs fraud proofs you know you can think of it like somebody has run run a fraud and then challenge period somebody can kind of come come and challenge it and then kind of slash a crypto economically penalize the faulty uh person who is trying to you know withdraw uh in a fraudulent manner instead of that like you have validity proof which is again again like very much debated that whether the validity proofs are better than the 427 all that and the reason being that in validity proof you rather than you know having a particular transaction done on the main chain and then somebody challenging it validity proof is at the time of withdrawal itself you check whether this uh you know whether this transaction or whether this withdrawal has a validity or not so that is slightly better in case of zika rollups again you have all the transaction data on chain so in case of validim like starkware uh the data is off chain managed by uh you know like what they call i think they have a committee system where the data is stored by the off chain participants and then on the main chain they run validity proof so this is one of the critical uh you know areas like fraud proofs and and you know detection mechanism the third one and the simple one is that who is actually running the execution environment like i gave you an example of let's say somebody running a single operator plasma versus a matic kind of environment where you have hundred plus validators uh running the uh you know the layer two execution environment similarly uh you have uh like as i mentioned about validum there also you know you have a committee of you know people who are executing or running the uh layer 2 apparatus to optimize where the entire data is being stored on ethereum so you have full data guarantee right data availability is completely uh secure and in terms of data availability there are multiple approaches uh like lazy ledger uh you know it's being uh is being tested out by uh by group and all that so yeah so these are these three are the primary uh parameters then uh you know let's go into the approaches of uh you know what all approaches have been uh for the layer two so they're uh like you know the the most earliest approach that have been tried is state channels where essentially you open a channel between two parties you have some sort of guarantee on the ethereum main chain and then these two parties take the tr take the execution off chain where you know let's say there is a chess game so you have a five ether bet on it on that so two parties will have a five ether you know kind of contract on main chain then we have uh you know we take the transaction and then you know we are playing the chess with each other uh you know sharing transactions with each other so you can see that the transactions uh like basically the just the signatures are being shared appear to appear so scalability is really really high over there but and but then if something goes into a dispute then we can bring all those transactions and then put them onto ethereum and then you know try like very verify that on ethereum itself and and you know the ethereum smart contract can identify that who actually was the winner or was going to win the this thing and they can settle the dispute problem is that the moment you take you know you do beyond of uh executions uh then uh you know it's very hard to get all that data and put it into a smart contract execution uh you know and then solve the disputes so that is one problem then you have other problems like what if the the one of the two parties or both parties lose their let's say they are playing a game on the mobile phone and then there is some problem with the mobile phone then the data is lost and those kind of things so that's why it has been like till now fairly hard to implement uh you know state channels in a in a very uh significant manner like i think counter factual seller they have been uh you know toying with that approach a bitcoin lightning network like i just mentioned it just to give an analogy bitcoin lighting network is sort of uh you know a straight channel mechanism connects network is is doing uh very good work with the state channels they are uh kind of doing and now focusing on the interoperability between chains so uh like for example we are also working with connect steam where uh let's say from layer one to layer two withdrawals and deposits can be used via connect stage channels so that can they can be much faster currently if you have to deposit onto like let's say matic layer two it takes around seven eight minutes to uh because you know you need to have a confirmation on ethereum main chain then the side chain actors need to do their consensus and then you get the credit on the layer two right uh so instead of that you could use a you know connects like state channel which you know carries some liquidity similarly it's it's actually more prominent on the withdrawal side because in the withdrawal you have to wait for at least 30 minutes if you're using simple pos security and you know around 7 days if you're using plasma so you can ensure like almost instant kind of transactions for that so that is like one i think uh you know upcoming use case of state challenge but apart from that like uh you know apart from few games that are there on the seller platform uh you know state channels are still in that evolving approach uh evolving you know kind of mode and still like uh you know for production ready state channel systems we are still uh you know we are still not there uh similarly then there is a side chain kind of mechanism wherein where they can have a simple uh you know mechanism of of running the consensus on the side chain and then uh you know they you simply have you simply have a bridge between ethereum and then the assets can move to and fro between side chains but once the assets are on the side chain the the problem is that once you have the assets on the side chain then the assets are fully in the custody of the sidechain actors like if sidechain actors decide to collude and then decide to do uh anything fraudulent then you can't really do much with that so for example like you know loom network had the plasma chain poa network uh you know uh was started like two three years back but you know again because it's it has a proof of authority that means seven eight uh validators are running uh the the side chain then you know the system essentially becomes a trusted system the same goes with the like x die uh system also it's like almost like a poa but then it die as the gas piece mechanism so which is uh which which provides a slightly better user experience but then the side chain actors are you know few in numbers seven eight maybe ten in number and then you know they have to do a consensus on uh like uh you know between them and then if you are doing any deposits withdrawals your your funds are at the custody of like seven or ten withdraw you know this thing uh players if you consider only the pos approach like as i said that and i'll cover it slightly uh later on for example for matic network so if you if you as a if you are developing something which only relies on the proof of stake uh security of uh matic then also matic uh you know evm chain will also become a side chain in that like you know in that sense you can think of it uh but you know only difference that we feel is there you know you have 100 plus validators unless uh yeah this is this is also there's also one more criteria that whether the sidechain actors are you know permissionless and decentralized so you know in case of matic anybody can come in and become a you know a valid editor on the side chain uh whereas like you know with poa or xda it's a proof of authority kind of system uh or a dow kind of system so dao has to decide who can come in as a validator or not so those are slightly the differences uh in that sense uh this i already covered then uh plasma so in in terms of plasma what is actually happening is that you have a you know uh side chain uh kind of like sidechain environment where the execution is happening on the side chain side chain itself but then if like when you are withdrawing uh but plasma has its front proof so i also showed the the same table right so uh you know when you are withdrawing and in case there is a fraudulent uh you know kind of withdrawal or the side chain actors go rogue uh and you know try to try to you know uh kind of try to do fraudulent exits or something like that then you know you can go to the ethereum main chain and actually uh run fraud proofs for example and then uh you know try to slash the fraudulent uh you know kind of actors so you know with plasma these these are the two main things like the the assets special specifically the assets or in case of mating you have something called predicates so anything that is predicate enabled uh whether it's a smart contract or it's a payment with anything that is uh predicate enabled for that you can actually uh if if you if you you know don't trust the side chain then you can go on to ethereum and then you know challenge uh any particular transaction and if you are able to you know successfully challenge it then you get to slash all the people like you know in case of matic i i told you that you have hundred plus validators and 66 percent of them have to sign it so if let's say they signed on a fraudulent transaction and it became a checkpoint so one important part of plasma is also that whatever is happening on the side chain the sidechain actors keep checkpointing it to the ethereum engine you can also think of them as a commit chains right so uh using that commit if you don't trust the side chain or you you know kind of want to like challenge it you can go to ethereum and you can challenge any particular transaction if you are able to prove it in case of magic you get to slash at least 66 percent of the participants who actually signed on the front line transaction so that kind of provides you slightly more security as i was already mentioning omisego that doesn't have like 100 like you know multiple validators over there it has a few operators i'm not sure whether only omisego foundation is running it or there are few external parties also but essentially you are like two three uh you know participants are running or few participants are running the side chain and then you know if something goes wrong then you know you are essentially there is some level of trust involved in the the sidechain because you know one uh one problem is that what what if the sidechain actor simply doesn't even share you the data like this uh blind you the like that's that's called data withholding right so if they withhold the block data then you know there it might be difficult for you also to kind of uh go and challenge on interior so those kind of scenarios also uh emerge uh with like less operators in case of matic again i might be biased because i am i'm speaking from matic network right so being one of the co-founders but with magic we feel that you know having a multiple like hundred plus validators permission less and wd decent like it's very hard for uh 66 of them to collude and you know try to uh do something fraudulent with the network so yeah that's that's one approach other other one part other part also is censorship resistance so uh let's say if only few people are running the the side chain or the you know layer 2 apparatus then there is a possibility that you know some of the few actors actually uh might end up you know censoring a few transactions right so uh you know what if you have more decentralized actors on the side on the layer 2 apparatus there is a possibility that there will be less you know degree of censorship if at all right so that's that's about plasma uh one you know issue with plasma that is always cited is mass exits so mass exits is a is a is a scenario wherein uh let's say side chain goes rogue or maybe you know uh like the side chain operator that i said that you know if single if it is a single operator group or in case of let's say matic networks let's assume in a worst case scenario all 66 percent of them go rogue then everyone will have to exit their funds to the main chain and that scenario is called mass exits right so and it has been cited as one of the bigger problems in the plasma design and you know again giving the perspective from the matic side like we believe that you know if you have larger number like in this scenario 100 plus validators the scenario where mass exit can be a reality is is like almost like negligible or like highly uh you know kind of uh mitigated but let's say if you had less number of people running the layer to apparatus or you know running as operator then it becomes like a significant uh problem right so that's why we believe that having is you know kind of secures that and uh then uh like for eight plasma as front floors i already uh said also one more thing is that because you have to prove things on ethereum like with the fraud proofs you are you essentially want to prove things on ethereum so if you have generic smart contracts right like an arbitrary smart contract which let's say some defy landing borrowing platform uh smart contract that you have it's it's you know you you cannot have a direct like a generic like nobody right now there is no generic fraud proof mechanism for every smart contract so for example in case of matic if let's say you have some standard operation let's say you know fund transfers uh dexes and all that for all of them you have something we call predicates right so you have those uh you know standard fraud proofs for those uh you know standard use cases but let's say you had an arbitrary contract and you wanted them to be fraud proof that means you wanted them to be very favorable on on the on the on the main chain then uh you know you need to write a specific predicate for it right so for example uh you know we've been experimenting with auger team right so you know building some uh fraud roofs uh alongside them or predicates for for the augur kind of markets and then you know i think with each waterloo i think joey had also uh mentioned about about them so something like that so in terms of the genetics for generic smart contract even automatic although you have an evm but if you want to have your generic smart contract to be plasma fight you could use like a simple you could rely on the pos security of these hundred plus validators but if you wanted to use uh like you wanted to have the plasma verification available on ethereum engine then you would have to write uh you know your predicates that's one criteria over there now the the rule ups which are like kind of uh you know uh you know younger in that uh in that whole category of uh various approaches and they are you know also picking up a lot of traction because uh we as we mentioned that uh you know uh like mentioned about the data availability because the data availability is on ethereum itself so you know there is more security uh for for the like in case of fraud in case of fraudulent transactions and things like that so finally there are two kinds of roll-ups there is one is optimistic roll-up and then there you have zk like zero knowledge based roll-ups so in that sense like optimism is doing great work with the optimistic roll-ups and you know recently you many of you guys would have seen the launch of uh like the test net of optimistic uh you know ethereum and arbiter is also one uh you know a very important important player there and they're also doing some cool work plus you have you know other participants like interstate uh i you know accidentally i think i have not mentioned few labs they are also like you know uh doing a pretty cool work on that uh so that's that's there and in terms of the zika rule ups i think lubring is is one of the biggest example again that is not mentioned over here apologies for that so for zika roll-ups uh new bring is there um zk sync is also i think zk sync is also building on zika rollups uh so those those are the examples looping and zika would be the examples of zika rollups uh and then you know like from our side also we also are exploring with various approaches around the zk uh based solutions but yeah more on that later so without with the rollups uh you know you have higher ethereum security but then since you are putting all the transaction data on to ethereum itself then there are scalability limits because you can only put certain amount of data on ethereum right essentially you are running those uh transactions and you are putting all the data on to the ethereum engine then uh you know as of now as of yet i i feel that you know the developer experience is also not much sorted because most of these solutions are still in the evolving stage and none of the solutions is like uh the production ready except i think uh loop green uh which has a few applications but i i don't i i'm not sure how many uh you know third party developers are building on that but then you know looping has also been uh uh you know one of the more production ready uh solutions uh zk sync also i hear few uh teams are using uh and then uh you know like one of the other things is that till like very recently uh optimistic roll ups uh where you used to be application specific that means you have a tab specific uh rollups uh and then uh you know that that actually kind of hurts the composability side of things uh but then if optimistic roll-ups are able to evolve into generic uh shared chain kind of roll-ups that would be uh very interesting and i i believe optimistic uh optimism and arbitum team both both are doing uh really uh working hard on that and if that comes in i think it will be uh it would be pretty cool and then you know one one other part is that since the roll-ups are run by few parties like you know one two three maybe five participants then there is a higher chance of these uh parties polluting and then you know maybe uh doing censorship so uh you know on the censorship resistance uh i'm like yet to see more uh you know formidable solutions on that there are some solutions proposed but uh i i have not seen a like a production uh or theoretically even theoretically a more uh kind of uh sustainable uh solution on that so yeah so uh lastly like these these four were the you know these these were the primary approaches lastly i would take like four five minutes on explaining why uh you know what what exactly is matic network and then uh you know like how is it uh how is it uh you know why it is getting so much traction i'm pretty sure most of you guys would be uh you know hearing about a lot of applications uh building automatic uh you know even the now some of the d5 protocols are also uh you know looking uh to build on automatic and few of them actually went live recently uh you know got some good amount of uh you know like maybe tens of millions of tvl so what matic is like i was explaining that it is a hybrid uh you know proof of stake and plasma why i say so because you know as i said that it's a multi-operator plasma that means uh the uh you know uh uh that means the uh the the like multiple operators like this proof of stake network of hundred plus validators they are running the plasma uh you know automatic so out of them 66 percent of them have to sign on a particular checkpoint and then it goes to ethereum and then having so many uh you know number of like large number of operators it also helps in terms of censorship resistance and more decentralization and the data availability because you know we assume that if more than 66 percent of like it's very very rare that more than 66 percent uh of the validators will pollute and you know uh it's very very hard for them to do that and uh i think like 100 cosmos thing which is a layer one so you have a layer one level of security on the on the layer two pos so that makes it uh like that's why many developers simply choose to build on the pos system because it's much much more developer friendly and user friendly but then the solutions like uh you know which which have it might have high amount of uh money involved in that and they want ethereum you know uh ethereum security they might use plasma okay um okay so then yeah developer like one of the bigger benefits of matic is that you know it's a full evm based solution so if you are building anything on this thing and i would actually uh you know love to request or invite every one of you like instead of let's say using a you know test net you could simply use the magic you know sidechain even on the main chain you could run your entire application on the main chain and you know test it like hundreds of times because right now the fees are like uh i think around ten thousand two hundred thousand times like ten thousand times less than ethereum so basically you can in one dollar you could do like maybe from 5000 to 10 000 transactions so you could actually you know show your application running on main chain or maybe on our mumbai test net both are and the good thing is that on the on these on matic network the the the section the block confirmation times are two seconds only right so you could go to explorer.matic.network there are more than half a million transactions that have been done by various applications and the user experience goes you know top-notch so i would like you know love to invite all of you guys to use the matic test net as your test net because you know the user experience and much those things are much uh higher over there and then you know acquiring uh you know test heat from one it's much easier uh automatic to acquire you know for testing right so use it as a test net and see what your developer experience is like and then if you like it then you know we would love to uh you know help you out in terms of developer tooling that is also one of the bigger you know benefits that most of your developer tooling which which include like your wallets your web3.js uh you know oracles so chainlink for example you know matic is going to be the only second chain i think after ethereum where chainlink is you know expected to launch their uh mainnet uh uh you know like uh the second tm and then your remix id your ganache uh and your truffle everything works out of the box so that's why like i think it's it would be a great start if uh you know many of you wanted to try it on the mainland on the test net side and uh you know have a better user experience and then you know already we are seeing all the number is around i think 70 even now and then 50 plus the apps but safely are on the main net right now uh the number of transactions also today would be would have caused like 600k 130k plus active addresses and around 12 uh million dollars in the tvl in the bridges so you know for defy for for all of you are looking to build device uh you know applications also uh for the hackathon would love to uh you know connect with you guys and then we also we have a very solid developer support program where we if you have a cool product which you think that you can take it to mvp stage we you know provide uh you know that developer from our site and we also have a building uh actually give out for early stage applications right so we give our dollars monthly uh you know one of the uh you know attacks and that i think uh from the bitcoin uh you know donation round and one of the dapps i think they have got like eleven thousand dollars so it's a good like you know mechanism for you to kind of experiment in your uh with your application when you're in early stage and then you know we also help many of our applications recently which are ecosystem applications we help them to raise funds also and then you know all those things so if any one of you like goes to that stage after your hackathon and you want to reach out please do reach out we're there on the discord site right so that's all from my my side uh yeah i would love to take any questions great thank you so much sandeep um actually we're

Automatic transcript — names and jargon may be misspelled.