Building the First Real-Time Blockchain
TOKEN2049 Dubai 2024 · April 2024 · 11:17
MegaETH co-founder Shuyao Kong presents the design of a real-time layer 2 at TOKEN2049 Dubai 2024. The keynote covers how a high-performance sequencer and optimised execution aim to deliver very low latency and high throughput while inheriting security from Ethereum.
Speakers
Topics
From TOKEN2049 Dubai 2024, hosted by TOKEN2049.
Transcript
Yeah, anybody has heard of MegaX? No one? That's why I'm here. Um cool. So, my name is Xuyao. I'm the co-found one of the co-founders of MegaX. Uh we're really a bunch of passionate builders pushing the boundary of what a fast a real-time blockchain could be. So, if there is one thing I want you to take away from my conversation today is that MegaX is taking an extreme approach to scale a blockchain.
We're here to fundamentally unlock new use cases and new experiences. We're good? All right. So, let me introduce my team a little bit. Uh we're a team of both gigabrain researchers and business professionals. I have two technical co-founders. Um Elon graduated from Stanford computer science PhD program. He focused on low latency data center computing. My second technical co-founder Lei, he graduated from MIT computer science department. He actually focused on high throughput network. Um anybody here knows EigenLayer?
So, the famous data availability white paper that EigenLayer is known for, my co-founder Lei is actually the first author. So, he wrote that while he was at MIT. Uh myself, I'm Xuyao. I was leading business development at ConsenSys for the last many years. I went to Harvard Business School. So, let's face it. Blockchain hasn't scaled. Everybody talks about TPS. TPS is this old-fashioned memetic meme. You can claim to be 1 million TPS. But in reality, none of the blockchain has really scaled beyond a few thousand TPS.
And we've all seen on some blockchains you have a few meme coins and it just crashed the chain. So, why is that? The problem isn't on the hardware. In fact, if we look at the components of hardware on a blockchain, aka computing power, disk IO, and network bandwidth, each component is sufficient and capable of handling 100,000 TPS. So, why haven't we scaled the blockchain properly yet if it's not the hardware?
What is the difference between potential and reality? Our short answer is software inefficiency. If we look at the modern blockchain, right? There are really two important components. Consensus and execution. Consensus is basically ordering users transaction and sequencing it. Transaction is basically execute these ordered uh ordered um ordered execution is basically transacting this uh transactions based on the order.
Both are extremely important to a blockchain. And having both is actually determined the performance of a blockchain, which means a blockchain's performance actually depends on the slowest one of the two. I can give you an example. Um Dubai rained, right? Anybody suffer from the rain? Everyone? So, imagine Dubai's uh rains again, God forbid. And the sewage system has two pipes, a bigger pipe and a smaller pipe.
Guess what is the amount of waste water the pipe can handle per second. What does it depend on? The smaller pipe, right? Because the smaller pipe is the bottleneck of the TPS. This is the same with blockchain. You have consensus and you have execution. Whichever that is slow actually determines the performance of a We are clear here? So, based on that knowledge, why hasn't layer one scaled? Layer one fundamentally cannot scale because the layer one nodes have to do all transactions
at the same time. So, layer one nodes have to perform consensus. They have to perform data availability. They also have to perform executing the transaction. When you have to do so many things at the same time, you're basically duplicating efforts. When you're duplicating efforts, you become really slow. I'll give you another example. Suppose I'm a teacher. I have a thousand students. Some of my students are probably really bright. Some students probably need a little bit more care.
But the speed of my teaching really depends on the students who are slow. And this is what a modern blockchain layer one blockchain faces. It cannot go fast because it will have some node that is just simply slow. Therefore, layer one has fundamental bottlenecks and is fundamentally inefficient. Let's look at layer twos. Is I mean, are layer twos better? Sort of, but not really. Layer two has sorted one problem, which is the consensus layer. People familiar with optimistic roll up and CK roll up.
Yes, no? That's what they have done, solving the consensus. But none of the existing layer two has even touched the execution layer. So, going back to my Dubai rain pipeline example, it's like the layer two has two small pipes trying to drain the sewage, and they fixed one pipe, so now you have one big pipe and one smaller one. What's the result? You still haven't solved the scalability issue, right? Because you still have a smaller pipe.
But what we believe is that layer two possess the most unique and underexplored scaling opportunity because it has already solved one pipe. Now, if you solve the second pipe, you're actually having an ultra-high performance blockchain. And this is where MegaX comes into play. We aim to solve the last mile scaling bottleneck, which is the execution layer. Our goal is to achieve over 100,000 TPS and sub-1 millisecond latency. Let that sink in. I don't think anybody has seen a blockchain that runs like this.
So, how do we do it? We have two special secret sauces. The first one is node specialization. What is node specialization? It is an idea of decoupling execution from the layer two full node. So, you're basically offloading heavy lifting compute to a smaller set of execution nodes. So, in my original example, right? You have 1,000 students, and rather than teaching the bright and the one that's not so bright at the same time, you take out the not so bright, you give them special care so that they can go fast.
And this is what node specialization is really about. You concentrate on a smaller set of nodes to maximize their capability and then you have a bunch of watcher nodes that is decentralized to validate the execution node to make sure that they're not cheating and to ensure the liveness of the blockchain. Our second secret sauce composed of a bunch of ingredients and the whole idea is once you have this smaller set of sequencer, you can optimize the hell out of it and there are a few optimization techniques. I'm going to list the four today.
The first one is maintaining Merkle tree. So maintaining Merkle tree actually consumes 90% of CPU cycles and we are using a bunch of newer data structure and data try to solve that. The second one is execution overhead. We are deploying in uh JIT compilation uh to solve execution overhead. The third one is in-memory compute. So for those who are not technical here, when you are loading data onto memory, it actually is the fastest storage layer for everything.
And the last one is parallelization. So who is familiar with parallelization here? Okay, so parallelization actually doesn't scale blockchain. The most that parallelization can give you is maybe 2x to 3x performance. And the reason is not everything is parallelizable. For Mega Ace, parallelization is a teeny tiny part of our tech stack, but I always feel obliged to mention it because everybody's hyped around parallelization, but I think soon people will realize that especially layer one parallelization will not solve anything.
So what does it mean, right? Remember the one thing I want everyone to take away from this presentation is that Mega East is taking an extreme approach to scale a network. And when you're taking an extreme approach with centralized block production and decentralized block validation, you're really unlocking a new set of user experience and use cases. So, club, right? Central limit order book. It has not worked on any change. Has not worked on EVM. Has not worked on Solana. I don't know what it hasn't worked on, but it will work on Mega East.
Real-time sports betting. Who watches Love Island? Imagine you're watching this guy, you raise your hand all the time. Thank you for supporting. And you're not even part of my team. That's great. Uh imagine you're watching Love Island and you can make real-time betting with your friend of the outcome. That's pretty cool. That's a streamlined blockchain. Imagine fully on-chain game, right? Never need to worry about the engine anymore. You can For developers, you can feel free to put everything on chain rather than being worried about gas golfing. And that's where the unlock is.
And lastly, I think there's a lot of use cases, honestly, even our team hasn't thought about. Like when the internet became mature, who has ever thought about YouTube would happen? So, to me, Mega East is a technology that would unlock the next YouTube on Web3. We're here to make Ethereum great again. Come build with us. Thanks.