[ETH Seoul 2023] The zk app chains thesis by Igor Mandrigin, GatewayFM

ETH Seoul 2023 · June 2023 · 26:04

Igor Mandrigin of Gateway FM explains why private rollups and ZK rollups make a strong foundation for app chains. The talk covers what an app chain is, how rollups and validiums differ, how optimistic and ZK proofs work, and how data availability and proving costs shape the design. It also explores how much decentralization an app chain really needs, with a look at Polygon Supernets and Gateway's roadmap.

Speakers

Topics

From ETH Seoul 2023, hosted by Kryptoplanet.

Transcript

foreign [Music] and I'm here to talk about private Roll-Ups and app chains in general so first a little bit about myself so I'm a favorite technical background engineering background I've been in the non-blockchain industry for quite a while was built in fintech browsers security and stuff like this then in 2017 joined status which is a messenger slash wallet Mobile Wallet then for a while I've been an ethereum core Dev likewise Thomas from Netherlands like working on Aragon team one more note and

I've been doing a little bit of research if you've been on the Thomas presentation he mentioned Witnesses so I was the one who measured them and brought this news and then right now I'm a city one co-founder at Gateway FM and we are as a company basically one of the core devs of the nurses chain where Little Bill helping with uh like again another architecture on polygons ekvm side and in general we provide quite a bit of infrastructure that we try to diversify from both the client perspective client diversity perspective and also on the data center diversity so we'll work with the independent data centers around the

globe to make sure that like no Cloud providers can capture too many of the rpcs and validator nodes and uh one of the here you see that we are used by quite a few clients already and uh one of the important thing that we also like a polygon supernets implementation platform and polygon super nice is essentially an app chain platform and this is what's to some extent inspired this presentation so at first I wanted to talk a little bit about just in general what step chains are then how can we use private Roll-Ups ZK relapse as app chains and a little bit of a roadmap should we at Gateway

how we see the future of this so yeah basically we start with the basic what is an app chain and it's basically if you can imagine that you have some kind of application or maybe a couple of applications that use this blockchain uh and you don't maybe even see it it can be publicly available or not and it's you can think about it as a basically a mechanism that's very useful when blockchain meets real world right because when you are within the blockchain space when you are doing defy or purely in a digital connections and stuff like this you you are fine with blockchain limitations but then when you

work let's say try to connect it to fintech or traditional Finance there might be some compliance security privacy or maybe some performance limitations that you just cannot like maybe the current Solutions that's kind of designed to be one size fits-all like a public rollups or public layer once or something like this they might not fit maybe you want some some ux and interesting gaming mechanics or tokenomics within your blockchain that is not available on them on any of the rollups or maybe too expensive to do on some kind of a smart contract level so when you can think about this as also a scalability version of the blockchain

like way back when we had this uh Serenity project that was renamed to each 2.0 right when we had the idea that we will scale ethereum uh in a way that we have multiple shards all the shards will be different some will be executing smart contracts with a VM some will have some wasm smart contracts with a beacon chain to kind of manage them all that's one way of like scaling the base layer but then it was kind of rebuilt in terms of oh let's instead of trying to scale the base layer we will do layers on top of that like layers two roll ups maybe layers three later on and then we see there that's that this purple applications they are land on these layers

uh neatly and with app chain thesis basically is that you have one ish like application to one each chain and in this case I show this is like more of a ethereum specific when we use private Roll-Ups they all are merged by layer one ethereum here but there may might be like let's say no CS also have this notion of ethereum verse when you have multiple chains that all run on the beacon consensus so then you can kind of bridge things and treat them as app chains within the same ecosystem that's another kind of way that's not here okay then the next slide basically in the if you look at modern app chains

again you have the cosmos ecosystem or polka dot or Avalanche that were built forever ago without chains in mind we have some ideas of how to do this on ethereum as well I'll Focus mostly on ethereum and I think the having the base layer to be like ethereum or something that's decentralized and neutral is super super important here and I'll talk a little bit in depth later about it and then if we switch to the roll ups themselves so we won't have chains we want to use rollups as app chains so what what is a roll up essentially it's uh two things right so to be called a roll up basically you need to have some

kind of a blockchain that runs you can call it on top of let's say ethereum and it has two connections to to ethereum one is data availability connection it basically means that in case roll up goes offline you can still recover the whole state of this roll up using only layer one only ethereum in this case and the second is some kind of a proof on chain there and then of course this setup is a bit expensive to run often especially the data availability that usually has uh scalable because the more transactions you have on Layer Two the more expensive

it is to to provide data availability to it so there is also a notion of validiums when you just have one chain proofs but you don't have data availability tuned on on layer one sometimes you might use off chain availability committee for that but still it's like a validium so it's a cheaper version but then you have a trust assumption that either this off chain availability committee or the layer to roll up operator does not go dark and the same way you can do basically layers 3 as well when you can have a layer 2 as a roll up whereas a validium and then I have like layer three as a roll up on the top of a roll-up which is also one more thing how you do uh basically the scalability

solution uh and then we have two types of Roll-Ups right we have optimistic Roll-Ups and ZK ropes and one critical difference between those two is that in optimistic roll up the proof that you have to provide on chain is the proof that something went wrong right so by default everything is okay we're not checking any anything and we trusting uh the system right but then if let's say multiple people are running optimistic roll up nodes that might be like oh this was an invalid transaction that was made and then you need to kind of prove the system to challenge this uh things uh on chain and this approach uh supposed to

be done by by the optimistic rollups and then we have kind of a ZK roll ups where the proof is it's actually the proof of correctness the roll up has to publish the correctness proof every now and then uh on on layer one to see that all transactions All State transitions all evm execution everything was done correctly and I roughly divided it in like three generations so first we had a very simplistic ZK Roll-Ups like Stark X Aussie casing Glide right they were operational specific you maybe could transfer money through it but you cannot do any generic code execution then we have again I roughly call it generation

two Stark net ncara because uh it's kind of they have of evm compatibility to some extent starknet has a transpiler that again never mind team is working on for instance which can take your solidity code transpile to Cairo and then it compiles to the byte code of Stark net roll up right then on GK single carry it's a little bit shorter the process is shorter it takes solidity code and using like llvm or something it's compiled towards some kind of a byte code that's then ZK sync is using and then we have zkvm from polygon which is basically a bytecode compatible ZK machine when your solidity code is compiled to the same byte code AS on

ethereum and then it's executed in the virtual machine that looks like and feels like ethereum virtual machine with like a couple of KVs but very minor okay then basically if you send the transaction to SDK roll up with the KVM let's say then at first it's just getting sent and then sequenced means included into sequencer includes it into layer two and then to basically save money on the gas fees they getting batched to put them together because if you put every transaction onto foodative ability on layer one basically we'll have the fees of layer 1 ish maybe a little bit less of them but if you bash

them you might save on the fees so before before it sends to a layer one for availability you kind of need to trust at this point the that the roll up will not like go out of service or will not do anything because it's not yet protected by by layer one but then as soon as it sends to the data availability you can at least again recover the state if you want and then after that usually quite a beefy server generates a proof for for this batch of transactions and sends this to L1 smart contract and dsl1 smart contracts actually checks the validity of of this proof and the proof

is basically it validates all the state transitions all the application of these transactions and as soon as proof is sent to L1 is and validated there you can basically at this point you can think that it's actually has security guarantees of the base layer of ethereum before that you still have some trust assumptions of overall up here I want to switch two slides I don't think we will so the data availability is one more thing it's like there are two approaches to that basically one is when you send inputs of transactions like polygons EK VM basically it sends transactions to be executed in batches

in in layer one and then the other approach is if I understand the casing and Stark net is doing this is that they store on chain already on the state div what the difference is what changed in the blockchain after the transaction transaction was applied like each has its own uh kind of a pros and cons approach so yeah that's another two things so basically if we combine all of this together we we're looking into using this ZK VM or some kind of overlap technology that's uh has the security and datability of layer one and use it as an app chain and there's like a

couple of uh the current already tools that are kind of based on on the roll up you see like there are super chains there is Saga there is like tools like Caldera that takes the optimism stack and stuff like this and set up a roll up for for this so and now the the point of contention with the app change was always kind of a centralization and to kind of a I'm giving it if we're using the right technology then like uh I think we can keep it a little bit of a I would say it's a little bits less requirements of decentralization on the app chains and

the reason for that is that I say that decentralization is not the kind of a it's it's a good thing but it's not a goal even of itself but the properties of decentralization is what we actually care about and there are two properties that I want to show here and the one property is liveness basically if your system is properly decentralized that means that there is no single entity then can shut it down right so in case like let's say if ethereum is really well decentralized no matter like like if let's say even Lido goes completely dark ethereum will still be

working right or let's say even fewer goes completely dark ethereum will still be working so there is no single entity that controls it and the second is that it's uh basically user agency which is also very important and user agency means that regardless of what a single or like couple of entities want really users still can participate in the network and users still can if needs to be like exits this network so these properties are like what's important uh and what they are actually achieved through decentralization in terms of base layer

but since we are building up chains as Roll-Ups on top of this base layer then we can kind of have something of this something similar for that without having to completely decentralize things so first of course there is still a property of liveness that's very very useful but since Roll-Ups usually or should publish the data availability onto the base layer like ethereum you can like even if roll up goes dark you can still Just Launch it yourself and have all the state the same state as it would have

been in the roll up that was running by the original team of course there is like a caveat that you need to be able to run this thing so means that it should be open source at least and it should be able to answer it should be shouldn't be any hidden components to this and also of course the smart contracts for this they should be well audited and it should be like proven that they actually publish what they claim they publish right and the second is that with this computational proofs and usually the notion of either forced exits or forced transactions or something like this uh it means that you as a user again for for an extra fee but you can force regardless of what the

sequencer or people who run this centralized sequencer think about like you participating in the network or you exiting the network you can still force them into like executing a certain amount of transactions so in in zkvm like in polygon years there is a notion of like a force transaction so it could be like any transaction that sequencer has to include uh regardless of yeah if it wants to censor it just cannot censor it or if the sequencer itself will not include it then you can run a sequencer that includes it basically uh and then there are also some kind of a caveats to this and one caveat is of course that

uh the state is not changed yet until at least you have data availability transaction sent to to the ethereum and until the proof is ideally the proof has come to ethereum as well it was verified right you cannot trust fully the state uh in this case and the second is of course that's what I talked a little bit earlier is that it actually brings quite a lot of requirements on the underlying layer 1. I mean if your underlying layer 1 is run by the same entity as Layer Two only one entity then you don't have anywhere to exit like you you basically you will collude one way or another so

uh so about non-finality and that's a little bit of a thing that's it wasn't really formally described before I think proof of stake consensus but you all seen like in your wallets or something that's oh this transaction has this many confirmations on top of this maybe some some operations are executed when it has 12 some execute advancements 24 but like when it was proof of work or in Bitcoin days or Legacy proof of work ethereum uh basically you didn't have this notion okay this transaction is final and will not be it will not be reverted it's just with each next block on top of this is

harder and harder to revert it but theoretically not impossible right uh at certain lengths it becomes purely a theoretical exercise of course but then with Beacon chain uh there is a notion of finality for instance there is thing called Casper friendly finality Gadget uh in in ethereum consensus when for instance your blogs are grouped into epochs and when there are at least two third of validators online it kind of marks this Epoch as final and that means that it's guaranteed by the protocol that the transactions in this Epoch will not go anywhere and I would argue that uh ZK roll up also have this notion of finality and

this notion is when the proof is proven on the layer one right after that you kind of have these guarantees that uh well I mean if you go and greedy really deep then when the proof is checked by layer one and it's final like because layer 1 also can rework in theory which is very unlikely but then you also but you also have this you can kind of transaction okay this transaction in theory if somebody who runs sequencer really wants can be reworked away but then as soon as the proof reached layer one there is nothing to do for the ones who run the sequencer so that's why I also want to have this notion of finality in in the roll ups insecure ropes and it's important and

then again base layer neutrality basically you exit into the base layer you exit into ethereum or maybe to gnosis or something like this and base layer for this it's actually needs to to give you this property of agency and liveness and since it's a base layer right now we don't have any better tools to to give it to user than good decentralization so and I would say that this kind of a property of again neutrality if you want to call it when single entity cannot like censor you or something like this it can a little bit bubble up again with a certain caveat uh with a less trig guarantees upwards if you're using let's

say ZK VM roll up on top of the KVM roll up on top of ethereum and ethereum is well decentralized and with certain caveats you can think that's layer 3 is also can bring some of the security and decentralized not this realization but leaving us and agency to the user uh so to put it all together if we take ziki roll ups and start building up chains on this and base it out of credibly neutral and decentralized networks like ethereum or notice chain for instance you can get a lot of the properties of the app change that you want including the Custom tokenomics Performance characteristic

just prices and stuff like this or compliance for instance benefits for certain regulated uh Industries while still giving this properties of agency and liveness through data availability and computational zero knowledge proofs for instance so that's kind of the the phases that I did and then to to bring it into more action then I wanted to say that one yeah there's of course here caveats are everywhere yeah the one thing that I forgot about there is still like if you're doing D5 for instance especially on the app chain approach you will end up with liquidity Bulls being

quite fragmented so right now the biggest liquidity pools are on ethereum some of them of course around shared roll ups like arbit room optimism and stuff like this but then there's one thing that's if you're doing defy on app chains that's one of the trouble and they're like things like shared sequencers approach could potentially help or some bridges like hell extra life from uh from polygons EK VM or this hash here that's A system that gnosis is working on then of course purely constructing these zero knowledge proofs is expensive means Hardware expense of humans you need to rent a pretty beefy server at this

moment of course the teams have working really hard to take this course down but still like you need to run quite a bit of a server and for each app chain you have to provide This Server it bumps the cost up uh quite a bit so for this I would say that first we can work on the efficiency of the proofs themselves algorithmically or maybe using more specialized Hardware or something like this or we can use also shared prover across multiple options so we don't have to provision it many many times and then there are base layer fees of course because both data availability and proofs are sent to the layer one you will have to pay gas fees on the layer one so and these fees are again for data

availability they are kind of a they dependent on the size of the amount of transactions you want to send there or something like this for uh for the proofs they are basically they're more or less constant but still uh let's say State diff approach wins here because it's cheaper because you can bundle a lot of transactions let's say if we had 5 000 transactions between only like me and Thomas for instance they will be a very short State d4000 transactions there right which which might work in the cases again when you have super super popular a single application when everything is changing in one smart contract or we

also can work like basically more efficient in terms of maybe some recursive proofs to make the proof themselves smaller and smaller to be able to include multiple proofs and a single if you created proofs and and stuff like this so now to the practicalities so one of the things that is happening is that like on the polygon supernets basically the future super announced there is more and more moving towards that they will be private Roll-Ups on top of on top of ethereum for instance so this kind of the the typical supernet high level architecture and now it's instead of having their own validators their own kind of a stake and stuff like

this it's more using layer 1 RPC to be able to to synchronize it and we at Gateway want to also take it like a little bit a step further again it's a little bit long-term reason is when we want to allow users to create their own not only like roll up but the whole like environment with just a couple of clicks with like both the block explorers I don't know identity providers wallets like multi-seeks and stuff like this and basically to provision it with a couple of clicks and maybe like a couple of minutes after this waiting time so yeah um so that's basically it

that's what I wanted to say so feel free to reach out to me either here if you have any questions or want to just discuss this thing here is like our official Twitter my Twitter on the public Gateway FM you can find a lot of again public RPC if you want to like use it in your projects like they don't even require registration and here is my telegram handle so yeah I think that's it for now foreign

Related talks