Aggregation + sequencer marketplace = L2 interoperability

ETHCC 7 · 10 Jul 2024 · 28:30

Ben Fisch explains how L2 interoperability can come from combining validity proofs and proof aggregation with a sequencer marketplace. He argues that synchronous composability, shown with flash loans, sets Ethereum apart and that rollups lose it, causing liquidity fragmentation. He describes synchronous message passing, rollups exchanging proofs within seconds, and aggregating them into one proof for Layer 1. He then covers a combinatorial auction where bidders sequence bundles of rollups, with goals of efficiency and rationality, revenue splitting and reserve prices. In Q&A he says block building is already left to sophisticated actors.

Speakers

Topics

From ETHCC 7, hosted by Ethereum France.

Transcript

I don't need to be a little bit more. All right, let's get started.

Okay. So this is a talk on L2 interoperability and how it is enabled by the combination of proofs and proof aggregation with a sequencer marketplace. And so this is a very general talk about the topic, but um, obviously it's related to Espresso Systems, uh, which is building a sequencer marketplace, and uh Polygon, which is building an aggregation layer. So what makes, let's start out with sort of the motivation of why interoperability and specifically synchronous uh composability is so important in my mind. It's important in my mind because this is what makes Ethereum so different from what we had before Ethereum.

We have traditional web applications which are independently operated. Often people can find someone who they trust to run their bank account. But the but the critical thing is that trust is fragmented, right? It's very, very difficult to build one thing that everyone in the world trusts. And that is what Ethereum has uh always aimed to be, and what is um I would say has become. Um traditional web apps are independently operated, you need to trust each operator, and they communicate or interact asynchronously. Whereas Ethereum apps, they are updated synchronously, they share memory, and uh you know, anyone from their dorm room can just write a new application that taps into the liquidity that exists already on Ethereum.

Uh, there's no need for them to establish some kind of partnership or trust relationship. Their users don't need to trust the developers of other applications. They just need to trust in the security of Ethereum. That's what makes Ethereum so different, and that is such an important thing to preserve as uh we look at the next generation of Ethereum, uh, which is scaling through L2s. Um, synchronous composability of apps, what does it mean at sort of a more technical level? Um, so this is characterized by function calls between smart contracts. This is a hallmark of Ethereum.

Uh, you can have, you can imagine having this is just a toy example, um, but you have a trader contract uh that is implementing some smart contract wallet that is going to try to execute a limit order, so it's going to request sort of a price quote from an application like Uniswap and only execute a trade based on what that price is. Synchronous composability can also enable you to do cool things that have just never been done before in the world of web applications, such as flash loans. This is sort of the quintessential example that people give where you're gonna have a lender application, an exchange, a different exchange, all developed by different companies, developers, and now a user can interact with all of them at the same time to borrow funds, take advantage of arbitrage and return the money and keep the profit all within one single transaction where it takes zero risk on returning the loan.

So roll-ups have obviously come about through the need for scalability. Um the way that I think about roll-ups are that they introduce application layer servers which are executing transactions and uh and proving state transitions so that when every time you add a new application, you don't actually burden the existing system of Ethereum validators with the job of running that application. You can just introduce a new set of servers. Um this allows for horizontal, uh almost infinite scaling of the application layer of Ethereum. Um this has has obvious advantages for scalability.

Um it also enables for diversity on the virtual machine level, but it comes with some disadvantages, right? And one of those advantages is the loss of the synchronous composability that uh I've just you know stated is one of the most important properties of Ethereum. Apps on one rollup can't make function calls to apps on another. And this leads to, among other things, uh liquidity fragmentation, right? Uh liquidity providers, for example, need to split their liquidity between DeFi protocols on different rollups. Um it doesn't enable just uh you know one rollup to be really, really good at DeFi, and then other rollups to just tap into that and specialize in other things.

So the challenge is how do we achieve synchronous composability across distinct rollups? And that's what I'm going to tell you about in the next few slides. So the starting point is how can we emulate function calls with what I call synchronous message passing? So let's take a look at this. Um this example is not real, it's just sort of a sketch to give you the idea. But imagine if you have uh a contract on one roll-up, right? This is playing off the toy example we had before, but I'm sort of simplifying it a bit.

And the point of this contract is to execute a limit order. In other words, it's going to try to get um a price quote from some automated marketplace, but this automated marketplace now sits on a different rollup. So if these roll ups could communicate with each other, meaning they would send a message and then wait for a response, which is not it at all what what we can actually do. I mean, it would totally destroy the whole concept of roll-ups. But if we could do that, then you you can imagine this trader contract would uh start by executing this limit order function. It would ask for a price, uh price quote from the AMM on the other chain, um uh or essentially a price lock.

Uh it would get this quote back, let's say it's 2,999, um, it would check if that's below the threshold at which it wants to execute the trade, and then it would send a message back instructing the AMM to um to actually execute the trade. I'm ignoring details here where it might need a bridge over assets, but I I just want to simplify to illustrate the concept. Okay, so this uh achieves sort of this synchronous composability, but it would cause a very, very big change to the way that applications work. Namely, they would have to send a message, wait for a response, send a message, wait for response, and that's not at all what we want to do.

Um but the really cool thing is that if magically we had some kind of coordinator that could figure out what messages need to be passed between these contracts on different chains, and could um sort of pre-populate basically an inbox of messages on each of these chains that the respective uh um transactions on each chain could just read from. Then if this coordinator were did its job correctly and didn't cheat, then uh we could actually enable this entire interaction without interacting. Okay.

So this coordinator would unroll the execution ahead of time to figure out what should have happened. It pre-populates an inbox on each chain with the messages it should have received. The transaction limit order A on roll up A would execute, it would perform a write to its outbox, which would normally be sent. It's a simulating sending it to the other chain, asking for a price lock. It would then read immediately after from the inbox that um you know it what the price was, what the response was. And that's already there because the coordinator put it there. And then it would write again what the instruction is to the other chain to swap 10 tokens.

And on the other side, uh there would be the same kind of simulation of the transcript. This remote swap function would read from its inbox that it's asking for a price lock, it would send the price, it would write that to its outbox, and uh and then it would read the next message from the inbox, which is 10, and it would execute the swap. So of course the problem is this coordinator could cheat, right? So the coordinator could include the wrong value in the inbox. It could write 200 in the inbox of rollout B, even though that's not really the message that would have been sent from roll-up A.

It could also just emit one of the transactions. It could not include the transaction on rollout B. So how would we prevent this? We can summarize the security goals against this malicious coordinator as follows. First, if the outbox on A doesn't match the inbox on B, or vice versa, then the transactions should just fail. The second thing is if transaction B is excluded, okay, then transaction A should fail, and vice versa. Now this is actually implied by one, because if transaction B were excluded, then either that just means transaction A will fail, or it must be that wrong things were written to the inbox, and inbox A will be inconsistent with the outbox B.

Okay, in which by one, transaction A will also fail. So all we need to do is ensure that these inboxes, inbox B matches outbox A, and inbox A matches outbox B. And how do we do that? It's quite simple, and we can even do it with optimistic rollups. There's a key advantage to uh to ZK, which I'll say I'll mention in a second, but the idea here is uh rollup A would just so it it receives a transaction at the very beginning that the coordinator, or you can think of a coordinator as a block builder or a shared sequencer between the two rollups. Uh it just populates the inboxes as a transaction to some special special contract that's implementing this inbox logic.

And then the transactions A and B would execute, they would perform the reads and writes, and the state would be posted to the L1. As a part of the state, we include the um uh some fingerprint, so like a hash of uh of the outbox and a fingerprint or a hash of the inbox. It's just part of the normal EVM execution. Um the only additional thing that we need to do on the layer one is that contract A can't um can't just blindly accept this without kind of coordinating with contract B. So the layer one would be in charge of checking that the hash HOA is equal to the hash H I B.

This shows that the that the outbox A matches the inbox B. And it would also check that the inbox A matches the outbox B. That's all you need to add at the layer one. Now, if in an optimistic case, if something were wrong, in other words, if the state transition, if something were posted wrongly to the L1 from either roll up A or roll-up B, this would be caught in a fraud proof later. Now the problem with that is that the phone nodes of each rollup, they actually don't know the state of their own rollup without executing for the other rollup. And uh if there's a malicious uh party that posts to the L1 something wrong, then um then then then sometime within the fraud proof window, which could be, I don't know, seven days, there could be a massive re-org that causes everyone to uh change their idea of what of what the state of the rollup is.

A very important property of rollups is that a full node for a roll-up actually knows the state of the rollup, it doesn't need to wait for settlement on the L1 because it's executing for the rollup. This is no longer the case here, that's the one caveat, because the two roll ups, the full nodes for each rollup will now need to execute for the other rollup in order to determine their state because of this interdependency. So validity proofs uh work would work the same way. We would do exactly everything the same. It's just that rollup A would now post a proof to the L1 instead of having this optimistic thing. And rollup B would post a validity proof to the L1 as well.

Everything else remains the same, we have this one additional consistency check. Um there's no need for aggregation, like this works without aggregation, it's an optimization I'm going to introduce in the next slide. Um the the the benefit here is that ZK proofs generally have you know uh something like uh an uncertainty window of an hour as opposed to fraud proofs, which have an uncertainty window of maybe several days. Um I want to add that with validity proofs, if the rollups can communicate proofs to each other, so if the operators of rollup A can communicate a proof to the operator of rollup B very quickly, which is actually quite feasible because proofs these days, they they can be with parallelism, they can be constructed within a matter of a few seconds. The reason why they're posted every hour or so to the L1 is just to optimize costs.

So if the full nodes of rollup A can quickly compute a proof within a few seconds and communicate it to the full nodes of rollup B, then we reduce this uncertainty window about the state to a very, very small to a small window. So that is the key advantage of validity proofs. I would say actually off-chain validity proofs as opposed to on chain validity proofs. So finally, there's a there's a very nice optimization, which is that we don't, because all of this is being checked together on the L1, we might as well aggregate it before being posted to the L1. So proof A and proof B can be aggregated together, and in fact, the aggregator can even remove the job from the L1 of checking the consistency of the inboxes and outboxes.

This can also be handled at the by the aggregator, and just one aggregated proof, calling it pi ag would be posted to the layer one, and that's the only thing the layer one needs to aggregate. With more than two rollups synchronously communicating, this becomes extra important because otherwise the number of comparisons of out boxes and inboxes would grow quadratically. So who gets to be the coordinator? This is a difficult problem because rollups can't easily agree on a coordinator. An enshrined coordinator may not share revenue fairly with rollups.

So it's it's good to uh it may even be good to change the coordinator ad hoc based on demand for cross rollup transactions. So this leads to a question of whether there's a mechanism design that solves this problem. And this is where we get to sequencer marketplaces, right? So we need coordinators, fundamentally need coordinators in combination with all these fancy ZK tricks in order to get synchronous composability between between rollups, between applications on different rollups. But the difficult problem is how to choose a coordinator, right?

Rollups don't want to lock themselves into a specific coordinator that's shared with other chains. They want to retain their own value capture. This becomes a mechanism design problem. Okay, and so this is where we come to a marketplace for rollup sequencing. In a marketplace, rollups would be selling their rights on some common marketplace. Players would be bidding for the rights to become or the coordinator or block builder sequencer, whatever you want to call it, for a given time slot. And in fact, players can now buy simultaneously the rights to be the sequencer for multiple rollups at the same time. Or in other words, they can bid on bundles of rollups.

So what are the design goals for a sequencing marketplace? So one design goal is efficiency. The market should find an allocation of rollups to bidders that maximizes value. Okay? And in particular, if there are many cross rollup synchronous transactions and interactions, then the most efficient configuration would involve some form of shared sequencing, and we want the marketplace to discover that in a way that's still transparent and rational. So that's the same, sorry.

So that is the second uh goal. So the second goal is rationality. We not it we don't want it only to be efficient but rational. Rollups should be earning as much revenue participating in this marketplace as they would running their own PBS auction, which is the alternative that they would naturally do. And the only reason why they may not participate in such in you know, obviously efficient better mechanism for them. So we can view the marketplace as something called a combinatorial auction, where players can bid on individual rollups or any combination of rollups, and each bid is for the right to sequence this combo in a specific time slot. Efficiency is achieved by finding the partition of rollups among bidders that maximizes the auction revenue.

And then there comes a question of okay, now that we've done this, how do we actually split the revenue from the auction among rollups, especially if some of the winning bids are for bundles? How do we split the bid on a bundle among rollups included? Before I get into that, um, right, actually, no, so let's go into that. So, how do we how do we split the bundle bids? Well, there's a number of different options. Um, one would be just proportionally based on the highest single item bid seen for each rollup, but there may be alternative ways of doing this. There's something called a Shoply value.

Um, another thing is that rollups can set a reserve price, which is a quitting equivalent to bidding on itself, and this ensures that at a minimum each rollup would receive its reserve price, or otherwise, the sequencing right for that rollup would not be allocated to a bidder, it would just be kept by the rollup itself and handled by some default operator. Um there are some challenges with these combinatorial auctions. So, one, roll-ups may set arbitrarily high reserve prices to receive a higher payout from auction bids on bundles. And how do we prevent that?

Well, one thing to note is that setting the reserve price too high would cause a rollup potentially to be excluded from bundles. And if the uh benefit of being included in a bundle is that your applications can synchronously communicate with other applications, uh you may very well want to do that. And also you might be getting more revenue from the uh you know from the um from the bids of the bundle than you would make if you just sequence your own roll up. And so setting a high reserve price might be a good strategy to try to scoop up more value from from the other players, but it could cause you to be excluded, and that's not good. So is that enough of a disincentive to be seen?

Uh there's a lot of more research to be done on this. Um the other concern is monopolization. Auctions tend to uh pick the same winners. It might be better to run a lottery which has you know encourages more diversity of winners. Another challenge, which is related to the first, is that if a reserve price is inaccurately low, okay, if a rollup doesn't know how much how high to set its reserve price and sets it too low, then strategic bidders could try to create fake roll ups or collude with other rollups to steal MEV from the rollups that don't set high enough of a reserve price. Okay, so what would happen here is you can imagine rollup A, which sets a reserve of one, but its true MEV is 10.

We have fake rollup B, fake rollup C, which are controlled by bidder one and bidder two, respectively. And bidder one sets a really high reserve price of nine. Uh bidder two sets a high reserve price of seven. In this case, uh the roller the bidder one bids on the bundle of AB at 10, because A is actually worth 10 and B is technically worth nothing. This bidder two does the same. Um the result of this is that bidder B bidder one would win, okay, but out of the 10 that it bid, uh, because of these reserve prices, only one would go to roll-up A, which is much lower than rollup A should be receiving, and nine would would go to Bidder 1. So Bidder 1 has sort of successfully cheated rollup A out of uh you know nine tenths of its MEV.

Um a solution is if a roll-up isn't sold, then it should pay a marketplace fee proportional to the reserve price that it sets. And with sufficient competition and risk of not winning, then uh then this could serve as enough of a penalty to dissuade this kind of attack. Because in this case, C gets screwed because C is um or bidder two is creating this fake rollup C that is actually worth nothing. It wins its own rollup and now it has to pay a fee proportional to eight. So there's also questions of when to run the auction.

I don't want to go into that in this talk. Um there's various advantages of ahead of time versus just in time. You can check out more information about this online. We've been sort of writing a lot about this research problem. Uh, I think it's it's really exciting and happy to have other people contribute ideas. Um so, in summary, how do we achieve synchronous composability across rollups after all, which is I think the key on lock to achieving the best of both worlds, scalability and uh and interoperability. Uh, one, have a sequencing marketplace. Two, synchronous cross-rollup message passing, inbox-outbox consistency checks, and the best way to do that is through something like a proof aggregation layer.

And in addition, this motivates creating faster off-chain proofs, which is a very active research area, and every month somebody comes out with a new paper on how to do ZK proofs faster. This opens up a whole new design space because we don't have the constraint of posting those proofs to the L1. There are proofs that are larger to communicate but much faster to create, and those could be really, really good for this application. So thank you for your time. Any questions?

Yep. Yeah. Thank you. Uh very good lecture. Um I wonder since we know that L2s have not been really so far willing to kind of let go of their centralized sequencing. Um, how do you think this will bring them over that kind of step that they they weren't willing to take yet? Yeah, I think it's mo it's I it's I think it's related to two things. One, it's just sort of an education thing, and two, uh it's just L2s kind of coming to realization of you know, kind of the next step. I think a lot of L2s are that they're all competing with each other trying to get to market.

Um once you have L2s running PBS, so they're if they're not, you know, uh just running their own sequencer, but they realize they can actually outsource building to more intelligent builders through the same kind of PBS that happens, uh proverbuilder separation that happens on Ethereum L1, then the leap from that to participating in a join synchronous uh marketplace is not that different. Um if we can just sort of show that look, the marketplace is the same as PBS, it's but it results in better better results, and you still get as much as you would if you were auctioning off your own um you know block space, then that's I I I already see this shifting the landscape. I mean, I talk to L2s all the time because this is our product, and um and I I see this shifting.

Um Polygon, you know, uh, for example, is an ecosystem that is ahead of others in terms of realizing the the value of that. Um, Arbitrum ecosystem as well. Um, of course, you can also, you don't need to sell full sequencing rights through a marketplace. You could also sell more restricted sequencing rights. So you can still keep your own sequencer, say to produce a block every now and then and and only sell you know time slots um you know at specific uh periods. Um you can also do something which Arbitrum is exploring, which is have um have sort of just a fast priority lane for transactions that gets sold on the marketplace, but um other transactions can also still be pushed through by uh by the by the by the ecosystem's own you know designated sequencer. Thank you for the question.

Anyone else? Well, I guess that's it. Ah, sorry. Yeah, thanks for the talk. Uh just curious about the prerequisites for this coordinator role. Um particularly interested in kind of hardware requirements, for example. In my understanding, if uh this coordinator or shared sequencer network, they kind of work for multiple roll-ups who might have different VMs, and also they might need to maintain the state of each of these roll-ups for them in order to kind of provide um execution pre-confirmation, that would be a very challenging task. Or is it a problem at all, or how do we tackle that?

Thanks. Yeah, this is a question that comes up a lot. And um, I think we need to do some sort of level setting. I mean, the reality is that the m the building is always going to be done by the most sophisticated actors. And so, yes, the requirement to build for it's there's no requirement, but they're the set of parties that will be best at constructing coordinated blocks between multiple um roll-ups will be a maybe a smaller set of sophisticated actors. But as long as sufficiently competitive, then it will look very, very, very similar to sort of the block building dynamic on Ethereum today. And we the level setting that we need to do is that the the c the computation that's being done is actually not that hard.

I mean, AI does a tremendous amount of computation. The amount of computation required to process transactions across multiple roll-ups is honestly peanuts. It's peanuts compared to computing ZK Proust, too. So um the like the goal of systems like Ethereum is to make uh the economic security really high, and that and the goal there is to make it easy for for for many many people who are not sophisticated to participate in consensus, but that doesn't need to be the goal for block building. In fact, it's not the reality on Ethereum today. Block building is not done by normal validators, it's done by uh a sophisticated set of actors, you know, tight Titan Rsync and others.

And so I I don't think that this is going to be a problem at all for the LT. One last question. Well, that's it for today. Thank you again. Can applause all speaker again.

Related talks