zkSync: A zkRollup Platform

EDCON 2020 · August 2020 · 19:55

Alex Gluchowski compares scaling approaches by their effects on node load, resilience and usability. He reviews channels, Plasma, optimistic rollups and validity proofs, then presents zkSync’s transfer capabilities, developer plans and a live wallet demonstration, including the tradeoff of waiting for on-chain proof confirmation.

Speakers

Topics

From EDCON 2020, hosted by EDCON.

Transcript

[Music] hi adkon here is alex klulkovsky from metal labs and i'm here to talk about layer 2 scaling zk roll up and our scaling protocol called zk sync which implements the key role so why scaling it's obvious to all of you that the ethereum prices or gas prices are getting outrageous cost three bucks to send a one dollar erc 20 token transfer more complicated transactions are even more expensive and the uh the the reason for this is pretty clear

price is determined by supply and demand ether is ethereum is in high demand with the transaction space limited by block s limit and we see that it's getting consistently used and projected uh usage is probably going to be even higher when more people potentially millions of people are going to jump onto blockchain and become users and the problem is actually very old it was previewed by satoshi back 10 years ago and it's been really hard to to to solve like we had 10 years of research which led us here where we still cannot properly solve layer 1 scaling why is that why is it so

hard to scale blockchain the reason in my opinion is that the value proposition of layer ones is resilience that's the most important thing for blockchains for decentralized blockchains ask guys from libra and telegram why they didn't launch they could not defend their projects they had technology they had the users but they could not just push through because they were not resilient enough the reason or the way ethereum and bitcoin reach resilience is decentralization we have lots thousands of full nodes verifying the blockchain all of these nodes are equal there is no single point of failure so

it's really hard to control all of them because they are spread all across the world with different jurisdictions different countries you cannot just impose one rule on all of them this is very valuable but this has a consequence if you want to have network consisting of heterogeneous nodes with like all being equals and peers it means that you cannot trust anybody because they can be malicious anybody can join such an effort so you have to rely on the principle of don't trust verify you have to actually execute every single transaction in every single layer one node

to keep the system secure which brings us to the definition of scalability simply increasing throughput by extensively raising the bar higher let's say by by increasing the ethereum block gas limit would not increase scalability because it would also increase the requirements on the full nodes and so less people can run them and the network will become less decentralized and are less resilient so you you you you want to improve throughput without increasing the load of an average node and this is what we call scalability it turns out there are two ways to do

this you either verify not every single transaction but less so maybe you split your accounts in different charts and you only verified like everything with what happens in your shark and this is the approach layer once themselves are taking with you near another blockchains for doing multi-sharding technology or you do something sophisticated and you execute or you verify a larger amount of transactions spending the same amount of computational resources so for for the second way the compression we have something like zero knowledge technology which is very

recent uh and only became mature in the last year uh sharding is more popular it actually the the layer two world started with sharding approaches such as payment channels which is an ultimate charting solution where you have a payment challenge between two parties and these two parties only need to monitor the state of their channel on layer one they can transact nobody else cares of uh about their transactions they can update the channel state off chain many times but it's not very convenient because you you don't want to transact with one single person you want to send money to like arbitrary

recipients so then they evolved into payment networks such as lightning but that brought additional problems because you needed capital requirements like you need to block a lot of capital on this network to be able to route transactions from arbitrary user to arbitrary user and you had to undergo security risks for running these atlantic nodes because they you have your keys on hot uh wallets and online machines which can be easily stolen uh so they it evolved further into things like side chains where you sacrifice some of the security because you still verify last transactions

uh by by the fact that like you delegate verification to a small number of validators who have some kind of stake but of course it has like very limited applications so then things like plasma emerged uh where anybody could challenge those validators or one single validator and it further evolved into optimistic grow up uh which we will cover a bit later but we there is actually we created a framework to evaluate all the solutions and i'm going to post a link under this video a framework of questions

where you can just go and check look at various layer 2 solutions from various angles but you will see that the nastiest problem in all of them is data availability if we look at all the solutions most of them keep the data off chain and this leads to problems except for layer one this this is a bit incorrect like player one is of course everything is is on chain but layer two solutions all the red ones have it on layer two uh sorry have it off of off chain completely so it always it is always possible to withhold the data

and then you have to react to the situation and you need to build very complex game theoretical and technological things around that and you have the mass exit problem in plasma and so on uh but you have two technologies optimistic roll-up and zika roll-up so we can call it just roll-up technology which puts all of the data on chain and solves most of these problems so with withdrawal ups you actually reach levels of security very very comparable to the mainnet and also levels of usability it comes at a cost the cost is that your scalability boost is capped at

around 100x compared to mainnet so we cannot exceed that we still need to put some data on chain but on the other hand roll ups are capable of reaching up to 3 000 transactions per second and the cost if we take current ethereum transactions like a couple of dollars divided by 100 you will get a couple of cents it's probably okay so like if your application if your protocol is okay with like 10 cents up to one dollar fees for transaction you probably don't need anything else you're probably best served by roll ups

so i really recommend looking into them uh it's interesting to compare optimistic and zika roll up they are very similar they are both commit chains they keep only the fingerprint cryptographic fingerprint of the state in the contract on the mainnet um and they have blocks these blocks change the state and record a new cryptographic fingerprint of the new state in the same contract they are different in the ways they secure this the validity of state transitions with optimistic roll-up the operator is allowed to make any state transition

they want but anybody who sees a problem with this state transition can challenge them so you have some period of time where you can submit a fraud proof and revert all the changes from the last valid checkpoint with the zk roll up it's it's it's the opposite the validator is required to submit a validity proof in advance so first you produce a validity proof and only then are you allowed to make a state transition and as you can see on this comparison it creates a number of advantages for a zika roll-up for example security of the roll-up does not depend on any validator or actually on anyone

doing any work it is completely passive with optimistic roll-ups you have an assumption that at least one party at all times is monitoring what is happening on the roll-up and is honest so one of the parties who monitor the the activity must be honest for optimistic roll up to function and realistically it must be a validator because only validators are incentivized to actually do some work if they stop doing this work then malicious party can steal all the funds in the roll-up even if they do this work and they they spot the fraud they still need to submit a fraud proof transaction and if they fail to do this or if the

transaction fails to mine because the network is congested or because there is some failure in in in sending nodes and they run out of ether or maybe because uh miners are are colluding or being bribed then all of the funds in the roll up can be lost with zikr all up you don't have this problem if you don't have like if if your validity proof fails for some reason you just keep trying until you generate a proper one and during that time the funds are safe if nobody generates state transitions people can always exit through layer one further it like the the this aspect of fraud proofs

makes the usability of zika roll-ups much more delightful in terms of normal exits because an optimistic roll-up you need this long period of time for everybody to be able to spot the fraud and to submit the challenge with zika roll-ups as soon as you have the the zero knowledge proof of validity which takes minutes uh you can immediately exit with optimistic roll-ups it's considered secure at around one week at least finally because in zika roll-up we use zero knowledge proofs uh and they have this nice zero knowledge aspect that you don't need to disclose everything for for proving validity we can implement privacy naturally

easily and cheaply whereas in optimistic roll up the privacy is going to be at least 1000 times more expensive so both zika roll-ups and optimistic roll-ups are in development zk roll-ups are live with zk-sync and loop ring you can try them in mana they they are fully functional um so as you can see the lots of advantages to zika roll up except for one optimistic roll-ups are theoretically easier to construct in such a way that allows portability of existing solidity cord or existing evm bytecode with zika roll up you would need to if you want to deploy

smart contracts you need to rewrite them or adjust them from the code which currently exists which takes some work it's not a part of protocol but it's something which you need to take into consideration so if you just want to do transfers zk roll ups are available today if you want to do smart contracts you you will have to do some slide changes so we actually have another article which dives deeper into this comparison of z kerala versus optimistic roll-up i'm gonna put a link to this under the video as well okay so let's talk about zk sync our zk roll up protocol implementation

here is a slide from our reddit great scaling bake of submission we were one of the something like 20 projects who made submissions and i think one of a very few who actually fulfilled hundred percent of reddit requirements uh we can handle up to three thousand transactions per second on uh today's ethereum mainnet it's not yet implemented right now the the tested facility was uh 800 transactions per second but we it it will take a short time to to make uh small minor optimizations in the uh block aggregation to get to three

thousand uh it has security comparable to mainnet operators can never do anything wrong with user fonts not not freeze them not steal them not corrupt them in any way not not not confiscate nothing it's going to be decentralized we're going to have a consensus among multiple validators which is going to be governed by token holders in zika sync and it's it's built around users and centricity it's it's very um we put a lot of effort into building zika sync as a very usable application or a usable protocol

right now what you can do with zk sync is ether and erc20 token transfers and we support meta transaction we natively support multisig you can send ether to any ethereum address even if it's a smart contract or some account which you never interacted before with and you can also interact with smart contracts so smart contracts with some funds in the zika sync can can have some interactions with them they can set multisig uh like they can appoint uh custodians or they can force withdraw funds and so on so you can build some interesting complex interactions around that and zk sync version 2.0

will support smart contracts with a programming framework called zync which we're currently developing which you can also already try and start building programs you do not need to know anything about zero knowledge proofs math any complex things uh you you just have to uh observe a few simple rules how you write these programs but they are essentially the same uh as you would write them in solidity so you define your state you define your public private functions and you're good to go if you if you learn if you know solidity you can learn zinc in essentially one day uh if you're in no rust it's going to be very familiar as well so it's

we took the best elements from rust and solidity and combine them together um that's it you can follow us on twitter uh you can go to zkc dot io and try out zika sync on mainnet or testnet and now i'm gonna show you how it actually works uh so i'm gonna go to my wallet and i can connect any web free enabled wallet like metamask so i'm gonna click on metamask sign a message here to login i'm in my account i got some balances here i can deposit some more let's go and make a deposit of some ether 0.1 deposit i'm gonna

confirm it it's in transactional layer one we can follow it on rink b it's been it's pending so we're not gonna wait which is gonna go and and make a transfer nzk sync with existing balances so for for a transfer i'm gonna go to a different browser uh open metamask create a brand new account i'm going to call it account 4 click create copy the address of this account it has no ethereum history no historians a kissing i'm gonna go back to brave and make a transfer of say 100 usdt to this new address click transfer sign a message

it's sent now i'm going back to chrome and now i'm connecting with metamask so it will ask me to sign a message uh it's a wrong account sorry i need to switch i need to click connect here and now now i'm on the right account i'm just signing the message it's open and i already got my 100 usd team so i can go see from whom i got it and send some money back i need to unlock the account uh that is to say i need to set my my private key for zk sync network which is

going to be used for zero knowledge proof so i'm just signing a message and it's instantly confirmed and i can send some tokens back click transfer send so it's immediately out if if i go back to brave i will see this incoming transaction here all the transactions with a single check mark are pending that means they will be they are instantly confirmed but they are not yet finalized uh transaction is final as soon as you see this double check mark that means that we generated is your knowledge proof submitted it to ethereum to the smart contract of zk

sync and it's verified and once you have this double check mark this transaction or this balance is enjoying the same security properties as mainnet so you can withdraw it no matter what even if you go offline for a year and come back uh yeah so that's it thank you very much