Why builders are flocking to interchain DeFi and how users can reap the benefits

ETHCC 5 · July 2022 · 25:56

Sunny Aggarwal examines the growth of interchain DeFi and connections between ecosystems such as Ethereum, Cosmos and Polkadot. The speaker considers what cross-chain liquidity can make possible for users and applications.

Speakers

Topics

From ETHCC 5, hosted by Ethereum France.

Transcript

foreign where sorry oh no sorry my bad oh okay sorry oops

hello everyone thank you all for coming to the second to last talk of the last day of ecc so you guys are the real ones for sticking around and as a reward you guys will get to learn about the alpha of the future of blockchain and how where everything is going and the key word is app chain so you may have been hearing this word around a lot recently you know dydx i guess helped push along some of that uh get that up more publicly known but you know i want to talk to you guys a little about the vision of app chains why apps are moving towards this and uh just how things are going to play out going forward so uh there's another word for what i call the vision of app chains

it's this thing called cosmos uh one thing that's like you know the sometimes the terminology of cosmos is a little bit confusing what people might not often understand is it's not a blockchain it's not a token all cosmos is the word is just an idea which is a vision of app chains and you know we the tagline is the internet of blockchains but yeah it's just this vision and an idea and so i'll start with kind of explaining what this idea is so before we talk about the idea of app chains and blockchains or anything like that let's go back and just talk a little bit about development of human society so you know what we see is like you know a very very simplistic

view you know we can see that human societies develop in these like three stages so stage one was these villages and kingdoms where they are relatively specialized but relatively isolated uh systems you know there's you know not much uh trade between them um but then what you realize is people realize that you know you get all these benefits from like larger scale aggregation and stuff and so we started building these things called empires where we said that hey look through this like mass scale political integration we're gonna we can build this like great economic integration you know put everything under a standard set of laws standard set of uh

measures uh you know and if someone doesn't want to trade on you you know just march your army on them and make them trade with you right and then you know in the last hundred years what we've sort of moved towards 150 years we've moved to this words this world of nation and city-states right where sort of like the greatest innovation of the last hundred years or so is this idea of mass scale economic integration without mass scale political integration and you know we have this world where we have all these nation states deeply economically integrated but without having a single global government and how did we get there how did we move to a world where we sort of stopped

building empires well it came through a series of social technologies over the last few centuries one is uh free trade zones right like this idea that you can you know build bilateral multilateral trade agreements that like you know free trade has become the norm in today's world another one is institutions you know you have institutions like the un it's not a government but it's a forum for governments to come meet and discuss so you have the world bank the imf these sort of institutions help create this like globalized economic interdependence you have the internet obviously right you know with the internet you can do economic interactions with anywhere

anyone anywhere across the world and it gets even better with blockchains and a big one actually people might not know too much about is this idea of containerization and that doesn't mean docker containers that means the if you ever go to like a shipping port you'll see that they always have these exact same like shipping containers in every port in the world and what this enabled was every port in the world can ship cargo to every other port in the world because every port every cargo ship is designed to handle this one standardized container format and so this standardization of containers is very important so you know that'll come in handy in a little bit um and so we can kind of see a similar

development in blockchain development where you know you have this generation one of blockchains you have your bitcoin which is for payments you have namecoin which is for dns you have saya which is for storage but you know you can't use your bitcoin to buy a dns name on namecoin and have it point to a file that's stored on saya right there's no composability between these systems and so to solve this we created the ethereum empire where we say hey let's put everything under one common standard system and we get this like great amount of like massive composability here but it also comes with a lot of sort of drawbacks uh which i'll get into in a little bit but you know

empires charge fees to their subjects well when you use a theorem you have to pay your gas fees and eath you lose a lot of the sovereignty that you get other in generation one um so the vision of app chains is sort of an amalgamation of of the two past ideas where how can we can we still have the sort of sovereignty that we had in the v1 of blockchains but still get the composability and economic uh interdependency of the empire model of blockchains and so this slide was actually you know from a talk that i gave like i don't know three four years ago uh back when this was still a very theoretical concept well today that that network actually exists and it looks a

little bit like this so we have about over 50 chains in this uh sort of economically you know highly composable system using a standardized uh protocol called ibc uh very similar to the container uh stuff where like you know a standard system that like allows any two chains to talk to each other in a very trustless way using on-chain like client proofs eventually you can upgrade to using fraud and validity proofs as well if you'd like and so one interesting thing about this is most of these chains are actually app chains application specific chains and why do people want to build these application chains right so you know we see a lot of them coming out very

recently you know dydx uh is migrating to its own app chain uh you know a lot of focus around like you know you can build these really cool products with them uh better products and you might be able to otherwise you see uh projects that you know spun off of chains that exploded like terra and then you have apps sort of building onto their own uh blockchain such as mars uh you have uh you know uh board ape yacht club you know trying to plan on moving on to its own chain eventually so so why are they doing this what are the benefits why are we seeing this sudden rise of app chains so oh osmosis of course is an app chain uh we are a dex app chain uh and yeah so why why are we seeing this rise of app

chains and i'll i'll kind of show some of the stuff that why we decided to go the app chain route and what are the sort of things that we're able to do that we that other uh dexes might not be able to do so one i guess the obvious one is just you know scalability right so there's two types of scalability it's there's what we call vertical scalability which is you know you increase the amount of things that one system can do whether it's a blockchain or a server or something horizontal scalability is you you know spread out the uh over over many machines or many blockchains but the problem is the most logical way to shard things horizontally is by application because that's what has like

high levels of data locality and what you know you can have all these like rise of l2s and you know but as if they're all using generalized uh execution systems in which every application is there what you end up seeing is that all these l2s are sort of you know rebuilding internal ecosystems and you're not really actually getting scalability benefits from that you know you look at polygon you have situations where like you know a game suddenly shows up becomes super popular eats up all the throughput of the blockchain and then you know it causes issues for everything else going on on that blockchain and you see this actually happening on basically every generalized l2 where uh if you look on arbitrom the the treasure ecosystem ends up uh taking over a lot of the block

space um if you look on uh gnosis chain you know dark force ends up eating up most of the block space so if you have these generalized chains you're still end up competing for throughput in the same way that you would on base layer ethereum and it doesn't really solve the scalability problem and so the solution to the scalability problem is you know you have the scalability trilemma that vitalik pointed out um and he uses this like notion of decentralization where it's the number of nodes that uh you know if you want to validate everything you know you you have to be running a node for everything but the problem is with this like framing is it doesn't take into account the fact that like most people are not users of every single

application when i run an ethereum node you know i use unisof on a daily basis you know maybe i use compound but let's say i don't use ave on a daily basis or i don't use um you know some random game that's running on on or some you know nft project right like why am i validating the every single application when i'm not even a user of these what what this allows what the app chain model allows you to do is you only have to run the nodes and validate the things for which you are a user of and that means that some things will get more uh you know decentralization and security than others and that's okay right you know it's probably okay for the maker dow app chain to have more

decentralization and more security than i don't know the nouns down right these are two very different applications that have different requirements um another benefit you get with uh app chains is you get this like high level of vertical integration so you know this is what apple has done is they've built this like system where they control like high levels of the stack on like you know they build a lot of core apps they build the software they build the hardware now they even start to build the components um and this gives them this like very tight control and like ability to create very cool things so you kind of see other uh dexes often when they're building on top of an existing chain they'll control their smart contracts and they'll control

their front end but that's about it and that kind of limits them in the kinds of things that they can do with osmosis you know we control the application the smart contracts but we also control the front end but we also control the blockchain itself and we also actually happen to maintain uh the kepler wallet which is one of the primary wallets for the cosmos ecosystem and so what that means is we have the like this full stack control from wallet all the way down to chain and that lets us do some like very cool things which uh you know we'll get into in a little bit um another uh sort of benefit is sovereignty so you know this is a headline from you know a couple years

ago in the in our previous ethereum hard fork where there was an upgrade to ethereum and it broke a number of contracts that aragon was using and if you guys were here for vitalik's talk earlier today you know it seems that there is a plan to create more breaking changes uh in ethereum that and you know and the way vitalik put it was like you know it's okay if you know some things break but you know from the perspective of the people who are building those few things that are breaking that is not okay right like you know you can yes maybe if you haven't deployed yet you can you know read into these changes and plan for it but if you're trying to build on-chain immutable systems right it's hard to build these things in a way that like you know you don't want the base system

from breaking from under you so if you have your own sovereign chain that you know things won't just get you know the protocol you're building on won't just get rugged from underneath you um so what are some of the cool things you know i talked about like you know you get a lot of cool functionality you can do only with app chains but what are these kinds of things so one um is custom fees so a couple years ago i was showing one of my friends how to use die for payment and i was like hey this is so cool we can pay each other with this and you know i made him install a wallet and i open it make an account and then i sent him some dye and i'm like cool now try sending it back and it's like oh wait he couldn't because he didn't have

eth for transaction fees and it's like man this is like not okay ux like this stuff is never gonna you know be usable if you have to pay like l1 assets uh for fees so what's cool with a with a app chain is you can one you could just use your own token for fees so you know in osmosis you know you don't need some other token to pay fees you can pay fees and osmo but one step above that is you know what we've done with osmosis is we allow you to pay transaction fees in any token you want right as long as it's you know trading on the decks and so you know it can you know we have a general spot price for it and that's something we can only do with an app chain because you know we had to go change the core

logic of our blockchain and how transaction fees work in order to enable that but it also helps that we own the wallet because you know we have to make sure the wallet supports this and you know by having this like full stack control this is one of the things we can only do and then you can you know even take into account the application layer stuff so uh one of the things that we're working on you know as a dex app chain uh people pay swap fees uh when they make trades we can allow the swap fees to count towards people's transaction fees so that will sort of make the ux sort of even better reduce a lot of the transaction fees for people and then you can charge different type transaction fees for different types of transactions so one of the things that we do on osmosis is if we detect that a

transaction contains a cycle arb we charge a higher fee for that just because you know it why not you know they're making profit off of this why don't we we should be able to charge a higher fee for this kind of um another thing you can do is custom pre-compiles right so you know there's always work on adding new functionality to ethereum whether you're you know adding you know new cryptography and stuff but you have to like wait for that to come you know there's been so i feel like the amount of you know brilliant human hours that have been wasted on like you know designing systems to fit with the constraints that the evm gives you today is just like really sad when when if you have the ability to add custom pre-compiles to your chain you can do things like custom

cryptography you know in osmosis we do a lot of things with like you know we're working on things with like custom signature schemes you can do a lot of complex amm math you can do on-chain like client verification that is subsidized you can do you know more efficient encoding compression that's uh subsidized as well another thing you could do is you can play with cool custom execution models so you know you can do things like parallelizing computation so on osmosis once again it's a dex we have multiple pools that are and things that are transactions that are trading against multiple pools we can parallelize them because they're not touching the same state and you can use like application layer semantics to inform parallelization at the

chain layer which is quite cool you can experiment with new vms so we use a vm called cosmosome in osmosis that allows you to you know it's really cool you can check the fun line of what cool things of course was them it's really like the best inter-chain native uh contracting system uh you can have new types of asset models right so one of the things we're doing we're working on is making sure that every all assets and tokens in osmosis sit in a shielded pool and then when you do a trade it comes out it swaps on the on the decks and it comes right back into the shielded pool and so basically all assets are sitting in a private system by default um you can do self-executing code so

batched amms for example you know instead of you know you have a bunch of trades on a block at once instead of executing them in order have some like unfairness with like sandwiches and all this stuff you can take all the transactions all the trades in one block and accumulate them at the end of a of a block and have them automatically uh be run back with each other so kind of having almost something like cow swap but natively in the protocol no risk of censorship or anything like that you could have protocol owned liquidations you can have you know you can have code that's like just runs at the beginning of every single block and just checks a few things and says oh okay these things can be liquidated it can liquidate them for protocol health and safety rather than relying on these

like off-chain keepers to uh do that you can build in protocol arbor so this is one of the things that we're building as well which is you know at the beginning of every block we can have a on chain arbor that automatically runs it's not going to be perfect because you know solving the arb is like an np hard hard problem but you know if we can use heuristical systems to even capture fifty percent of that uh our profit and and distribute that to stakers that's like protocol revenue uh that could be that can be captured rather than giving it out to others um you can make your validators do more for you so you know you can have your validator provide price oracles this is something that the uh the t-word

blockchain uh did where they used to pro tara used to provide price have their validators provide price oracle so you have uh oracle pricing that's like atomic with the uh block production itself which is quite cool you can require your validators to have certain node requirements such as an sgx or a gpu or storage systems like for example there's um a nft focus uh cosmos chain called stargaze they're going to be requiring their validators to run like i ip ipfs pinning services and you know makes it makes it easy for these nft projects you can do off-chain computation so one of the things that dydx is going to be doing is they're

actually going to be running their order books in the mempool so you basically require validators to do this matching engine off chain and then set sending settled transactions on chain so this is quite cool where you know we can see that like you know this is actually really helpful uh you can have your validators uh be required to run bridges so that way the security of the economic security of your bridge is equivalent to the security of the chain because it's being run by the same validator set um you can do custom transaction ordering you can you know mev mitigations you can have your protocol sort of look and you know disallow sandwich attacks uh you can you know have this batching system in in chain

you can prioritize certain types of transactions so for example oracle updates you know you can you can look at all the transactions you can say hey this is an oracle update we're going to make sure this goes at the front of a block or something like that and you can also do built-in flashbots right so instead of uh you know relying on an off-chain system like flashbots to have transaction prioritization systems you can do this on chain where you know you can say hey we're going to let any transaction bid on the first transaction slot in a block and you know the result of that auction should be can be given to all the stakers of your chain so once again this is this form of protocol of revenue so you know this is a tweet from anatoly a couple weeks ago he's like you

know the biggest thing that l1 you know the real value of l1 tokens is just the mev that they can capture so as an app developer why are you leaking that value to some l1 token instead of capturing that as protocol of revenue for your token holders right so by having an app chain you can allow that mev to be internalized into your protocol um custom staking systems you know you can have your own staking token use use your token as a staking token you can do custom slashing conditions right so you can say that like hey along with uh you know basic safety stuff you know i want my validators to provide data availability so we're going to give them uh data challenges and

they're going to have to reply to them and if they don't reply to them they get slashed and basically you can you know this kind of goes in line with making your validators do more but with these custom slashing conditions that's how you do that you can do things like super fluid staking which is something we do in osmosis which is allow you to use application level assets at in the proof of stake system so our staking token is called osmo um and a lot of our liquidity pools will have you know let's say it's osmo paired with eth right you can take the lp share of that and our protocol you know because our chain understands the decks it can say hey look this lp share has this much osmo underlying it so we can

allow you to use it in the proof of stake system you can stake the lp shares themself and help secure the chain this is sort of like an alternative to staking derivatives taking derivatives you know carry with them all this like security risk they kind of undermine this you know evan just gave a good talk on this right before me how they kind of undermine a lot of the security properties of proof of stake well this is a way of like sort of getting a lot of the benefit you can use your assets in both defy and proof of stake at the same time but in a more secure way but this only works when your chain knows about the application you ethereum can't use uniswap lp shares in its proof of stake system because it doesn't understand uniswap lp or even something

as simple as wrapped eth it doesn't understand the concept of wrapped eath right it's only understands its uh native system um and what about roll-ups right like okay application a big thing i've i've been hearing recently is about these like app chains versus roll-ups so what what is the benefits and pros and cons of these so you know government with roll-ups you know one if you look at the state of roll-ups today you know they all have sort of these generalized execution systems um which and it's pushed everyone towards this evm evm compatibility fraud creating fraud and validity proofs is really hard so instead of like we don't really have systems for creating

application specific roll-ups today and i think eventually it will get there so you know we see things like cairo and stuff that are making it easier and easier but you know it's still a ways out the ability to build uh custom things you know custom specific blockchains is like you can just move way faster when you're using something like the cosmos sdk you can write and go and you know iterate on the application layer composability on the ux and then once these validity proof systems come around you can easily change your chain security model to using those in the future i think really the long-term end goal of all of this is that shared security is not going to be this like

hub and spoke system where like you know there's one base chain and then there's roll-ups on top of that and maybe roll-ups on top of those it's going to be a bunch of application-specific blockchains that are providing validity proofs to each other and are sharing slashing conditions so you know there's some at some point we have to admit that like look most of these blockchains have like greater than 50 overlapping validator sets anyways so you know what will end up happening is validators will opt into like joint slashing conditions will they say hey if i do something malicious on osmosis and i get slashed there osmosis will send that as a validity proof to all the other app change it'll send it

to mars and dydx and everywhere probably even ethereum 2.0 and my validator will get slashed on all of these chains as well so this is sort of how we will you know unbundle the value that's been captured in l1 tokens and move it in back into the application tokens because you know why are we leaking that value and so yeah that's end of it is i want you to start building app chains thank you [Applause] i have time for one question yes i don't have time for one question

what if it's fast it's 30 seconds okay thank you [Applause]