zkSessions: Mapping the L2 Landscape - Sponsor intro with Jordi Baylina (Hermez Network)

16 Mar 2021 · 17:00

Jordi Baylina of Hermez Network gives a sponsor talk at zkSessions: Mapping the L2 Landscape, a Zero Knowledge Podcast event supported by Hermez Protocol and MolochDAO. The talk covers Hermez's zk-rollup design and where it fits into the broader Layer 2 landscape taking shape around Ethereum in 2021.

Speakers

Topics

Transcript

kind of welcome jordy to the to the stage jordy's from hermes network uh who's also one of the sponsors of the zk sessions event so take it away jordy yes hello i'm i'm the technical lead of uh hermes network we are very close uh to the launch actually we wanted to launch during this week but there was uh well it's not even an issue but there was an adjustment in the last week in the we decided to what uh to adapt you know to fix that and to adapt to the reference implementation so we we will have to re-run the trusted setup again but i hope that

probably next week we will be able to launch we have everything set and you know test mode test test net is already there so we are very excited to the launch but in this presentation i wanted to talk uh to the one of the properties of uh helmets which is about uh it's about uh massive migrations okay um what's massive migrations well if we see um an ecosystem of roll-ups we can have like a lot of volume so roll ups at the end it can be understood as a if you want a smart contract or an as an application that's running some specific some specific transactions but with uh with a scalability with a lot of transactions per second so you throw up maybe run here you can

think of course there are payment rollouts but can be also auctioned roll ups it can be uh landing roll ups it can be voting roll ups it can be identity props it can be any any kind of i would say application can run the roll up and i would say that um if applications wants to go mainstream so they want like thousands and uh thousands of of uh transactions to run and they will have to migrate at some point to to to some sort of uh roll up or any other scalability but probably some more feasible uh for doing now so once we have these roll ups running how do they communicate how do i transfer value from one rule up to the other okay

so this is about uh massive migrations in order to transfer this uh to transfer from one um from front row up to another wall up what techniques we have well we have the i would say the trivial one the trivial one is uh you just do a withdrawal and and then you do a deposit in the other roll up this is well this is quite well you just do a couple of l2 l1 transactions but this is very this this could be very very very expensive it's it's doable but if the if the gas price of the network increases this would be very very uh expensive um this this decentralization is uh okay

but you know you need to do this this transaction another option is do a kind of maybe it's like an exchange you may you have a centralized exchange or you just deposit you know you just transfer in one in in the same roll up you just transfer uh uh coins from in rob one and then this uh centralized exchange just returned the phone's intelligent uh and and then is this exchange who's managing actual the the transfer the aggregate transfer but this is not uh decentralized it's a centralized exchange could be cheap because at the end it's a couple of ll2 transactions one in each roll-up but it has this decentralization problem so

in the middle what we have is these uh massive migrations so massive migrations at the end what we are doing is uh when there are many users you know in a volume roll up that wants to be want to transfer funds in uh uh the other in another roll up instead of each user doing a single layer one transaction when two transactions in each roll-up or for the user we can aggregate them we can aggregate them and then with a single l1 transaction we can move we can transfer all these uh users in the case of the example is for users you know they can just transfer simultaneously from one roll up to the other wall up

just expanding one simple transaction these four users can be even thousands of users so in a continuous system where there is a lot of transactions moving back and forth than the the this scales because you know you can do a lot of transfers uh in the same in the same batch so i want to explain here a little bit i'm going to be here it's a short session but i'm going to be here put some some a little bit hope this would work okay so the idea is that uh the destination will approach this will work in fme so so there is that this destination roll up actually holds an account in the layer one roll up here we have two laps in the left side we have the the source roll up so these users wants to transfer some

uh assets to the this second roll up it's in the right in the right side so the destination roll up has an account in the social app the people uh the people in the in the first roll up in the social lab they just transfer to this account okay and this uh this is transferred to here this is a smart contract so this is automatic it's not a centralized uh actor here it's just uh this uh a smart contract can create a layer two roll up in the other in the other in the other roller okay so here i want to show you some code of how this would uh more or less work okay so we

have a smart contract this in this case would be this destination roll up so the destination roll up is to create an account in the in the source roll-up hope he does that in case of her message just do a normal deposit in this case it's a zero deposit but just do a deposit so they create they create a deposit in the case sorry in the case of hermes when you do a layer one transaction the operator is required to do that in the in in some block in the future but they you know that these transactions for sure will will happen okay so here we have the second part of the code this how we identify how the smart contract knows which uh which is the account that they had they just uh created rob just create the account

and here we can use interesting is in the case of firmware we can use the withdraw verifier just to prove uh in the in at layer one level that a specific uh account is created and has a specific index so here in the last line we saved uh what's the index of the of of the account inside the inside the robot okay so once we have once the second destination roll up has an account in the first roll up uh okay so people will they can just transfer phones okay and um we need to do uh we need to do actual the transfer so in order to do the transfer the first thing we need to do an exit

okay so how we move the phones from one side to the other so here is a three steps they can be packeted with the same transaction but there are three steps the first is doing the exit a normal layer two we would do just a normal uh layer two transaction but in this case it's a it's a smart contract a smart contract do not have and so do not have a private key inside the ruler they're just a another account so what he does he does is he do what we call it a force transfer so if he does uh layer one transaction telling to the roll up that he wants to withdraw all the funds okay so this is what he this is what we see in this code we do we just do know one transaction here the trick is a

destination is one one is a special number that means that you are just exiting okay so once it's exit then we need to do the withdrawal this is what actually moves the funds so the tokens from one smart contract to the other smart contract okay so here we have the normal withdrawal in the case of hermes we can do have to kind of withdraws one that's done with the circuit the other is done with just microproofs here we are here we are just using the circuit one and uh yeah so this just transfers the phones uh to the to the uh to the to the road okay and finally but okay these fonts how we send it back again how we send to each

individual uh pieces well here that the cool thing is that we can so the the destination rollout can have like a special processing circuit that actually does this distribution this circuit just takes all the layer one transactions if you see the here the so here it takes all you see here in red if you see it takes all the transactions that happen in the same batch okay and they need to process that so it takes this this is what we call here so we can in the case of hermes we can uh uh we call it here the l1 l2 transactions hash map so this is a hash of all the transactions that happen in

that batch okay and process all these transactions to update the state so we go from the current state we are seeing the new estate that's actually where the it's processed these transactions that are so we send this we assign we add the balance of the destination address according to the ethereum according to the same so that they have the theorem address so and this process is just processing so this import process is just like processing a normal roll up a normal roll up patch okay so here we have all the proof of course all these threes can be packed in the same uh transaction and with a single

uh layer one transaction maybe we can move 1000 uh transfers from one uh roll up to or from one uh from one roll up to another roll up or another l2 uh solution okay so that's very much what i wanted to explain uh uh i'm gonna be also in guther so if anybody wants to talk about that i'm glad to do it and uh uh yeah just here is if anybody wants to test hermes right now it's already uh in the test net so you can test it here with wallet.testnet.messonio i hope that during this during the next week or next days uh you can also use that in in mainnet and very excited to want to

have this in production and and to help the community uh to have this uh to have the community to actually to use the cryptocurrencies and to scale ethereum in general so that's very much what i wanted to talk about and i don't know if i'm in time or you're good i just lose a sense of time there's about six minutes uh before the next talk so there are there's actually there was a little bit of conversation about the destination roll-up and the source roll-up um oh am i muted still can you hear me no yeah i'm yeah yeah i gotta hear you oh

somebody just said that i'm muted oh i don't think i am okay um i'm sorry marcel for some reason you can't hear me but hopefully other people can't okay so yeah um maybe just i don't know if we want to go back to that slide the destination roll up accounts uh destination roll-up source roll-up that was sort of some there's some question here yeah yeah just go ahead and i think that well the question was just clarification that it's the destination roll-up account not just the destination roll-up and i think that's what we wanted so that looks really good um yeah another year yeah i don't know if there's anything else to that actually

i think there was another question from kev though and that's is this using groth 16 yes in the so hermes is using growth 16 right now but the idea is that this migration mechanism uh can be used to migrate from uh uh any uh so from glass cysteine for example to to plonk or for example from ghost 16 of one cork to to gloss 16 of bls 381 when it's implemented ethereum so it's like it this is uh this can this mechanism can be used uh uh for connecting different schemas uh also in hermes we provide this so anybody

that wants to integrate with hermes we provide these uh this information of uh which transactions uh so we hash all the transactions that happens in a patch so you can we can use this this this this hash as a mechanism to import to get used to importing another roll up they will just have to decode this and use this information in order to give it give back the the tokens to the specific layer two transactions of the destination pull up cool um feel free to add any other questions in here if anyone has but i

have another question which is a little bit about like you say it's about to go live you mentioned there's a test net but like what kind of time frame should people have in mind and like should like do you want people to actually start engaging now with the test net or do you want them to wait what's what's your idea if anybody wants to test net and if anybody has feedback or they see box also we are running a back bounty not not for the ui but but mainly for the smart contracts the circuit so if anybody just want to check out the circuits uh uh of course they can uh back bounty is open and will be open uh so it's a good time especially for dabs and nearly adopters to start checking it but you know in the in a few days

you know just i hope that during next week but you know it's like it's it's a matter of how the trusted setup ceremony works but uh probably in during the next week we will go maintenance we have everything set we have everything ready and just a matter of just finishing this uh trusted setup and deploying smart contracts and and and start and start uh and start um working with it and start the main skill i feel like people are excited um i'm curious to see it do you uh do you have any like are you as you launched do you have any sort of ui or like test cases already set up like will there will it be possible for

a kind of an end user to already do yeah end users and users if they connect to wallet wallet. sorry it's wallet.testnet.hermes.io they they will see a full wallet they can uh you know they can deposit it right now it's running in winkerby this testnet but they can do deposits uh we also set up a uh uni swap ring reveal unit swap so they can play with other tokens in there so they can buy and sell in in in uni swap and they can just transfer it and play around with hermes they can do deposit they can do transfers they can do with rows they can do everything and we also have a batch explorer it's explorer.testnet.hermes.io

you can see the blocks running in there yeah of course you know it's a work in progress uh it's it's it will continue after the launch just improving the ui and improving some a lot of functionality so have a lot of ideas uh to do on on there so that's like uh but right now the goal is just uh to launch in in mainnet and just be the service available for everybody sounds good there's actually there is one last question before we move on it's actually from alex who's going to be speaking after but alex asked are you using non-algebraic hashes for checking batches we are using our show uh well yeah it's uh we are using uh for the hashes we are using sha-256 yes

okay cool well thank you so much jordy thanks for the talk and thanks again for sponsoring the event you are welcome it's a pleasure always to sponsor your friends we will see you possibly around the park bench panel if you want to jump on and have some ideas and also after at gather dot town okay