Mesh Security: why we don't need L2s?

ETHCC 6 · July 2023 · 27:18

Sunny Aggarwal presents mesh security as a way for sovereign blockchains to pool security. The speaker contrasts that model with rollups and argues for a different approach to shared security.

Speakers

Topics

From ETHCC 6, hosted by Ethereum France.

Transcript

[Music] foreign [Music] hello everyone uh thank you guys for coming um my name is sunny Agarwal I will be giving a talk today called mesh security a little bit about me for anyone who doesn't know my I work on a project called osmosis which is a interchained DEX built primarily you know using the cosmo stack and in the cosmos ecosystem but and so today I'm going to be talking a little bit less about osmosis more about the cosmos ecosystem as a whole

and this idea of how we are bringing uh shared security into Cosmos and how it differs from the models that you see in most of the other blockchain ecosystems today so you know so what is cosmos Cosmos is this network of many inter-operating chains each of them have their own sovereignty they have their own validator set and then there's a standardized protocol called IBC that allows token ends to tokens data smart contract calls anything to go between them but the most important thing to note about the cosmos ecosystem as you can tell from that uh diagram is there is no Center to the

ecosystem right it is very much this mesh style system of like you know there's point-to-point connections between Every Chain there's no such thing as a single settlement layer in our system rather Every Act chain is the settlement for its own native tokens in its own native state which we will come back to so before we get uh continue talking about blockchains I want to take a little bit of a detour and talk a little bit about uh political Theory I'm sure everyone has probably seen some version of this uh meme before the or like the authoritarian the political Compass system and I saw this like meme on Twitter like three years ago that's

always stuck with me for a really long time which it was basically taking like Network topologies and overlaying it onto the political compass and so you have like you know authoritarian you know you have your authoritarian versus libertarian axis depending on how like you know hierarchical the uh system is and then you have the left right Axis being sort of how equal different nodes are or whether you have like more power laws uh taking place in the right in the right base systems and so you know this like beg so much okay how do we want our networked apologies in blockchains to be organized and so in Cosmos we we call ourselves you know the tagline of causes we call ourselves the

internet of blockchains and part of it is like you know we actually did take a lot of inspiration from the architecture design of the internet uh as it was developed and one of my favorite quotes uh from David Clark one of the early internet Pioneers um we reject Kings presidents and voting we believe in rough consensus and running code right like if you're rejecting Kings and presidents you know what we're trying to build is like we can't be building these um hierarchical systems right we want to be building Network topologies that are uh you know fundamentally distributed uh in nature right and so you know these green systems seem very nice and enticing we've you know built and we have systems how do you make these green

systems work you need these things called consensus protocols and we've built many different types of consensus protocols you know we have bft consensus protocols like you know tendermint or Casper and stuff right you also have political consent uh green consensus protocols like democracy the thing with these consensus protocols while great they don't scale uh infinitely right like you need a point-to-point connection to make these things work that's why tendermen is a relatively complex protocol it doesn't scale to tens of thousands hundreds of thousands millions of nodes but it scales to thousands of nodes pretty well uh democracy right this is a uh picture from Auburn zahlern uh one of the Swiss cantons where they do real live like

open air democracy but that's like true direct democracy because you do have a synchronous communication medium for n-squared communication and that synchronous communication medium is line of sight but obviously this doesn't scale as systems grow right and so what we've done so far in blockchain today is we've built many many green systems you have each of these are called blockchains they all have their own internal consensus systems and now the question that like faces us or is how what is the meta topology of these systems going to look like right how are these systems sort of interact with each other um so one option that you know is where I see

most of the rest of the blockchain ecosystems going towards is building these very uh Hub and spoke style systems where you have a single chain that acts as the settlement layer the source of security for the entire system and then everything else is these like Roll-Ups or l2s or uh you know subnets or parachains or whatever word you want to call them right you fundamentally have this like system where there's all security emanates from one place and I don't know I just personally see this as fundamentally creating a very like top-down hierarchical system at this meta topology layer this is not how the internet was designed and I don't think this is how the interchange should be designed either

um yeah now you have people going for like these l3s like okay bringing in even more hierarchy um my take is you know we very much have to be building even at the meta topology level we need to be building these uh either green or yellow systems right green systems maybe they'll work you may you know that we we've had ideas of how can you run meta consensus protocols like you can run a consensus protocol between blockchains themselves so I think that that is a direction that is possible but I think what is most natural what is probably going to end up happening is we're going to move towards this world of like a yellow style system and as I mentioned you know this is basically what we've done in Cosmos

today right we have this yellowish network of like you know all these chains are talking to each other in their own mesh system not all chains are connected to every other chain you know it's some chains are far more connected than others the ones that have more economic activity and stuff but you let the power laws of the system naturally decide how these connections form but okay so now coming back we have this question again of how is the security in the system going to work because today every single one of these Cosmos chains has its own validator set its own proof of stake system and you know our security is much more fragmented so what are the how are we going to solve this so

what let's look at like we're gonna think here mostly about Economic Security we'll talk about like you know fraud proof validity proof stuff later down the road but when we come to Economic Security I'm going to use this sort of diagram as a key uh basically you know we have if you have this hexagon that means a blockchain a circle inside of it is the validator set and the line is that means that validator set validates that blockchain so today what do we have we have the Sovereign blockchains let's say you have a chain like osmosis you have another chain called axillar they both have their own token osmosis has osmo as its staking token axler has axle as its staking token cool um then you know we can move towards a

world where I'm gonna skip this one where you can get this like sort of sharded replicated security right where what you can say is hey a subset of a of a larger validator set can be validating another chain that chain doesn't need its own uh validator set right and so this is sort of what eigenlayer is building right now on ethereum right it's saying like Hey we're going to use this restaking system and say a subset of The Ether validators and choose to re-stake and help secure this other another system whether it's a roll up or Ada system or some C Oracle protocol or whatever it is right you you have this um subset system which it's cool uh inevitably I think this is not gonna uh the incentives of this

aren't going to fully work out and really what's gonna end up happening is all these projects are going to want to have their own tokens as well because incentives um and so really you know you can you can imagine something like osmosis still tapping in to something like eigenlayer so while we have our own osmo token used for proof of stake we can augment our security with E3 staking so now basically you can come in and you can either stake osmo directly or you could restake eth to help secure the osmosis chain and so you know I do imagine that this is in the current trajectory this is how we're going to start to see uh a lot of the economic security and ethereum ecosystem playing out where you're going to have projects chains that have their own native token plus E3

staking to help secure it this kind of if you if anyone follows the Avalanche ecosystem this is kind of very similar to the direction that they're going as well but at the end of the day I shall see this as a fundamentally red system where you still have most of the security emanating from one place there's like centralized points of failure here and it's this very you know I call it the Empire model of blockchains where everyone is subservient to you know the one the the the you have the Empire the core and then you have the periphery right and every everything else is this periphery what we want to build towards is this world of that we live in today called of nation states and uh city-states right where it's like okay so I I as you can

probably tell I really like my political analogy so when I look at this it's like okay how does security work in the real world today between countries greatest security Alliance in the world today is probably the NATO alliance right and the NATO alliance is interesting because it is not this Empire and Colony system rather it is an alliance between Mutual like you know 30 countries or I don't know exact number but uh like 20 30 countries where it's an equal Alliance where they all basically agree that hey if any one of us is attacked the others rush to each other's defense but what's important is they all still maintain their own sovereignty they all have their own militaries they all have their own like governance systems their own and what they're getting by joining this Alliance

is they're getting the sum of all of their military capacities to help defend any one of them right and so it's basically this network of similar such alliances that have been built up throughout the world that have basically kept the relative piece over the you know last 180 80 years like on a relative scale of humanity we've been in a pretty good uh peaceful time and one of the things that I think is really interesting is um how the relationship between economic interdependence and and like military security and uh dependence right where like out of I think only four EU countries are not part of NATO and that shows that

like okay look there's like a lot of within the European Union the amount of economic interdependence leads people to want to have this sort of uh military uh or security interdependence right where these things are very tight and so this goes very well with something in blockchains as well right like let's say you take two chains that today are very Sovereign osmosis and axolar osmosis is a DEX we use axillar as our primary bridge for bridging assets from the evm ecosystems onto osmosis and you know today osmosis makes up I think like 70 percent of axillars like usage so we're obviously one of their biggest customers meanwhile this is a little bit outdated like four out of the top five pools on

osmosis are done are via bridged assets from axler there's clearly high levels of economic interdependence between these two chains and it would suck really bad for either of us if the other got attacked right and so this is why the the natural model that I imagine arising is this idea of mesh security where you're gonna have bilateral restaking between blockchains so the osmosis chain will say Hey you can use osmo to stake on osmosis but will also allow restaked axle to help secure the osmosis chain meanwhile the same will happen the axillary chain axillary chain will allow axle to secure it but it'll

also allow restaked osmo and in the when the incentives play out basically you're going to end up in a world where almost all awesome steak awesome is going to be restaking on axillary and all axles will be restaking on osmosis and you basically get a system where both chains have the sum of their Economic Securities together and you know let's say you add in a third chain into the mix right Mars is a lending app train being built on on Cosmos and so okay now you're going to have the sum of all three changes uh security system then keep in mind what's interesting here is is like a bilateral treaty so it's this is one thing that makes it slightly different than NATO because NATO is NATO is more of like a green system where it

is like a multilateral thing well this is a network of bilateral treaties and you let the mesh play out and see how it cannot uh security systems uh grow um what's really cool about this mesh security framework that we're building is it can be plugged in into other other things can be plugged into it as well so something like eigenlayer can be plugged in to the mesh security system so we're working with a team called Union to basically build this connection where you can use restaked eth to help secure Cosmos chains as well in the same way that you can use Cosmos restaked assets as well and then there's a project called Babylon which is building uh restaking for Bitcoin so okay great now we're going to allow restate well I

guess it's not restate because bitcoin's not staked in the first place but you'll allow staked Bitcoin restaked eth uh and restate Cosmos assets to all secure all of these Cosmos chains um so restaking itself uh I think most people here if you're familiar with eigenlayer it's a pretty familiar concept but I'm just going to go through it really quick uh it's basically this idea that when you state you know Amelia when she Stakes her osmo she basically what is she doing she's basically opting herself into a slashing condition so he's saying hey I'm delegating these tokens to the figment validator and if the figment validator does anything malicious I want my tokens to be slashed with restaking all it means is you are

basically opting yourself into additional slashing conditions so this is a it actually works a little bit differently than eigen layer where eigenlayer they're very much dependent on these like staking derivatives and you stake the staking derivatives we think that kind of adds like unnecessary risks like you know kind of forcing people into using staking derivatives we've actually built this as a core primitive into our staking module where you can basically take any staked asset and opt yourself into more slashing conditions so you can be Amelia can basically say hey on the cosmos Hub blockchain I also want to be slashed if the figment validator does anything malicious you can also be but you don't even have to be for the same validator right you

can say hey I want to be slashed if the notional sorry I don't know why that's there that must be a bug um I want to be like slashed if the notional validators does anything malicious as well um and so basically let's say anyone does something we'll show on a different chain her osmo will get stacked slashed one of the important things about building these systems core into the protocol is you can have your chain actually be smarter you know there's all these concerns right now about how much are we over leveraging the stake that's like being used with eigenlayer right by building this into the protocol you can have your chain like make decisions such as let's say I'm getting uh State let's

say something like osmosis is allowing atoms to be restaked on the on the osmosis chain we can say hey we never want more than 10 of our change voting power to come from restaked atoms so what will happen is atoms will keep getting staked the voting power made up by atoms will keep going up but at some point it hits some cap and even as more atoms gets restaked that's fine but it's not going to let the the consensus voting power of that restaked atoms ever increase past 10 percent you can you can also have this happen from the consumer side as well where you can say hey our chain is going to be able to detect you know osmo is being restaked we're going to decrease your voting power for

your osmo on our chain slightly because we know that you're you know restaked osmo is not worth as much to the our chain security as non-reached Osama because you know there's not additional liens on this so basically by building these restaking protocols core into blockchains rather than externally you can allow the blockchains to have more opinions on how to like weigh the value of restaking and what how it affects its own native security um okay so versus Roll-Ups this is kind of going in a slightly different direction you know this so so far I've talked mostly about Economic Security uh this is more talking about like so what what is an L1 and L2 right so or

what is a blockchain as a whole it's basically these three levels right you have execution settlement and data availability um and you know I think it's actually precisely wrong I think their order that's a typical order you see it in I think it really should go execution data availability settlement because that's the order that like things happen you have to you execute something that you've proved data availability and then you settle once you prove data availability to the settlement system so today the the model of the world is very much this like idea of l1s and l2s where you have settlement on the L1 execution on the L2 you have an asset like eth you flow it onto the L2 you do things on it however you have this issue of like what about assets that originate

on the L2 what does it mean for them to settle on an L1 because without the environment of the execution environment the assets themselves are not meaningful imagine you had an LP share for a token that are for for uniswap on optimism that LP share is meaningless to you on the settlement chain because without the rest of the execution system it doesn't really do anything right and so really this world you know we're actually going towards is this idea that every chain is an L1 for its internal State and an L2 to its foreign State um so you know I think I'm running out

of time so what I recommend for this stuff is go check out this like blog post from DBA it's basically about this idea that like all l2s are actually just bridging protocols with fraud proofs and uh you know this is kind of the world that Cosmos kind of sees as well so um I'm gonna leave it there uh does anyone have any questions yes I was wondering with all this mistaking yeah yeah so what will happen is that it will

be up to a chain to say hey okay something like osmosis we're going to say oh we want to allow Axel to be restaked on our chain and then we have to provide some mechanism of like we would have to divert a portion of osmosis's staking Rewards or revenues or whatever to that restaked axle right so there's some claim that we're making that oh there's some you know we're getting a certain amount of benefit from allowing that axle to be restaked what's going to happen is like at the same time the axillar chain is also going to divert a portion of its revenues and staking rewards to restaked osmo so it's basically going to be these like bilateral agreements where at the end of the day I actually think

this the actual aprs for people is not actually going to change because whatever slightly decreased awesome rewards you're getting you're going to get you're going to get made up for by resting of Axel but this incentive system is going to push everyone to restaking everywhere and that's how we get this like uh basically the the sum the both change are going to be uh secured by the sum of the two market caps they would be getting slightly lower Rewards yeah if that's if that's the conclusion if it if if everybody has to restake on every

protocol and we're uh increasing the computational overhead of all the validators um are we just recreating Solona no because so okay that's so that's kind of what I was trying to get across here so what we actually do is staking is not actually restaking is not done at the validator level it's done at the Staker level and it's up to a Staker so in Cosmos we have like this notion of Delegation very natively into the protocol where you have validators and you have delegators and the delegators choose validators to delegate stake to and the key here is you don't have to delegate you don't have to restate to

the same validator on every chain if you if you can only if you had to do that then yes that would not be cool because now it's going to benefit only the few validators that have the capacity to stake on to run validators for hundreds of chains they're going to get all the delegation but instead here what's gonna we can be like oh I want to delegate to figment here but they're not running on this other chain I'm not like incentivized to read remove from figment on my first hand I can just choose I'm going to restate my currency to a different validator that I do like on this other chain so you have to remove you yeah we remove validators from the equation the restaking decisions are done by stakers yeah

another thing to note is it doesn't have to only be for like consensus protocols and for like blockchains themselves you can build restaking for all sorts of things right like Oracle protocols da systems or uh fraud proof Styles systems anything you want the way we've implemented mesh security it's just like interface that you can plug in arbitrary we call them slasher contracts so the first contract we've written is a tenderman fraud proof system but we can write uh further slasher contracts where you can say like oh if I restaked on this Oracle provider and their Oracle price is like this much Divergent from all these other Oracle providers like okay they're gonna get slashed as well so you have you can re you use this

restaking for all sorts of things so let's talk about economics for a second because I noticed you you went on that a little bit how do we value another chain stake on a different chain so like if the value of a stake decreases dramatically or increases dramatically the voting power that stakeholders should change right so how do you actually value that because I feel like on every different chain the price of ethereum or the price of you know wrap Bitcoin is different yeah so this we've left as a decision up to the chain that's Implement so we call this um so we call these like um provider and consumer so in this case we would call the osmosis the consumer

chain and ethereum the provider chain because it's a restaking of eth on osmosis how to Value restate eth relative to Native osmo stake is a decision up to the governance system of the osmosis chain so the way that we would do it on osmosis is we're a DEX we're just going to use the t-wop prices from our decks right and we so one thing is we actually do have something very similar to this whole system already in osmosis today it's called mesh security and what I'm sorry it's called a super fluid staking and what that does is we allow you to use LP shares from our decks in our proof of stake protocol so

we can say like we we actually today you can say hey I'm going to take my osmo eth LP share and stake it and by what we have to do is we do have to make certain um risk assumptions about eth and so we provided discount Factor on it we say that oh we're only going to use 50 of the economic value of this osmo eth LP share in the proof of stake system and so you usually will provide a significant discount on the uh on the economic value so let's say it's a 50 discount and then you can choose like how it's okay you don't need to be like perfect on like what the economic value is it's not like that's why taking like a really slow to you up that's like a one week long T WAP or something as long

as you're making this assumption that like hey the price of this asset is Not Gonna Change more than 50 relative to your native token in whatever your T walk period is um we and then we also have all those other like security systems in place as well be like oh this asset cannot make up more than 20 of our Economic Security or anything like that uh you can all if your chain doesn't have a DEX on it doesn't have your own t-wops you can do things like um you know one osmosis uh provides t-wops over IBC to all the other Cosmos chains today um but the other thing you can do is you can use things like validator provided price oracles which is another module we wrote where you can basically have the validators of your chain uh provide like

on-chain price oracles that you can use as the uh waiting system okay thank you uh we need to finish now to have time for another talk if you have more questions to the speaker you can grab him after all right so thank you so much thank you [Music] foreign [Music]