Defying Gravity: Levitation Lifts Off with ZK-Rollups

ETHCC 7 · 11 Jul 2024 · 25:17

Stan Kladko, co-founder and CTO of SKALE, introduces Levitation, a protocol for decentralizing ZK rollups. His starting point is that rollup sequencers are centralized. Levitation reimplements most rollup stages, such as the pending queue and block building, as Solidity smart contracts on a fast chain, leaving proving and relaying to off-chain agents. Existing ZK rollups then act as pluggable modules, and several can share one chain. He also announces the SKALE Pacifica release, giving about 400 TPS and two-second block time that equals finality, as he states.

Speakers

Topics

From ETHCC 7, hosted by Ethereum France.

Transcript

Give me a reason. Hello guys.

I'm Stan Kletko, co-founder and CTO of Scale. Nice to see you here. That's the last day of the conference. Hope you all enjoyed the conference. So I'm gonna talk about roll-ups. How we came up with an idea to decentralized to decentralized rollups, ZK rollups. But before we start, I just have some simple question to you. If you have any cash in your wallet now, even one one euro or whatever, raise your hand. If you just have one euro in your wallet.

If you have a hundred euro in your wallet, raise your hand. If if you have a thousand euro in your wallet, raise your hand. Okay, that's a joke, I don't have a thousand. But the point I'm making is that actually I don't really actually know. I can I can check how much I have. I mean, I have this tiny thing because usually don't people don't use much cash now. They have like credit cards, but still you still need to carry a little of cash because you need to pay, you know, kind of like reserves reserve thing. So I actually have, I think I have like 50 euro. And I have this tiny compartment because I don't use much cash, but still, you know, I want to to have cash.

And the wallet is a very interesting thing because it it actually is actually an illustration of the trade-off we have between security and uh convenience, right? Uh wallets are pretty pretty insecure. You can lose the wallet, you can lose cash, but they're very convenient. And then actually the smartphone is the same. People carry out smartphones, which are very expensive, you know. So you can lose the smartphone, but it's actually a very convenient thing. So this actually is it's an important thing because it illustrates the fact that people ask a question: do we need to push all of the transactions to Ethereum main net?

And I think the the answer is clearly no, because if if a transaction is not so valuable, there's a trade-off between security and convenience, and it's faster not to push. So I think when people talk about roll-ups, you know, it's kind of a slider where zero is there, no roll-ups, and a hundred push everything to the main net. I my feeling is that you know the real thing is somewhere in the middle. So there are some transactions uh that you need to push and some not. And so uh I'm gonna discuss it.

And I also have this uh kind of screen from the inception movie, and you'll understand later why this is all related and related to rollups and the ZK rollups and decentralization. So why I'm I'll start about talking a little bit about scale, why we want rollups and what is scale. So scale is a pretty successful network. We've kind of launched several years ago, and like since like probably like two years, we've been having a steady steady growth. We have lots and lots of apps. You can you can find us about on DEPRADAR.

You know, we are pretty successful in gaming. We have many many games now. We are probably now daily a leader, if not the leader in gaming. So we have lots and lots of these decentralized games, really interesting stuff. And then the question like for decentralized games are our chains, you have many many chains. The chains are zero fee, which is really great for games because you do many things in games, people click, you know, they gather some items. And as I mentioned, not all of this needs to happen on Ethereum mainnet, especially because our detail also also has very fast finality. So we are very fast, zero chip, and uh we uh have lots and lots of transactions.

But then we're still thinking about ZK and ZK rollups, and the point is that some of the transactions on our network do need to be ZK, we think it they would benefit from being ZK because they are high value transactions, right? If one of our users ends up making a 10,000 euro and there's an NFT, this user may actually want to secure this NFT with uh with uh Ethereum mainnet. So there's this slider, the trade-off, and for higher value transactions, higher value items, the user actually needs ZK rollups. So for our network, the answer is in some cases people want them, in some cases people don't want them, but in any case, they they have to be decentralized, the rollups.

Yeah, again, it's like we really, really really have many, many games. So, first of all, what is a ZK rollup? Like a very simple introduction for those of you. Which of you guys know what a ZK rollup is? Please raise your hand. Okay. So I'll I'll provide you a very simple explanation of what the ZK rollup is. It's kind of a trade-off because the computation doesn't happen on Ethereum mainnet. Instead, users submit transactions to this guy, the sequencer, and the sequencer actually does the computation and kind of pulls all the transactions into blocks and pushes the blocks to Ethereum mainnet. But then on the Ethereum mainnet, there is this cool thing which is called ZKL proof, which is actually verified by by the network.

So all no, so the trans the computation is made outside of the network off-chain, but then it's verified on chain, and then the chain doesn't have to make computation. So the idea of a rollup is very simple. And then it's actually pushed. The trade-off is that this computation, the ZK proof generation, is pretty computationally intense. People are working to make it less and less expensive all the time. But still, I think at this point you need to spend about maybe one cent per 10 transactions, something like that.

So you still pay. So you still have this trade-off. And another thing which is also important, the problem about sequencers now, they are centralized. You probably know, like a couple of days, a couple of weeks ago, there was a problem at one of ZK rollups. So decentralization actually turned out to be the hardest problem you you have all of the things running you know but all of them are centralized and that that's that's the thing that needs to be solved.

So we came up with this interesting idea. Basically, that's why we're talking about inception movie that to if you want to decentralize uh like decentralized rollup, a very vague idea is that you take its code and implement it in Solidity. So anything which you which is centralized, if you re-implement it in Solidity, it becomes decentralized. Just because Solidity runs on decentralized blockchain. So there is this inception idea where you take the ZK rollup and implement it in Solidity, and it magically becomes decentralized. So that it can be done really fast.

And that's that's really interesting. That's really got us really interested. So we basically that's how we want to decentralize the rollup. So like the vague idea is just take the code and re implement it in Solidity, but then you have all kinds of problems. And I'm gonna talk about these problems. Yeah, and then what we found out actually when we tried doing it is that it's not so hard. We looked into different roll-ups and uh how they can be tweaked to get decentralized. Uh and it turns out that you know in some cases you just need some tweaks, little tweaks of the code to do it. It turns out actually possible to do it, and this kind of a general framework how to do it.

So we thought, okay, now we can maybe take many, many, many roll-ups and decentralized all of them and create like a plugin architecture where there is this inception thing, and all of them get magically decentralized. So, yes, our protocol, as I mentioned, it runs on blockchain, it's implemented uh as a set of super contracts in Solidity, turns existing ZKRs into pluggable modules, uses standard Solidity tools and libraries. Also, we can run multiple ZK rollups on a single levitation chain, and we provide common transactions ledger and state and force. So these roll-ups can interact.

So basically, we take our chain, scale runs many, many fast chains. We are really fast. And it's because we are fast, we can actually take one of our chains or many of our chains and actually run rollups on them on in Solidity. That's the idea. So how the protocol works. Turns out if you just look up abstractly at the higher level, pretty much any rollup, you have the stages. So the transaction is submitted, there's a pending queue, then the sequence sequencer works, and sequencer basically glues transactions into blocks. And then the sequencer executes the block.

And also in VM, right? And also runs this number crunching, this expensive ZK ZK stuff, something which is called proving. And then once this thing is actually done, the proof and the block, the entire thing is relayed to Ethereum mainnet, plus smart contract, and then there's a smart contract in Ethereum mainnet that verifies ZK proof. So pretty much any ZK rollup you can take. Like ZK sync, you can take Polygon, you can take scroll, you know, all of these guys are many of them, many, many of them now actually work the same in the same way. The mathematics is different, but there is this you know abstract thing.

And just to illustrate it from a different perspective, again, there are the stages, and you have on on top, you have two rollups. And so what we want to do is actually create this common architecture where we take these two rollups and we pull out some of the things and re-implement them in Solidity, and then the things which we cannot do in Solidity, right? Uh is the most important thing is uh proving because proving is super expensive computationally, so we cannot prove it proven solidity. That's why this has to be executed off-chain.

And another thing which needs to be done outside of Solidity is relaying. But that's really simple. The relay agent just you know pull takes the block and uh pushes it to the mainnet. Every rollup has a relay agent, but we can take our relay agent and use our relay agent for fair thing because it's actually very simple, very simple component. And to decentralize relay agent, it's also pretty simple. What you do is basically do some kind of round robin where there are many relay agents and each of them in time slots in round robin fashion, just relay data to from the rollup to the Ethereum mainnet. That's the idea.

So the idea is we take all these roll-ups, we we implement many of the stages in Solidity, and then each roll up just becomes a plugin. And what we actually need in the for from each of the roll-up mostly is the mathematics, the number crunching. Yeah, so that's actually how this thing works. Uh this is uh just an illustration. So, how how does it work? So, a user, you are a user, right? Right, you submit a transaction. That always happens on Ethereum, right? That's where it starts.

You have a browser and you submit a transaction to the queue. Here, you submit the transaction to a queue, but the queue is a smart contract. So your painting queue becomes a smart contract. Users submit transactions to this queue, and the queue actually orders transactions, uh, glues them into a block. And usually this happens off-chain, but in this case, the the smart contract you know glues the transactions and create a block, creates how to block out of them. Block candidate, right? And then this off-chain off-chain parts need to happen, where the off-chain agent, the number cruncher, pulls the block from the chain and does the number crunching and then pushes the the proof back. Here actually, centralization is also very simple.

You can do like round robin, you can do financial incentive. So this part needs to happen off-chain, but the economic model is also pretty simple because this agent needs just you just need to do number crunching. There is this block candidate, you pull it, do number crunching, and then push the proof back to the two chain to the smart contract. And number crunching is specific to each rollup because the game is different for each rollup. And then the smart contract gets this block, this proof, and then relay agents, as I mentioned, uh push the block and the proof to Ethereum mainnet. And then on the Ethereum mainnet, this kind of proxy smart contract are like which actually receives this data.

And then there is a specific verifier smart contract which we can pull from each uh each uh ZK rollup because verification is also roll-up specific. So that's actually really interesting framework where we hope what we hope we can do, we can take all of the roll-ups and kind of bring them into this like a plugin system. So we kind of started looking into different rollups, and you know, not all of them are at the stage where you can do it because people say they are all done, you know, the code works. You actually start running the code, and in many cases it's not 100% complete.

One thing, so which we're which is pretty complete. We've been actually playing with polygon. Polygon, and it looks to be the most stable code in terms of other people being able to use it because we need to take it and use it in our engineering team, in our QA team, and actually do this thing. So this with Polygon, we've been doing pretty well. We have already the prototype running in our inside of our lab. And uh we're actually thinking about you know releasing this prototype at some point. And also we're waiting for other roll-ups to mature a little because at this moment, not for every roll-up you can actually pull the code and execute it. You know, it's it's not for every.

But Polygon, I think was pretty pretty good in terms of them publishing everything on GitHub and like you know, being us being able to use and compile and everything. Turns out the tweaks of the code are not so big because what you need if you have a roll-up, you just need to find a place where receive the transactions, and you kind of interject and push this transaction to the smart contract, and then you need to have a fail find a place where the transactions are uh processed by the game number crunching, and again you kind of interject and you pull from the smart contract. So essentially by massaging an existing rollup a little bit, you can actually turn it into a decentralized roll-up almost magically, where like things actually start happening, happening on um in a smart contract on a blockchain, and then instead of a single roll-up number crunch, and you think you have this nodes, relay agents are decentralized, number crunching are decentralized.

So you're actually making the entirely centralized system. So that's something which really really works because it is actually very lightweight in terms of taking something and making it decentralized. Yeah, so maybe uh that's kind of how it works. I don't want to go too deep because I know you know people sometimes going too deep is not the most effective thing during a conference. But essentially, you know, we have the smart contracts, and we kind of the most important smart contract is definitely the queue that that receives the transactions, the block candidates, the the contact which stores block candidates. These are the most important things.

And then we need to have a verifier smart contract, which is kind of a proxy that actually accepts transactions as blocks, and then pushes the thing to the to the roll-up specific uh verifier. That's pretty much how the thing works. Now, last thing I want to talk about is now we have this interesting thing, we have a fast chain, but we have this inception because inside of the chain we have kind of another chain, right? It's like the smart contract becomes the pending queue, and we have blocks inside smart contract. So we literally have this inception.

In theory, we could also inside this one, we could have another one. So we have like in the movie, we could have you know any number of these levels. So we have this inception thing. So but even with small one level, what we get, we have the we had the the kind of the original chain, which is fast in our case, and zero fee. And then we have the ZK chain, which is kind of an inception chain. And the user, these are like different virtual IDs for those chains, different chain IDs. So the user actually, the the uh the the game developer, for instance, right, can use this chain or that chain depending on what the asset is. And that's something which we discussed at like at the beginning about the trade-off.

That for some transactions you can use fast chains, and for some transactions you have you can you can use the k-chain that is actually secured by the mainnet, and then and then we can actually have a bridge, a virtual bridge between two chains. Yeah, so we're actually gonna release beta soon, as I mentioned, we're working through this beta soon. We're always looking for developers, both to contribute to our source code, but also we're looking for developer for gaming developers to work on scale. And uh why we worked on scale, we're actually growing pretty fast.

Uh the gaming side is growing fast, the DeFi side is growing fast. We now have already almost five million transactions, uh 50 million transactions a month, but we are growing fast. And uh you guys uh are uh welcome to try scale, try developing on scale. Also, if you want to contribute to the limitation protocol, also please let me let me know. And last but but not least, you know, why you need to develop on scale, we constantly innovate. And we just announced today, we're announcing today the new major release of scale.

So that's something that we call Pacifica, Pacifica release, because we kind of like this cool names, so it's Pacifica release. It's actually our six major release, so we're constantly improving our system. But the key things about this particular release is it's major major URI improvements. We got our stuff really really working really, really slick and fast. The TPS got increased twice. We were very fast before that, but now it's way way faster. And also we are getting to a two-second block time in this release, which is also important in terms of interactivity. And there are many many many other things in this specific release, just which I just announcing.

So you guys are all welcome to try Pacifica, run applications with Pacifica, and thank you. Thank you for coming to this lecture. Okay, thank you. If you have Christian, praise your hand. No. Okay.

Excuse me. Yeah, hey Stan. So I'm a bit confused about the TPS and block time or uh finality numbers. So with the Pacifica upgrade, what's the real TPS and the real finality of scale? I think the TPS we got uh in our QL we get we get about 400 uh transactions per second in this release. So I I I think uh at this moment we are the fastest uh Ethereum compatible chain, right? There are there are chains which are Ethereum compatible, but they don't have to execute the EVM and it kind of slows the slows things down a lot. But for Ethereum chain, I'm pretty sure that we are the fastest at 400 TPS.

The block time and the finality time for scale, actually the block time is the finality time is the same because uh every time a block is generated is final. It was other chains you can call kind of go go back in time. So you know like on Ethereum mainnet for instance, you have the block time which is like 15 seconds, but then the finality time is about 18 minutes, right? But in our key in our case the chain is fast and the block time is immediately uh finalized. The times are the same. So finality means just if you pay someone how much you wait before you actually give the apple, right? If you sell the apple to someone and you're waiting for the credit card transaction to complete, how much you wait to make sure that the money comes?

So in our case it's also gonna be two seconds in in both cases after Pacifica release. Thank you.

Related talks