MEV In The Cosmos | Henry de Valence, Barry Plunkett
9 May 2023 · 1:19:47
Henry de Valence, founder of the privacy protocol Penumbra, and Barry Plunkett, co-founder of Skip Protocol, join Bell Curve hosts Jason Yanowitz and Mike Ippolito to break down how MEV works differently across the Cosmos ecosystem than on Ethereum. They discuss Osmosis's ProtoRev module for capturing arbitrage at the protocol level, the tension between app-chain sovereignty and cross-chain interoperability, and how threshold encryption and ABCI 2.0 could bring private mempools to Cosmos chains.
Speakers
Topics
Transcript
all right everyone welcome back to another episode of bell curve before we jump in quick disclaimer the views expressed by my co-hosts today are their personal views and they do not represent the views of any organization with which the co-hosts are associated with uh nothing in the episode is construed or relied upon as Financial technical tax legal or other advice you know the deal now let's jump into the episode [Music] hey everyone before we get into it today just want to give a quick shout out to this season's sponsor Rook close to a billion dollars worth of Mev has been taken out of users pockets and that's just on ethereum and that number is only getting larger unfortunately Rook thinks that it's time for a change and they've
built a solution which is going to automatically redirect that Mev back to where it belongs into your the user's Pockets so you're going to be hearing all about them later in the show I'm a huge fan of this team and what they're building so stay tuned to find out more welcome back to another episode of bell curve today unfortunately uh josu is not with us he's doing some enjoying some well-deserved vacation but we're going to do our best to hold around without him here uh and I'm joined and to talk about Mev on on the cosmos and today I'm joined by Jared Plunkett of skip protocol and Henry de Valance uh penumbra guys welcome to the show good to meet here thanks for having us Michael um so maybe before we dive in I would love if you guys could just give a quick 30 second intro of who you both are and
the projects that you're working on and maybe Barry I can call on you to start yeah yeah uh my name is Barry Plunkett I'm one of the co-founders of skip we build a variety of uh Mev infrastructure and protocols if for Cosmos blockchains in particular and and app chains and uh Roll-Ups in general to try to help them regain and maintain control over their Mev Supply chains and make decisions about what kinds of Mev can and can't be extracted and how and who extracts it and where that Revenue goes um so my name is Henry
um I'm the founder of penumbra so a number of uh building uh uh shielded decks and also an interchained privacy layer um and what's interesting about it is it's sort of also an experiment to see like like what is like one possible point in the like design space of useful blockchains with privacy um not trying to start with like here's this like fully General thing but what's this like one specific application trading where privacy has some kind of real world quantifiable value to the
product um and then generalizing from that what lessons you can learn for you know what should the future of privacy blockchains be excellent guys thanks thanks very much now maybe maybe just to kick things off as I mentioned before and as listeners to previous episodes in the season will know we've largely been exploring Mev through the perspective of an ethereum native or how Med gets done on ethereum maybe Barry I could call on you first here I know that at one point you were a Searcher in in ethereum and I know that some of the philosophical differences that you had uh with how Mev was being pursued on ethereum made you move to Cosmos so maybe if you could just fill us in with that backstory and
what made you um kind of start building skip so I I did used to search in ethereum back in 2020 2021 uh I I had brief periods of time where I was quite successful with my co-founder and for longer periods of time where I was less successful or getting out competed uh but I the The Experience uh of searching there on one hand I think really impressed me with just like the sophistication uh and the depth of the Mev supply chain on ethereum in terms of uh the number of different kinds of actors who are participating in the space and uh just
the lengths that they're going to try to squeeze out as much Mev as possible as as they can but we got pretty disillusioned with what we were seeing just in terms of uh the ecosystem progressively moving in that direction of maximal extraction all the time as the guiding philosophy I think from our perspective it's it's something that made a lot of sense for ethereum uh it's massively decentralized community that and the protocol itself can be very hard to change but socially and technically given how much value uh is being secured by it at all times
and how many people are building huge variety of different things on top of it but we thought that there was an opportunity to explore the Meb design space from a very different perspective where instead of saying okay because we have this decentralized community we and because we have this relatively static protocol we have to evolve in the direction of trying to create a folio off-chain supply chain for any of the extraction that has no guiding principle Beyond we should try to maximize extraction and we should try to democratize our ability to do that we thought there was a lot of opportunities to be more opinionated especially you know some of the stuff that upset us early on was a lot of the front running and sandwich
stuff that we were seeing I mean we didn't do any of that ourselves and I come from traditional Finance background and so seeing that it looked like Market manipulation and it didn't look like the kind of thing that legally I would be willing or excited to do and so we set off look for other places where we could uh explore what any of the infrastructure could look like and we found Cosmos where a lot of these uh a lot of these constraints the theory of ecosystem has of of having massive decentralization having to support tens of thousands of validators running on quantity Hardware having a very uh that inflexible protocol layer didn't exist and you had people running really cool
experiments about you know how they were building all the different layers of the stack from uh consensus all the way up through uh how smart contracts work and the things smart contracts are and aren't allowed to do accounts work and so we we found a home there for what we call Sovereign and EV uh which we can we can get into more but at a high level is the protocol should be opinionated in the protocol can be opinionated about how Mev Works uh and we want to try to build tooling that that helps them Express those opinions yeah that's that's a super helpful explanation and I want to just bookmark this idea of sovereign Mev and the idea of having an opinion on Mev for a discussion about uh
cross domain Meb later but you know two of the design principles that that I've heard you talk about very that are in ethereum both are concerned with the validator and they're kind of polar opposite in in Cosmos at least from my perspective currently so I feel like kind of the two points that the Mev supply chain on ethereum are optimized for is commoditizing the validator um and paying the validator as much money as possible basically making sure all of those funds flow to the validator for the security budget of ethereum but also making sure that no validator you know from a large pool or something like that can have an advantage over the little guy per se and in Cosmos it's it can be very different right so you hear
this coming from osmosis quite a bit but there's kind of this mentality of what can your validator do for you because one of the key differences in Cosmos is validators run consensus so kind of tender mint consensus but also the application code as well so can you just kind of unpack that difference and maybe the design space that that opens up for Sovereign protocols yeah yeah uh so that's a it's a great question so when I to to go back to your point it seems like at least from an outsider's perspective that the design of ethereum's Mev supply chain especially focused on PBS and boost was largely largely built to try to maximize
extraction and at the same time like minimize the required intelligence and participation of validators in that extraction so like Builders and relayers take responsibility for coming up with valuable blocks and forwarding them to the validator and ensuring that they are okay and and and that they extract as much as possible and all the value does is it just like Signs some blinded header and says trust the relayer that they've done a good job simulating things and picking the highest block from their set of Builders and that's um that's to your point because you need to support tens of thousands of quantity validators there for Cosmos chains for listeners who aren't familiar you very different validator set you know on most chains you have somewhere
between 100 to 150 on the high end validators in the active voting set and these validators are also pretty sophisticated operators they often validate 10 20 30 different tenement blockchains they're often staffed run by people who have half a decade a decade of devops experience who can sort of tell you what's going on with their node just just by like a quick peek at a grafana dashboard and so these these people are are pretty sophisticated and a lot of protocols ask them to do things that you might not want to ask in ethereum ballot you might not want to ask if you're invalidated or all ethereum validators to do so axelr is a great example of
this to participate uh on axelr as a validator you need to run nodes for other chains that axelr is connected to how appsar functions as a cross-chain bridge is it requires value participate in these like voting committees and so that's that's an idea that other Cosmos chains take to uh apply that to the Mev supply chain so imagine uh rather than having ethereum validators always just be dumb recipients of a bid in an auction that they could actually say run and auction themselves or they could you know compute some some routes in a Decks that might be built into the protocol
that would allow them to capture cyclic Arbitrage themselves things like that so generally uh taking this idea at very dumb validator and flipping into lion's head and saying okay like we already require our validators to not be dumb and we already have some vetting from the community and from our from the core Dev team that these validators are aligned long term with the health and the goals of the protocol that we should ask them to to do a little more and oftentimes you've actually used the rules of consensus to ensure that their their fulfilling those additional roles in the Mev supply chain the way that you might want them to
um so I I don't know I don't know if I've fully answered your your question there but I think a lot of this comes from this place of saying one our validators are like socially aligned with us for the long term we already trust them to represent the community in governance which which plays a very very significant role in Cosmos I don't know how significant it is in ethereum um but in Cosmos governance decides where chains spend their money it decides when when upgrades happen to the protocol what upgrades are and aren't allowed to happen and broadly what the developers prioritize on their roadmap um so we're already trusting them and so why don't we and where are you requiring them to do more in a lot of different ways so why don't we extend those same
ideas to Mev and to try to make Mev within the bounds of our protocol the same way you know we we have what transaction type is within the bounds of our protocol or like when finalization happens or you know what specific version of tenderment we're using is all that's that's all up to the chain um and and so we just try to take those ideas and apply them to this Mev supply chain as well that's you did answer my question perfectly there and I think it is like a big difference sort of just observing the the perspective of Meb and ethereum versus Cosmos is in Mev on ethereum the protocol is taken as a set thing whereas in Cosmos my observation is that oftentimes the
protocols actually thought of as sort of a stakeholder and that may be value chain in parameters can be changed uh in order to give the user us a more desirable experience so maybe Henry this is a good sort of segue to to you here as a as the leader of a of an app chain I would love to kind of hear some of your design principles um and maybe if you could just touch I know we're going to talk quite a bit about privacy later but if you could just touch on some of the you know privacy driven user experiences um that you can sort of start to create on penumbra yeah um so one thing that's kind of interesting about about penumbra is that um we've sort of like walked backwards into Mev
um in that we didn't you know like unlike Barry I did start out uh doing like searching on ethereum or something I started out actually doing like Zeke infrastructure like you know how do you build private stuff who's working in zcash and the sort of origin story for a number of comes from a very different place of like how do you build a like a a project that has privacy in it that people are going to use because it's better and not just because it's like a private X and that ends up intersecting with an EV through this angle of life um you know if you're not disclosing
information about your activity then other people can't be exploiting that um so her number looks quite different than I think most other chains um because it has this extra dimension of uh which data is private and which data isn't one of the insights that we had through thinking about this problem of okay what does it mean to build a private decks once you've zoomed in on that it's like okay here's an initial use case what does that even mean does that mean like make literally everything private like run everything inside of snarks like don't disclose anything at any time to anyone no because it turns
out that's not actually useful if you look around at pretty much any useful blockchain the reason that it's useful the reason that it's valuable is because of its shared public state right like the reason that ethereum is so valuable is not because of like all of the like great technical decisions that were made at 2014 it's because it has this like accumulated mass of like users and state that can all be interacted with and so the challenge for building something that's private is like okay once you've added this new kind of design access of um what information is disclosed to whom
how do you manage the interaction between the kind of public shared State and the private per user State because what you you don't actually want sir everything to be private what I want is to actually it's almost like recovering the same privacy story as like tradfied where like somebody can't like log on to my brokerage account and build a dashboard my p l that's insane um but also keeping the the benefits of D5 where you have this kind of like real-time transparency of the aggrebid state of the system you have real-time accounting on all of the system invariants how do you keep that for the
outer pieces but pertain you know privacy for each individual user's contribution to that overall shared state and so for canibra We've Ended up with an architecture that has like a pretty explicit segmentation between here's the kind of public aggregate State and here's the private per user state um and that puts us in a pretty different position um relative to a lot of other chains just some like sort of you know how is this thing put together um and so for for the just coming back to the original question
um for the Mev context I think it's kind of interesting because it's very um cardly very uh specialized like fixed functionality you know it does a DEX that's it um for the moment but in that narrow scope there's this kind of like end-to-end idea of of protocol design right like one kind of you know personal opinion is I sort of hated the term like any of these supply chain because to me it feels like okay that's just like protocol as I right like what you're talking about what people talk about when they talk about the med supply chain is like what is the whole like you know sequence of steps between
uh you know end users intent and then like tracing their actions as they're affected on the system as the user learns about them but like that's actually just like the protocol right like the protocol doesn't stop at the edge of the full node battery it you should think of it in this kind of holistic way it's going all the way out to the user and I guess the sort of meta perspective that it had there is that like it in some ways in that if you're I I wouldn't say that I'm like really like part of the ethereum community but as my Outsider perspective on it is that the sort of the ossification at the like base layer like drives all of the
innovation um into okay it has to have a different label because then you know it can be a thing that people can can build and evolve and change over time but really that just is that ethereum protocol right I I'm in agreement with you Henry on that I think it's been in very difficult this season in trying to be focused on Mev it's been pretty wildly difficult actually to parse out what is Mev versus exactly what you just said what is protocol design I I'd love to maybe uh kind of try to parse out from what you were saying the other thing that really resonated with me is you know where sometimes I think about from the ethereum perspective people tend to think about economics for instance if you read something like Dan
ellitzer's the uni chain is inevitable people tend to talk about Med in sort of economic extraction type terms whereas my experience with talking about app chain uh developers or sort of Cosmos in general is actually building it into the user experience so could you help translate Henry some of the design of penumbra into a better experience for users of the decks yeah so I guess like one example is on on a number of the decks runs uh on on a kind of frequent batch auction style model um and part of that is for technical reasons
um about how do you have interaction between public and private state um it's a lot easier if you do that as as part of a batch because um you know if you think about you know somebody submits a trade on uniswap right when they sign that transaction and submit it they're not also signing over like and share the exact state of the reserves of the unit swap contract and therefore this is the exact amount of output that I get right like there's this kind of late binding where when that Trend that that transaction is formed has like here's the slot that gets filled in by the chain State and then when I send it to the network then it actually gets executed but in a
private context the way that you achieve privacy on a blockchain is by removing all of the execution off chain onto the end user device and having them submit like here's a proof of this new state that I've constructed and so in doing that you lose the ability to have this kind of like late binding property uh and to recover it you have to move to this like asynchronous model where like oh I'm going to make a swap and I'll somehow sort of freeze the state of my um you know just the swap that I'm trying to make and then later this the chain will figure out what the execution
price was and I'll be able to like resume that computations and so once you're in that kind of async model it's just much easier to think about it in a a batched way um so that's kind of the technical you know weeds of why we did that but there's also I think this like pretty powerful and intuitive kind of economic argument which is look if you think about what a blockchain is doing it's coming to consent us on transactions right and it comes to consensus on transactions in batches and we call the patches blocks for basically historical reasons um so why is it that we have economic mechanisms on the chain
that assume a kind of like finer notion of time or causality then you're actually getting out of the underlying consensus mechanism right well once you do that then of course there's this kind of like mechanical Arbitrage race to like oh I gotta be at the top of the block because that's how I'm gonna like you know get at this mechanism but you know if you have a mechanism that has like consensus and bashes then your economic mechanisms should also be operated like the same kind of time resolution um and uh you know we we took that to heart for for penumbra and so as a
result we don't really have any like unique full notion of like intra block ordering um you know technically you can go to the block and say like look the transactions were in this order but all of the meaningful uh execution is happening in batches um and so it doesn't really matter uh as a user you know at what position in the block was my transaction included either you know if I'm making a swap it's going to get executed in a batch and I'll get a common clearing price or if I'm doing liquidity provision um we process all of the you know we have this like phased execution process for the deck so it's like okay go open
all the newly opened positions like uh execute all the swaps like arm everything back to consistent prices close all the the positions that were requested to be closed and so it's kind of this like stepwise like batched execution for each of those different participants and so at that point the the only like real sort of blocked producer choice is just like do I include something in a block or not and the um that even you know without having any privacy having that that mechanism
design I think really changes what the Mev uh landscape looks like because you know not not only do are you just only able to control like what does this like is this transaction gonna go on a block or not but because all of the mechanisms are are operating batches the marginal effect of including that transaction ornament on the overall outcome is you know like one out of n yeah I like whatever the like size of the like if you have some giant whale to induction then including it or not maybe makes a bigger difference but as a you
know if I'm a normal user making a normal size trade somebody is doing block reduction and choosing like should I you know include this transaction or censor it that choice has a pretty marginal effect on the overall economic outcome of that block and so I think that that really like cuts down a lot of the like um you know sort of classical Mev where it's you know any view where the block producer actually has some kind of structural privileged physician to exploit um uh extract value um and that's that's something that kind of
comes from having this sort of like fully batched um design so we we don't work with penumbra full disclosure uh that we wouldn't wouldn't mind doing that uh we we were with a lot of the other dexes in Cosmos that that make meaningfully different trade-offs and design decisions uh not just around ordering an inclusion but also by extension right like the value proposition that they're trying to offer to users and to builders on their chain so one of the folks that we work very closely with it is the osmosis or team in the community there and um I suppose this is very different than penumbra in so far as they have a they
have uni V2 style pools and concentrated liquidity style tools and soon we'll have an order book uh provided by astroport and you know some some lending protocols through Mars that uh do actually have significance for transaction ordering so uh on osmosis uh decks you know if you're uh if you're the first transaction in a block you're going to have it operating against a pool you're going to have a different price than the second or the third in the same way you might with ethereum um and when we talk to the community and the core team there that's something that they view as uh important right now for uh composability reasons that uh
having having that uh transaction level granularity allows folks who are building on that chain to uh build smart contracts and sort of extend the platform in ways that uh you can have transaction by transaction interlocking and interaction might be more difficult or might just look very different in a protocol that's more focused on on privacy so when when but when we work with them they've they still want the protocol to try to be opinionated about trying to recapture some of the value that leaks from user transactions as a result so um one of the one of the biggest sources of Mev and
ethereum because transaction ordering matters there and and also on osmosis for the same reason is uh is atomic Arbitrage and back running so you know a whale comes and makes a large swap against some kind of pool pushes the price of one token to be very high and then that creates an opportunity where a Trader can trade against a set of three pools that have some overlapping assets that then rebalances the prices of all of them so uh and and this happens potentially because instead of it happening sort of at the end of a block uh because prices be different this happens potentially every transaction so but the the osmosis Community sees this and
they saw this as an opportunity to try to create a new source of revenue for the chain so what they wanted to do is they wanted to say okay we want the protocol to try to recapture some of this Mev from back running we don't want to front run users so we we don't want to force people Force the whale to pay their worst price possible uh and then take the money from them but after they've paid whatever price they'll pay as a result of using uh their front end router then they wanted the protocol to come in and see to actually check the protocol itself to check rather than a Searcher whether there are any back running opportunities and to to capture them so we built a module for them but it's just basically an extension of the chains application logic called protorev
which is short for Revenue because we're bad at naming things uh that does this right that takes a look at a few uh potential cyclic Arbitrage routes after every Swap and then flashman's tokens to capture an opportunity if it sees one and Flash Burns those tokens and then returns that money to the community pool um and we talked with a lot of people on osmosis about this decision uh of saying okay well like we could build this this could actually just be like a router that maybe gives some users better prices as opposed to the coming in and back running them it could be uh you know a service that we run sort of just as an auction for off-chain Searchers and the the thing that we heard from the community was
we want this we want we actually we care about right now is not giving users in the short term better prices but but is creating more value for the community and we think that there are other ways we're going to improve routing the users later on so we want we want to do this um so you went ahead and and built that out for them and it's interesting like we got a lot of pushback from people in ethereum when we were doing this they were like oh like the protocol shouldn't do anything like searching like there's no way those algorithms are so complicated like it'll never run in protocol like it'll be so gas inefficient like how is this ever going to work and then we were like I don't know like we'll see uh and we we actually did a
bunch of data analysis initially and we realized the vast majority of cyclic Arbitrage was from like four routes on osmosis like the vast vast majority 80 90 and all of it basically settled to osmo or atom which the community obviously loved because those are the tokens that they want to hold um and it was very easy to build using the tools of app chains into the protocol a way where we can say okay like we're just going to check these routes we're also going to have some mechanism by which we can maybe add new routes potentially interesting um and we're gonna every block we're gonna have like gating to ensure that okay if actually like somebody tries to grief this and they submit a bunch of really tiny swaps or they you know somehow like there's osmosis blows up
there's thousands of transactions again everybody's printing money it's bull market like we have circuit breakers that just turn it off uh in in case there's there's issues with that and very very conservative with how much computation we put in the protocol and even even still like it's recapturing tens of thousands of dollars a month for the community uh on a pretty small number of transactions and they can upgrade that to say actually we want to give the users back that money they can upgrade that to say okay we want to pay validators who uh you know are running these expensive machines or they can they can just say hey we want to give that money back to LPS so that's one of the really nice things about Cosmos about using the tools of consensus and the way Henry's been talking about is that now the community actually gets to
decide what the hell we're going to do with this Revenue uh or what the hell we're going to do with the protocol instead of it just being purely a question of all right like who is who is paying the validator the most as a bribe or who's the fastest or whatever it might be now we've sort of brought that in to the design decision and then people can users can vote with their feet right they can say Okay I want privacy so I'm going to go to penumbra or I I actually think that this frequent batch option mechanism is better for me it makes more sense I'm going to go to penumbra or they can say ah you know I I know osmo says I'm going to say here you know whatever it might be people people can actually developers can make choices based on what they
think their users want and users can make explicit choices about how they want not just muv but to Henry's Point like the entire spectrum of the user experience of participating in the blockchain to work so I think Mev is like one part of this and and app chain developers are very concerned about this whole experience because they can be like you can't build what Henry's building in ethereum and and have the same tools at your disposal so why why would you have an opinion about how transactions get ordered you're like well that's just given to me I need to figure out how to work around that um but Cosmos you can actually say like actually like that I don't like the way it works if we're gonna have it work in a completely different way um and there's a nice framework around
it so it's pretty easy to do to add on to that point about the the gas like once you break out of this mode where oh everything that I have to do has to be like run you know inside of this like the same execution environment as all of this like random untrusted code um there's a lot of flexibility that you can have um you know as the if you're writing like uh a native module or component of the chain you're now just like writing software and you can make that software fast in ways that are not possible for this kind
of fully um generic kind of uh VM thing especially at a VM where you're constrained by you know all of these Legacy design decisions right um so as an example for number um you know we do cycle R detection in as part of the the protocol but um when we're going and like having the the chain go and look to see whether there's any this pricing that needs to be corrected we can just like do a like big like graph traversal where we explore every branch of the decision Tree in like a parallel Fork of the
chain State and you know do all of this like multi-core stuff it's all near rust code like actually computers are pretty fast um and and so the being in an environment where it is possible for somebody to kind of control each uh layer of the stack I think causes there to be a lot more openness to like oh what if we just didn't do that or like this isn't actually a given this is just a thing that we made up uh and we could do a different thing um you know potentially with a lot more effort right so there's always that
trade-off of like how much additional effort are you going to spend um versus like what kind of controls you get but I think that there is more of an idea of like the software that the chain runs is actually you know the thing that we're creating and not just this this given say hey guys quick break from the show here I want you to imagine something for me imagine swapping two stable coins on chain paying zero dollars in gas and instead getting a rebate of two thousand dollars this is something that's actually happened on chain to understand how I want to introduce and thank the season sponsor Rook zooming out for a second the current state of affairs at Med is
billions of dollars so far have been extracted from users Pockets using Mev Rook is coming in and saying enough is enough blockchain should drive value to their users and the applications they use it is time to leave the hobbyist era behind us if we want to move forward we want to get this right that's why Rook has built a custom blockchain settlement Network and it's one that gives you full control over the entire transaction life cycle today you can connect to an open source rep node The Rook protocol will automatically match bundle and auction your orders and transactions in seconds with zero gas overhead also any Mev that's discoverable along the way will be returned to you the user created as a collaboration between the industry's top mechanism designers and Mev Engineers Rook was built from the ground up to be
scalable safe and programmable you can get your own mempool choose searches and Builders and link your mempool with others to discover even more Mev you can Define how the Meb is shared and delivered as well and what could basically process anything from transactions to meta transactions and more this is the way that blockchains basically should have been from day one so if you're a user listening to this here's what I want you to do I want you to go to your wallets go to your favorite app your node provider and say Hey I want you to be working with these guys rock I want the Mev that I create to be redistributed back to me if you're a developer and you want to stay ahead of the game the best way to do that is to follow them on Twitter they are at Rook or even better
yet slide into their DMS they are lighting responsive they'll get you set up today and if you do slide into those DMS as always please tell them that I sent you completely in agreement guys and I think that was one of the the ideas that I want to dig into just in terms of chains being allowed to have their own opinion so maybe in the case of something like osmosis and the proto-rep module that you've helped develop area at Skip it's we think back running is okay and we want some of those proceeds to flow to the protocol itself or in the case of penumbra we really care about privacy and that's why we want to trade on penumbra and just building that into the the user experience I I want to shift here because I think the the question of
sovereignty and owning these decisions becomes very interesting in the world of kind of the interchain and this is where maybe I want to dive a little bit into cross domain Mev so we've talked about this a little bit in ethereum specifically within the context of layer twos and Roll-Ups on ethereum that to me looks a little bit there are definitely parallels that you could draw to the cosmos right where you kind of instead of having everything being composable on each main chain you have many different Roll-Ups and suddenly you're entering kind of this asynchronous environment that looks very similar to what Cosmos looks like today and I actually got super excited about I'm sure people have been thinking about
this for years but the first time I really start to get excited about cross-domain Med was the atom 2.0 white paper that you know Sam Park helped to write I know he's with you guys at skip that Berry um but I would love to sort of get your guys thoughts in general about just maybe as a jumping off point about cross domain Mev just what are your kind of thoughts as a high level is it this kind of interesting opportunity is it more technically unfeasible than people think and then I want to kind of get into um you know this idea of sovereignty in this world so I can I give my high level tape very quickly which is I think a lot of cross domain Mev so there's
you can mean broadly maybe two things uh which is one might be executing an arbitrage strategy where one leg of that strategy is on one chain uh or one market another chain is on another or another leg is on another chain or in another market and I think that's usually what people mean and then uh number two is you could you could mean specifically actually doing these things but more complex versions of them and we can somehow get atomicity across These Chains I think atomicity is a big thing that people get interested and excited about uh I'd say one on the first one so we do a lot of uh data collection today in
Cosmos to try to understand okay how large is the cross chain Arbitrage opportunity like is it worthwhile to try to build the kind of complicated systems that you might need to get pure honest to God across animosity which do look very very complicated as you as you get more into it um and what we've seen is the vast majority of Arbitrage uh is sex to Dex so the vast majority of uh even even for Cosmos tokens which are on average less liquid on centralized exchanges than big ethereum tokens are and uh you traded in many different venues on different chains throughout the cosmos ecosystem
centralized to decentralized exchange Arbitrage are still much larger and like what happens is the centralized exchange moves and then all of these different chains will in their local markets follow like move towards what that's informatics exchanges except for osmo and osmosis where the centralized exchange usually follows osmosis just because liquidity is so much deeper on osmo uh so like I think at a high level like people are really really excited about this I think it's a long ways off uh and I think this will probably be the case for a long time because as a Trader uh if you have a continuous time Market that you're trading against uh or if you have the choice of continuous time Market with really deep liquidity and a a um not continuous time Market where
you're gonna have to lock in your order for a longer period of time and liquidity on average is lower and there's a lot of bespoke things depending on which chain you're trading against you're going to see mostly people just continuing to do this sex decks Arbitrage for a while and like that's okay so like I think I want to add like a crypto Twitter needs to like chill out about cross domain and crosstrain Mev and like think more about realizing that like binance is the most important chance in the world right now uh as far as Arbitrage goes uh so that's one big thing I think I think what we like to think about more just on a day-to-day basis at skip is ways we can build cross Gene systems that make multiple chains feel like one chain by leveraging
off-chain actors to do interesting or difficult tasks that occur at the boundaries of different chains so this might mean you know performing some kind of Crossing swap where all you want to do is sign one transaction you have you one kind of token on chain a and you and want to end up with a different token on chain B and you don't have to worry about how it gets there you just want like whatever the conical token is I think there's a lot of interesting things around pushing complexity to off-chain actors we're talking about the boundaries of chains you can also be much simpler things which is just like hey I have this transaction that I want to execute on uh Juno or on Neutron or something I don't have the gas token there so like can somebody execute it for me uh and I
will I will pay you right so like there's a lot of ux things that we try to spend our time thinking about because I think those things are real right now and there's whole question around relayer incentivization that we could talk about IVC relayers or other kind of cross chain messaging protocol relayers which are important and in many protocols fully unincentivized who could get up to malicious semiv things or could maybe be leveraged uh in the nav supply chain if we want to call it that to like again continue to improve ux so I like to reframe this as like you know from Cross chain Arbitrage to this question of what are the problems like what are the ux problems that arise
when you exist in a world where users are sometimes going to be on lunch and sometimes it's going to be on another chain and how can help them use often actors to solve the as opposed to just like if I could control State on like arbish Realm and on ethereum mean that like how rich can I be uh which is like probably honestly not that rich right now but I'll I'll pause there completely agree with everything that you said Barry and actually that specific point about sex to Dex Arbitrage is definitely been something that we've been focusing on a lot this season and the fact is that price Discovery happens at on binance now that's by by virtue of that being the fact that's where most of the Arbitrage is sort of available but let's sort of take your point and
go run with that here and say okay on something like in the cosmos ecosystem where we have many of these different chains that have sort of these different rules and opinions we want to find a way for users to not we want to abstract that complexity away um and I think that's where I kind of want to dive into this point because I think Roll-Ups on ethereum are kind of undergoing that same battle right now um where it's a very very analogous sort of situation where users don't want to have to think about the fact that you know I have to migrate in between something like optimism and arbitrum and I want some sort of communication and standards of interoperability and that also kind of gets into where that's really manifesting in ethereum right now
is this discussion around decentralizing the sequencer set or shared sequence or sets right and there are obvious implications for cross domain Med there and this is what I really wanted to ask both of you here there's a very interesting we had this exact same conversation in ethereum land on roll-ups and the the question that I think costu asked that Robert Miller was is it the is it the the Fate The Inevitable fate of every blockchain to be influenced by the sequencing of another chain and I wanted to get your guys perspective on that and maybe Barry I could pick on you first here because this is where that cop that idea of sovereignty comes in that's very core to the philosophy and Ethos of Cosmos is being having an
opinion or being Sovereign and not being impacted by by the decision of other chains but as you to your point as you kind of move in and try to increase the interoperability in between all of these other chains you know to what degree is it appropriate to be beholden to the decision that other chains make you know at what point are you giving away some of your sovereignty you know in in favor of compatibility I would love to know like what you think about that tension um I'm happy to try to answer that but I actually think maybe a more interesting first version of this question is to like turn it on on Henry and just sort of hear Henry your thoughts on uh you could penumbra b roll up could it
participate the erratic artist of roots whether it's roll-up like would you use a shared sequencer how would you think about these things like how do you guys think about sequencing relative to what your what your product is and the value props that you're trying to offer users um and then maybe I can try to get my answer but Henry has more more appropriate more thoughts oh I mean I don't know that I have like a super big take on this I guess I feel like the boundaries of like like what is an elbow and what is an L2 like what is a roll-up I don't know um I think like there's various technical aspects that
you could point to to distinguish all of those things but it's not clear to me how much that matters to the end user experience and I think from the end user perspective um having a bunch of different l2s actually does look a lot like having a bunch of different chains because all that in L2 is is a distinct chain that has some kind of like special way to Anchor itself to another chain um one thing that I think is kind of underappreciated about IBC is that IVC is actually this like very very flexible and generic
um sort of cross chain time stamping system as a side effect of doing messaging right so in IVC you have chain a and chain B and they're running some kind of clients of each other but what that means is that like chain a is going to have inside of its state here is my view as chain a up the chain B state but the chain B State also includes like hey as chain B here's my view of chain C or chain D or whatever and so you end up with this uh picture where it's like it's almost like you have one big sort of meta blockchain that has all of these like localized little neighborhoods and from each one
you know you can verify State anywhere else in the ecosystem but potentially with some kind of like light tone of verification where you know until this has been relayed across however many different pieces I haven't pulled those latest changes of you know chain b or CDE whatever into my sort of like local like column of verifiability on and from that perspective you know like what is a rollout what is not yeah I'm not saying that the the trust distinctions are not meaningful
but I would say that they're not the only thing that that matters um I do think that there is a kind of interesting future where uh and a thing that we're hoping to build into penumbra where um we generalize it to be more of a kind of interchain privacy layer retake the kind of asynchronous ZK execution that we built just for the one use case of having a native Dex and then expand that to like well why can't I interact with the public chain stage of say you know uh osmosis or ethereum or whatever
um from the shielded pool of penumbra right um and so I think that in the long term you know what it looks like in ethereum what it looks like in in Cosmos there's going to be some kind of convergent evolution because a lot of the problems end up being like fundamentally the same um I think that like IBC between roll-ups um seems like a really obvious thing to do because um you know it turns out that like one of the hardest parts of doing cross-chain messaging is not actually just the like how do you verify the
state route part but also like how do you have like in different chains all agree on common data formats right and that's the part that is like not very like cool and sexy and we're doing this like awesome like Moon math to make it work it's like how do I like RSA protobuf um but that actually is like also a quite hard engineering problem um and so yeah I think that there's definitely going to be some kind of conversions in in the future there yeah I I agree with that I think like uh it's it's kind of like interesting being a little bit removed from the center of a lot of ethereum's roll-up
conversations and roll up proliferation stuff today but living in Cosmos because like when ethereum people talk about this stuff they're like oh like we can have like Atomic cross chain like sequencing and and like you'll be able to start a flashlight on one chain and end it on a different chain and like all these things and I'm like you guys have no idea how hard like basic is about to get for you uh if you don't have good standards um and you're gonna have like you have you're like the old uh meme about like like a thousand different standards are gonna arise um and I I think like when you talk to Cosmos people they're always like yeah like the basic is what you should really focus on and if you get that
right like you're gonna start to have more users and better user experience so you can build up from there um so I think it'll be interesting to see this all play out like but like Henry I think one of my big takes is is a lot of this stuff you is going to start to look more like Cosmos which uh I think will be fun and and we'll have some exciting things to hopefully share and to teach based on what we've learned uh in a multi-chain world to touch on the question of like is it uh the fate of all blockchains to be influenced by the sequencing of another chain I would mostly just say I hope not uh like that seems bad like there's this I I I think like there's this vision
of having a single chain that can uh is like the Hub of Mev and block building and where Searchers go and where users go to express their intents uh which that's a that's a really hard social coordination problem it's a hard technical problems it's um hey it's like roughly in line with the Suave idea right um I think it's a pretty cool Vision uh I think probably the the version of this that we're most interested in is one that is much more um much more limited I'd say and much more opt-in uh and much more focused on
sovereignty where you know when it is economically reasonable and good for a chance to coordinate they may choose to do so for brief periods of time with somewhat limited guarantees uh and then I think a lot of this Crossing coordination is going to happen over something that looks like IVC uh I don't so I don't know if it's the fate of all I really don't think it is like I I think these these takes usually overestimate the value of um coordination or actually like probably like underestimate the cost of of any kind of coordination uh like if you if there is a one chain that is like
helping to sequence a large percentage of ethereum blocks and uh you know our return blocks perhaps that chain is going to have to do a lot of really different weird to sequence a number of blocks uh and number of validators are gonna have to think is like really important for them to participate to opt into that chain and and like they're going to have other things that they're thinking about as as well so I I'm generally quite skeptical of those kinds of mechanisms and and uh I think the part of of this Vision that I do think is most interesting is around the idea of uh intense insofar as maybe having a place you go to express hey I
want to go buy this nft on another chain uh and I want to transfer to a third place or I want to go to my for special nft wallet and Basics because basic stuff can become challenging in a grocery world I think like simple intent fulfillment where somebody an auction act can come and say okay I'm gonna make this happen for you like you give me the permissions uh or maybe in Henry's model like people who care about privacy just be able to go to penumbra and say hey yeah you know I want to make this swap on this other decks or I I want to go do this or I want to transfer my tokens we can use two chains like that experience of having one place they go actually does seem really really good to me um and that's that's pretty exciting long term
that's a little bit less about sequencing and though the like sequencing layer does matter a lot there but we try to be very oriented as I said towards this vision of like okay what gets hard when you have a lot of chains and like how can we use some of the tools that people usually associate with Mev to help fix those problems I guess one other thing I would add is on this there's sort of this question okay what does it mean to actually be influenced right which is another sort of way where depending on your reading of the question you could end up with like quite different answers either you have a kind of a more minimal sense of like like a more literal like protocol sequencing like is this chain really
being sequenced by this other one and I think the the cost of doing that coordination uh may actually be quite high as you know per various point but if you're talking about a more General kind of like economic influence then you know in some sense like the answer is I think always yes but that doesn't necessarily mean that something isn't a sovereign chain or to if it does mean that then you know no changes are like you know in some sense you could say like look it has this other consensus mechanism which is that um you know Circle decides like what the canonical East chain is and if they want to have a different eat
chain then like you know that's kind of gonna be a big deal um and people have had you know this is not obviously a new insight right like there's a lot of discussions about like okay what does it mean to have um you know so much of the economic value be tied to these like off-chain deposits held by some actor but it it if you're stepping away from the kind of very literal like protocol sequence in question of you know what does it mean for one thing to influence another saying then you can already see those discussions that are
happening about um like off-chain assets and uh as being another instance of that that same kind of dilemma yeah I guess you could take this all the way up to its highest sort of philosophical level and says anything that exists at least in our world truly independent of something else you know I mean even at the highest level something like the US has its full sovereignty right but we are also somewhat dependent on what other nation states in the world do and I guess you've got to kind of map that analogy to to blockchains and say where where does you know how do you draw that line right like I know there's a lot of focus on come before Choice rule is something that's sort of a technical requirement
but then there's also you know they're also sort of softer economic reasons to be influenced by by other chains guys I I want to make sure there's we could I'm sure you know keep going uh you know talk about this for another two full hours but I would love to um just because we're a little time constrained here just get your thoughts on sort of privacy and maybe Henry I could call on you here I know you've sort of brought up ABCI 2 I think is the um you know the upcoming change in could could you maybe just give an overview of what that is why it's an important development and then maybe segue into some of the sort of cool um implications that has for privacy at least on a number yeah so in ECI is um an API that was made originally for
communication between tenement and the cosmos SDK but the idea when he made it was well rather than doing the thing that like pretty much everybody else did in like the sort of 2017 and 2018 cycle uh of coupling the consensus engine to the chain what if we decoupled those things and said we're going to have a generic interface for here's the application that's replicated by the consensus mechanism and here's the consensus mechanism itself and those things can be somewhat distinct um so that's the point of ABCI it's
making the consensus engine pluggable um and in the first version of of ABCI which is what's currently used in Cosmos the consensus engine is basically like telling the app okay here's the stuff that occurred and that's just a giver right and that is very useful just for you know being able to ship a chain and so on um but there's a lot of cool stuff that you could do if you had the app have some way to extend hooks down into the consensus stack and so there's been an
ongoing project first called ABC plus plus and for various uh reasons got um kind of re-split up and and renumbered into ABC i1 abc2 um and basically those changes provide additional hooks for the application to have greater control over what's going on in fiction census layer so there's two two big um sort of things that are that you can do um one is this idea of prepare or process proposal which is the idea that
um instead of just having the consensus engine deliver to the app like here's stuff that occurred you know deal with it um you could give the app a way to control um you know what block a um a validator is going to propose or um you know whether a validator is going to vote up or down on a particular proposal so you can think of this as kind of being like almost like a native way to do um PBS but where you're having the application actually also be a block Builder
um you know and maybe the app chooses to delegate that to sound you know off-chain actor or something or maybe it chooses to do parts of the block building itself but by having that interface the application can kind of have full control of like exactly what it wants to do there um so as you can imagine you know that's already quite powerful um but the second really cool thing that is coming uh later in in ABCI 2 is uh this idea of vote extensions which is basically a way to have each validator who's participating in the consensus process uh include some extra data
as a kind of extension to their vote of do I you know approve of this block or not and that means that you can have the validator set also be performing uh MPC so you could have the validator set do like oh we're gonna do a uh key generation or we're going to do like threshold decryption and this is really powerful because now you know I going all the way back to the beginning of the episode one of the things Barry mentioned was this idea of like you know you have these validators and the validators can do more fits right part of that is because the validators are not just socially aligned but also more
economically aligned with the chain like you can slash though um with more impact than you could do on on the theory and say but the point is that you know you have these actors and they're acting on behalf of the chain and so you can ask them to do more stuff in particular you could ask them to do some kind of like online you know coordinated cryptography that you couldn't necessarily have each individual user participated in because like you know maybe I just want to send my transaction or maybe I you know would be open to doing some fancy cryptography but like my Wi-Fi cut out and so I'm you know not participating anymore and so on all these things that make it difficult
to sort of push that computation out to the the end user you can have the validators act as like here is this like you know Committee of participants who are economically and socially aligned with the protocol and so we can get them to do useful stuff and threshold crypto is I think the the most obvious coolest example of this on so in the future you know Cosmos chains are going to be able to do uh threshold encryption or transactions so that you can do uh some committed reveal type execution and for Panera we can actually take that a step further
um and build something that we call Flow encryption which is a way to encrypt not you know the entire transaction because for us the transaction is already shielded so it's already not revealing a lot of information about um you know who is doing it or or what um but maybe somebody wants to interact with the public State like I want to make a trade right um using flow encryption we can say we want to have these sort of flows of value between different parts of the system like here's the value that's flowing into a back swap or here's the value that's flowing into delegations to some
validator or so on and we want to be able to have the system see only the aggregate but not be able to see any individual users contribution to that flow and we can do that using thresholds encryption where the threshold encryption is also additively homomorphic and verifiable so in my transaction I can prepare this encrypted contribution of like here's my I'm out and I'm going to put into this back swap and once all of those transactions get included in a block the validators can sum up all of the encrypted
contributions of everybody's uh batch swaps and then decrypt only the batch total and so now I and everybody else who's in the same batch as me yet like not just this sort of commit and reveal privacy up until inclusion we get a much stronger like long-term privacy because the only data that's publicly revealed is the aggregate of all of our user intent so it's sort of a way to have private coordination between all the users of the system without even them having to interact with and and Henry just just because honestly it's probably you know a little criminal that we
haven't discussed threshold encryption um and the implications that much on ethereum so far could you just underline again for the for the for the listener why you know the way that it's done on penumbra is like very different from the way that it's done on on ethereum today and maybe if you could talk about sort of the the information advantage that decrypter gets on ethereum just as specifically underscore that Mev implication of that as well on on ethereum or or some other place where you have this kind of transaction by transaction granularity um and the transactions this kind of generic blob of of execution um
basically the only thing you can do with threshold encryption there is encrypt the transactions contents and effects up until the point where you're going to include it in a block and then at that point you decrypt it and the whole system can see exactly what the transaction does in order to execute it um and so as a user um that threshold encryption is not giving you any long-term privacy it's only giving you privacy up until the point that your transaction is included in a block and that also poses some difficulties for um the system like you know if you can't verify that the transaction
is valid before you commit including it you know what do you do on how do you account for gas if you don't know what the contents are Etc um on pinebra on the other hand because all of the transaction contents are already shielded except for here is this you know Anonymous contribution to some part of the public state the only thing you have to encrypt is like what is the input amount to my of my transactions contribution to some batch and so if you're a decrypter let's say you know there's like a malicious
Coalition does that um the amount that you can learn by illicitly decrypted transactions is much less right you don't get to learn like hey here's exactly this particular account that's doing stuff you don't get to see any other details other than like this is the the contribution um and it also I think it means that in this sort of like longer term picture um maybe a better way to say it is what would people talk about Mev and exploitation a lot of the time it feels like they're talking about just the sort
of first order thing because seeing how people are like you know rearranging blocks they're produced is kind of the most obvious and detectable way to see that people are exploiting excess information disclosure from other people's transactions but really that's just the kind of the tip of the iceberg of possible can adversarial behavior that you could do on chain if I can see your entire history of your trading strategy um I can probably get a lot of information to use against you even if I'm not controlling you know exactly what your um you know transaction inclusion is right like let's say you're doing uh
Market making I can look at all of your trades I can see what your strategy is maybe I can predict like what's the one percent of the time that you're going to do of Miss pricing and at that moment you know come in it really will and I don't need to have you know control over the sequencing of your transactions to do that I just need to be able to see your entire history um and so I think really you know the current kind of discussions about Med are really looking at just this kind of like first order um effects but even in a world where you can perfectly solve all of those with threshold encryption or sgx or you know whatever else
you haven't actually really solved the problem of kind of excess information disclosure on J like the Dark Forest is still there it just moves up like one level of difficulty I completely agree there and then I know guys we've gotta um wrap up and it's tough because I know we could probably go for another couple hours on this but I guess uh Barry any any sort of uh you know comment to or response to what Henry just said regarding privacy or any just sort of any way any anything that you want to say to book and the conversation or kind of a a takeaway that you want to leave listeners with I guess on the privacy and adding Henry put it super well I you skip as a company from
day one has been getting comparisons to flashbots but we try to take a very different uh cultural and Technical approach in so far as our goal is to try to give genes more control over Mev how it gets extracted what gets extracted how it gets distributed and so that leaves a musician where where we all are and always have been very unfavorable very favorable to things that try to improve privacy to try to protect users from Mev we're going to be working on the threshold decryption schemes that uh Henry's talking about for osmosis as a part of our our product partnership with them so
you know in general I I'm also much less qualified to speak on privacy and encryption than Henry is so I'll leave a lot of that to him I will say you know maybe very broadly whether you're talking about encryption of transactions or just trying to reduce the number of actors who have access to any particular kind of information about a trade or um anything related to the to the life cycle of a swap there is always this trade-off between um what kind of information can I can I give people uh and how many how many actors am I giving that information to you versus how what is the user experience that I'm
going to have uh and I I think these things can come in tension uh for example like when we think about order flow options right there's there's always this question of okay if I have an intent to swap I can do what Mev blocker does and just tell everybody hey I want to swap you know this much uh Heath or this much dye like who can give you the best price possible um and we'd nothing to protect that person we do nothing to limit that information or try to obfuscate the actual intent and then that potentially has leakage considerations for you know who um actually what what Dex is get swapped on and and so and you can make that
intent more specific as well you can say Okay I want to trade ether die on this particular exchange like or in this you do swap pool and that's even worse because now as a Searcher serger can go and they can see that they say well I'm not gonna bid to background you but I'll just front around you I know you're going to come in you push the price a little bit and I'll sell after you I can do that probabilistically uh and then there are much more complicated systems that try to limit that information flow quite a bit more so Mev share tries to say okay instead of just broadcasting your intent to trade everyone will allow you to program the specific piece of information that we share with Searchers by default we won't broadcast anything and Searchers
will just have to like blindly submit bundles that attempt to interact with your trade so like the order flow sampler there's a few different ways about this and system probably produces uh or potentially produces better prices for users but the cost of this like overhead of complexity and um he's just more difficult for Searchers to interact with and so then the question is where do we go with this trade-off I think you'll see different systems make different choices that blocker gets used quite a bit right now you know like it's very easy for people to interact with I think a lot of that the encryption work that Henry's doing and that like potentially more broadly the tools of app chains allow you to do kind of gets around
some of this this trade-off like the the fully morphic encryption Henry that Henry was mentioning means well actually we can just use shielded information um in our computation we don't actually have to make this black and white decision which is pretty cool it's like uh like the Infinity Stones you know like we're just infinite power um so I think uh like fully General is something that everyone in Mev is very excited about as a result because you look at this fundamental trade-off and you're like oh here's like here's a way around it um and so there's smaller you know more practical pieces of that that I think the member team are taking it and implementing now which is pretty cool um
more broadly if I were to say one thing I want people to walk away from the conversation with it's that like uh Cosmos is looks like a very different ecosystem than ethereum does uh not just in terms of how Mev gets distributed and extracted but also how people build and interact with blockchains and ethereum with the proliferation of rollups is going to start to look a lot more like as well as does now and in Cosmos who can be concerned about cross-domain mov but I think it's much more useful to be concerned about what is what is the ux that I would want to achieve like from a God's eye point of view about how people do different things across different chains and how can we think about Mev as
improving that and offshine afters as being responsible for improving that as opposed to like just trying to take money from different people throughout the stack so I think and like another thing for listeners who are like mostly in ethereum or like mostly just live in one gene or operate on mainnet like go see what it's like to interact with a bunch of different genes at the same time go like try to take some money out on osmosis and like go to stargaze and buy an nft and come back to ethereum um I think you'll find that like there are there are things you can do that you didn't think were possible and then there are some things that are unexpectedly frustrating uh and I think that kind of experience be very
informative for how people think about and build Roll-Ups guys uh unfortunately that is all the time we have Barry and Henry thank you guys so much for coming on this was an amazing episode and I'm sure all listeners will take a lot away so thanks guys once again and hopefully we can uh do this again soon yeah thanks for having us all right thanks so much foreign