# 'Exploring the Layer 2 Spectrum' - Sandeep Nailwal

- Speakers: [Sandeep Nailwal](https://streameth.org/speakers/sandeep-nailwal)
- Channel: [ETHGlobal](https://streameth.org/ethglobal)
- Date: 2021-10-09
- Duration: 27:41
- Topics: ethereum, scaling, ethglobal, polygon, matic, sandeep nailwal
- Watch: https://streameth.org/watch/yt-qJE0MvyTJv4
- YouTube: https://www.youtube.com/watch?v=qJE0MvyTJv4

## Description

Sandeep Nailwal of Polygon covers a variety of approaches to scaling ethereum via sidechains.

## Transcript

for our next talk and i'm super excited for this one uh here we're going to be learning about what the whole layer 2 spectrum looks like and especially kind of from the perspective of polygon previously no asthmatic and we have sundeep and mahalo telling us about this from their end so both of them are here i'll let them turn their videos on and kick us off and i'll take let them take over from here so welcome sundeep and welcome me hello thanks karthik thanks for yes having us here and yeah like uh amazing work uh you know as as always by eat global so yeah uh uh you know so thanks thanks for giving us this opportunity also to talk uh you know in general about the uh layer two spectrum um so we wanted to like you know give uh you know with this presentation give a larger flavor of something that we you know these guys call as ethereum scaling techniques because you know there is this there's a lot of information that gets uh you know missed in the semantics so uh you know you know at the very last stage i also asked my uh fellow co-founder mihaly also so hopefully we'll be able to give you a decent flavor of like what all is there when we when we talk about uh you know theory ethereum scaling techniques so yeah so we'll get started uh i have okay i see i have screen sharing right so i just this is not a presentation or anything uh i have a you know basically a very very simple um kind of you know few notes actually you can say these are my notes basically i prepared just for this presentation so you know it's a very uh simple thing so so yeah so i mean at a very very very simple level you know the goal for all of us is ethereum scaling right so um you know at the end there are various different uh kind of uh techniques and i've also tried to create a you know kind of a spectrum in some form where you can actually see what all mechanisms are possible and then you know just kind of touch base more on this layer two semantics also and what exactly constitutes a you know a layer two and then what can what might not be layered to but then still is working towards uh let's say uh ethereum scaling uh you know technique like we uh you know we'll talk about some examples also on that sense but first of all i you know uh want to talk about two key things here and let me see if i have that pointer here uh so you know the two main thing like uh when we okay let me let me start from here so you know like when we talk about ethereum scaling techniques there can be a lot of different flavors there can be side chains which are standalone chains there can be you know one a different flavor called commit chains which commit some some some proofs to the main chain ethereum main chain then there are you know validum kind of solutions and then there are kind of you know layer two which we can which can be pure layer two kind of solution so uh so let's let's uh you know first start from what constitutes a layer too right which where we can uh you know kind of see so two key parameters over there are first is like dispute resolution uh where you can even also see my you know kind of cursor and then the other thing is the data availability so here we have mentioned that you know the data availability is uh basically whether it's on chain whether it's an off chain and dispute resolution is what kind of dispute resolution mechanism you are using in case uh the off chain uh so so let's take a step back like what exactly is layer two or scaling technique how we are trying to scale ethereum we are trying to do some of these computations of chain right and then uh so that you know ethereum main chain doesn't have to have so much of uh you know computation it has limited uh you know kind of bandwidth in that sense so how do we do that uh so these two things dispute resolution and and and you know data availability so when you're doing this computation off chain you know you need to make sure that if it's a pure layer two which is completely dependent on ethereum you need to see that where exactly the you know the whatever transactions are happening on the off chain where the data is being kept and how the dispute resolution will happen in case the the off chain uh you know there is some sort of fraud or some sort of you know inconsistency in the uh you know in the off chain uh you know kind of computation so these two things are get very important over there that whether the data whatever you are computing on the layer two whether the data is on uh data is available on ethereum or uh the data is not available uh directly on ethereum layer and then how are you going to solve the dispute so primarily we have two main categories over there uh one is uh you know like on chain as i said on chain and off chain data and then in dispute resolution whether you have validity proofs or whether you have uh you know uh fraud proofs uh to kind of resolve your uh your your uh like dispute for for the for the for let's say if there's a dispute arises uh you know whether you're using fraud proof of that the difference between validity proof and fraud proof is so fraud proof is you know you can already see the by the name that if some fraud has happened then you can prove uh that fraud uh you know engine of using a smart contract where you provide some sort of information or a challenge and then you know it can be an interactive fraud proof or it it can be a you know single interaction for proof and things like that and a validity proof is more like you know when somebody is trying to exit uh or you know from the layer 2 and you know and then the valid it checks for the validity of that exit right at the time of the you know exiting right so based on that there are you you can see there are primarily three four kind of uh you know mechanism so you have uh like when you have the on-chain data right so and you are using validity proof they are called zika rollups when you have on-chain data and you are using fraud proof for your uh you know dispute resolution it is called optimistic roll-ups similarly when you have off-chain data and it's a it's a validity proof then it is called uh you know validum and uh you know valid like good example of validum can be for uh this thing let's say starkware's uh solution uh recently uh matter lawyers also announced their zk porter so i think that will also fall under the valid category because they are talking about a data availability uh you know solution on the on the outside and the dispute resolution will be on the on ethereum major so so these are this thing and then when you have the off chain data and then you are using fraud proof though that that category of solution is called plasma and then you have some hybrid kind of categories also like volition and optimistic pollution these are like you know more evolving techniques so largely this is the spectrum uh mihailo if you you want to add uh anything more to this particular spectre this thing or you know explain more about the hybrid side of things uh feel free to chime in otherwise i'll you know kind of move to the other uh yeah sure maybe maybe just a few quick um a few quick things to follow up on what you said so uh yeah basically it's like this is uh basically two by two metrics and sandeep already says we said they've even either have validity proofs or fraud proofs validity proofs are just proofs that are proving the validity of a whole batch of transactions and we are also popularly calling these type of proofs zk proofs so these are basically succinct cryptographic proofs that the whole batch of transactions is valid and that validity proof is validated or processed on the theory of mainnet and that is how actually uh these types of solutions are deriving security from from ethereum so this is uh um these sorts of proofs are by default non-interactive uh uh on the other uh on the other hand we have fraud groups which are by default interactive or reactive if you will so what does that mean basically um for fraud proof based solutions uh it is necessary that some party ideally the owner or the end user so if you have some funds that are in a solution that is based on fall proofs uh ideally you should be monitoring the the that particular chain or that particular scalability solution and in case you notice some malicious activity you should ideally or some third party that you might then necessarily have to trust um should submit this challenge that sandeep already mentioned so uh that is kind of a major difference between validity proofs and and fraud proof validity proofs there is no there is no need for that sort of constant monitoring of the the the scaling solution ie activity in it so that is i would say one one advantage of validity solutions um unfortunately the tradeoffs the trade-off visibility solutions there are multiple i guess all solutions for your traders but basically validity proofs tend to be larger in size than to be computationally intensive it is kind of not trivial in terms of computational power to generate these zk proofs um the cryptography is still being improved um many of these solutions excluding probably only stark fare because they're validity proofs are based on stark which is a separate type of a separate flavor of cryptography that doesn't require that thing called trusted setup all other solutions are actually requiring that trusted setup and trusted setup is basically a ceremony where you generate some initial parameters that are required to actually later produce this these uh qualitative proofs and this at any point this ceremony this trusted setup ceremony is compromised um there can be basically any any sort of exploit and the the entity that managed to compromise the trusted setup is able to basically steal users funds and steal them in a very um if i may say catastrophic way because the the the ethereum mainnet would just process that uh that fraudulent validity proof without even being aware that is fraudulent because the the setup is compromised so yes i mean we can talk we could talk for hours basically about these solutions but but yeah and uh maybe just on the other side cover the other side of the matrixes and that is basically where the data is stored if data is on chain the situation is very clear in a sense that uh we that's the highest level of guarantee that the data is available but one made and that's why these solutions like optimistic roll-ups and zika roll-ups are so popular recently because it is like a trivial way to solve data availability problem that is basically a pretty challenging problem and however the major downside of storing data on james that you're kind of continuing to to clog the ethereum and we all know that the capacity of the mainnet is very very limited and that is why we should i guess as a community be aware that optimistic roll-ups and zika roll-ups are very exciting solutions but uh they are not unfortunately long-term solutions for ethereum scalability because again we are storing all these data on ethereum mainnet thus ensuring really high guarantees for data availability the highest guarantees but we are significantly limiting throughput of such solutions so to to put that into perspective the kerala ops and optimistic roll-ups can offer us maybe two orders of magnitude of scalability improvement which is i guess we will all agree not that uh not that amazing on the other hand these off chain uh data variability solutions don't have that trade-off but it is as i said data availability is a challenging problem it is pretty hard to ensure or guarantee data availability if the data is of change so there are basically many techniques that are being explored but none of them of course can offer the guarantees of ethereum so with any scalability solution basically the point is it's all about traders exactly yeah so as you you already saw that you know the the the the on-chain like with this kind of category on-chain data it's really secure and with if that's why we call them roll-ups because even if let's say the layer 2 setup completely goes for a toss you can actually you know roll that chain like you know kind of create that chain back from the available data uh so it's much more secure uh you know in terms of any fraudulent uh kind of uh events or fraud events uh but then it has limitations because the data is on ethereum engine same but with off chain data that trade-off is not there but then if the the data availability setup goes for a toss then uh you know the it can be catastrophic as miaow mentioned coming to the then other kind of solutions how like you know these like again the the pure layer two because see again on a higher level if you see the the the trade-offs at the end you want ethereum to safeguard the off chain setup so if you want ethereum to safeguard the uh you know layer to set up then it is going to be costly so and then you know there can be a lot of use cases where projects don't do not or kind of the solutions that are being developed they do not want uh let's say you know that high level of security like you know for example uh some sort of nfts like you know small ticket size nfts or you know somebody's issuing let's say tickets of the events and things like that so there are huge number of you know use cases wherein you might not need that level of security like me hello at times give that gives that example that you know do do you want like a global uh level like ethereum main chain level security for uh for for uh like a convenience store's transactions right so it might not be required so the the philosophy and then you know like right now we are not speaking too much about the the polygon but the idea of polygon or the core thesis of polygon revolves around this that ethereum is going to be the ultimate settlement layer and then on top of it you will have all of these different techniques like layer two techniques so you know for example we are also working on these some of these optimistic roll-ups equivalent related you know techniques we have our plasma you know solution and like the proof of stake or the commit chain solution already live uh we have we expect to you know kind of launch uh like more solutions like which i'll talk about like shared security solution for ethereum which let's say you know you the popular example for that is let's say polka dot where polka dot is trying to create a shared security layer where which will be a central chain and around that you will have uh you know para chains so what we want to eventually build is and in some form the matic pos because it works using a validation layer if you want to go deep into that maybe we can talk offline that you know there is a sort of a beacon chain and on top of which uh you know the polygon commit chains work so they can actually the same security setup can spawn off multiple such chains right so that will kind of in some form might look like uh you know a sharded kind of architecture or like a polka dot kind of architecture on top of ethereum so our approach is that you know what uh polkadot is building as a separate ecosystem we you know want to offer that uh you know opportunity for the ethereum uh you know developers wherein they can spawn off their their you know like i don't want to call para chains but let's say standalone chains using shared security security mechanisms run by the polygon validators and they all uh you know kind of center and connect into ethereum um so that's that's that's one way and then you know you can also have standalone chains so standalone chains means uh for example uh you uh standalone chains can be like this like lazy laser is one you know or very off example although it's more into data availability but then the you know the examples of completely standalone chains can be let's say let's say x die chain which is a standalone consensus everything is you know separate or you can think of like cosmos like chains which are which are completely standalone chains so with polygon and we are you know coming out with something called uh polygon sdk in some time which will be like something like what you have substrate in the polka dot ecosystem or cosmos sdk in the cosmos ecosystem wherein you can spawn off these uh you know ethereum compatible or evm compatible chains uh which can then uh you know work on top of ethereum or connect readily connect to ethereum and then finally uh i want to lastly you know kind of show this spectrum that you know this is ethereum scaling techniques like whenever you are thinking about it you know think of them as a as a larger uh kind of uh you know larger uh this thing uh like larger spectrum wherein on the complete left side you have a lot of side chains which are contributing back to ethereum like you know there is like x die is a very good example that that's a completely standalone chain but uh you know they are hosting uh quite uh you know a lot of ethereum uh you know applications like uh you know people are building uh a lot of casual as well as uh you know some d5 applications and daos have been built on xdi so you know they are also contributing back to the ethereum ecosystem similarly uh you know the next like and and when you see this this this this line basically consider the left extreme the the the side chain extreme as completely standalone which does not depend on ethereum's uh you know security at all and then uh the the right extreme that you can see where i am posted as layer 2 this right extreme is completely secured by ethereum so and then the things there are multiple then you know these things bit in between so side chain is on the left left spectrum then you have uh you know polygon pierces a commit chain where everything the the the the staking every staking happens on ethereum main chain the the slashing the reward systems everything is on ethereum and this is a very very kind of coupled chain to ethereum and then uh you know if let's say there is some fraud happens on the layer two if it is plasma then you can actually you know uh uh exit your funds directly from the main chain but even with the with the normal pos chain if there is some fraud happens at least you you have the slashing available for the you know the the validators which are validating the commit chain so that that's one layer above let's say a normal uh you know side chain and that has some security benefits in that sense but then one layer above that would be let's say validum kind of solutions which as amihallo was explaining that the data is these are pure layer two solutions but then if let's say the data is being stored off chain there is certain level of trust assumption of the uh you know the the off chain data availability providers if they go for a toss then it can be catastrophic as emily mentioned but you know as far as that layer is is secured enough you have uh you know a fair amount of uh you know security of the ethereum uh main chain uh and and the last and the bigger like the most uh secured solution by uh you know by ethereum main chain are uh you know your pure layer two solutions which include zika roll ups optimistic rollovers because they're both dispute resolution and the uh you know the data availability is directly on ethereum main chain so they are more secure there are other solutions like state channel and plasma which have been explored before plasma has like you know although everything works fine for transfers and all that but then there are there are scenarios of let's say mass exit wherein like some chain goes off and then everybody is trying to exit and ethereum main chain gets clogged and all that so those kind of scenarios are there but then there are mitigation techniques uh you know with dynamic withdrawal periods and things like that and with state channels like you know it is specific to or kind of uh you know people have or the community has realized that they are useful for certain kind of mechanisms if you want to see state channel based solutions you might want to look at let's say connects network host building now this layer 2 and layer 1 bridging solutions so that also those are also you know interesting solutions uh yeah and on somewhere between this layer like i think before that i think scale network was doing doing the presentation so scale network will also lie somewhere somewhere here because you know they are the because i think there's theirs taking and everything also happens on ethereum main chain if i'm not wrong so they will be somewhere between here so that kind of this gives you a rough kind of uh you know spectrum of the ethereum scaling techniques uh hello if you want to add anything please feel free to add just because yes basically basically as some people said it's ethereum scaling is definitely a spectrum and all these solutions have different trade-offs and sandeep said there is this left uh left extreme side which is completely standalone uh uh chains or solutions and on the right side just a small basically correction plasma should be in that uh in that section before the last one because plasma also has off chain data availability but basically i will kindly ask you to forgive us we are not really prepared honestly for this presentation because we thought actually it's going to be a panel believe it or not so yeah i think you can forgive us because this was last minute kind of for us um anyways just to maybe add a few things regarding polygon via polygon are first of all in love with ethereum and in among other things in ethereum scaling ecosystem it is um amazing in a sense that many different independent teams with lots of brilliant people are working on these exciting solutions and it is an organic ecosystem and again we really love it but we believe number one that um there needs to be some sort of uh structure to this creative chaos of ethereum scaling ecosystem and that's where we see the the place for for polygon polygon is basically a project that aims to introduce structure in some way to this beautiful organic but somewhat chaotic ecosystem um also we believe that we are still very very early in terms of infrastructure maturity um ethereum as a project aims to kind of build alternative financial uh global ecosystem and basically to change the way we collaborate we work with each other even the way we organize ourselves and and it is like a very very transformative idea and and the infrastructure building the infrastructure to actually achieve that idea that will actually be able to uh on board billion plus people to actually use this this uh system uh is going to take time so uh we as a community of course and as human beings we really want things to happen today if possible but in our opinion that is not going to be the case definitely ethereum is five years old and ethereum steering solutions are generally like three years old and to achieve this great vision great dream of ethereum that we all believe in uh we believe it's definitely gonna take years years of hard work so when people say this is the year of ethereum scaling we believe that is unfortunately definitely not realistic and with that in mind we just want to kind of facilitate uh further innovation in in on the ethereum scaling front and uh there is that famous miss quote that says let one thousand flowers bloom so that's what we want to do with polygon we want polygon to be ethereum scaling and infrastructure hub that will support innovation and help ethereum go through this transitional phase of infrastructure maturity if you will uh and also yes basically it's kind of uh overlay theses on top of all these flavors that we try to introduce today so basically all of them have their cradles all of them they're married so we just need to kind of facilitate and allow innovation to happen and see where that will kind of take us in the years to come awesome thanks thanks lord uh hello and i think we are uh already uh you know exhausted our time so thanks yeah no um thank you so much for that talking and a really good overview of what's happening and um i i largely agree with everything you said uh you know at the end is a very contrary and opinion but uh i sincerely hope uh you're wrong because that's when the whole ecosystem gets to move forward really faster so um thanks again for for uh the talk today and uh is not really always the best thing as a human being like to move faster but it's not really always great it's it's about the compounding not not the the velocity so uh yes yes yes but uh yeah with that thank you so
