Layering vs. Sharding
EDCON 2020 · August 2020 · 41:11
John Adler, Hsiao-Wei Wang and Augusto Teixeira compare layering and sharding with moderator Kristina Lucrezia Cornèr. The panel examines hardware and state-growth limits, security assumptions, upgradeability and interoperability, asking how Layer 1 and Layer 2 approaches can complement one another rather than treating scaling as a single throughput number.
Speakers
Topics
From EDCON 2020, hosted by EDCON.
Transcript
hi everyone happy to be here and happy to present our wonderful co-panelists with whom we will be talking about scaling solutions slayering versus sharding for the next 40 minutes i'm christine lucrezia managing editor in telegraph and here are my wonderful co-panelists uh let's start with the women first xiao wai wang for research at ethereum foundation nice to see you i wish to take seria founder and cso at cartesi hello nice to meet you pleasure to be here anton adler co-founder of fuel labs
hello everyone uh thanks for having me here so i would like to ask everyone to present a little bit uh what are you working on right now and what is your role in the developing of the solutions for for scalability of blockchains whoever wants to to start first maybe in the same order cool um hello everyone um so i'm showered i'm from cern foundation research team so uh we are the researchers to maintain and design the is to speak um so in 2.0
akh2 serenity and so we have different phases to uh get all together of the e7 2.0 so we have different phases about e2 and as you all know that uh madara tesla [Music] has been launched a few weeks ago and we are planning to launch phase zero this year i think so and um the next stage will be the phase one yeah phase one is um about the striding uh shot data chain so in this phase we will introduce the
shutting to the e2 so um about the easter shouting it's the quadratic shutting so uh with the random detention that will be introduced in phase 0 we will have the ability to produce the pseudo-random number function so it will help us to should randomly shuffle the current by data state to select a small set of the validators and this set of
datas can represent the and the verification community um as a committee of a certain shot block so by um this random traveling algorithms that and also we have the honest majority assumption and so um with enough number of validators we can uh have the in security and to prevent the system from manipulated by the attackers so that's what the shutting is
and the basic idea is that like this yep thank you so we delved directly into the issue thank you very much al so you know that you we know already that you are from the part of studying okay let's pass to augusta tell us a little bit about your project i think you're muted i'm sorry can you hear me now i'm sorry so i'm augusto i'm working at cartesi we are layer 2 solution on top of ethereum for now to improve on the scalability issue
so before i talk a bit more about uh what what are the pieces we're trying to tackle let me talk a bit about scaling which is a problem that everyone you know is worried about for a long time it's a bottleneck on ethereum and every blockchain that cares about decentralization but it's a multi-faceted problem so we have for example the number of transactions per second one wants to achieve or how much computation can you do in each transaction or what's the latency or how much data can you put so there are several aspects to it and that's why you see such a flourishing an ecosystem of
different projects trying to tackle different aspects of this problem and we are working on computational scalability so we are now we have launched our sdk so we are able to make transactions that are fully decentralized but they are very intense in terms of computation so in one transaction you could launch an operating system run linux run a spreadsheet do several things that are normal for a computer but are very costly to be made into the blockchain and the technology we use behind this called interactive verification it's a an algorithm that is famous from the
90s so there are other projects that are going to tackle you know transaction throughput number of transactions per second and my view at least of the future of scaling is that all these projects will interact together and become a super machine that is not anymore worried about scaling very interesting image of the future thank you agusta john what about you sure uh i guess i'll have to go with uh the layer layer root but if if we need if we need me on charting i can always argue for
sharding but anyway so i'm working on two on two projects one of them is fuel labs which is ethereum focus so it's uh we're building fuel which is a highly scalable optimistic roll-up that uses a different execution model than for example the evm uh we're focused on using the utxo data model uh and execution with things like stateless predicates which will allows for you know much greater transaction throughput without increasing the cost to run a full node so that's one thing i'm working on the other thing i'm working on is lazyledger which is a new blockchain that is specifically engineered to be optimized for data availability throughput uh so
it uses the uh the intuition behind it is it uses the paradigm of separating uh data ordering and availability from execution so it uses the blockchain just to timestamp messages messages just the timestamp data blobs and then all the execution can happen on this ordered and available data client-side which is in some ways very similar to the paradigm that rollups are using right where execution happens off chain but you use ethereum to order data and make it available so those are kind of the two the two things i'm working on wonderful guys okay so we have kind of uh two different camps and also well done
you can be a little bit in the middle uh helping to to develop different uh paradigms um yes if we're talking about advantages of different solutions um and maybe maybe we can take about challenges at the same time um if you can enumerate the advantages of the solution that you're you have been developing and talking a little bit about the obstacles that you've been encountering uh on your way that would be really interesting and maybe you can you can discuss it interact on on every point altogether because i'm very fascinated to hear your opinions and how how do
advantage i think so um so i i do think that uh leo ryan lin truly can help each other a lot but for but the main advantage of the layer one solution is that it is secured by the the um by the other validators who joined the protocol i think so compared to layer 2 solution that only selected a common com community or company to support that there to solutions um i
think security is the main advantage here nice what about what about challenge what is the biggest challenge so the biggest challenge uh you can see what it is in is one so why we have to implement each one is two in parallel is that the corporate code changes is not easy to to make community or together to upgrade the core protocol you need hard forks or soft folks
mostly hot folks um it's um very very difficult or like because we worry about security very very much so every hot box should be fully audited and fully uh tested so um it's less likely to have the very overhaul of the whole systems in this one currently so that's why um we think design is two could be more efficient yep that's the challenge
we'll get back to the hp of security for sure and the floor is yours so yeah the when i see the layer one and layer two playing together uh shall we said so we are gonna benefit mutually from each other so we are working on layer two and every improvement that happens on layer one beat uh usability or scalability even stability of fees everything that happens only one has a direct impact on us so sometimes we we cancel a route because we think okay the cost of fees in layer one
could keep growing and make that route not very feasible so if sharding helps with that it's definitely gonna open new routes for us on the other hand it's clear that charlie alone cannot take the heavy lifting if ethereum wants to be you know the new uh platform for what now only centralized solutions uh have a role so for example if it wants to be the new amazon new uber so it needs some heavy lifting that cannot be shared the way to to the edges of the network the edges are going to help the sharding is going to be fundamental but some things will have to be
away from the consensus protocol and then we go back to the consensus protocol only in the case of disputes only in the the situations of conflict or misbehavior so in talking about advantages um i like to think of this scaling solution in parallel with the scaling of hardware that we we saw boom in the 80s so at that time people were developing very fast crystals so computers went from 10 megahertz to 2 gigahertz in very short period and also going from one core to several cores graphic cards fast memories all these were solutions that were trying to tackle different
aspects of the hardware limitations at the time and now we have a very clear understanding of what good hardware is if you go to a mobile phone store and you buy the cheapest possible phone it's going to come with all these solutions built in graphic cards multiple cores ram layers of caches everything and i think that at some point to go to your you know blockchain solution it's going to have all these solutions between plasma uh roll ups zk zero knowledge roll-ups uh interactive verifications all of that and joining together and working for a scalable system
and in terms of challenge i think these solutions are developing very fast and i'm very excited to be in this field but given the security issues that shall we mentioned developing is very slow and it requires a lot of attention and when you start to merge these pieces together and try to make them work in tandem this is going to be a major uh exciting challenge so to say i like i like this one very much for convergence and at the same time the fact that we are still at a very young
stage and uh this creates challenges as well as opportunities john what what what would be your your view on this sure so in some ways i'm going to agree with both of my final fellow panelists here uh in the sense that uh you know building building out layer one scalability especially in the form of sharding is important and also layer two scalability is also important uh so the reason for this it comes down to what kind of guarantees each system can provide i think so in terms of layer two you can't really have the same
guarantees that you can get out of layer one for one very specific reason and that's uh if you uh have you know some smart contract system you know it could be a rollup it could be a sidechain that could be uh whatever car disease working on which is i guess some sort of variant of surgeon uh or you know some sort of interactive computation there like true bit uh what have you ultimately the kind of adjudication of this protocol must happen within a smart contract and unfortunately you can't upgrade a smart contract without introducing some sort of reduced trust guarantees right even if you have something like a dao well now the entire integrity of the protocol relies on this now being honest
not on the computation being correct so you can't really upgrade a smart contract without introducing these issues and this is something that layer two has and layer one does not you can upgrade a layer one blockchain without a dow right you just take a hard fork and you do whatever you want you get the community together and you can you can change the blockchain however you want and it's not just changing it for whims it's changing it so you can do things like fix bugs fix denial of service vectors and so on and you can really do this in a layer two uh so because of that uh layer two kind of fundamentally has this issue of upgradability that layer one does not have on the other hand layer two can do nice things for example
have really really high throughput or you know huge transactions computation that you really don't want to be doing on everyone's nodes all the time and you can make that trade-off on layer 2 which you can't do on layer 1. so there's kind of a push and pull here that each layer has its trade-offs and benefits that the other layer you don't really want to be doing and they both have their applications and they both have their places in my opinion so what do you agree with with all this um and well anti-starting arguments that were just mentioned and um like do you also support this idea of um interchangeability between
uh different uh layer one and the two solutions and they're like working one on another and and vice versa so thankful it's simple um i think some roll-ups are can be fully benefit function shot data trend even if there is no uh state extrusion in phase ones um so um in phase one there's no um no transaction to value to transfer the user from one account to another account in phase
one so but but uh blocked proposal can put a piece of data on chin so this functionality can be can benefit the role of solutions uh very much in phase one because the wraps um the operator they only have to push that part of the hash result to the layer one chain and uh and about and yeah so most like john said that the most
there two solutions they will have to up found a way to update the contract and that's the pain point in i mean it's also a pimple in layered one in somewhere as well i think because it the code protocol is not that easy to change but um thinking you can say it's very that so if if some thereto solution is somehow just broken then there's no way to fix it with community consensus i think in my opinion at this
moment like you can ask a community to have folk and to help you to fix us the two solutions um for most cases but if it's somehow bad thing happened in the corporate of the consensus protocol then it is still a thought that we have to fix anyway so yeah and the security um uh spo uh explore that point uh and how the dealers can fix it the ability is different from it all of the community is incredible very important that goes to what
what would you tell about the role of community oh yeah the issues the community is another dimension of this discussion that is very interesting and difficult so all the projects that are now coming at layer 2 like us can look at what happened in the past with layer 1 ecosystem bubbling so you can learn a lot from them uh we get involvement of the community a lot and we do things in steps that i think are necessary to to make the things safe from the
governmental side so we we don't want to have so that's one advantage of layer 2 you don't have to roll the whole struct to to launch the whole structure at the same time with layer 1 there is the problem that consensus is either there or not there you cannot put something that's half in layer in some previous layer and half in the layer on top it's bootstrapping you have to do everything in one take and that requires a lot of decisions that the community sometimes is not you know able to to engage so that's why it was very complicated for layer one
now in layer two we can do things much slower we can say okay this part now is going from layer one to layer two and this is another piece and another piece and then we can feel what the developers are interpreting and what the community is interpreting and take decisions in a slower pace so that's the plus side which we can do things lower on the negative aspect i have to agree that you know if we when we find bugs we have to have kind of predicted them in certain way to be able to to roll them back and to fix them so we have to put things in place that are
waiting for bugs to to come before uh so that we can patch otherwise it's if you're in a very uh dire situation where you found a bug but the layer one cannot stop to help you of course they're not gonna fork layer one to fix the bug in layer two so you have to have this infrastructure programmed in layer one this update upgrading infrastructure and upgrading is always a community topic right you always have to engage with the community to to talk about changing smart contracts and uh changing for example how you you deal with the economy of your solution yeah very interesting how could you
evaluate the way that the community had taken together with the developer of different projects in this recent years uh well it's been out of the youngest stage we've been experiencing um development of the market on an incredible scale um how did it impact the community and uh well i imagine that you've been guys for so many years within within the community so how would you [Music] what is your opinion on how did it change during these last years so maybe you you mean uh how do what do
i feel about the community changes recently or for yes yes scalability or generally yeah well their interaction with the the discussions of the scalability issues but also well on maybe a more broad topic in general because well community is a reflection of the technology that has been developing so it's uh something that is developing together with the technology itself community and the technology that's what why i'm very interested in interested in your take on that so i think i can talk about the um easter development community especially so i think we will have to
thanks to danny ryan who did a lot of work to communicate with different teams and the users who pay attention to the development process so the it's currently i think we still have about maybe five to seven things that are working on the core protocol or uh kind different different implementations of the east 2. so um every the core uh our bi-weekly course currently around like 40 at least 40 people will attend the
community called on quite a large uh com quite a lot of small community um folder development i think maybe the the people who are working on these two are maybe it's more than is one called team currently or they're similar so i think it's the communal education is a big point for um i would say uh eastern foundation we made some uh as changes that i think you can see we have more black uh
black uh announcements this year it's much more in the last few years and to make communication with uh the and users like how it is really going on so transparent is a good um important part for it i think and i hope that in the next few years that the um the communication china won't be one way it should be two-way and more frequently for sure totally agree with that um john what would you add
uh at least i mean i don't really have much to say about the the community on the e2 sharding side uh because i'm only tangentially involved in community in general i mean the blockchain community yeah uh so i guess yeah i guess in terms of two things one being you know in terms of scalability are there two solutions and so on and the other one being community in general so there has been i guess a slight uptick in a more rigorous analysis of the security and trustless and whatnot guarantees of their two solutions that wasn't really happening a few years ago uh that is happening more often now uh which is which is nice to see so this
kind of like a burgeoning but still a fairly small research community around you know the guarantees that their two solutions provide how to design incentives and so on uh and and i find that it's mostly not mostly orthogonal to and mostly disjoint from the community that has kind of risen out of things like yield farming and and the d5 community which is not inherently a bad thing it's just different uh there's not really a large overlap between those two those two systems or those two communities from what i can see uh and in terms of you know which one has had more growth i think it's inarguable that the d5 community has had you know a pretty obscene amount of
of growth over the past two two years or whatever as a various like a huge number of d5 protocols that are atomically composable have been deployed to ethereum wonderful interesting i would would you have something to ask about the community i think the community has clearly uh matured a lot so it's uh it's an environment that so the community is very exciting the community that builds this um decentralized universe so it's a it's composed of very ideological people so people who believe in decentralization and the replacement of
uh you know centralized and dictated solutions but it's also composed it's not a homogeneous community at all it's composed of people who are there for speculation and trying to sometimes uh favor one project in with respect to another for gain uh sometimes in a positive way it's that it's not necessarily speculation is a bad thing but sometimes you have you know money at stake in one solution and you try to to paint it in a different shade you also have the community of miners which is of course vital for the the whole
system to run and it's going to have a huge shift when you start to to have eth2 with uh proof of stake so all these players are mostly aligned i would say that all of them want decentralized solutions to strive for the apps to get adoption so that's what we should center on the aligned interests and from time to time you have some collisions some group wanting something some other group wanting something else and this okay has to be talked through but i think the community
has matured a lot so in the beginning projects were dictated by very few people because they were the only ones that actually understood what was going on then it became uh it was rolling down to groups that were overseeing the development and now it's actually very uh intense in the community if there is one proposal happening in the headquarters it goes to reddit and it gets evaluated by essentially everyone so it you have a very big peer review of uh every proposal that comes and i think this is becoming very mature
very healthy yeah i totally agree and also the number of developers blockchain is growing and that's that's fascinating and well more people are working on on these issues uh more great technological development we have uh we will have experience there's something that we maybe haven't yet even considered uh john my question will be my next question will go to you um i'm sure that you will have something to say about this what is sustainable scaling and how would you evaluate the development sorry the importance of this concept for for the whole
blockchain industry sure i can give a brief a brief description of what i think sustainable scaling specifically is uh so there's a unfortunate kind of conflation or confusion around state and history so the blockchain history is just the list of transactions in all the blocks it's all the previous blocks uh the blockchain state would be in ethereum it would be the account balances and contract storage and bitcoin it would be the utxo set and all nodes need to keep the full state around barring status clients but that's that's another story but you all knows need to
keep the full state around you you can't prune it you can't discard it because if you don't have the full state you can't validate a new transaction but nodes don't need to keep history around the other difference between these two things is that in order to validate a transaction against state you usually have to do random accesses against the state mostly because state elements like accounts for instance are usually hashes of something and therefore they follow some presumably uniform distribution and then just random so it's not sequential because of this you have to do random accesses and if your state is too big to fit in a ram which in the case of ethereum it is uh for
eth1 the state is around 60 gigabytes there's no way you're fitting that in ram in a modern uh like a retail laptop or whatever so you have to go to disk and as soon as you're doing random access is on disk then goodbye performance uh so this is kind of or and the the other side is history which is just you just store some transactions on disks you never do random accesses against history you just store it on disk so history is much much cheaper and much more sustainable than the state and therefore we ideally want to make using history very cheap and using this state very expensive uh comparatively and this is especially true in some sort of consensus critical process so the base layer should ideally like
you know let's say ethereum the base layer should ideally be you know very expensive state very cheap history to encourage people to move state off chain in any way possible and this could take the form of roll-ups it could take them for side chains you could take the foreign channels however you want it just any way to move state or move you know the the cost of running a node move it from state and put it into history some way or even put it off chain entirely and if we can do this this is you know the direction of sustainable scalability because history is very very cheap and it can be pruned while state is very expensive and cannot be pruned very interesting okay i think we are
moving to the last question we have last five minutes um so i would like to get back to the to this antagonism of layering and starting and uh try to place it within our famous trilama of decentralization security and scalability um do you think there is a difference do you think there is a different impact on the on the whole balance of a truly decentralized secure blockchain network uh if we talk about different scaling solutions xiao i think it's a bit difficult to define what is fully it's really just
depends on the use case i think um so for example if it um it's easy to think so the security is different if i want to transfer one dollar or one million that's a would be different trader for me personally um but [Music] in the end that the production so in proof of work the blockchain finality is uh in probably tick because the finality is not
real it's not a certain number in proper work world but um in for a state that we at least we have a certain uh finality for the kinetico chain in each two if it's fully uh excluded and also um so and also uh the narcotic is about what is the fully decentralized that's also very hard to make it concrete for every user i think but um i think we will have a
best we will at the end we will get to the best point that makes like almost everyone happy that would be my answer right now yeah well thank you also fully scalable it's not is that a good combination so i'm sorry about the word fully it's something that i took definitely from some journalistic texts uh but yeah gusta secured decentralized scalable blockchain so i run the risk of overusing my analogy with hardware but i i like to emphasize that at some point people in hardware development said okay it's impossible to go over
at 10 gigahertz hertz so that's you know moore's law is doubling every two years things are getting very fast computers are getting very fast but at some point it will not be able to transpas this limit it's a physical limit physicists were saying that but you know the the industry can't stop it has to innovate and we are still following moore's law essentially up to today so of course physicists were correct they were the limit to how much you could accelerate the processor but you could do other things so let's try to to see what could happen in in blockchain so of course there are statements that you could make five years ago about
what are the trade-offs that you cannot join together security scalability decentralization but is the user willing to reduce it's this it's this generalization of a given transaction or the security of a given transaction if you're trading a crypto kit that costs two dollars are you willing to reduce a bit the security and do this in a in a delegated proof of stake system for reduced taxes so there are other solutions that sometimes give you a hundred fold increase in something so some roll up solutions are giving are not violating anything in terms of
this dilemma but they are giving a hundred fold uh improves improvements and for example in the original statement about this dilemma there was not uh there were no considerations for example like uh can you outsource things and get back to the first layer and verify that things that were done outside were correct with very little effort so this is one thing that is you know borrowing from a bit of a cryptographic mirror uh miracle so you you could do things that you know violate the dilemma without violating the trillion just because you have a tool
that is you know a cryptographic uh miracle that allows for things to such things to happen for example in cartels we can do these things like run a very complicated computation that would take you know decades to run on the evm in the current gas limits and you know throw it in the blockchain and have it verified if need be with uh 20 interactions so it's a it's something that uh was not in the original claim that some things are impossible because people innovate so i think that's uh that's going to be the solution people
are going to innovate their way out of the trilemma wonderful i think we can we can handle this note john that's my very last question to you just to wrap it up so layering or sharding both perfect that's what i wanted to hear thank you very much i've learned so much from you guys during this 40 minutes thank you very much for the organizers of the conference and thank you see you see you later thank you christina very much have a great day bye bye thank you so much stay safe