 All right, I think we'll go ahead and get started here People are slowly trickling in that's okay the first little bit so the talk or just a little bit of background before we get into the meat So I don't think people are a little late if they'll miss too much to it so this talk is Ethereum layer two and beyond Talking about what's going on with a layer two solutions in Ethereum Solutions to scaling problems in a theorem layer two and in some cases how those might be applicable to other Hyperledger projects all these solutions. We're going to talk about her right now just a theory based solutions But they are very portable if people are interested to the other solutions for the various block chains and that of course You know kind of depends on the reasons of why you might need scaling and what you might get out of this kind of a scaling solution I my name is Daniel Farron. I'm a blockchain protocol engineer I am one of the original Maintainers on hyperledger basu. I also sit on the technical steering committee I used to be on the all-core developers, which is kind of the equivalent of the TSC for Ethereum And right now I am working at reddit On the community points team and one of our concerns is of course ethereum scaling So I have a bit of insider knowledge as to what's the issues with a lot of these are Which is why I thought this talk might be valuable to the community as a whole into hyperledger community So first I'm going to talk about, you know, why does ethereum need a scaling solution? And then I'm going to give an overview of the various scaling solution approaches and some of the trade-offs And some of the things you might need to do to scale it beyond just what's carried as the carrier on the chain and Finally, I'm going to talk about specific categories of these solutions because there's you know It goes deeper. It's like you could do these sort of things and when you combine them Here's what you get out of it and then finally I'm going to finish with an incomplete review of a few of the existing solutions And I'm in that I'm mostly going to focus on the solutions that are live today and actually being used on the ethereum blockchain Not so much focusing on the hypothetical solutions, but the solutions that are actually out there being used So the first question you guys ask is well, why does ethereum need to scale? What does scaling mean to ethereum? So here's one example that's been used is it is kind of a reference point Since the beginning of bitcoin and you know bitcoin had its own scaling issues But you know as far as the scale that the credit card networks reach is a good example of the type of transactions You might need for a world computer So one example mastercard and this is just mastercard not visa discoverer or any of the other European or Asian card networks But mastercard alone as nine hundred and sixty seven million Mastercards in circulation. That's basically the equivalent of an ethereum account And that's just the type of cards you might put in your wallet or that your company might have on file to do Transactions, so that's an account that you know, you can do a transaction with Each day there are about a billion transactions a billion and one was one estimate that I found and if this was evenly distributed across the entire 24 hours hence it's not but if it were that would be 11,500 transactions per second on an even basis it clumps up It's busier in the morning when everyone buys coffee in the evening when people buy dinner And it's not so busy at two in the morning when people buy their steam video games off of steam So the peak transaction that ab visa advertises that it could handle Or estimates that have been talked about in some of these whisperers You can't get a hard number from visa because honestly the number varies with the way they set up their network But the peak TPS that they've been that's been tossed around is between 24,000 and 56,000 Transactions per second and that's just for visa and you throw in mastercard Discover and all the other card networks and you get quite a large transaction per second And that's if you wanted to support a credit card payment network Of course, you know like trades and finance and high-frequency trading it can get even higher than that So what is Ethereum looking at? How do they compare to these scales? Today Ethereum has released last week when I put the numbers on these slides 155,998,485 unique addresses. They've probably gone up to 156 million by now It's not too hard and that's addresses in use on the network That is about an order of a thousand less than what's going on with Mastercard or you know more than a thousand Not a thousand. It's only It's about 5x The second thing is the daily transactions. This is the thing. It's at least a thousand less than Mastercard And they may do a million and two hundred forty seven thousand daily transactions And that's fourteen point four three sustained transactions per second now Surprisingly it does hit about that it doesn't go too far from that and that's because the blocks on Ethereum are basically full all the space that you Can't put a transaction on there There is enough market demand that they are filling that up and that contrasts with the fifty four point nine TPS theoretical maximum of the current 15 million gas per block divided by a block every 13 seconds And here's the real kicker is that twenty one thousand gas per transaction if you're just shuffling Ethereum between accounts You can get almost 55 transactions per second But if you do something more exciting like a decentralized finance arbitrage call between two different liquidity pools You're not going to get that you're going to get something more along lines of the 14 Transactions per second and that's a lot of what's being seen on Ethereum today So and this is at a 30m Ethereum's current scale There's lots of you know if you listen to Elon Musk you just say well just increase the block gas limit just reduce the block time and Pick you'll try that on Binance and you run into different Creative ways in which the blockchain can fail and fall down and not provide proper health For one Ethereum right now is on proof of work So it needs to have the smaller gas limits begin with when you get on to the the Binance smart chain type solutions Even then it provides issues But I think the kicker there is even if you go with those you know bigger blocks faster That you're still that the demand is going to exceed what is available at Ethereum when we do those obvious layer one scaling solutions Um, so what happens and what people have seen is that when there's more demand than space The cost of gas goes up So that's why people complain about the price of gas Because there's people engaged in decentralized finance and see that there's money to be made And they're willing to pay a higher premium than someone who just wants to trade their crypto kitty and give it to their nephew So the prices go up and only the people who are willing to pay the price go in there So the space contracts and the space, you know, the space is the same The the the available percentage of the addressable market that can use the contracts because the market is growing And this is a fundamentally an unsolvable problem If you do it just at layer one Because the fundamental scaling issue with Ethereum is that at a certain key critical aspect Ethereum is single threaded All the transactions that you read into Um to create the state route are executed in order Each previous transaction can impact each subsequent transaction You can do some parallelizing parallelizations if the transactions don't interact with each other But in a lot of these decentralized finance scenarios The ordering is very important because that's how people make their money So Ethereum is single threaded when it comes to evaluating the transaction. So that puts an intrinsic limit on it So so the solution for layer two is to find ways around the single thread And that's really what makes layer two a separate thing as layer two is like, okay, great We'll take this one transaction. We'll keep it single threaded and we'll kind of multiply it out to multiple other transactions That will be rolled up or combined in some fashion So that what sits on a theorem layer one is some representation Of what more complex things we're doing on layer two And this is how we get the multiplication to the scale that is necessary To scale up to these larger solutions Is by taking multiple transactions and combining them and say the net effect of this one transaction Is this token moves from here to here might take 15 steps in between and that's what the layer two scaling represents and solves So when we do this sort of a solution, there's some concerns when we move stuff for layer two The first question is data availability if you're going to take all these transactions and you're going to combine them together Where do these transactions didn't live? And this is a fundamental question you ask for all of your layer two And all of your off-chain scaling solutions when your chain is full. How do you scale off chain and get the data? So one thing you can do is you can store your data on the chain And that's what things like call data and ethereum events You can get the equivalents of your calls of what would be executed in your layer two without actually executing them You can say I do this really complex d5 transaction with these parameters and you don't actually execute it So you can fit it in that gas limit on the block The second option is of course to do it off chain rather than putting the transaction on the block you say I have 15 transactions. They're represented by this hash and go find them in ipfs. You're using our layer two You know how to go find them Um, the question the problems with this data availability Again is where do you get the data if it's on chain? It's more decentralized more censorship resistance because everyone can get it and if you store it off chain then you need to have some sort of a Cooperation and discussion between all the layer two Participants and service providers so they can get the the data work together And not be subject to concerns about censorship data invisibility and all the other things and Actually in some cases not being able to see the data is kind of an advantage A lot of the early um private transaction solutions on things like quorum We're kind of a proto layer two solution off chain using this off chain as a feature So, um, I won't go to that depth in this talk But that's you know, some of these ideas are have been around for quite a while And they're just formalizing into this new idea of what layer two is The second question is what sort of things are you putting on layer two? What does the data mean? And there's a continuum of about four steps of what these things on the on layer two mean The first of course is just data. There's no intrinsic chain meeting. It's just Whatever you want to put on there. It has no meaning to ethereum You might have meaning to your layer two, but there's no meaning to the ethereum The second layer is it's the native transactions the same transaction you might put on layer one It means the same thing to ethereum. It's the same smart contract. It's the same Peer-to-peer networking solutions. They just might have different chain IDs and different sub-networks. They transmit upon The the the next layer is of course transaction claims and fraud proofs And this is where you get the roll-ups where what you're putting on layer one Is the net effect of a of a clustering of several transactions Where you might have you know five transactions the net effect is that one column goes up the other column goes down And so what they put on there is the transaction. They claim this is what it means And if you don't believe me post a fraud proof to show me that we've done it wrong And so that's the essence of a lot of these optimistic roll-ups is they optimistically post the results And then they say prove me wrong and they put money on it So there's an incentive for you to prove them wrong. I put one eth to say this transaction is correct Come and get the eth and prove me wrong And of course the fourth solution is a bit different from that. These are the zero knowledge proofs So there is no fraud proof and there is no full knowledge of what's going on there But there is an argument using zero knowledge encryption technologies to say well I did a transaction all the rules were followed and here's a proof to say that all the rules were followed So you put a state proof to say the state's consistent everything's true and what I did I don't have to share with you, but everything's correct And that's kind of the extreme of the layer two is where the knowledge is not required to be known amongst the amongst all parties Um, one last one another concern is asset mobility So let's say you have a token on layer one or you have a theorem on layer one How do you get it back and forth between these layer two solutions? this kind of goes into the uh, The complexity continuum of what the data is because if you're just drawing data You might not be able to put a theorem there But if you're using zero knowledge proofs Then you have some very structured meaning that I can only take a theorem and these five smart tokens in here And I can prove that it's correct But then you have the question of how do you bridge it between layer two and layer one and layer one and layer two Getting into layer two is easy. There's a smart contract. You can do custodies. That's typically a solution Getting from layer two to layer one is difficult because you got to get the layer two data on the chain You got to make sure it's going to stick on the chain And you got to make sure that it's not going to be rolled back or challenged or proven wrong So in a lot of these cases it takes about two weeks to do this It's like the agreed standard for you know, the the censorship resistance Some people have found this is a market opportunity. I'll give you a fast exit I'll engage that counterparty risk all they want is a hundred basis points So there are solutions that will do these fast exits and it's kind of built a financial Uh complex financial systems for some of these items if you're willing to wait you get it all if you're not willing to wait Pay a fee and someone's willing to take the risk for you. You might not like the fee, but that's the way the markets work And of course the one that I've alluded to in some of the other slides is censorship resistance controllability Um, there's a layer two solution. Is it open to all providers? Can you make sure that your transaction gets on there? Can you make sure that um people aren't manipulating it without being seen? On chain, it's simple because you can put any transaction on chain. You can interact with contract It's fully there and in the public and you can prove that the data either was there or wasn't there When you go off chain, it gets a bit more complicated Because you need to have different systems to prove that wherever the off chain aggregation is happening The people are actually accepting it and it's actually working well um so the um Let's go It's a second So on off chain, you know, there's there's ways to prove that you are actually Your data is being included and it wasn't there But those are involved more complex systems that affect the impact and the complexity of the layer two solution And there's some advantages that only some people may see it. That's a privacy and security concern that some solutions find advantageous So in this it forms a complexity continuum Data it is what it is transaction is the same as what's on the layer one Fraud proof this is actually a roll-up and that's actually executed somewhere else And it relies on external watchers to catch the errors and of course zero knowledge Big fancy math easy to verify but a few people can tell you why it works. So there's a lot of um Mathematical faith put in it. Luckily, you know faith in mathematics is actually kind of easy to prove if you can get the right person Um, so, you know, I I can't explain how some of these work, but I believe that they do So from this we get what I call the periodic table of scaling you take on chain and off chain on the vertical axis You need to get the four scale of of the four entries on the come constant Continuum of complexity along the top And this gets you what I think is a more complete solution of what the types of solutions are The four boxes on the right the fraud proof zero knowledge on chain off chain when most people talk about layer two on ethereum They're talking about one of these four solutions Now when it comes to off chain data for data transactions, some people say it's layer two. Some people say it's not So I call that category quasi layer two and if you're doing non-chain transactions, you're just doing layer one And if you're just putting data on chain, please don't do this. There's more efficient ways to do it Um, it's happened before so I have a slide that'll show you some of the details on this later on So again each one of these have put a name some of these the ones on the right are the industry norm for if ethereum Optimistic roll-ups are on chain fraud proofs. Plasma is off chain fraud proofs ZK roll-ups are on chain zero knowledge and volidium is off chain zero knowledge Um side chains are the typical off chain transaction solution And hashed commitments and graffiti are the typical data solution where they have no meaning You're just committing a document. You're hashing it or you're putting the document literally on So the on chain and off chain data solutions are pretty simple On chain is just graffiti a famous example if you go to bitcoin block 268060 It contains an entire rick roll and op return before they lock down the size commitments Off chain, you might hash a document or a merkelized data tree or use fancier structures to put it on on chain Up to put the data off chain and put the hash on chain so you can later come back and say hey I invented this 20 years ago. Here's a hash of the invention document So that's the sort of things you would use off chain data for some of the simpler solutions Transactions on chains just layer one data and off chains. You would use something called side chains basically any Peer chains is another example. I might give to a name It's basically any other blockchain where there's some sort of mechanism where you can bring the The tokens and the data back and forth between the two chains Tomic swaps custody's oracle doesn't look up and lockups are typical ways that you might do this quasi layer two Is kind of a layer two system Um, so, you know, what's there between a quasi layer two and a real layer two In my opinion a real layer two system depends on the transactions of the layer one blockchain And the layer two system systems just roll them up and make them behave like the other systems quasi layer two systems may or may not follow the transaction semantics of the layer one that they're being put on They may respect the conventions. They may not and in some cases you could consider these blockchain integration systems like cactus and And you know, it's probably a good example and weaver is another example These might fit into the quasi layer two where you can integrate data between them bring them back and forth They're not strictly a layer two because in some cases you're bridging peer systems So one can't be said to be a layer of another Sometimes one might be entirely a layer of another So I think this quasi layer two space is an interesting space to look into that I don't have time to dive into in this talk So fraud proof systems are the the next layer of complexity And the only like I said have recorded the net effect of the change Um, the results of whoever posts it is trusted until it's proven false And these systems have ways where they can put them where they can say here's the proof Here's the math. Here's the transactions. Here's the rules you would run it by Some systems you need to find the block and run the entire block It's one time where you run the entire thing and show that the output's different on the layer one chain Another ones have more interactive systems where you kind of do a a binary proof to where you find the one transaction where things were different And where you have to do it interactive So what happens is whoever posts the result will put a stake on there and say hey I put one a theory to say that this works and people who Post a false one and are proven wrong or who their software is buggy will have their stake taken from them And typically whoever's proving it will get the lion's share of that stake because they proved it wrong It's kind of a bounty for you know, I dare you prove me wrong. Okay, you are right here Have your have your share of the money So that's how these fraud proof systems work is they incentivize people when you post it on chain To prove it wrong and when they do prove it wrong you get the money Kind of the financial incentive to make it work in a permissionless system So on chain you would store the inputs and results on the layer one. There's no computation on the layer one It's just execute the fraud proofs themselves are posted on the layer one Off chain it gets more difficult because not even the inputs and results are always stored on layer one When you do your fraud proof, you got to bring those with you and you got to have mechanisms to prove that Those were done one very simple thing is a counterfactual You just have you know one thing that says, you know what I give up your lying and you know You push the everyone loses button So that's one way to do an off chain solution But there's better solutions where you can prove that they did this they did that and they lied about their battleship and put it here So the results are posted on chain only when fraud is proven And you might do checkpoints or might be incentives to do it, but mostly all the data is kept offline The zero knowledge systems are of course the very end of the continuum These depend upon a lot of advanced polynomial math that I don't understand I didn't take nearly enough math in college to understand this The big one that's out there is called the z-case mark. There's zero knowledge succinct non-interactive argument of knowledge A couple key things each one of those words is improvement is important zero knowledge There's you don't need to know anything about the transaction to prove that the rules of the system are followed Succinct these proofs are actually small in size small enough to put on a blockchain Because there's some zero knowledge proof systems that are just huge and easier to use But you can't put those on a blockchain The next step is also important non-interactive Because some cases to prove it's interactive like you know, if you're thinking of odd or even numbers you might give them a number Or say five, okay, and you might check and see if it's odd or even at that point But the non-interactive they need to set up a system so that you don't have to do these challenges So the challenges are kind of built in and the last part is argument of knowledge because this is cryptography At the end is probabilistic These probabilities are cranked up to the extreme But again at the end of the day there is an outside and I do mean outside chance that you can find two solutions for the same key highly unlikely It would take the burning out the entire jewel strength of the sun to calculate those So it's a very strong argument But at the end it's an argument that you know that someone did this math and they follow the rules So these transactions nobody can really see what's going on in these transactions All you know is that the three column argument, you know, like for example, if you do three column math that it's it's proven well in the That it follows the rules of like, you know, three column or two column Counting but whatever the rules for the transaction The uh the circuits the integer circuits are set up so that proves it Now the zk snarks don't have fraud proofs and they call these validity proofs and these are what you post to the chain And once it's there the math either works out or it doesn't there's no stake to put on there's no finality um And peter ask if I can name some of these open source projects and these will be coming up on the next set of slides Um, so yes, I'll definitely name some of these and it's coming right after these slides Um, zk snarks are specialized and not yet general programming capable is one big risk Um, you can't just take an ethereum contract and put it into zero knowledge proofs So as peter's question We're gonna list some sample projects. These are the ones that I have here today that I have slides on baseline protocol is an example of off-chain data where you can just put your data on there A good example of a side chain is x die For optimistic roll-ups arbitrem is one and for zk roll-up volidium loop ring off the top of my head some of the other examples of side chains, um Would be polygon has a chai side chain solution Anyone that bridges off to um, you know the the other x die the x chi The side chain solutions tend to be specialized So there's there's that the optimistic roll-ups. There's another company called optimism running something called the ovm um, and that is something that Should be shipping here in july arbitrem has actually shipped their main net So these optimistic roll-ups are actually rolling out now arbitrem and off in optimism are the two best examples Polygon is said to be working on one hasn't shipped it yet. Um, polygon is trying to do everything Um loop ring is a zk roll-up volidium as tech is another zk zk sync I think is another one So those are some of the names of some of the projects. Um, and I should update the slides Actually, there is uh update the slides on there and I will post um I will post these on the uh Well, well, I'll update my slides So question from tom kline. Can you give some examples of where zk snarks is appropriate and where not? So the most simplest place where zk snarks are most appropriate Or where you're simply trading ownership of tokens and you're not doing anything fancy with it If you just have a simple erc 20 contract and all it is Is it's who owns the token and who doesn't you can send tokens you have You can not send tokens you don't have and that is a great example of where a zero knowledge type system works Where it's a very small self contained well defined Loop ring implements such a system like that and they support up to there's I think it's a thousand and they're loop ring v3 2 There's a limit to the number of erc 20 contracts that they can support because of the math Say support ethereum and basically all the major value bearing tokens that you would have on there So a situation where it's very simple very repetitive Stock ownership would be another great example. I mean, that's essentially what tokens are If you're just sending stock back and forth to people and doing something very simple That's where it's appropriate where a zk Zero knowledge proofs are not appropriate or where you're doing rich smart contract type interactions Um, for example, if you're doing stuff like, you know interest bearing things like ave does if you're doing, uh More complex logic in there If you have like the crypto kitties, um, they have some special on-chain logic that goes on when you breed the kitties That's kind of unique the more specialized and the more distinct what you're doing on The blockchain on on your smart contracts the less and less appropriate zk rollups are Now you can always write your own zk, uh, circuit zk integer circuit That is always an option But the more and more different you get the more and more harder it's going to get to write those and you'll need to get You know, there's less and less people who have the knowledge to do that So I think that's an excellent question When would you do zk over smart over an optimistic rollup? And if you're doing fancy stuff with your evm contracts The optimistic rollup is almost always the better solution if you're doing very simple Standard industry standard token trading zk rollups are an excellent solution and you get a lot of privacy out of them Um, so I got about four minutes. So that's going to be um one Minute per each so baseline protocol is a way that you can baseline your records into layer one And they got some fancy your way. They don't just store data They got some fancy way where you can close your baselines Um, you can tokenize what you've done with what you put into those protocols So the theory the the story that's always told is you can take your You can take your bill of sale and you can baseline it or your your purchase order You can take your purchase order You can baseline it make a token out of that and trade that token on an insurance basis And that data is committed on the blockchain through the various servers You can get your data Um, and you can prove that it's been on there that it's been proven and you can You can tokenize it which I think is something that people are really excited about Um, this is under active oasis standardization and the website is baseline dash protocol dot org The next one is xdai. I think this has to be the oldest side chain that is still running on ethereum That's functional and provides value Um, I actually used this about two or three years ago at eith denver Um, they started paying the food trucks with xdai. So you'd actually use the blockchain Um, and you would be able to Buy all your lunch with xdai xdai chain.com is the solution is the location for that And it does, you know bridging protocols with proof of stake and all that other stuff Arbitrum just launched. Um, I don't have nearly enough time to talk about it But it has interactive fraud proofs and you can put any Evm smart contract on there that you want it compiles it to its custom solution Offchain labs.com. It's probably one of the hotter Because they just launched their their um, their beta net and they're going to be opening up It's going to be one of the ones you're going to see a lot more pressed about Um, optimism is the other one. Um, they we're going to launch in march. They had as late to july So you'll probably see another press cycle about optimism coming up here in july as well And loop ring. I think it's one of the ones that is actually running on ethereum right now is a zk as a z as a zero knowledge circuit It's been live since about 2020 each block route is committed to layer one But you do all the zero k circuit stuff mostly offline. I think it's more of a lydium Than a zero knowledge roll up Um, michael brugani asked can you compare the capabilities of current l2 plus e solutions To the promises of blockchains that claim better scaling than e in terms of complexity potential economics of scale, etc Wow, I wish I would have had that question earlier in the talk. That's a that's an excellent question. Um so One of the values of doing l2 on ethereum is that's where economic value is um, solana For example, doesn't have the same community around it yet They may get it. They may not but today it doesn't But um, solanas also doesn't have multi-party backup failures They had one node can bring the whole network down and they had to do some rollbacks. So there's one risk there It's not really bft tolerant. Um, but as far as um scalability Um, it's it's you're still running on the same issues in that When you do a layer two you're spreading across multiple computers And you're creating a solution that you don't have to get everyone through the door at one point Um, you can do lots of transactions per second, but if it has to go through one cpu to prove it That's going to be the problem. So when you look at these other solutions that are doing it on layer one You're going to want to make sure that they're not just you know Just cranking things up faster and shortening block times making blocks bigger You want to make sure that there's some fundamental solution That is saying to it that your computer does not have to transact in the entire world's credit card database That your computer could participate and only transact one portion of it be sure about that and share it And that's a lot of what these layer two solutions are doing is they're breaking it out. They're taking their world So the world only needs to care about their fraud proofs But everything else that's going on the economic value of their chains only the people participating in there Um need to worry about it. Um an anonymous question is what is a side chain? so a side chain is basically Um a side chain isn't just another blockchain network And when they call it a side chain Um what they're doing is they're making statements that this is a subservient to this other blockchain So I think xdai you could say is truly a side chain of ethereum Because they use the dye token that is made by the maker protocol and without the dye token They would not exist as a blockchain. So they're really a subset of the ethereum uh blockchain otherwise you could have Near protocol is is very popular in doing some of the stuff where they treat it not as a side chain, but as a peer chain Near protocol has you know stands on its own has its own economic value But they have logic where they bridge things back and forth You can take your nfts you can put it on near and you can trade your nfts on near By by pinning them in a particular address on eth1 And you can move them back and forth but near has its own economic value So near is not a side chain of ethereum in the same way that xdai is a side chain of ethereum But all three of these these chains are independent blockchains that run their own consensus They have their own nodes that if you want to participate as a node in there you have to process all the data in there So I think that's probably the best description of the side chain is just another blockchain That is dependent upon one of the other blockchains to get its meaning So that's what differentiates a side chain from just another competing chain um, so again, uh, these are my last two slides And it's coming in two minutes over so I'm going to keep talking until the room proctor tells me that I need to That's probably what they've done in the chat room to tell me that I need to be quiet So yep, and so it's I'm over time But these are some of the baseline examples and I thank everyone for coming to my talk You can get me online. I am I think I have my I didn't put it on the on the thanks page, but I am at shemnon And you can get all my contact information on the hyper ledger forum website I'm the only dano out there for the most part in the ethereum world. So it should be easy to find me All right, thanks