universal synchronous composability

ETHCC 7 · 10 Jul 2024 · 37:41

Justin Drake argues that universal synchronous composability is one of the most elegant ways to fix Ethereum fragmentation, letting contracts on different rollups call each other as they do on L1. He says it needs two ingredients: real-time SNARK proving, helped by SNARK ASICs, and shared sequencing, with Ethereum itself as a based sequencer. He explains pre-confirmations, which need no hard fork, and says they could cut censorship from about 70% of blocks to about 10%.

Speakers

Topics

From ETHCC 7, hosted by Ethereum France.

Transcript

Okay, good morning, everybody. Um, today I'm going to be speaking about universal synchronous composability, which in my opinion is one of the most elegant and wholesome ways to fix Ethereum fragmentation and gracefully scale Ethereum. The vision is the united chains of Ethereum, where a contract on rollup A can synchronously compose of another contract on rollup B, where basically the boundaries, the friction between roll-ups melts away and disappears. We have the same luxurious composability that we have at L1 today, where you can immediately pass messages across contracts as well as pass assets in and out of contracts.

In order to achieve this very, very ambitious vision, we're gonna need a very powerful tool. We're gonna need some magic. And the magic that we have in development right now is called low latency SNARKs. It's SNARKs that are produced extremely fast. And with low latency SNARKs, we can have real-time settlement of rollups and real-time message passing between rollups. Even though these rollups don't trust each other, they can still synchronously compose. Now we have made tremendous exponential progress on SNARK-proving performance.

Just a few days ago, there was an amazing benchmark where a laptop CPU proved 1.2 million hashes per second. Now that might not be a number that's relevant to you, but to me, this is an amazing benchmark for 2024, and it's shown how far the industry has progressed. And what's going to take us to the next level in the coming months and years are gonna be SNARK ASICs. So not only do we have software optimizations, but now we're moving into the world of hardware. And there's three different companies that have either already successfully taped out a SNARK ASIC or are in the process of taping out an ASIC this year.

Those are Axial, SISIC, and Fabric. And that's gonna give us another couple of orders of magnitude speed up versus what we have. So real-time proving is coming. And in the short term, we can use TEs and enclave as a training wheel to fake it until we make it. Now here's the big picture mind map. The ultimate goal is to fix Ethereum fragmentation. And my thesis is that for that, we want synchronous composability. Now, in order to get synchronous composability zooming out, we need these two main ingredients.

We need the real-time proving, the magic technology, but we also need shared sequencing. And shared sequencing is not about technology. Shared sequencing is about humans, communities. It's about coordination. It's about the various roll-up communities choosing to opt in to the same shared sequencer. Now, there's a lot of shared sequences that are being built out at layer two by various teams. But unfortunately, every new shared sequencer introduces a token, a brand, a security assumption.

And so my personal thesis is that the L1 chain, Ethereum itself, the so-called based sequencer, because it is the base layer, is the most likely candidate to become the shared sequencer for all of Ethereum because it doesn't introduce a new brand, a new token, or a new security assumption. But there is one massive downside with base sequencing, which is that the slots are too long. Ethereum operates at the scale of 12 seconds, which is too slow. So Vitalik, a few days ago asked the question what if we just reduce slot times?

What if we go from 12 seconds to two seconds, for example? And that would be a fantastic outcome and would make the base sequencer so much more attractive for rollups that want a fast user experience for their users. But the good news is that we have another path forward that's especially relevant in the short and medium term because it doesn't require hard fork, and that is pre-confirmations. So what I want to focus on today are the two green boxes. The synchronous composability, I want to explain to you why synchronous composability is so powerful, why is it so valuable, and why is it something that we should strive for as a community.

And I also want to focus on the preconfirmations, which is kind of this technical unlock that gives us base sequencing as the shelling point for the community to rally around. So I'll just go ahead and do just that with a talk on two parts. First focusing on the synchrony and then on the preconfirmations. So what is synchrony? It comes from the Greek synchronos, it means happening at the same time. The opposite of synchrony would be asynchrony, where things happen at different moments in time.

And in the context of roll ups, we have this notion of a super transaction. A super transaction is a more complex transaction that touches multiple roll ups. So instead of happening all within one roll-up, it touches multiple roll-ups. And here I have two roll-ups. I have the yellow roll-up roll-up A, and I have the green roll-up roll-up B. And so a synchronous super transaction happens all at the same time within one block, and it's all done by one entity, which is called a shared sequencer. On the other hand, the completely different model is called asynchronous supertransactions, where you have an initial leg of the super transaction which happens on rollup A, that triggers another leg on rollup B, and then maybe there's a final leg on rollup A again.

So one example here could be that I have EFER on rollup A, I want to buy an NFT on rollup B. Step number one, I send my EFER to rollup B. Step number two, I buy the NFT, and then step number three, I send the NFT back to rollup A. And you see in the async case, it's three different blocks, three different proposers, and we're introducing this notion of asynchronous friction, asynchronous boundaries between the blocks. And then we have other ecosystems that have tried to go down the other path: Cosmos, Polkadot, Nair, the internet computer ton, where they don't do things synchronously, and developers hate it.

Users don't like it, it's not successful. And so I believe that we should stay strong with the synchronous model and embrace it even for rollups, not just for the layer one. So one of the big advantages of synchrony is that it is maximally forward compatible. What that means is that it's possible to build asynchrony on top of synchrony, but it's not possible to do the other way around. You can never build synchrony on top of asynchrony. And the reason is if your if your platform forces transactions to be in different blocks, well, they can never be in the same block.

But on the other hand, if you have the option to have your legs of the super transaction be in the same block, then if you want, you can just spread them out over multiple blocks. And so you have this notion of optional synchrony. Synchrony doesn't mean that every transaction needs to compose synchronously with every other transaction. It just means that if you have a use case which requires synchrony, where synchrony adds value, then you have the option to enjoy this luxury. You have the option to pay for it with transaction fees.

Another benefit of synchrony is that fees are much easier to handle. And the reason is that you have your super transaction enter the next slot, and you know what the gas price is at the next slot. This is a known quantity. On the other hand, in the asynchronous case, the gas price is unknown because it's going to happen in the future. The gas price might go up, it might go down. This leads to all sorts of complications around how you handle change. And it's one of the advantages of synchrony to not have this complication.

Another big advantage of synchrony is just speed and latency. Things happen faster. So here in a synchronous world, it just happens in one slot. Whereas here it happens over three slots. So if your slot duration is two seconds, the right hand side takes six seconds and the left hand side takes two seconds. It's faster. But it turns out the delta between the left and the right grows much bigger when we add this notion of pre-confirmations. So when you have a single shared sequencer who can sequence all the legs of your super transactions, you can get a pre-confirmation from that next sequencer.

And that comes on the order of 100 milliseconds. But when your supertransaction is executed by different proposers who don't have full monopoly power over the three next slots, then you can't get these pre-confirmations. And so now the delta between the left and the right is 60x. It's six seconds versus 100 milliseconds. That's almost two orders of magnitude of additional latency in the synchronous case. Another huge advantage of synchrony is the notion of aggregators.

So on L1, we have a services like One Inch or Matcha, where if you want to make a trade, it will very cleverly route your trade through the various pools of liquidity so that you get best execution. We don't have Matcha or One Inch across rollups. And the reason is asynchrony. And so what we're left with is these fragmented pools of liquidity. And so now as a user, if I want to buy an asset, I'm limited to my local synchronous market within my rollup. I don't have access to global best prices across all of Ethereum.

Another benefit of synchrony is this idea of a flash loan. Flash loan is kind of this magical superpower that is only really possible in blockchains, and it they only work within a single block. So before your super transaction, you open a flash loan, and then you can have that flash loan flow through roll-up A and B and black to roll up A, and then once you're done with your super transaction, you repay the flash loan and it's all good. But in the asynchronous case, you can't do that, right? Because if you take out a flash loan in the first block, you have to repay it by the second block.

And so it cannot flow through rollup B. It's kind of local to rollup A. And flash loans are relevant for all sorts of other applications like loan refinancing and fancy arbitrages. Now we're moving on to some of the developer experience advantages. So it's not just the user that gets a better user experience, but also developers have a much saner way of programming complex applications. And one of the reasons has to do with reversions.

In a synchronous world, what can what happens is that the builder who builds the next block can simulate the whole super transaction, just like they simulate a whole bundle today in the context of proposable builder separation. And if there is any reversions, they can prune away the whole transaction because it's kind of a non-valuable transaction. On the other hand, you don't know a priori which legs of your super transaction will fail because they're spread in the future and the future is uncertain. So in our example of trying to buy an NFT, what could happen, for example, is that by the time that my ETH has arrived in rollup B, someone else snatched the NFT before me, and now I can't buy it.

And so now my application has to deal with the case of reversions where it needs to send the ETH back to rollup A. And sometimes like the operations are not reversible. At the very least, one operation which is not reversible is paying for gas. So you end up wasting gas at a minimum for the user. And the idea is that the transaction doesn't become public until it hits the blockchain.

But here, in the asynchronous world, you don't have encrypted mempools. They don't work very well anymore. And the reason is that the second and third leg have to happen after revealing the first leg. And so you've leaked information in your first leg, and so now you're potentially exposed to front running and manipulation because you've disclosed information publicly about your transaction halfway through the execution of your transaction. And then another very important consideration, especially as applications become more and more complex and touch more and more rollups, is liveness and censorship. When you have shared sequencing, there's only one thing that can fail, is the shared sequencer.

But on the other hand, with asynchronous execution, multiple different uh sequences can fail. So if you have a centralized sequencer, you know, we've seen accidental liveness failures happen, but it's also relevant for censorship. Let's say that rollup B just wants to censor certain types of transactions. Well, now your application stops working if it requires rollup B. And so the liveness failures start compounding on each other as opposed to having a very strong link and not suffering from the weakest link problem. Okay, so those were some of the highlights, some of the advantages of synchrony.

And I think it explains the correlation between successful blockchains and synchrony. It's a much saner model to program in for developers. And it's maybe correlated with the fact as well that imperative programming languages are much more popular with programmers than functional languages, just because they're easier to reason about and easier to build applications. And not only is it easier for developers, but there are benefits for users as well. Okay.

Part two, pre-confirmations. So just to give you a recap, pre-confirmations in some sense is the key technical unlock in the short and medium term that can give us the synchronous composability that we want. Pre-confs make base sequencing very attractive because it reduces the user experience latency. So it's a user has uh a latency of 100 milliseconds in sense of 12 seconds. That gives us shared sequencing, synchronous composability, and ultimately gives us a path towards fixing fragmentation.

Now let me introduce some new terminology that is relevant to preconfirmations. We have the notion of a slot, which is the unit of time that is used for blockchains. In Ethereum, it's 12 seconds. Let's zoom in to the slot and break it down into smaller chunks, which we are gonna call ticks. Now, this tick terminology I've actually stolen from Solana. Solana has 400 millisecond slots, and within each slot there's 32 ticks, and so each tick is 12.5 milliseconds. And then there's another project called Mega ETH that has one millisecond tick durations.

Okay, so that's ticks. Another notion is a space notion as opposed to time, which is the notion of a shred. So we start with a block, that is our unit of space in a blockchain, and we're gonna zoom into it, and we're going to look at various shreds that are built from top to bottom within the block. A shred is like a small piece of a block that contains transactions similar to a bundle. Now, the way that pre-confirmations work, the basic idea is extremely simple.

I, as a user, have a transaction, and I want to have it pre-confirmed within 100 milliseconds. What I do is that I identify who will be the next block proposer, who will be the next entity that can sequence my transaction. So in the in the diagram here, we have the look ahead, meaning that we know who the next proposers are. And the next sequencer is the one with the emojis one, two, three, four, because they get to order the transactions. And so as a user, I make a request to this next sequencer, I can contact it directly, and the next sequencer gives me a promise that they will execute my transaction, for example, in position 10, and that the price that I will get on my Uniswap trade is $12 per token, for example.

And this changes the dynamic of block building. We move to a paradigm of real-time block building. Imagine that the sequencer has already built the top of the block, the blue portion, the first few shreds. And then here comes a request from the user. What the sequencer will do is that they will append the user's transaction to the to the block prefix, and then they will send a promise saying, hey, I promise to build my block that is respectful of this prefix that I have committed to. And the way that it works in Solana is that they have a proof of history, which is a cryptographic mechanism like a delay function, a VDF, whereby it's difficult once you've committed to a shred, it's difficult to go back in time.

So they use physics in some sense to do the commitment. So if a user was given a pre-confirmation, and this pre-confirmation was reneged, then there's an opportunity to slash the sequencer because they have collateral. And there's two types of pre-confirmation failures. There's a safety fault, which is when the sequencer says, I promise to include your transaction at position 10 and your price will be $12 per token, and instead it just includes a completely different transaction that doesn't respect the pre-confirmation. That is something that should never happen if I am an honest sequencer and I honor my pre-confirmations.

But then there's another type of fault, which is that the sequencer has a missed slot. Now it turns out that there's two reasons why blocks get re-orged out. One is that you built upon the wrong parent, or reason number two is that you broadcast your block too late. Both of these things are under your control as a sequencer. So if you have a good enough setup and a good enough internet connection, and you make sure to build on the right parent and to broadcast your block on time, then you should not have liveness faults, just like you should never have safety faults.

Now, one of the reasons why pre-confirmations are very wholesome is that they give breathing space to the consensus layer. If you take Solana, for example, they have gone down this race towards zero duration slots slot times. Right now they have 400 millisecond slot times, but they want to go down to 100 milliseconds and below. When you have preconfirmations, we already have the UX benefits of short slot times. And so we there isn't this pressure for the validators to provide these very, very short slot times.

And that gives breathing space for the validators to run on home internet connections and like slightly less sophisticated and centralized hardware and internet connections. Another really big benefit of preconfirmations, besides improving the user experience and improving the decentralization of the L1, is that it defangs the builders. The builders today are very powerful and influential intermediaries in the process of block building. We're all familiar with this MEV pipeline where the user originates a transaction, it goes through a wallet, and then this transaction goes to searchers and builders and sequences.

This is the so-called MEV pipeline. And we have intermediation between the wallet and the sequencer with searchers and builders in between. And what happens is that it's pure capitalism. The most economically competitive builder is the one that gets to build the whole block, the entirety of Ethereum for a whole 12 seconds. And in particular, they get to enforce their preferences. So if they want to censor certain transactions, they'll just do that. They have the power to do so.

On the other hand, with the real-time block building model, there is no intermediation between the wallet and the sequencer. The user has a direct connection with the sequencer. And the searchers and the builders are worker bees that come in and help in real time. So for every shred that needs to be built, the searchers are engaged to try and build the best shred for the users, and they don't get to dictate the contents of the whole block. They merely help building shred by shred.

And so when we look at censorship today with the monolithic block building, which is the status quo, there's two entities that can censor. On the one hand, the sequencer who has monopoly power over the contents of the block can censor. That is a fundamental thing. But the context of real-time builder, meaning, the most economically dominant builder is just a helper. It cannot censor, it does not have power. And so what that means is we can dramatically improve the censorship resistance of Ethereum today.

And the reason is that today, roughly 70% of Ethereum blocks are censoring OFAC transactions. These are transactions that touch addresses that are on this sanctions list, the specifically the US sanctions list. So today we have a very bad situation with censorship. 70% of blocks are censored, and it's all due to builders. Almost all of it. On the other hand, only 10% of staking operators of validators connect to only censoring relays. And so we have an opportunity to basically improve censorship resistance by 7x, going from 70% censorship to only 10% censorship.

And then again, one of the really amazing things about preconfirmations is that we can do them now. There's no need for hard fork. Shrinking the slot times is amazing, but it's going to take most likely years. And so what has happened is that a small group of very passionate developers have started building pre confirmation infrastructure. A few weeks ago, we had Zoom-In, and it was the very first DevNet that showed a proof of concept for preconfirmations. And here at EFCC, we have a long standing test net where many different teams and validator operators are testing preconfirmations.

And we even have an integration with the MetaMask wallet. So that's the end of my talk. I still have plenty of time for questions. Thank you so much. Any questions from the audience here? So you said that in order for the pre-comp.

Can you speak closer? In order for the pre-comps to work, you have to know who the block proposer is gonna be in slot N plus one or N plus, but doesn't it get picked at the beginning of the slot? Uh-huh, great question. So the way that leader election works on Ethereum is that at every epoch you're going to elect the list of sequences, not for the current epoch, but for the one after that. And so you have this notion of a minimum look ahead. At a minimum, you can currently you can always see the next 32 slots.

So we can leverage this relatively long look ahead to identify the next sequencer and use them as an entity to provide pre-confirmations. Great question. Thank you. Thank you for the presentation. Could you expand on what are the implications for moving that in production? So you have now a test net, and what are basically the constraints before having something that is actually working for the end users.

Right. So right now we have one single base rollup, uh, which is called Tyco. Um, and they are aiming to have pre-confirmations on mainnet this year. Uh so the main constraint is just productionization of the code and and coordination across the various teams. There's now something like six or seven teams that uh including many startups that have launched specifically to build uh pre-confirmation infrastructure, and they're helping out uh Tyco with with their goal to have preconfirmations on mainnet this year. There's also consultancies, so there's Nevermind, for example, that has set up a dedicated subteam called Switchboard that uh is doing nothing other than working on pre-confirmations.

And there's another consultancy called Lime Chain that also has a sub team dedicated to pre-confirmations. Um I think the real luxury is that we can move very, very fast. The idea of pre-confirmations came literally a year ago at EFCC. I was walking in the street with Mike Newder, and we kind of were talking about it, and then that it uh the idea came about. Um really only in the last few months, maybe the last four months, has there been any real building. Um so I'm very very hopeful that by the end of this year we will have preconfirmations for for Tyco.

Now it turns out that we can also provide uh pre confirmations for the L1 itself, but uh unfortunately, it's a slightly weaker type of pre-confirmation. It's called an inclusion pre-confirmation, where the only guarantee that you have is that the your include your transaction will be included on chain by a certain slot, but you don't know exactly how it will execute. So if you're doing a Uniswap trade, you don't know exactly what price you're getting. And there's a team called Bolt that is specifically building these layer one pre-confirmations, and I also expect them to be in production later this year. Thank you, maybe just a quick follow-up question on this.

Is when it comes down to the base sequencing, like don't we need anything at the basically validator level? So how the coordination happens between the layer twos. Yeah, fantastic question. So what we need is for the layer twos to agree on who the sequences are. So we need some sort of a shared registry contract where validators can opt in to providing pre-confirmations. And in order to register, they're gonna need to put forward some amount of collateral, for example, one ETH.

And then once we have that, we need actual entities to do the heavy lifting. It turns out that providing pre-confirmations is a sophisticated job. You need to have very good uptime, very high bandwidth, you need to be running full nodes for all the different base rollups. You need to have low latency, et cetera, et cetera. And so just like we have the concept of a relay for MEV boost for proposable separation, we will we're introducing a new concept called a gateway, which is the equivalent for pre-confirmations. It's a sophisticated entity that you can delegate your sequencing rights to, and they will do all the pre-confirmations on your behalf as an agent.

So we have uh you know teams building gateways, and some of the existing relay teams, uh so for example, uh Estes, uh Ultrasound, um, and Titan have all expressed interest in launching a gateway in addition to their relay. Because it's a very similar job. It's basically very heavy on DevOps, uh, which is what the relay teams have expertise in. Um this is basically a follow-up question to the first question, uh, where we established that we know the proposals or sequencers um ahead of time.

Does that mean that um pre-comps are inherently um incompatible with secret leader election? Aha, great question. So, secret leader election is this trick uh where a public observer doesn't know the identity of the next sequencers, and this protects this entity against denial of service attacks because it doesn't leak the IP address or the pub key of the next uh sequencer. But it turns out what you can do is that you can encrypt the pub key, that's how secret leader election works, and now you can send your preconfirmation request to the encrypted pub key. So even though you don't know exactly which proposer you're dealing with, you can still communicate with them cryptographically.

Great question. Um searchers and builders um should become like worker bees, you said? Yes. And uh where's the what's like the fundamental part of the pre-confirmation design you have in mind that kind of guarantees that or keeps it that way and doesn't uh and prevents that these worker bees again get very big and centralized um because I don't know, because they buy all the shreds and then resell them, or I don't know. Right.

So one of the things that we need is a credibly fair auction that is held by the sequencer or the gateway. Um one of the things you can do is like rely on trust, just like we have trusted relays that are trusted to be good auctioneers for the PBS auction, but we can elevate that with tools like Enclave, like SGX. Uh there's projects like Sua from Flashbus that are building exactly that. Um the important thing is that there's a competition for every shred, and most of the heavy lifting is actually done by the by the searchers. Now, let's imagine that there's a contentious transaction that comes in.

It's it touches an OFAC uh sanctioned address. What's gonna happen is that we we start with a set of let's say K different searches, and you know, half of them drop out because they're regulated and they can't search for this specific transaction. Well, it's all fine, you know, you still have half the searchers competing against each other uh to provide best execution for this one transaction. And basically you have this notion of um you know, honest minority. You just need one single entity, one build, one searcher that is not censoring in order to get that that shred within the block.

Thank you, everyone, for a great questions. We don't have more time. Can we give one more applause to Justin? Thank you.

Related talks