What Are Layer 2s?

EDCON 2021 · 29 Aug 2021 · 14:30

Patrick McCorry explains Layer 2 systems through the security of bridges that connect other execution environments to Ethereum. He contrasts custody and committee-based bridges with proof-verified designs, showing why withdrawal authorization and independent verification matter when evaluating scaling claims and new blockchain networks.

Speakers

Topics

From EDCON 2021, hosted by EDCON.

Transcript

awesome hi everyone my name is patrick mccrory and today i'm going to present what's l2's anyways which is the greatest grammar goal title i've ever been given so what i didn't notice in the schedule was there's a lot of technical talks for the past three days i mean this is always technical but i want to step back a bit and really talk about the motivation for why l2s are really exciting and why we need them so hopefully you'll get an idea of you know why we care about stuff like optimism starkware arbitrim at all so as everyone's probably aware cryptocurrencies do not scale you know they support on the magnitude

of you know 15 transactions per second and it hasn't really changed much in the past you know 11 12 years since at least bitcoin has existed in the past six seven years for ethereum and as we're all aware i guess as well once we you know surpass 15 transactions per second once we go above the ceiling the fees on the network skyrocket so this was a screenshot that i took from a few months ago where ethereum collected 60 million dollars in fees in one day and actually i think yesterday was 40 million dollars because of some nft drop and when the you know when the fees skyrocket uh like no one really wants to pay 400 for a single transaction you know this

is far too expensive for most people to use these networks on the flip side you know there has been work towards scaling blockchains and there's various you know blockchain protocols out there like salona they can do 65 000 tps polygon claim to do 7 000 transactions per second and avalon say they can exceed 4 500 transactions per second so if we can really go you know warp speed for these blockchains then why can't we do that for bitcoin or ethereum what's the problem surely i don't even have to give this talk because the job's already done right well feels like they can't know the dope's not done and there's a very

good reason why we can't achieve 45 000 transactions per second on ethereum so we step back a bit you know what does it mean to be decentralized uh and in the ethereum world we tend to think about this one common goal a percentage of the world's population should be able to verify the blockchain's integrity in real time and to validate all transactions this is the trust but verify paradigm you know i have the sort of trusted block producers the order transactions but i should hold them accountable and verify everything they do ideally anyone in the world can download google ethereum run their software run the node connect to the peer-to-peer

network and start validating ethereum transactions regardless if you're in indonesia argentina chile canada greenland norway the little island at the top there it shouldn't matter really where you are you should always be able to verify you know given some hardware constraints the ethereum blockchain in real time and all of our powers can combine and secure the network and they keep it decentralized and remove any single point of failure but because of this goal we have this artificial constraint on the network resources you know we have to constrain the cpu we have to constrain the storage only of the constraint the bandwidth

because we want to be able as i mentioned like people in indonesia africa chile we should be able to verify these uh the network with reasonable hardware you know you shouldn't need a supercomputer aws to do it that terrible maxi meme but because of those constraints we end up with a computer from the 1970s it's slow it's very expensive and everyone has to share it and this is i believe a photo of italic with his old computer another computer is probably more powerful than ethereum so what do we do then if we have this goal for decentralization should we just give up on scaling the network

well we know we can't give up on that obviously so one point to make is if a user can't afford to use the network if you have to pay 400 dollars per transaction then why should the any user even care about validating it if i can't afford to use the network i'm not going to run a node because i just don't have any coins on the system because it's too expensive so while we want to have decentralization so that anyone can validate the network we still need to work towards the goal to make sure it's affordable for anyone to use it so anyone in the world can have the right to have custody of their own funds and not to trust a third party so scalability you know it is about

increasing the network's throughput but for blockchains we have to adhere to the same set of resources and still at the same time increases throughput that is the ultimate bottleneck for blockchain scalability which is why many you know many other blockchains give up on that on this constraint and they do 65k transactions but really they give up in decentralization and we don't want to do that for ethereum so there is a third way of gm protocols and the idea is very simple why don't we take our assets that are on ethereum move them to another network and just transact there

so we just take transactions away from the mean chain we take transactions away from ethereum and we just transact on a different network but using the assets that reside on ethereum that may sound a bit weird or funky so my question is have you ever deposited coins onto an exchange or an online service like coinbase finance or piston if you have then in a way you have used an off chain protocol now the problem is these services are fully custodial they can freeze compass get lose your funds we can't audit them you know they're they're layer two databases so peak it's not publicly auditable are they running

a fractional reserve we have no idea it's just not publicly verifiable but of course we trust these services they also order transactions so if i submit fight trades you know coinbase in this example would order the trades and execute them and ideally i should be using funds that reside on a theory and if you step back a bit this is sort of what it looks like from you know ethereum to coinbase but what we're really building is a bridge there's a bridge contract in the middle it has three functions in a really simple world can deposit withdrawal and update account balance so as a user i'll deposit coins into the bridge

and the bridge contract will notify coinbase to unlock my fund to create me an equal number of coins on the service when i want to withdraw my funds you know i ping coinbase and i'm like coinbase let me withdraw my funds coinbase will send data to the bridge contract that will authorize alice to withdraw a thousand eth and then alice can call the withdrawal function and withdraw her funds so in a way the bridge automates the deposit and withdrawal process so this sounds really cool you know we are technically scaling ethereum in a way when we use these the coinbase crack in bitstump etc what's the general idea that's going on here

we're actually just bridge engineers and we're connecting blockchains to ethereum we have ethereum we have lots of different bridge contracts and we have this wonderful galaxy out there of different blockchain networks and services and the trust assumption really boils down to when i transact on another network what really matters is how the bridge contract is convinced about alice's new balance okay so if i transact on the network and i get a thousand each you know i flipped some jpegs i sold a penguin i get a thousand e from that other network the trust assumption is how does that other network inform the bridge that i now have these coins and i can

withdraw them back to ethereum you know it ain't much but but it's honest work overall so let's go through some of the trust assumptions the first is single authority one ring to rule them all this is coinbase bit stop and move to the exchanges you know it's up to that single authority whether you can withdraw your funds or not another bridge is the multi-authority bridge kevin parties this is the rsks and the liquids the idea is that i lock funds into the service and then there's kfm parties you can imagine 5 out of 10 people they all have to agree that i can withdraw my funds from the network and bring them back to ethereum so we distribute a trust

there's now several rings that roll the ball but all these rings have to work together i forget the lord of the rings equivalent for that and then the third one is a crypto economic bridge so again they typically have this dynamic set of parties you know kfn but the idea is that every party can appoint themselves they can stick on the network and they have skin in the game so i could lock up a billion dollars and then i can start helping people withdraw their funds from know example the polygon network and because of a large stick in the network you know i should be honest and not you know try to steal people's funds because of such a large stake i want to see this succeed well that's the basis behind how those other bridges work

what can we do better than this because in every example we still have to trust one party or multiple parties to protect our funds in the bridge and in blockchains we want to trust minimize we want to remove intermediaries we don't want to add intermediaries to move from that one network to the other so this comes so this brings us to the layer 2 bridge the non-custodial bridge where we only trust ethereum and the bridge contract to protect our funds this will assume that optimism orbit rooms ek singh starkward loopering all of these l2 protocols if those l2 protocols are fully compromised posted in valid transactions

trying to steal our funds the brits contract is there to protect us and it will never allow those other networks to steal our funds if we've you know locked funds into that network and how do we do this well at a high level the update account balance now has two arguments one is the data what was alice's new balance and the second one is evidence the operators of another network has to provide evidence to the bridge contract on ethereum why this data is true why does always have a thousand new coins in your service and that's really the simple trick you know it's providing evidence the bridge

contract will check it if it's convinced that all is well the other networks are compromised the evidence is correct it will then allow alice to withdraw her a thousand coins and in the worst case scenario the bridge contract can just forgo the network forget about it ignore it you know hit crisis mode and allow everyone to withdraw their funds a way to visualize it is sort of like boxing you know you have the adversary they're trying to do censorship invalid transactions with whole data and you know what ethereum's fighting for you it's basically punching it in the face and saying no you cannot steal our users funds and that is why layer 2 protocols are so damn exciting so a layer 2 bridge

at a high level allows us to transact on another network with assets that reside on ethereum while retaining that should be retaining not retraining security of ethereum it is the bridge contract and not the authority that protects your funds and in this way we are truly we're actually truly scaling ethereum here because we're taking the decentralization the security of ethereum and applying it to other networks and at the same time ethereum's not processing most transactions it's just protecting your funds that's his only role and you transact somewhere else and you still have a theorem security and what's also exciting is that this

old dream of side chains is now alive and well the sidechain dream came from a block stream keeper in 2015 we could build experimental blockchains move bitcoins under those blockchains and work out how we can scale these networks bitcoin could never do it so obviously blockstream can never pursue that dream uh not in the way that it should have been pursued but now on ethereum we can you know all these new blockchain networks gk sync arbitrom loop ring start we're optimistic rollout or ethereum sorry they're all new blockchain networks and they're all unique they have a different validator setup different blockchain protocols different smart contract environments and even special scaling techniques like zk proofs so we can now experiment with all these

really cool scaling protocols on these different networks work out how they you know test them see how they work in practice work out the you know the quinx i think that's the right freeze and then if they really work we can then apply it to ethereum and at the same time we can experiment by still keeping the theorem security and that's amazing so just to finish the talk this is how you should visualize layer 2 protocols ethereum is holding out its hand these layer 2 bridges are holding on to ethereum and carrying along these new blockchain networks and allowing us to scale and make it affordable for anyone in the world to use these networks and of course there's the moon

because we're all going to the moon i hope you enjoyed this talk and uh to the moon you know maybe we'll find another moon cat