Osmosis Mesh Security & Permissioned CosmWasm with Sunny Aggarwal
14 Oct 2022 · 1:07:09
Sunny Aggarwal joins The Interop, Sebastien Couture's show on interchain infrastructure, to explain Mesh Security and its implications for Cosmos validator sets. The conversation covers ATOM 2.0, how Mesh Security lets chains share stake to boost economic security, and the tradeoffs of permissioned versus permissionless CosmWasm on Osmosis. They also compare MEV dynamics and liquid staking design between Osmosis and the wider Cosmos ecosystem.
Speakers
Topics
Transcript
foreign and today I'm speaking with my friend and epicenter co-host Sonny alcohol he's also the co-founder of osmosis the greatest decks in the interchange and we're gonna be talking about a whole bunch of things today starting with mesh security and how it aims to radically shift the security model in the cosmos we'll also talk about the osmosis ecosystem permission Cosmos and contracts and item 2.0 why he's not so bullish before we get started make sure to subscribe hit the like button and the notification Bell to get notified when we do new live streams every week
my guest Sonny Agarwal is coming up next right here on the interrupt foreign [Music] hey welcome uh welcome to the interop for the first time I mean no actually I mean you were kind of on the interop uh at Cosmo verse but yeah uh but like actually properly uh doing you as an interview so uh yeah thanks for doing this and um I think it's gonna be interesting um in the intro I never said I'm not
[ __ ] on 2.0 I actually am we gotta get people hooked right you got to make it spicy um yeah so what's going on how you been since Cosmo first uh good uh been getting back to reality a little bit uh you know took like a took a few days off after college reverse just went you know around Colombia a little bit um and then yeah this week we're having a lot of our team is here in Berkeley just grinding away on a bunch of stuff uh trying to get a lot of cool features shipped by the end of year yeah well let's uh let's dive into some
of those cool features um yeah by the way I mean like what was your kind of takeaway from uh from Cosmo versus like you know two two weeks two weeks out now or you know the dust is settled um what do you what do you think um I think just you know a lot of really whole growth in Cosmos definitely a lot of people interested in like I think a lot of the projects that are building stuff on top of osmosis are really like starting to get to the point where they're almost ready to deploy now you have like Mars and Lavana and you know a lot of these like a lot of these projects are like real like you know I think we're gonna in the coming like month or two we're gonna start seeing a lot of deployments happening really quickly we've already seen that some of
the you know a lot more contract deployment proposals uh going on to osmosis these days so um yeah so just excited to see those and then uh otherwise um you know I think just been a lot of interesting discussions around Adam 2.0 and stuff I think like the if you look at um more it's a little bit more controversial than I I guess I had originally expected it would be yeah me too yeah um and then I think just in general everyone seems really excited about mesh security as well so um yeah yeah and and you know I think it's it's interesting that that we have really kind of two visions here that um I think aim to achieve similar goals
but that are just in the implementation so so different and um yeah I I do agree that it feels like since Cosmo verse Adam 2.0 has just monopolized the entire like all of the attention in Cosmos like everyone's talking about it like we did um uh we did a podcast here like two days ago uh kind of debating um from the community side and from the hot side and um lots of really interesting insights and like I see people like people are sharing like here I'm going to probably publish this blog post about item 2.0 like what's your feedback and like everyone's kind of like trying to position themselves um about like how they about their their opinions of the of the proposal and I think like
the main kind of takeaways for me is and that maybe I I think I think the ICF like okay first of all like you know this is a a huge document you know like a ton of work went into this paper um you can't discount like the amount of work and research and um you know the one with this paper so like you know the the authors definitely like deserve some some uh some praise for that um I think where where things failed maybe and you know I want to say like in true ICF fashion is like the communication around it wasn't great and particularly I think that they've I think I think they've kind of failed to make it clear that this was a
signaling proposal and I think this was meant to spark a discussion rather than like this is a thing that should be taken at face value and then we're going to implement it like I was saying on the podcast like zaki's talk should have had like draft written all over it and the paper should all like draft written all over it and it should have been like this message should have been just like hammered like hey this is we're putting this out there now we're going to talk about it which is exactly what's happening but just like all of the kind of you know um negative feedback and pushback I think comes from yeah this this kind of weird you know feeling people have I think in regards to the ICF and like how how it communicates and it's not so transparent and you know I really hope
this changes but I feel like that was kind of a missed thing um you know yeah anyway so yeah let's talk about my security um you guys implemented it or at least you implemented like um well a a a a a a preliminary version of mesh security at the at the hackathon um right after cosmen wasm yeah very very proof of concept but yeah yeah but there's a repo there's code there's contracts so like you know and people are contributing to it um yeah like what's mesh security for those who miss the talk uh you know we'll link to the talk but like give us a high level yeah uh mesh security is this you know it's the
kind of the entire point of how Cosmos uh shared security was designed from the get-go which is like you know we want you know we've always been building up this world of sovereign app chains um and now it's time for you know we need to get more secure you know everyone every time we talk to someone about this app chain vision of like hey you know a desktop chain a lending app chain you know a gaming option all these things are going to happen and then people are like what about the security of these like you need an L1 for security uh you need to like you need base level ethereum level like a level of security and it's like so that's always been like a question of like oh how is that going to happen in these app chain worlds and the answer now that we have is well all
these app chains are going to secure each other like you know maybe any one app chain might not have the same security as like an L1 with like base moneyness and stuff right but like all the app chains together will have enough security so you know the an example you know I gave uh was you know if you look at like the market cap of the highest money asset it's gold right uh it's like 11 trillion dollars but the market cap of the 10 biggest uh companies like stock market caps uh added together is actually more than 11 trillion dollars so this like the some market cap of all the app chains companies is higher than the money which is gold right and so I
think that we can get higher Economic Security by all these chains pooling security together in almost like a NATO style model right NATO is like Sovereign countries like you know uh France doesn't go intervene in you know the UK's internal politics but it's it's a mesh of security alliances that if any one country gets attacked they all rush to each other's defense and so this is kind of how chains will work as well where they all are sovereign have their own governance systems but they should all be like sharing security with each other in a a mesh system and not necessarily all chain secure uh share security with everyone else
what happens is chains share security with the ones that they have economic dependence with right and so an example would be osmosis and axillar so osmosis makes up over 70 percent of axillar's entire tvl right now meanwhile four out of the top 10 assets on osmosis come via axillar eat die usdc and wbtc so it's like okay these two things are so economically intertwined it would really suck for osmosis if axelar got like attacked right um so it is in osmosis's best interest to help provide more security to axillar in the same way that it's in axelar's
best interest to help provide more security to osmosis and so these two chains will want to do shared security with each other and so our entire view here is that like these economic dependencies and reliances are what's going to lead to security alliances as well and so um you know and then obviously uh which chain and Cosmos is almost everyone has some economic dependency on is osmosis so obviously you know pharmaceutical perspective we're hoping that we there's ways to turn the our economic relationships with all these chains into valuable security relationships as well yeah okay but Sunny these are all just Fiat economics you know this doesn't really secure anything all the
validators are the same I mean that's a good thing right that shows that like hey the teams here are like you know there's High overlap in communities and like economic stakeholders which gives more reason why there should be like a mesh of security systems across These Chains imagine a validator does something malicious on one chain they should probably be slashed and all the other change as well you probably want validators to be correlating their identities across chains um and then you know the goal here and the Fiat economics are important right because how do you take over a train as you buy up enough of the tokens to do a one-third attack or two-thirds attack or something right and you know if you increase the economic cost of buying up that one-third of token that's that is
how you know this Fiat security is literally that is what proof of stake is that's the entire point yeah um I was I was being facetious there trying to trigger you a little bit but uh you've been through this before I think um yeah so I've only some of them for stake as a concept for the last six years yeah so what are some of the non-obvious like properties that emerge from mesh security like what are the things that the edges that emerge that you know maybe just like looking at it here we're not you know really seeing but if mesh security does um become you know sort of the norm in
the inner chain and we have like all the trans security each other like what kind of other properties you think might emerge um positive or negative both okay uh positive I think it will like you know increase the ease of interacting between chains so you know instead of having to think about oh what is the security uh threshold of different change you know you part of the whole claim of like ethereum oh it's easier to compose it's not actually easier to compose from any technical level what makes what what they mean is they say it's like you don't have to think about the economic security levels of different Roll-Ups because they all use the same security
system first of all that's not really true but um like that's the claim at least and so the idea is by having this mesh system it's sort of like you know make the economic security levels of all these chains much more uh closer to each other and that will make it easier to do like more um trust free or not trust yeah more Carefree I guess uh cross chain composability um so that's like one of the benefits a con that you know what we've so you know like uh the like informal team had actually been working on like stuff that's like kind of leads to this but they kind of actually paused because on like
interchange security B2 and V3 because they ran into some roadblocks in the architecture uh especially things around validator centralization and chain takeovers and all this kind of stuff and so what we were able what we had to do was like figure out solutions for these things and so um you know it's so open question of like Hey will this lead to Too Much validator centralization where it's like it makes it so like the few validators that know how to run on 50 chains will get like unfairly benefited from Mass security or you know how do you make sure that a a giant chain doesn't just come and entirely take over a tiny chain and stuff so I think there's a lot of like open questions and I think our mesh security design has like answers to
those questions but obviously these are theoretical answers like sometimes it's hard to know everything until we put it into practice a little bit yeah I think that the the validator centralization thing is is the thing that I haven't really fully kind of wrapped my head around yet so like in your talk and I've heard you talk about this in other places as well where you say that um we should stop thinking of validators as the as the fundamental unit but we should think as delegates as a fundamental unit yeah um I kind of get that but at the end of the day the validate like from a governance perspective but like a validator infrastructure company is an identifiable like um capturable you know like by
regulation or whatever entity and and also there's the there's this idea of also like infrastructure centralization where like if you have you know most validators on AWS like practically speaking if Theory just goes down the chains go down right like delegators are not going down the same way that validators are going down um am I missing something here or like what is it are we operating on the same semantics here when you're talking about the fundamental unit sure so I guess like message security is just like high level idea that change should be sharing security with each other but keep in mind there's actually different types of security right there's like Economic Security there's infrastructural security there's like you know and so like I think the validator level is more like infrastructural where you know one
thing you want to do is maybe get valid because to start correlating identities across chains um and that way you know let's say one validator does something malicious on osmosis they should get slashed on Juno and axillar and uidx and everywhere right and that's like more in that's more at the validator level and I think that's a good idea the worry is to get incentivized validators to do that when you give them some re incentive to correlate their identities and if they get some incentive to do that that's what we're worried about leads to Value decentralization which is why we actually put that model of mesh security like on the side right now that's not what we that's not the version of my security we're building right now I
think we can build that but like that we do have to answer these questions about validator centralization that's why the version of mesh security we're mostly focused on is this cross-staking model cross staking is this idea that like delegators I can choose to cross stake my osmo on osmosis at stake down osmosis to also help I can stake in on a different validator on Juno it's it there's no benefit of like one validator running on multiple chains in the cross-staking model of Mass security this is all just about adding more Economic Security to all of these chains so um that's why so in in the cross taking
version of mesh security there is no like you know notion of validators correlating identities across chains okay so in this version of mesh security where validators correlated entities across chain so the goal here is like let's um let's create an on-chain uh kind of identity where like we know that this address so like interrupts validator on avmos is like the same as this other validator over here um you know like that might be obvious by just looking at the list of validators but we want to make that like an Unchained sort of representation because you might have like different validators that have different names um you know if you're trying to obfuscate your identity that might be
the case but we want to incentivize people and we want to incentivize validators to actually correlate their identities across chain the um the idea here is that they would receive more they would receive an incentive and financial incentive for doing so but at the same time like the the risk is that like they get slashed across different chains and changing to coordinate around like this slashing uh and you're talking you I've heard you talk about this before but basically you're saying that this kind of already exists right like if there was a big enough attack by a validator we would you know we would use governance or we would use some other mechanism to to to to apply some kind of penalty um but here just we we're moving that
penalty to like an unchain mechanism that like essentially just like you know runs circumstances yeah okay um yeah let's maybe like let's walk through how this work because you you guys have like a really good um flowchart thing here and like I'd love to get into like technically you know what are the different steps here so you know for those listening on the on the audio version uh you know you should check out the Youtube video um so here we've got like osmosis and Juno and you know walk me through the different modules and different contracts that uh yeah that interact here with yeah so uh for some context this is actually what uh we built at the hack wasm hackathon right after Cosmos
after Cosmo verse um I'll be completely honest uh I wrote very almost no code for this uh it was mostly Ethan Frye and uh Jake Hartnell who like hacked on this like three days straight and like actually got something working so that was like super cool but that's really cool which is like you know this keep in mind this mesh security thing is not an osmosis project this is just like a idea that we came up with and like like the Juno and con NPO teams have been like stepping up to do development more people have been starting to help the development of this um so what we helped with a lot was this architecture and part of Well here here's something interesting that we'll say is like what people might notice is that the architecture of this is extremely
similar to the architecture of super fluid staking because if you think about it what is mesh security mesh security is saying hey the governance of my chain let's say so who's the consumer chain it's Juno in this example right the governance of Juno gets to say that like hey I want to opt in to let this other token that's not my native staking token count toward use governance to approve that let it count towards staking power we need but we need to be able okay I think we lost sunny
let's see if this works all right foreign [Music] you were talking about how uh basically you're allowing um you're allowing the other chain to to accept your security yeah so in in Frost staking it's like the the consumer chain
is making decisions about which other these other token assets of these Ivy seed staked assets to allow to count towards staking power baby slashable give rewards superfood shaking was the same thing right it was osmosis governance saying hey we trust these LP assets enough yeah decision about another another token because yeah we trust this asset enough to let it count as part of our staking system give it rewards and have it be slashable so one thing well we are one of the reasons we were able to like you know architect this kind of quickly uh in like a day in less than a day was because it really was taking our super fluid staking
design that we had spent like weeks months on and we kind of just like broke it up into a number of contracts and uh have you know added this like IBC barrier at somewhere but like a lot of it was really the same design so okay so what do you want me to do you want me to walk through this entire slide deck you're muted smashing are muted yeah so I think the here that what we can do is say okay uh let's start here where osmosis approves crossed chain staking and um enables this uh cosmosa meta staking contract okay so here what happens is
Juno is the consumer and osmosis is the provider in this situation keep in mind security the idea is that we'll have this instantiation that will have the same thing going in the other direction right so this is one side and then we'll have another side at some point all right and so then at some point um yeah so Juno says hey they use governance to say we're going to let osmosis osmo cross taking count uh and then they'll put some cap on how much maximum this is to prevent like the whole chain takeovers so okay they cap it at 10 what it does is it deploys a contract on osmosis that is like this oh sorry on Juno it's a mesh consumer contract uh and then this mesh consumer contract basically deploys a
corresponding contract on the other side which is called a provider contract so if you go to the next slide and then this mesh provider contract it has like a Juno it has a special plug-in to another contract which is like all the specific details about how like you know about Juno right because and like this is too so that we can add more consensus protocols more types of slashing conditions and stuff over time so this is called the slasher contract um and then you know it opens this trusted IBC Channel between the contracts and what it does is it allows I can't see the slides
hello the joys of being in the woods man the best thing for me to walk through these slides right now I think these the walkthrough was available on YouTube and we can have some have people walk there because it goes pretty technical but the idea is basically I think the general high-level idea we wanted to show was that like look what it does is it allows you to take osmo on osmosis that is staked on osmosis say hey I am going to opt into an additional slashing condition and back this validator on Juno and then that
information gets transmitted over IBC and and the Juno system will accept that as voting power and then if any slash happens it'll send that information back over IBC or you can submit the double sign evidence directly to the contract on osmosis the reason you don't want to depend on IBC for the submitting of slashing is the whole point here is we're trying to deal with a Byzantine chain like what if Juno goes malicious and it starts censoring the evidence right so what we want is the ability for uh like double sign evidence to be submitted directly to osmosis so it doesn't rely on the liveness of the Judo
chain for slashing purposes um yeah yeah okay and and so and so when when this is implemented the the provider chain so who who's who's getting incentivized here like the validator the delegator and also the chains are are who's making money from this operation so the delegator the cross stakers are the ones who are getting rewards basically right they it's basically they get treated as sneakers um so similar to how in super fluid's taking right if you are super fluid staking your pool one shares it's counted as like hey this is being treated as this much osmo worth of stake right and you're getting staking rewards as if you state that much osmo it'll be the same thing here where okay it's less
right so with super fluid sticking you're actually making less you take a little penalty yeah you take a little discount on that right yeah that's that's good right you know especially for cross staking we want you know if you want to be maximally exposed to osmosis you should be pure staking osmo the cross staking Juno to secure osmosis is like a benefit it's a nice bonus that Juno stickers get but like you know you still do want people to natively stake the assets that you know let's say they're the most bullish on yeah well I'll link to this this flow chart in the show notes people can look at it also a link to the repo people want to take a look at the code and all the contracts um so when when this happens so then Juno is benefiting from essentially having
osmo staked to secure Juno so this is I think like the Mind shift that people need to have is that they're no longer securing um they're no longer securing Juno with Juno they're securing Juno with osmo um what are the implications here for uh say chains that have less security so you know like in The Interchange we have chains that are more secure than others and we have chains that are less secure than others so how do we how do we reason about the the security implications that this has um for chains that are maybe taking security from other chains that are like less secure so um
yeah so a chain that like less secure getting security from a bigger chain I think the benefits are obvious right they get way more Economic Security but a big chain why would they want to take security from a smaller chain right I mean like I said the whole point is it's not you shouldn't necessarily have to think about it as a one-to-one thing this is a mesh right and so even if like let's say like a big chain like osmosis gets security from 10 smaller chains uh you know maybe that could meaningfully double its uh security budget so you know it's often like hey people like oh why does the US does the U.S get anything out of NATO isn't it like us is just the only one providing anything to Daniel it's like yeah sure like the us maybe has you know outsized influence
relative to any one other country in NATO but like the the sum total of NATO is like you know the US definitely gets benefit from like the sum of all other NATO countries also helping secure the United States yeah I actually have this here in my notes NATO example the US is the biggest security provider yeah but like is it like more than it's not 90 of the security budget of NATO right it's like yeah like you know there's a reason it's a it's a security Alliance not a Empire Colony model right where it still does flow bi-directionally multi-directionally yeah uh no this is cool so what is the um what's the rollout here like when should
we expect to see this on osmosis and like are there other chains that are already thinking of implementing this as well yeah so I think um like Juno and uh Eve which is like notionals like uh Canary chain that they're building I think there's a number of chains that are like planning on implementing it I mean realistically yeah I was not expecting for development to even begin until well January because like I said we have you know actually from the osmosis core Dev team we have like a road map that we have that was like you know planned until December um and we were like we're like okay we're gonna pick this up in January uh but like I said people were just so
excited by the concept that they're like no no we want to start working on it this weekend so um I I mean I realistically We're not gonna see anything live at least until next year for sure right at least I think the development has already kicked off and we're going to hopefully see it I don't know I imagine we're gonna see like a prototype live definitely within like the first half of 2023 okay and what are the so one thing I was thinking about here is like maybe I gotta commit to shaving my head and maybe that will help move it faster yeah let's do that here here on the interoff studies committed to shaving [Laughter] um so what are the implications here if
you want to do uh if you want to do liquid staking but you don't want to do it on osmosis so let's say you've got your um you've got your you've got your osmo staking over on Juno uh but you want to use that staking position um on Quicksilver you know to like generate some liquid stake acid on Quicksilver could you do that or is it going to be someone is there going to be like a walk-in one more time yeah so so you've got you've got osmo yeah mad cat knows that you're gonna shave your head so he he's our witness um if um if if you've got uh osmo that is staked on Juno right so
you're you've got a staking position on Juno uh but you want to generate a liquid staking uh token so you can you take that that that share that staking share that's representing that Juno steak and like move it over to Quicksilver and generate a liquid staking asset is it is it the same as if you just had Juno steak there or or is it sort of some sort of like already some sort of staking derivative no so so keep in mind with speaking derivatives how they have to make it fungible because they need to make sure that all of these staking derivatives have the same slashing properties right and so yeah that means that like anyone who's let's say you're holding um Quicksilver uh atom or let's say Quicksilver hospital or something right
like yeah they everyone is holding that has to have the same distribution of Delegation to which valid it is right it's actually like okay you know 20 chorus 20 yeah whatever right but now it's like yeah but now cross staking is also part of a slashing slashing uh portfolio I guess and so we have everyone who has like uh Quicksilver awesome oh now you know the Quicksilver system also has to make the decision about all the cross staking that happens as well with osmo so that way everyone can have a fungible position so you know potentially this is going to increase even further increase the like
decision making power of these like liquid staking providers which is you know a trade-off yeah yeah I have to digest that a little bit um can you turn off your WhatsApp uh it's uh it's like chiming in here I think it's what's up I I think it's awful oh okay weird I'm hearing I'm hearing someone's up no I just anyway yeah um okay so so potentially we could see these cross-staked assets as part of a risk pool for liquid staking
uh but they do need they would need to onboard them like technically that's a little bit more cumbersome than onboarding just using like the staking modules uh shares right um is it is it feasible or is it like you know liquid sticking will only work with natively staked assets will work here as well right all the all the liquids take to osmo will also have the same cross-taking uh distribution as well um okay and what if so what if you've got some Juno and like Juno osmo uh liquidity pool right and you've got some
bonded um some bonded tokens in the pool you've got bondage Juno on osmosis are you gonna be able to stake those on Juno even like like sort of like like like liquid like some kind of flu super fluid staking but that goes cross chain oh wow yeah superfood's taking cross chain we had this exact idea all right so I would say even met even cross staking this idea we had in some Proto version last year with interfluid staking right so what was interfluids taking interfluid staking was saying hey we have this like let's say osmo akt pool on osmosis yeah and it's super fluid stake on osmosis why can't we also have
that counterward security on a Cosh Network as well and that was that is cross staking right but instead of cross-sticking for Native assets it was cross-staking for a super fluid asset so interference thinking was exactly this idea of like cross-daking plus super fluid uh yeah so it's kind of funny that we actually had this like I cross taking idea for this more complex thing of superfood and they were like wait we can actually use this for the native assets as well okay yeah I I had forgotten that we had already interfluid say staking um well we don't have it live yet but that was this idea that we had and I think now like you know it takes some time like you have all these ideas and then they all just everything just starts to click and you're like oh of course there's like one unified
framework that explains all of these uh things yeah no this is super cool um I I do think inner fluid's taking is an important part of how osmosis is like you know makes itself more essential to a lot of these chains where it's like hey look all all you Cosmos chains you already use osmosis for your liquidity and you have all of your tokens on our our chain you should you should be okay with using us for your security system as well and so it's like you know I think there's this interesting relationship that's going to happen between liquidity and security and do validators need to do anything different or are they just running the same software and they don't have these
run after anything different okay and but validators can't also opt out of being uh like if they're staking in the chain that has that has mesh security enabled like a validator but doesn't really have an incentive to opt out of it no it's just like it's just like as if someone staked more on you yeah right okay interesting uh very cool yeah I'm looking forward to seeing this develop um as uh as you said next year when when are you shaving your head no more shaving so yeah when we talked on when we talked uh in in median when we did this episode you were talking about permission smart
contracts like permission cosmolism and I've been thinking about this ever since and like I mean yeah what's the idea here and like why do you think all the change should just enable cosmosm as a as a like default permissioned uh system yeah because I think like cosmosm like smart so the cosmos SDK is like very powerful that's very dangerous because you are writing like native code code right and this allows you to do a lot of really cool things but it's it's dangerous meanwhile cosmosm is this VM system right it's like a nice sandboxed
environment that you can do like it's way less it's not as powerful as an SDK but it's you know because of the sandboxing and everything you you can the attack surfaces are actually much lower for logic that's written in the s in cosmoth because if you write a new Cosmos SDK module we have to do like a lot of auditing to make sure it doesn't go like screw with like another module in an unexpected way and stuff right because it's all go code they can all call each other uh we built this like object capability system to kind of help but it's not as good as the sandboxing system of VMS so that's why it's like for New Logic it is just so much faster to like hack on it
and like get a MVP and like start building it on causalism and more importantly it's so much faster to review it and feel comfortable adding it to a blockchain and so that's kind of why we've come to the conclusion that we treat we've how we've started to think about things more is that hey let's treat the cosmos SDK as like kernel level code right like when you're like yeah OS it's like okay yeah you need to do some kernel level programming but then a lot of the like application stuff that stuff that doesn't need you don't give pseudo privileges and to like things that don't need it right and that's like yeah most things in cosmosm and then use the SDK where we really need to like how we do transaction fees and how we do like parallelism and how
we do like you know all this like really interesting staking stuff like that can be in the SDK but like a lot of let's move more of our logic into class and you know osmosis we actually have now not in the in the next coming upgrade we have we're going to have our first module that's uh in cosmoplasm which is IBC rate limiting and obviously is a way of like you know we can say hey we only want maximum of 20 of this uh IBC channels TBL to like flow out every six hours or something so that way if there's ever a hack or something it's like okay we're capped at the amount of losses right at 20 or something it gives us time to pause the chain or whatever um and so it's like a similar situation
here but it's like okay we're like we're just going to write this in cosmosome it's way faster and if other chains want to adopt this uh IVC rate limiting module well they gotta adopt permissions cosmosm so they can add it to their chain right and like and so we're taking them very much just like the same thing happened with mesh security where we're like hey all these all this security stuff that we wrote at the hack awesome we wrote it all in cosmosum and I think what's going to happen is like more and more of especially this like whole interchange composability stuff is going to start to be written in cosmosom just because it's faster not not faster from execution perspective actually causes SDK is more performant but I mean faster from a development standpoint and you know I think the composability is just
gonna and change that don't opt into this kind of stuff use permission cosmosome they're gonna like not miss out on all these like cool things like rate limiting and mesh security and stuff and I think you know it's going to be an incentive for change so I'll start to adopt some permission cosmosm and human it should be permissioned because like you know we don't want every change to turn into a generalized part Contracting chain it should be like but it should be you know governments can add new functionality as you know as needed without having to go through all and the cool thing another cool thing about Cosmos you can add functionality just by governance proposals rather like than having to like do a software upgrade and upgrade the chain every time you want to change add a little bit of new functionality yeah no I mean all I'm
sense I'm so is is there a point where because I mean you mentioned the the performance benefits and obviously like writing a um uh Cosmos SDK module is going to benefit from much better performance because it's closer to tenement it can interact with tenement directly through adci um uh control over how you're like storage and database and everything works yeah right so is there a moment where say you know let's say mesh security let's say mesh security gets adopted you know it's like widely adopted across the inner chain and you know we realize that like hey there's there's a there's a benefit if we write this as a cosm as a cosmos
SDK module does it that makes sense or do we just like keep kind of trying to optimize this contract um you know when does this like quickly written you know like uh code become uh core enough to start building uh modules yeah I mean that's a good question um I guess we don't know yet we haven't hit those bottlenecks yet but you know I mean there's two answers one is we definitely have to improve the performance of cosmolism right the cosmosm today like honestly to me at least the storage is a little bit of a black box like I don't know how it's first of all I know it's like Json serializing things and like you know I don't know how the Merkel tree is
working underneath and it's like okay you know we probably should go and improve all those kinds of things and like I think we can get the cosmolism performance to be like much closer to the SDK I don't think it'll ever be as good as the native you can get it much much closer um yeah and then yeah I think maybe some things maybe should be Rewritten in the process SDK especially like things that happen very regularly like that are extremely important uh one cool thing about how cosmopolism works that is as a they have this concept of pinning contracts well what that means is like hey a contract that's used so regularly governance can pin it and what that means it'll store that contract in memory and so that way it doesn't have
to keep pulling from the every time that contract needs to be called it like doesn't pull it from the contract uh byte code from the database every single time it's held in memory just like Cosmos SDK you know go code is always held in memory um it's like validators and node operators are holding this contract in memory yes exactly and so that way it'll that will definitely help improve the performance and stuff so yeah long story short I think there's a lot of work that we can do on like improving Cosmos and performance um to get it closer to the SDK and then there are if things really do need to be moved into the SDK and that is like the big win we we can do that as well and our team has been working a lot on like
improving this called Cosmos on SDK experience overlap because I think you know a little bit of what happened was there was this a lot of dichotomy which was like there were some teams that know Cosmos SDK really well and there's teams are those you know everyone who's like helps most of the teams know the costumes SDK pretty well right like you know your regen who like builds causes yeah had forever only been doing stuff and causes SDK then you have some teams that know cosmolism really well like the Juno team right they I think they know Cosmos really well uh the configure team obviously you know they built the thing and they they obviously know the causes SDK pretty well as well but like all most you know the chains that they've
launched like Juno and T grade and all these things they are like very thin Cosmos SDK chains not much customization there because they've decided to build all of their logic in cosmomlasm yeah osmosis we're like one of the first few chains that you know we don't have a thin we have a really complex Cosmos SDK uh stack right all of our amm logic and everything is currently in the cost of SDK but then we also have this Cosmo or something and so when we started doing stuff with Cosmos and we're like wait so much much of the cosm was I am like developer tooling and everything was really assuming a very Bare Bones crossless SDK chain and assuming that
all the stuff is going to be built in cosmoasm and that's just not how we're building right we're building like half and Cosmos SDK half in cosmolism and so we've had to spend a lot of time in the last like you know few months like really making that ux of like interacting between causes Decay and cosmoplasm much much better so we've like built this Library called osmosis rust which is like a general lot eventually where this is all going to go into effect a product we're calling Beaker which is like the um you know we intended to be like the hard hack for for cosm walls and hard hat is like the Tool uh tool that everyone in solidity uses to like do all of their testing and
Scaffolding and everything right so Beaker will become that so that didn't it'll includes like ways of causing Blossom contracts calling SDK modules it includes a brand new cosmoasm testing framework that we that we that we uh created because um earlier like it was weird what was happening earlier was like the uh popular Cosmopolitan testing framework is called CW multitest what they expected was every time you write an SDK module you would effectively rewrite it and rust so that you can test it and I'm like that's kind of crazy right we're not going to like rewrite our code twice once and go and once in rush and so our our new testing framework we have it so we can
actually test you know we can write our contracts in Ross but you know the modules and go and we can still test them against each other so you know our team has to has been doing a lot of this like work and like making this like two universes sort of come together into one cohesive developer experience so so this Beaker thing um you know for for those like me who are like more used to like web 2 development what would that be analogous to in web 2 would be like a react or more like a what like um yeah kind of like a react uh more than no not really a react it would be more like um to be honest I haven't done like web
development in a long time but uh like you know it's the I mean look if you've done College SDK stuff right it's like starport but like okay awesome right okay so like kind of a CLI scaffolder framework okay yeah but also very importantly a testing framework right like right so you have in ethereum people coming from solidity you have things like hard hat and frownedly Foundry or or truffle was like the really popular one back in the day this thing status also had one also yeah yeah interesting okay so so this is what you guys are building and this doesn't exist
yet in Cosmos I'm like there's no real no yeah it yeah because I saw like Larry zero X I saw him tweet this thing today I wanted to ask you about it um is this CW SDK roadmap he's tweeting about is this what is do you know what this is yeah Larry has this idea that he wants to rewrite the cosmos SDK and rust okay and he wanted to like rip out all the go and just like make everything in Rust um it's okay you know I mean look it causes an informal also kind of working on this or are they writing like big parts of tenement and yeah so they're rewriting tendermen in a rust right okay
I I you know I wish Larry lock I think it's a fun project I just don't think I think the causeless SDK has been in development for like five years over five years now and there's just so much that goes into building an SD card it's not just the execution State machine right you have to build like signing systems you have to build RPC you have to build like you know there's like it is a massive pass to pick like yeah to build and you know we think that it's easy and you know we're not saying that's the case is perfect I promise you it is not there's a lot of room for improvement by thinking you know I think it'll be much easier to fix the issues with the SDK than it would be to like try to write a new framework all from
scratch again yeah that seems like a massive undertaking um yeah I want to get some from I want to get someone from informal on to um to talk about like this kind of rust thing um yeah let's try to see if I can get someone um yeah one thing I I think I tweeted about this and I was asking like if you have permissioned Cosmos uh cosmosm on your Cosmos chain and then you also want to have permission lists does that is that like the same namespace or should the permission stuff be kind of segregated and separated for security reasons or you know what should the cost so the permissionless stuff be
able to call the permission stuff if you have permission list I don't see what why you would have permission uh at all right okay but there's no security issues of like having these kind of core contracts like osmosis rather you've got like you know your mesh Security Contracts and stuff like those um you know like if you're thinking of like software development there's like namespacing and sort of yeah um certain things yeah it's like that's kind of like what I meant by this whole like security permit like uh sandboxing of VMS is like VMS contracts are sandbox like are private by default and they need to expose uh right okay it causes Decay to the opposite it's
kind of like everything is a little bit public by default then you need to like build in security systems perimeters around things so it's like yeah yeah if you if you have a permissionless system it's fine you don't need to have a separate permission cosmosis every sandbox every contract is already in sandboxed okay so with Cosmos when you don't have the same composability as with like uh solidity contracts no no you do it's just that like what I mean is like you let's say you have a mesh security contract right you can't it's not like any contract can just call in like you know it's easy for a contract to say oh I only want these contracts to interact with me okay here's an interesting feature that is built into cosmolism
it's really cool it's called a sudo message so what that is is it's a contract it's a it's a function in a cosmosm contract that can only be called by the cosmos SDK so you can't have another contract call it and you can't have an account and so this is how IBC rate limiting Works where you know we have this like rate limiting contract we don't want it to be called by any other contract or by a user that's not what it's for right what we do is we use a pseudo message so that the IBC go module in the cause of SDK it can call this Con this function in uh in this in this rate limiting contract and only you
know an SDK module can call that and so that's like that's a really cool feature that like Frye had added into that Cosmos of that will like that really makes it that that's what makes it possible to write I would say core modules of this in cosmosum because you know they can only be interacted with by other core modules from the SDK okay that's really cool I had no idea yeah I mean like I I I don't code cosmosom contracts so like it's helpful to be able to ask these questions and understand how it works um compared to like statistics there's a big lack of like tutorials and like uh for cosmosm where there's a lot of tutorials that teach
you the first uh 30 of it hello world yeah the hello world a little bit you know the intro stuff the basics of stuff there's not a lot of tutorials that teach you the complex stuff like the pseudos once you're doing this cosmoism Academy thing yeah they are so we'll see how hope that will that will be like the thing that will do it for me right now how I do it how I learn cosmolism is I like every time I get stuck on something I read through the Mars contracts and the Dow Dow contracts I'm like oh okay that's how they did it I'll start doing that too yeah yeah I think that's probably also how we try to how to try I mean that's also how I learned to code back in the day yeah um that and stack Overflow
um so yeah I want to talk a little bit here before we wrap up about um kind of you know osmosis versus atom 2.0 um you know we do have to make this a little bit spicy right and um like Jim Jim from from your team like posted this tweet uh I think late September kind of basically describing and comparing the the same tenants in cosm in in osmosis and in on the cosmos SDK and so like there's liquid staking interchange security Mev and and bootstrapping and both Adam uh 2.0 uh proposal and osmosis have very different views about how this
is going to work we've already talked about mesh security but I think you know the the um and then like staking derivatives and superflu is taking I think it's kind of easy to wrap your head around um how are you guys looking at Mev and how how differently are you approaching everybody compared to like this interchange schedule or uh that's proposed by atom 2.0 yeah so you know one of the big things we're doing with Mev I mean one there's two things right um so at the nebular summit I gave my talk call uh on Mev right and it was you know I think the takeaway of that talk was the goal is mitigate bad mub internalize good Meb and so you know
we've always been talking about this like threshold decryption stuff I think I have so many talks on it we've about like you know that's how we mitigate bad Mev right you want to stop the sandwiching and front running and all this kind of stuff um but what does it mean to internalize good Mev so there's some Mev that the bad Mev is the one that's like you're doing actions based off of someone else's transactions you see their transactions in the mempool and you act upon them and that's like a privacy breach and that's like why it's bad but there's some things that you can do that aren't based off of reading other people's transactions it's just based on reacting to the state of the world and just being the fastest right like so for
example a liquidation right that's like hey it's not bad it's actually if anything it's actually good for the health of the network you want liquidations to happen um or even Arbitrage right like there's let's say the price of Adam has moved on external exchanges and like you know someone needs to ARB the price of atoms on osmosis right and it's like that's not bad it's not like no one's being harmed by doing this right it's like okay it's a good thing you actually want prices to stay in sync um but there's still there's still profit to be made and it's a race to who can get that Arbitrage profit and so these are like good Mev systems and what we want to do is make sure those that
profit gets internalized into the protocol and gets like given to Osmos takers um you have what we're trying to avoid here is like not have systems like flashbots which are these like extra external to the protocol like these like I mean you know I I use this term called validator cartels in the senses or minor cartels right it's like and all it's an off-chain Coalition of people who are like doing this when instead you know all of these auctions and stuff so what we call them is what we're working on with um so this is where skip comes in where skip is helping build tools for internalizing good Mev and so what that means is
they're doing a couple of things right they're doing one The Proposal that that recently went up was about building an on-chain arbor so this is for you know there's pools on osmosis and sometimes they go out of sync and then there's an ARB opportunity to re-synchronize the pools like do a circle you know you you sell osmo for Adam Adam for Juno Juno for Osmond you get a little bit more osmo by doing that um and there's a lot of like off-chain Arbors who are playing this game right now uh to be the first to do that well the protocol can do that itself and capture that Revenue give it to osmo stickers so that's like the first thing skip is going to build then the second thing is like okay but you know that only works for internal
arms that doesn't help you ARB against external markets right so oftentimes there's a lot of value in being the first transaction in a block and so we call this top of the block auctions where you know what we should do is sell off the right to be the first transaction in a block and that way you know people can bid on it on chain and if they win that bid they'll be the top of the block and they can get be the first to execute arbs and whatnot so you know there's like value in these uh things and building these in protocol is what skip is doing and like you know effectively you can argue that they're basically being the joint they're like going to be a core Dev of osmosis and building like
functionality into the osmosis core protocol to do this kind of thing so this top of the block auction thing then the revenue from that top of the block auction would go also to stakers so when you're saying when saying like internalizing good Mev um or wait are you internalizing bad MAV or good Mev I mean good MAV so internalizing good Mev is kind of like leveling all like covering all the bases and leveling the playing field at a protocol level and then capturing the revenue from from that and like giving it back uh in the in you know because you can right because like with osmosis you can I think with I think with Cosmos and especially now with interchange security
it's harder to see exactly what that stuff is because like you guys have a specific like osmosis has you know very specific use cases and you can kind of Target the Mev that you see there whereas with with Cosmos there's gonna be like tons of chains there lots of Mev opportunities and so I think where the scheduler makes more sense here is okay like we don't know what those ARB opportunities are going to be let's let the market decide and let the market figure it out by having like these it's a like block future block options so let's talk about the scheduler right so there's two interesting things about the scheduler um one is this idea of it being a Futures Market that's an interesting thing that I've really heard of and it's
one one worry is it's hard to know like buy block space for a much a future block and like try to know how much Mev is going to be in it it seems on and then it seems that you know all the profit is going to go to the secondary Market of like reselling future blocks rather than like more just-in-time sales when the value of the Mev is more known so that's like a I don't know that's that's an interesting thing we'll see how that actually like plays out but the general thing is that like this whole idea of The Interchange scheduler is it's hard to see which chains are going to opt into this right like something like osmosis I don't see why would
osmosis opt into the cosmos hubs scheduler and give up instead of internalizing Mev to osmo stakers giving it to atom stakers or even like inner chain secured change even them like you know I've been talking with the neutron team and even they are like yeah no we have we don't plan on using The Interchange scheduler because you know part of the value of the neutron token was we're going to internalize the Mev into the neutron token and so it's like I feel that kind of one of the whole points of Bill one of the benefits of building an app chain was to be able to internalize mub and it's unclear why who's going to be the user of The Interchange scheduler and like opt into not internalizing their own Meb so
that's like a big question um yeah I think they need to they need to clear up like what the incentives are here yeah I think here's the most interesting question about how cross-chain Mev is going to work maybe there are benefits to having a singular Market okay so there's two options here let's say every chain has its own top of the block auction right let's say you know osmosis has its own Juno has its own whatever right if you want to do an Arbitrage between these markets like between osmosis and Juno swap let's say right you have to win both of the top of the block auctions and that's like
harder and it's like more unclear like oh what if you win one but not the other now you just wasted winning that bid and stuff right so that's yeah that's I would say the the null hypothesis that's the default of what's going to happen and I think that's probably how things are going to start off but there is benefit you know maybe to what if like these auctions were joined in some way right like what if you could say I want to bid on to be the top of the block of both osmosis and Juno and if I don't win both I don't want to win either because that's not worth it for me now you know the concept says oh okay yeah we'll do that and the allocator the scheduling module it's like okay and then that profit goes to animals like no no okay
you know everything's a mesh right so it's like the question is like okay all I think if if it is beneficial for osmosis and Juno if you have a joint top of the block auction they should do that and the value should go to osmo and journal holders but the question is how is the revenue going to be split who has the is it going to be split 50 50 is osmosis going to get a higher portion of the revenue then Juno will because you know I mean the liquidity on on us you know it's more likely that Juno's swap is being armed relative to osmosis rather than the other way around and so it's like yeah okay how is our Revenue split going to work is there like a formalized model for how we Define fairness in these like joint auctions and stuff and like I think that
is one of the most interesting questions and like open research problems that I think came out of Cosmo verse or you know I guess like I've been talking about it with the skip feet pull for a little bit but like I think that we had this Mev panel at Cosmo first and I think that was the first time we kind of like shared this open big open question publicly and so I don't know I think this will be an interesting research topic for a while how do you do Revenue splits of joint auctions yeah I think the med topic on on Cosmos and sort of like entertainment is like so interesting and I've only just kind of started diving into it I haven't paid much attention to you know I sort of like
you know follow the flashbot stuff a little bit but like not that much but then you know I had this interview with braps a couple weeks ago and he just like totally opened my mind to this and then like hearing you talk about it so um yeah I I think this is something I want to cover a little bit more on the podcast here maybe I'll get to skip people on um cool well listen uh I think I think we can wrap it up here uh it's been an hour we didn't really get to talk about osmos's ecosystem so much but um maybe we can we can save that for another time um so I'd like to try something here um okay maybe this is this could be like a recurring thing who should I get on next who should you get on next um yeah
have you had dogemos on I have not had dogemo song dojos would be a good person have you had um specifically about what just like Kepler and ux and how like building cross-chain wallets and like it's all yeah all this sort of um Mars team on I have not but it so we were supposed to do it next week but uh but we're I think we're gonna be pushed back a little bit but yeah they're they're due to come on as well I think Utopia is really cool so also get them on as well who getopia it's github.com oh okay this is cool okay those are those are three great
suggestions all right well Sunny thanks a lot uh thanks for coming on and uh hopefully we'll get you on again I know we'll get you one again for sure very time sometime very soon um thank you for listening to yet another episode of the interop we do live streams every week uh please follow this channel subscribe to this channel to get notified when new live streams go live you can also follow me on Twitter Ms sub 3.0 I tweet about all kinds of things related to Cosmos and the entertain and sometimes uh some other stuff um but yeah thanks so much for joining and we'll see you next week