Sequencers in Layer 2 Scaling Solutions and Beyond

EthPrague 2024 · 2 Jun 2024 · 24:46

Victor Muñoz explains the role sequencers play in layer 2 scaling solutions, how they operate, and the evolution toward decentralized sequencers. The EthPrague 2024 talk covers the fundamental functions of a sequencer in a rollup and the challenges that come with running one, as the ecosystem looks beyond a single centralized sequencer.

Speakers

Topics

From EthPrague 2024, hosted by ETHPrague.

Holešovice Market

Transcript

[Music] okay guys uh welcome to the flower stage my name is Mickey I'm uh this afternoon's uh moderator and I'm honestly looking forward to this speech about uh the key role of uh sequence in a layer to scaling Solutions and Beyond uh well honestly uh as you see I don't know much about the topic yet and that's why I'm here so I'm uh really looking forward to the uh talk so please

welcome Victor [Applause] Munos thank you all right uh I'm um let me see here is this thing working there you go all right thank you uh for giving me this uh opportunity to give this talk uh my name is Victor Muno I'm a developer Advocate at Med L2 and really my goal and my purpose with this talk is to

invite you to think and reflect on a topic that really is going to affect us all and it's getting increasingly more complex and it's getting also increasingly more important because of reasons that we will see on on this talk so let's start by uh stating uh some facts right you will see if if you open social media is kind of crazy how you will see all of these opinions about Al l1s or l2s if they are being used if they are useful and whatnot and I really prefer to uh stick to the data uh I have a background in physics so I really feel more comfortable that way and if you

look at the data you will see that L2 usage I put adoption there but to be more strict it would be usage is certainly increasing right so uh this is a plot that I took from uh L2 bit and it shows uh the total uh transactions per seconds of this l2s uh as a function of of the time right so as you can see the average TPS has increased significantly over uh the past year I would say uh and not only that right one of the main uh metrics for L2 is the total value loog and if you look at the data for that you will find that the increase is about

125% more or less right so of course this makes sense uh if if you are into ethereum right because etherum has a rooll Centric uh road map right so uh it is expected that as times goes by maybe we're now on a bull market and we see all of this hype maybe it's going to decrease but on longer periods of time we will see it is expected to see a bigger L2 adoption as this plot here shows and of course this makes sense because there is certainly an scalability improvement uh there is a reduced cost as you guys have seen with the introduction of the blobs and you can opt for uh you're going to have security maintenance from the L1

right uh now the something that you probably have seen in in social media or in other talks is that sequencers are kind of like this key piece on every L2 and the reason for this is because they have the job of uh performing transaction ordering so when you send transaction on an L2 really what you are doing is sending it to this piece called sequencer that has the power of include your transactions uh rejected I mean not include that or and ordering in whatever order it wants right and it also takes carees of the batch processing so a lot of the discussion if if you check out

the the literature and other talkx will be focused on centralization versus decentralizations and you will see a lot of people people saying like oh yeah we have to work towards uh decentralizing the sequencer and uh what not and what what what are the steps that we are taking uh but really what I want to convey on these talks are other implications that maybe we are not thinking too much at the moment but they will have an impact which are related to me so like I mentioned before when you send a transaction really on an L2 really what you're doing is sending this to the sequencer right so the sequence the sequencer will get a transaction

from everywhere and it will sequence that in the order it wants right most l2s have a centralized sequencer meaning that they control how uh what they can include and what not right uh and the thing is that it's not only about the order of these transactions but mostly for my point of view it's about the value that you can extract by doing so right so me stands for uh maximum value struble and uh sorry maximal struble value and essentially consist on on people trying to make money by leveraging from running transactions right uh and things like that so if if we you think about it when you have a

centralized sequencer not only you have full control of how you order these transactions but you have full control of the m and this is something that I think is like the next generation of uh you know discussions that we need to have because right now I would say that there is General consensus about the risk uh of having a centralized sequencer and that we need a progressive decentralization of these sequencers right but what happens with me do we want it do we not want it uh what are the policies and what should we be demanding as a community right from all of these l2s uh now there is a a variety of uh L2 sequencers uh if if you look at it at

the literature you will find that there are three main classifications and I just paste here uh some of the features that you will commonly see so uh essentially we have uh centralized sequencers uh we have uh decentralized sequencers which essentially what they do is try to replace this centralized Party by by another network of sequencers and you have shared sequencers in which essentially what you have is uh a network of sequencers that are serving multiple rollups for ordering these transactions and of course there are some uh common things that you can you can say when you you look at the literature uh one of them is that of course centralized sequencer they they should be more efficient right

uh because it's it's more simple while they have a single point of failure so there are risk associated and of course there are trade-offs the same happens with the centralized sequencer which you can argue you know there are less PR to single points of failure but of course they introduce uh extra complexities as we will see in these systems uh and finally for shared sequencers yeah you have uh potentially increase in through pod that's something that I've seen on the literature but I have not really seen any data that is showing me okay I'm doing this experiment with these uh sequencers uh and I'm I can demonstrate to you that this is more efficient there are good arguments though uh but not numbers now let's talk about uh each one

of uh these types of sequen so first of all the centralized sequencer uh you know like I mentioned before essentially you send a transaction you have one single particle uh controlling what is the order of these transactions then they send it to a roll up or the da uh and then you have the settlement uh and essentially here like I mentioned before you will have a tradeoff of uh security and control uh versus also being more efficient right uh now one thing that I I mentioned before is that there is kind of consensus uh among different researchers and community that we should uh move towards decentralized sequencers however it has not been established how

we should move towards the decentralization of the sequencers and it seems that there are like obviously like different opinions and different directions uh but again I would say that to move the this this discussion forward we really need to start thinking about what is happening with meev because here what's happening is essentially that you have one uh Central party that could take most of the me right and if if you're kind of lost on how how does the me thing work really is pretty simple so imagine that uh you're a whale I'm not a whale but I can imagine that some of you might be uh and you send a a transaction to to buy a large portion of tokens right so obviously you are expecting the

price to go up and and the sequencer can detect this and it could you know send a transaction to uh purchase those tokens before you so the you will purchase those tokens and and the price will go up and the sequencer will have also the faculty to send them a transaction to sell those tokens essentially extracting the value out of that large uh transaction right so that's like very broadly very basically how this thing would work uh and we have seen that obviously this leads to attacks to these centralized sequencers and in the past if you look at the data you will find that uh there was a time in which one of these big l2s had like 60% of uh attacks in terms of like the number of

transactions uh by uh trying to extract me so it's really something uh that is is something that we have to take seriously but also something that there are ways to mitigate this so when it comes to mitigating this risk there are different policies that one can uh adopt one of them is first come first serve uh another one would be uh Mev actions right and you know you will see these different Communities going into different directions uh however we should be demanding more uh transparency when it comes to what is your M policy and why because not necessarily MB uh means something bad maybe in some cases

you want it that's not up to me to the side now let's move into uh decentralized sequencers so uh decentralized sequencer they have tradeoffs just like a centralized sequencer right so here you uh like I mentioned before you are replacing one single note by a network uh but things get complicated this is what this diagram here is trying to communicate I I am not going to go over like kind of the details of what happens uh which it steps once you send a transaction that this is a diagram by the way for for the medic L2 it's also not my purpose here to chill Med in any way is just to illustrate that things get complicated quite easily and that's actually one of

the reasons why you have not seen uh this uh you know sharp transition from centralization to uh decentralization of the sequencer right and another thing that I I would like to communicate with uh with regards to the decentralization of the sequencer is that is also not kind of like a linear process in which okay you send your transaction you have the sequencer the sequencer just reordered these transactions According to some policy that nobody really knows and then it batches the transactions and that's it right it seems to be like of course this is uh after that the the sequencer doesn't have any other role but in between when when you look behind the hood there are multiple things happening behind you you will have uh uh you know the sequencer sending this

transaction to the bridge and adapter to get to the consensus then you will have uh sending some data back then you will have to verify send to the L one Etc so this uh is not really as simple as one can imagine from the previous diagrams that I showed to you uh but here really what happens with me I would say is still an open question right so we can talk about that uh later if you want uh but now I would like to move forward towards uh talking about shared sequencer so shared sequencers I've seen in the literature that they are getting quite some popularity so what is the basic idea behind this shirt sequencer so here you will have

one network of sequencers so it's a blockchain essentially uh that serves multiple rollups so these rollups will connect somehow uh with the SE this sequencer Network this sequencer network will have a specific policy uh about what is their me uh you know me policy and they will just make sure that the transactions get order in a in a certain way right and that's pretty much it uh pretty much it what what they do right then they batch the transactions and send it to the data availability layer right there are multiple examples and variation of these architectures uh is is is not really the goal of this stock like I mentioned uh but what I do want to stress here is that okay it seems

that this this seems more efficient that having a decentralized sequencer right because you have a network is decentralized uh and is serving multiple rollups instead of just one right and because if is serving this multiple rollups you can think also about doing things with interoperability right you have now connections between this rup through this at least through this shared sequencer uh however you are uh posing some risk in the sense that your role of your L2 now has given up all of the sovereignty uh of the transaction ordinary to an external party right I don't know if everybody wants to do that and I don't know what happens when the this uh the party here involved this

this sharing shared sequencer Network decides to change their policy towards me for instance I I have never seen any like article discussing that uh maybe there are uh but certainly something that we should be concerned about um so yeah I'm I'm I'm getting to the end of uh my short presentation here and I just wanted to leave you uh with some thoughts about what could be the potential future of sequencers in Layer Two Solutions so first of all we we have seen SE that uh there is this tendency to going towards decentralization of the sequencers it is not really clear how yet like how are we going to get there

it seems that this shared sequencer uh seems to be a nice option for many uh despite the risk that I that I just described before but one thing that I would like to see more and more is Clarity when it comes to not only decentralization of these sequences but also the governance right as soon as you centralize some something you need to provide a governance framework on who is going to participate what are going to be the requirements who is going to be deciding this and again what is going to be the meev policy behind all of this uh then we can expect to see more and more of uh cross layer sequencing so this is something that we are already seeing uh and of course this also presents uh

other Mev opportunities because imagine now that you want to do some Arbitrage in in different dexes that in different l2s maybe you can uh uh leverage a cross layer sequencer for that end but do we really want that again that's one of the questions that I I wanted to for us to think about and finally well there are things that we still don't know how how they are going to be taking place one is uh the use of artificial intelligence so of course we have a process in which we are handling uh data and ordering things and artificial intelligence is of course one alternative to do things more efficiently but again how do we want to do that still unclear and when it comes to uh the the role of CK for instance

let's think about uh sequencers uh decentralized sequencers that are rotating right so they are rotating but you need to verify one way or another uh that this is uh taking place right so CK might be having a role there and in multiple Ed components that uh you know I might not be able to predict right now but certainly is something that is worth thinking about and the final message that I want to convey with all of these elements is that as we progress and L2 adoption uh becomes you know wider and wider and we see more and more for instance I I think that today I check the data for L2 bit and we have about uh 50 uh l2s and there are like other 50 that are in review so it's getting crazy

is getting like a lot of these are tools are coming uh and what will be their policy for uh the sequencer uh what will be their policy for the me uh all of these factors together really are going to be given bir what I would say is kind of like the sequencer economy in which we really stopped thinking about uh sequencers only in terms of yeah this this is centralized but we need to decentralize but also in terms of what is the what is the me landscape that we want to see so that would be uh kind of all on on my end it was a little bit short I I realize now but as a summary what I want to convey here is is uh obviously that sequencers are a key piece of l2s and I hope that now you

have a better idea of why this is so important right because it's tied up to me as well uh and again here we have to ask ourself some questions and ask to this protocols to these l2s do we want do we want like Fair me struction do we not want M at all who should be allowed to do this uh who shouldn't be allowed to do this probably there are no an and we want something in between uh and then the next thing would be uh what is going to happen with these shared sequencers or is something that is going to be adopted or in the end we will have each L2 with their own decentralized network uh and how do we want to deal with that

so uh really I appreciate everybody of you who who took the time to uh listen to me uh if you want to talk about like other things related to the sequencers uh maybe related to medic itself or maybe not related to any of that but just want to have a Veer and talk about life I will be here until Tuesday and um yeah I'm I'm looking forward to connect with each of you thank [Applause] you I see a question over there yeah um so I have one question probably harsh questions regarding the cens

attack like for example suppose there's a Tado cache that is deployed on one layer Tu and how would the sequencer deal with the transactions that interact with the fix tonado cash contract on ler two um the the question is about okay I I understood the part of the the censorship attack perfect perfect great on the on the lay to like contract like cash yeah that's that's a that's a great question so I I forgot to me to mention that by the way uh but essentially there are multiple ways in which they can deal with sensorship resistance for instance when you go to the shared sequencer if you have your L2 and you commit to that

you you lose your sovereignty and you lose any right to do any kind of uh censorship or or or deal with that like you just leave that word to the decentralized network but if you're dealing with a centralized sequencer uh then you have more possibilities to deal with that and we have seen actually uh in the documentation of some of these l2s they have like ways in which you can bypass uh the sequencer if that if it gets tall right so you can essentially find ways in which you can send the transaction directly to the L2 uh like like like force execution yeah okay I have a quick question on uh L2

economics uh maybe you can share your thoughts um if you think about how like an L2 makes money there's you know two ways there's the me revenue and there's uh transaction fees and the transaction fees I assume that's a raise to zero so um there's going to be super tiny margins yes uh left so um in that sense sem will be the only uh Revenue Source yes uh for this L2 and um there's also like you know like different valuation Frameworks for blockchains where like where the new valuations are calculated based on me Revenue not like not fees so so do you think these l2s would even

want to give this uh me Revenue away uh are they even incentivized to uh like adopt this shared sequencer model that's a that's a great question that that was actually the kind of the purpose of my talk to you know have this kind of questions uh and like I mentioned before there are multiple angles here and perspectives uh I'm going to be sharing mine right so right now the way I see it is if you have a centralized sequencer I I don't see any I don't see like kind of big incentives for them to move uh towards the centralized sequencer if they can get them me right and like you mentioned as the transaction fees goes lower and lower their margins become

also smaller right uh so I don't think they have a big incentives for that and that's one of the reasons why I think we should really start demanding to have some clarity on what is your uh me policy because you know it makes sense for some cases to actually want that under Center conditions uh as long as it doesn't you know damage the network in some ways maybe it's a free market and and and you can roll with it and when it comes to like the more decentralized aspect think about for instance on medic on medic what we did is to decentralize this uh so now anyone that can that wants to run a sequencer can in in principle like send a proposal right and if they meet the requirements uh

essentially they could be part of the network and then what happens with me can they do because they will have uh the option to do that uh can they do that uh can they not do that you know those are the kind of policies that uh we should be thinking about and establishing uh actually when when it comes to like medic as far as I know there is no like public uh you know uh public announcement on how we want to deal with that I personally think that it should be allowed under certain specific uh conditions but I also uh don't want to see that you know we we get into a phase in which we are prev or not prev because uh that's that's really not not not something productive for us

as a community what I would really like to see is that we get to a point in which we have balance right we have balance in which okay we have something that it makes sense for from the point of view of the network to profit a little bit from this but also it makes sense to have all of these ground rules so that uh people do not see their transactions uh getting higher fees or they they do not see their transactions getting revoked or or not being included uh things like that so balance that would be my personal take so

good all right so if there are no further questions as Victor said he will be here till Tuesday so you'll have plenty of time so exactly thank thank you all Victor Munos thanks hi