ZK Podcast: Flashbots with Phil Daian and Stephane Gosselin
18 Feb 2021 · 1:08:21
Zero Knowledge host Anna Rose and James Prestwich talk with Phil Daian and Stephane Gosselin of Flashbots, the research organization formed to address miner-extractable value (MEV) on smart-contract blockchains. The conversation covers the risks lurking in the Ethereum mempool, frontrunning and transaction reordering by miners, and Flashbots' early efforts to build tooling that mitigates MEV's negative externalities for network participants.
Speakers
Topics
Transcript
[Music] welcome to xero knowledge i'm your host anna rose in this podcast we will be exploring the latest in zero knowledge research and the decentralized web as well as new paradigms that promise to change the way we interact and transact online this week james prestwich and i catch up with the team working on flashbots a research and development organization formed to tackle the problems and risk posed by mev or minor extractable value we revisit the topic of mev explore the flashbot's mandate
and check in on the state of their research now before we start in i have two quick notes first you may have noticed that this past week zk sessions event was postponed the event which is focused on defy and privacy was set to happen actually this past monday long story short basically a snowstorm in texas was enough to knock out my ability to be the host of this event as well as the ability of two out of the five speakers to actually attend so amazing that an online event can actually be affected by weather but turns out it's possible anyways happy to say this will now be happening this coming monday we've basically postponed it by a week it's going to be happening on february 22nd so actually if you missed it the
first time around you still have a chance to grab a spot event is free and we have fantastic sponsors ave and the interchain foundation as well as a roster of experts to help us discover how defy and privacy intersect interact and potentially conflict in certain cases we want to discover if defy is even possible with privacy if it's valuable and what we can do to bring this about now secondly i want to share a mating call from the scalability experts at optimism pbc our sponsors for this week's episode for some context optimism pbc is the team building the optimistic ethereum network and the optimistic virtual machine they
are champions of the optimistic roll-up that we have mentioned a few times on the show they are calling all curious hackers and seasoned engineers to come work on the cutting edge of the most interesting problems to push the limits of blockchains vms and compilers no blockchain experience is required as they believe that talented engineers can problem solve around any code base you'll be working alongside global teams that are defining completely novel businesses and games that need the optimistic software to scale if you're a developer who loves to see your code being used by innovators around the world then optimism is your gateway to paradise so if you're interested in becoming part of this compassionate hard-working team do reach out to join at optimism.io
i'll add the link to that in the show notes people of all backgrounds are encouraged to apply so thank you once again optimism pbc now here is our episode with phil and stefan from flashbots [Music] so this week james and i are catching up with the team who work on flashbots flashbots is a research and development organization formed to tackle the problems and risk posed by minor extractable value or mev we first dug into the mev issue on this podcast with our episode with dan robinson last year i'll add the link in the show notes to that if you want to check that out as well
but first i want to say welcome to stefan and phil thank you yeah happy to be here hello hello and hi james as mentioned you are the guest co-host for the week hi anna it's good to be here again very good phil so you've already been on the show um and i'll add the link to that episode but that was a long time ago so i really i kind of want to catch up with you like what have you been up to what's new yeah i mean uh not much i guess same same stuff i think last time we were talking about gas i don't even remember what the episode was on to be honest but i remember i think it was gas token yeah i remember doing it i remember the room very vividly and you know the experience but i don't
remember the content uh but i think it was about gas i'm pretty sure we talked a lot about gas because i remember i remember those discussions um yeah but yeah that was actually that was devcon4 i think right that was in prague yeah i think so yeah yeah um so yeah i've just been working on more papers kind of in the same vein and continuing the same kind of research on fairness and ordering transaction ordering at the consensus layer of ethereum and kind of digging deeper into mev which is i guess the subject we're going to be talking about today so that's been mainly my professional life uh yeah since then but even back then had you already published actually i mean we would have recorded that in
two like end of 2018 had you already published that first flash boys paper at that point yeah so i think the the devcon talk that we did on flash boys actually predated the the public release of the paper if i remember correctly um and so i think that would have been around the first time i was kind of talking about the work but before the actual paper came out if the timeline is is clear i don't know a lot of these things like always seem to happen around the same time uh to me so time is not linear and stuff [Laughter] so so that was the first time that you had sort of highlighted i guess for the community this issue of well i'm going to call the issue of mev but i guess that's not really the way
you define this what was the original problem that you identified well i think the original problem is that people were just building these dapps that weren't thinking about their impact on the consensus layer and even in many cases arguing that this was like a good thing for consensus which is still an open question i think we can discuss this more but i think i think there was kind of a blind faith in the community that you can build these kind of gaps like uniswap and like compound and maker and all these other dapps that people use that expose these massive amounts of kind of valuable minor attacks on the blockchain and that ethereum would kind of keep working uh in in the in the base layer
so i kind of just wanted to call that assumption into question a little bit and get people to talk about it and i think the reaction was was very strong and people kind of interpreted this in in many different ways and had many different things to say from financial perspectives and economic perspectives and computer science perspectives so that journey has kind of continued into the present day but that was that was the early phase of it i really enjoyed reading the paper because uh the ethereum community like you said had been very naive to these issues uh some of these had been known in bitcoin for a long time and had mitigations in bitcoin core and you know there were people like me who are aware of these and writing about them in the ethereum community before the
flash voice paper but the flash boys paper like really went out and showed that these were active that they were happening and that they could have an effect on ethereum i do wonder though like at the time that you were writing this like was it actually a problem or was it just sort of like there was some activity because as i've understood it like this is an issue that's become increasingly relevant which i guess leads to the flash bots project being developed is that the case or was it always this bad that's a good question i mean i think the goal of research is to prevent surprises in kind of an engineering context that's one of the many goals and one of the many roles of good research so i think
one of the things that i tried to do with that is kind of ask what people weren't looking at and what if kind of the course of the of the crypto community continued the way it was going what would become a problem in several years and would kind of take people by surprise so i think the problem was there and in the paper certainly we have blocks where the amount of mev is so high that it would destabilize the incentives behind ethereum consensus and could possibly have broken ethereum in the past if miners were purely short-term rational uh that being said i think reality is like a lot more complicated and minor engineering and minor incentives is a very complicated landscape so that didn't actually end up happening but it doesn't mean that the threat
wasn't there and it has continued to grow but it was serious back then and i think it continues to be serious and uh i think with time it will only become more serious as we see more engineering and more value cool now stefan this is the first time you're on the show so i want to get to know you a little bit do you want to maybe just introduce yourself real quick and i think what we want to hear for this particular episode is like what got you interested in this project at what point did you get involved sure yeah thank you so much for having me yeah i'll give a quick preview of my experience my blockchain experience is very much so focused on ethereum and actually a fun fact uh phil's the one who taught me how to write my first bit of
smart contracts back in uh in summer 2017. i just happened to make my way to the ic3 boot camp that they were having over at cornell cool and it was really my introduction to this whole world of of smart contracts that i had no no idea about before and yeah i haven't stopped writing smart contracts since then so been picking up as many interesting projects as i can along the way over the years sort of saw the wave of of mev uh coming just by by proxy of having uh having that relationship with phil and i think it was in 2018 we we actually wrote this uh this project called lib
submarine which was uh an attempt to provide a commit reveal scheme to mitigate some of the front-running uh that was happening on ethereum so it was a yeah sort of an early stage attempt at providing a mechanism for for protecting against mev um didn't pick up really it was it was much more of a research effort and a prototype but uh it was sort of enough to keep me interested in the space and then over the course of this year with with the growth of of d5 i think for many people mev became a reality just the sheer amount of uh value flowing on chain these days made it that uh it couldn't be ignored
um so yeah linked up with phil and the rest of the team and decided to see if there was something we could do about it cool now i gave a short definition of mev just at the beginning of this episode but i think for our listeners it probably makes sense for us to like do a very concise definition of that term and what this issue actually is before we kind of dig a little deeper so i don't know which of you want to take that question and run with it but let's let's give that definition to our audience uh so mev is called minor extractable value it's a little bit of a misnomer but it basically refers to the amount of value that miners can extract from a blockchain
uh miners kind of being these entities oftentimes companies or people responsible for actually creating the blocks that go on this blockchain so how can miners extract value from a blockchain well they can do things like change the order that transactions are included it in the blockchain by changing the order they put transactions into their blocks they can censor certain transactions by just not including them into their blocks and they can also add their own transactions in just like anyone else on these permissionless networks can create a transaction so these three kind of sets of capabilities are very powerful and they become particularly problematic when you try to do something like run financial applications on top of these cryptocurrency systems that use miners
so one example would be let's say you have an exchange with an order book it would be as if the new york stock exchange was an adversarial party who was looking at people's orders as they came in and kind of reordering them and inserting their own to try to make money off of people trading on their exchange in the real world that kind of manipulation is illegal but in crypto currencies these are the powers that we grant to miners and when you have things like loan systems on a blockchain exchanges on a blockchain other kind of pools of money that are just sitting there in kind of permissionless ways that anyone can interact with especially composed together when multiple pieces of of these kind of financial legos interact these minor abilities actually become very powerful and allow them to extract
really huge sums of money why is this a problem this is really a problem because it affects how miners play the blockchain game how they create blocks it incentivizes them to do things like ignore each other's blocks to try to claim large amounts of money that they can extract from these systems and that leads to all sorts of terrible consequences but it's it's interesting because when we had our conversation with dan robinson like the focus was much more on the bots front running not so much on the miners themselves so what is the connection point there is it the same actors do you picture the miners being the bots yeah that's a great question and it gets into why i kind of almost regret naming the term minor extractable value even
though as a meme it's taken off kind of very nicely mev sounds cool it does yeah it does it has a certain ring to it um and so the reason that we did call it that was because the miners in these networks kind of have the most power if you have a permissionless financial system anyone can come interact with it any bot can come use it or trade on it or whatever it might be but ultimately any transaction that interacts with this thing has to go through the miners and because these miners can also play this game themselves they can do anything those bots can do plus more wow so if you're trying to come up with like a number for how insecure your system is the miners are kind of the ultimate enemy because they have the most power so if you're trying to argue that like
this thing works you really have to look at is it secure against the miners which is kind of why we put the focus on the miners at first that being said uh we are as a flashbots kind of organization if you're interested and you don't like the term minor extractable value i think this term is going to be tweaked uh soon so if you want to think of mev as kind of meaning maximum extractable value as like the maximum value that any particular one entity can extract given uh the ability to to interact with the permissionless system you can think of it that way too that's also fine cool so the miners have kind of the ultimate authority here right and the bots are paying transaction fees to the miner
to get a chunk of that uh reordering or insertion ability do you think that's a fair description yeah i think that's that's a very fair description so flash boys kind of describes the game that these bots play with the miners and i'd say the main theoretical contribution of that paper is kind of formalizing the game theoretic dynamics of how these things work with the ethereum peer-to-peer network so it turns out the game they're actually playing depends on a lot of like low-level implementation details of the of the network and that's what we describe in flash boys but essentially what they're doing yes is like bribing miners to put their transactions first or bribing miners to put their transaction before other bots or before users things like that uh bribing miners to use those special
ordering powers that they have exactly almost implicitly by just kind of paying a higher fee but but it really is a bribe uh economically speaking so let's uh move on to flash bots this is the project that you're both involved in what is it is it a company what is this is it a group is it like i i want to say i keep calling it project but maybe you have a better definition of what flashbots is i think it is sort of difficult to define by virtue of the type of organization that we're trying to be it is very much so embedded in the ethos of being an open source project that is trying to be as inclusive as possible behind the scenes the structure of it is
to be incorporated as a company but we sort of see ourselves as a research organization that's doing r d work towards the fulfillment of the mission that we we've laid out and this is what was really important for us when when we came together there's five of us uh that are stewarding uh this organization and we've laid out uh essentially a roadmap that elaborates uh what we aim to achieve and it sort of serves as our rule base for how we go about making decisions on a day-to-day basis um i can maybe briefly introduce what that that mission is um but we talk about it more in our medium
article uh front running the mev crisis it essentially talks about how we see a potential future for ethereum and any other blockchains where this mev reproduces a lot of the negative incentives that we see in the traditional financial market um and we propose sort of a three-step approach to trying to mitigate that the first one being to eliminate information asymmetry in the system quote-unquote illuminate the dark forest the second one being to democratize the extraction so making sure that there's no privileged actor that has more power over another in the system to be able to access these
opportunities and then the final one is to distribute the benefits so make sure that there's no deadweight loss on the system and it's not the users that end up bearing the the biggest share of the cost of this extraction but instead there's a redistribution in one way or another such that all the ecosystem participants sort of come out with uh an event outcome you're trying to accelerate the development of mev software in order to shape the outcome to be more democratic and uh to favor more users rather than having gains privatized to a small number of people is that right yeah that's a that's a great way to put it is there any sort of equivalent to a
research group like this or a project like this in academia or in any other fields that you're aware of i think there's a lot of kind of various models people have experimented with in terms of how academia and industry can collaborate one of the things we want to do is fund research in academia so while flashbots mostly works on very applied engineering questions that on a day-to-day basis are engineering arm handles related to mev we also have a research arm that aims to produce original research and academic quality research by taking some of this redistribution and using it on research and the reason we do that is because we
believe that to accomplish these goals of eliminating information asymmetry we need to understand where that asymmetry is going to come from long term and kind of the only ethical way to proceed in this space if you are trying to to eliminate that asymmetry is to take this long time horizon and invest in those fundamental sciences that are going to answer questions like how can we reduce mev uh how will mev play out on the protocol layer what sort of new attacks does mev enable and what kind of mechanisms can we use to have mev increase efficiency for users rather than decrease it so those are all very deep questions that we're looking to fund on the research side of our organization this is interesting for me a little bit
from the zk perspective of like it's sort of this these concepts that can be cross network they may or may not be fundable they may or may not be tokenizable and so you can't always follow the same paths that a lot of projects do uh in order to get this research done so anyway i i wanted to just dig in a little bit on that because maybe we can take some inspiration for our community too yeah and i think uh one of the things we're doing is experimenting so i would love people to come join our discord i think we'll have a whole shout out of how to contribute later for sure but we we're trying to in this phase really figure out how we can create this new style of organization and what flashbots will be so a lot of these questions aren't actually set in
stone yet and if people want to come and answer these questions with us we know what our mission is we don't know how best to get there that's still something where we're figuring out and we're putting the pieces into place for i was i was going to ask a little bit more about that is uh you know flashbots as a company uh spending money on academic research and on high quality research in-house it gets expensive very quickly how is flashbots funded are there investors is there a plan for long-term sustainability do you expect flashbots to be around to realize the long-term vision here our goal is definitely to be sustainable and we see this being a huge issue in our industry
overall the misalignment of incentive caused by vare's different fundraising model as well as just the way that the industry moves so quickly it doesn't necessarily yield to the most uh long-term beneficial outcomes um and so that is very much so at the core of what how we're trying to organize as an organization as a research organization early on we actually just started as a telegram group and had uh just open source type of contributors and some of those contributors came from uh the paradigm team they they have a great team of researchers uh that they've onboarded and you know they've been contributing code and and they're
intimately familiar with their system uh over time when it started to come to considerations around okay how do we scale up this research how do we move beyond just this open source sort of amorphous team to something a bit more structured there was no other uh no better partner to to work with to help us do that so paradigm at the moment provided some capital for us to be able to continue uh growing our team and so far it's worked well for us to be able to bridge towards a more sustainable model that being said i will say that flashbots is a very sensitive organization and it touches a lot of political
uh kind of hot points in the community especially when it comes to the intersection with with funding models so i think everyone who's involved in flashbots understands really well that we would rather not do anything at all than to do something that's a negative for the space including any kind of investor conversations that we've had and the support we've kind of received from paradigm is with that understanding so at least so far we haven't raised any equity rounds or anything like that and and we've been very clear that we want to figure out a model that aligns the incentives of every single person in the community who uh cares about mev and aligns those incentives effectively
so we don't want things like outsized ownership or uh you know uh kind of preferred parties and uh and if we can't get to that place uh with the vehicle that we're creating to accomplish these missions that we're talking about then we won't be kind of continuing the organization uh so that's very much what we're focusing on right now on the organizational side is how do we create that structure and i think we have a lot of stuff that we're very excited to share coming up that's still very early stages cool that's a really interesting uh it sounds like you're not comfortable with targeting sustainability at the expense of the community or at the expense of incentive alignment yeah i mean i think it's natural to
expect venture capitalists especially to want growth that being said i think we chose paradigm because they have many investments in the eth space already and at this stage of our pre-seed kind of uh company formation if this is going to be a company even we we need to have this understanding that any kind of capital investment into flashbots is really leveraging the research we're creating for every single other project in the space so i think all of our partners understand that any contributions they make it may lead to sustainability it may lead to growth we're absolutely not seeking that at the expense of ethics or at the expense of uh incentives in the community i think a
lot of projects are doing that and and that's something we want to avoid at all costs so you mentioned just now you just mentioned that like part of the reason why paradigms involved is because they already have a lot of activity or they have a lot of investments on ethereum this is an issue that is that affects kind of smart contract blockchains and ethereum is the most used i think i think i could say this it's the most used smart contract blockchain right like bitcoin's not a smart contract blockchain right i would agree with that uh economically speaking in terms of value yeah i think that's uh yes well uh you know dan robinson over at paradigm wrote a whole smart contract language for bitcoin oh no way back in the day i think he has
some choice things to say about that experience uh but yeah oh he does so all right so so this is being built primarily looking at the ethereum blockchain but i'm wondering like is this research meant for all smart contract blockchains that are coming out is this only like is it is it so curated to the ethereum structure that it couldn't necessarily be used by other groups and to uh kind of piggyback on that we've been talking about minor extractable value does this generalize to staker extractable value and proof of stake i think it's a great question right like uh ethereum is sort of a monster today in taking all the attention but there
are a bunch of other blockchains out there that may suffer the the same fate eth2 is is one of those with staking coming down the line there are some hopes that some of these issues might be resolved but really a good way to think about it is who holds the power to order transactions within a block and what information do they have access to when they're doing this when you shift from proof of work blockchain to proof-of-stake blockchain you're shifting over from a minor to a block producer but the power uh remains there i would say what's been really interesting is we despite focusing
on ethereum as an engineering project flashbot's research is very much so looking at all layers of the stack and so we've i would say there's three categories of mev mitigation that we've seen so far one of them is at the smart contract layer so we would say it's maybe application specific mev mitigations where you try to wrestle the power of ordering away from miners another one is at the node level which is what flashbots is doing with mev geth by modifying the way that the transactions are being auctioned for
ordering and then the third one i would say is at layer zero so by modifying the way that the consensus of the blockchain is working to be able to delay in one way or another uh the revealing of the content of the transactions of a block so all three layers are sort of active areas of research here and i guess that that last one that's where people who are actually designing the new blockchains could potentially be using some of that research in their designs am i right that's right yeah and also people who are retrofitting old blockchains to deal with mev can also use them i also think there's an interesting
point about power dynamics so if you look at proof of stake who's going to have the power in that system it's whoever has the most coins and you're talking about right now actors like coinbase finance you know large exchanges large holders kind of large entities like this versus companies that are specifically set up and scoped to extract rent for a period of time which is what mining operators most often are uh structure-wise so these entities what are their incentives we don't know how do they interact with each other we don't know um i think it's very unlikely that they're just going to let user coins sit there and not participate in the system and once they're participating in the system i think it's very unlikely that they won't use the full range of powers
available to them just because in the long term not using those powers is going to be very anti-competitive and they're going to lose out to other stakers wow so how does coinbase interact with mev i think that's a very concerning thing about proof-of-stake where it could end up that it actually is a more serious issue rather than a less serious issue the idea there is that the exchanges that do extract value through mav will provide better rates of returns to their customers exactly yeah exactly so as an exchange you'll probably like if you can extract mev and give some kickbacks to your customers they'll probably move their coins around in the same way we've seen yield farming we could easily see mev farming with various exchanges kind of extracting at different levels and
ignoring each other at different levels or whatever it might end up being so that's that's a world we don't want to be in but uh but it's a plausible one yeah speaking of worlds we don't want to be in you know we've talked a lot about flashbots as an accelerationist organization we're producing code we're producing research we're making all of these things possible are you at all worried that somebody is going to take the things you produce and build a world you don't want to live in um i have nightmares about it every night um it is so scary uh to think that uh you know you build tools and you intend them to be for good and you try to design them to be for good but they could be misused um i think what gives me comfort is the fact that
i don't see there being alt any alternatives and so if anything this is an attempt at moving what is already a nash equilibrium before it gets sort of ingrained to a different one and if it works great if it fails and just accelerates us towards that same nash equilibrium will look like the bad guys but you know maybe we can still go to bed happy knowing that we tried something so you're you're optimistic that you can get to a uh happy future and you know kind of stay there make the cost of leaving the happy future too high for anyone to build the bad one that's the goal yeah i will also say that i don't think i would have been involved in flashbots or starting this organization
if there weren't several other companies that have pretty much developed and released exactly the software that we're releasing several of them in a closed source way so like this is not what we've released and developed so far and even our initial stages of the research roadmap is not like rocket science uh it's kind of something that's already been happening in the industry so we are moving the needle by kind of releasing code and making things easier and spreading the meme and just teaching more people how to do these things but the the technical bones to do all this it's uh it's been accelerating since before flashbots was created and actually seeing it start to accelerate was the catalyst for us forming the organization and saying like oh crap this is going to
happen with or without us maybe we want some say in kind of what this future looks like rather than letting the today's incentives kind of run away with themselves what kind of projects were doing that like do you have any like names of these projects do you mind mentioning them because i i don't know who was already doing this or who's closed source doing this i don't really want to want to call out any companies that may or may not you know be close partners of ours right now okay no not not not not i'm just kidding i'm like half kidding but uh but yeah i mean there are several projects um i think concretely to name a few blocks route tai chi network
i think archer dao is another one so these three are the main public efforts there are several other mining pools we've talked to and several other miners who are who have approached us as as interests either interested or committing engineering resources or at some stage down the r d pipeline uh so i think there's there's many different efforts to modify the eth network to be more friendly to mev and to kind of change the mev landscape in many different ways so there it sounds like there's a lot of kind of behind-the-scenes maneuvering going on right now yeah i think i think there's been uh behind the scenes maneuvering since really defy exploded this effort with flashballs
very much so started towards august and if you guys remember that's around the time where i think you guys recorded your initial episode and you talked about the dark forest and there was sort of this initial post about hey uh you know i got front run on chain like what's going on here um and then after some time there was a follow-up post by by samsung about escaping the dark forest um super interestingly that sort of came uh like a month in into our effort when we were talking with the mining pools and they were showing us what they were building um we were able to use that initial infrastructure for uh performing sort of a white hat uh rescue so there's definitely been the
development of this infrastructure behind the scenes and sort of murmurs around it but it has sort of a double-edged sword and i think people are very cautious about how developing this technology is perceived and so there's some neat things that you can do around rescuing cryptokitties like we saw over the last week or rescuing accounts that don't necessarily have any eath in them but there's obviously some some more malicious and user harm type of things that can happen with meb so you had mentioned stefan a little bit earlier the different levels that you were working on and one of those was this implementation level
like actually creating the mev geth i was thinking we should talk a little bit about that because it was on an episode a few weeks ago with where james explained to me kind of how you're not changing ethereum there's no fork and yet you are able to change how miners are interacting or how mev is perceived so let's talk a little bit about mev geth what that actually is and what it does sure yeah definitely so one way to think about the way the mempool works right now is just the communication channel between users of the network and miners right where users of the network are requesting to be included in the next block using two things the
gas price and the gas limit on their um that's a very narrow communication channel for uh users to be able to express what can become sort of a arbitrary complex set of requirements on where exactly they want to be placed with regards to other transaction with regards to the current state of the chain and all those details are completely lost in in that communication so the idea behind modifying geth what a patch that we call mev guess is simply to introduce an alternative communication channel for users of ethereum to be able to communicate
more granularly where they want their their transactions to be positioned within a block so it provides this alternative channel that has a few additional properties than the mempool has one of them is that the transactions are private so the content of the transactions is never published to the rest of the network until they are mined in a block the second one is that you can actually send an array of transactions so you're not limited to a single transaction at a time and you have some guarantees around the execution of those transactions being atomic and the final component of it is
you are not limited to paying out the miner using gas price and gas limit you can actually use one of these transactions to do a direct transfer of value to the miner as a way to make it conditional on certain state transitions on chain i mean from this you can already see how like dapps in particular would be able to like interact with this kind of these changes but i i think i want to go into like what it exactly is because mev geth is it a you sort of mentioned a patch but is it kind of like a fork of geth the normal guest client so i think the best way to think about it is is an upgrade or a patch okay about 500 lines of code that you can paste into your
uh your guest instance and you can start uh receiving and mining uh flashbots blocks okay um so it doesn't modify the ability of the node to be able to communicate with the rest of the network it simply provides uh an additional channel for uh receiving messages okay cool but do the my on the minor side did they also have to have this running like it's not like you as a user use the patch and then it works everywhere right yeah i'm glad you brought that up so this is definitely something that uh only the miners need to do as a regular node runner in the network you don't need to modify your node whatsoever this this patch only applies to
mining nodes so we talked earlier about minor bribery and how we're bribing the miners to exercise their ordering ability would you say that mev geth is the actual software that the miners uh run in order to allow people to bribe them i think any system that is able to pick uh the execution of the transaction order could be seen as being a way to communicate bribes i think mev geth provides an alternative way for those messages and those requests to be passed along to the miners such that there's less negative externalities on the rest of the network so for example if i'm a bot and i'm
using the regular mempool to try to bribe the miner for inclusion there's a few common strategies out there one of them is to keep resending the same transactions with the same nonce to try to overwrite and outbid myself that causes a lot of spam on the network where now your peer-to-peer network is crowded with these bots that keep resending the same transactions likewise there's a lot of these transactions that end up being mined in a block but not successfully targeting the opportunity that they're looking for and so you have these blocks that are filling up with transactions that are purely reverted and they don't produce any value they're just taking up block space and and
wasting it um so there's some mechanisms or auction systems that are more efficient at producing uh sort of the most desirable outcome for everyone in the network which is less chain spam less network spam and more fees for the miners and less risk for both parties involved so right now these bots are kind of making the entire chain ecosystem pay for what they're doing partially they're spamming the network they're filling up blocks with reverted transactions and mev geth is a way that they can negotiate these deals with minors without having negative impacts on everyone else
yeah i think we're we're getting the worst of both worlds which is economic centralization and information asymmetry and the externalities of like the networks and the channels that are being used are every single node on ethereum and every single person who wants to run a node or study the network or write a dapp or whatever it might be they're making it more expensive for for everyone so countering these negative externalities is definitely what we're trying to do and to go back to the bribery question i think basically any fee payment infrastructure on any cryptocurrency is also a bribery infrastructure and i think it's okay to normalize that word from my perspective like i think this is controversial but the authors of for example eip 1559 which is
a proposed change to how ethereum charges transaction fees uh they called any amount that you would pay over the minimum fee to get included a bribe because there's no reason you would pay over the minimum except to try to get in sooner and paying to get in sooner basically is a bribe of like here take mine no take mine uh it is also an auction it is all these things so i think we use these words interchangeably and i think for some newcomers especially from the traditional financial system they might hear the word bribe and be like oh my god what is this but when you're talking about systems that are intended to run in adversarial settings and intended to have actors running them who don't have legal relationships who don't have uh kind of external cooperation who don't have any police force that can
hold them accountable um i think it is an appropriate way to view kind of what is going on yeah we were using the word bribe but it shouldn't be seen as a negative word in these contexts it is just a description of what is happening and is a natural part of the system yeah some some people would call it also a tip i've heard used a fee i guess but i think really these are all the same thing it's like the rent you're paying the miner to use their right to include your transaction i had a question about like this geth patch though like do you have any relationship with the geth team are they aware of the work you're doing are they going to incorporate the work that you're doing like i actually don't entirely understand how those two things work together yeah so we don't have any sort of formal
relationship we've definitely been in communications with members of various different development teams uh so geth open ethereum being some of them um they're i think aware of what we're doing and they've definitely been useful in answering some of our questions our hopes is that you know we mentioned what are the benefits that we can bring to the community our hopes is that we can actually start to improve the way in which the development of these layer one nodes are being funded and and developed um so we hope that over time a lot of the work that we produce is going to be able to be merged back into the upstream clients because we think it would be to the benefit of everyone mavget
it sounds like this is out running in the wild today um how can i you know interact with it as a user as a developer as an engineer how can i like go out and use mev geth to order transactions today sure yeah so we released the initial specification uh i think end of november and sort of just published it as open source code what we saw is it initially started getting adopted towards the end of december to the point where we mined our first uh block on mainnet i think a couple days before the new year so at this point we've been live on ethereum mainnet for just over a month and what we've seen
is gradually over time there's been more and more interest on on both sides of the system so miners are slowly coming online to uh to run this this muv guest system um and we've seen sort of a gradual increase in the amount of hash rate that is uh that is powered by it and then on the flip side we've also seen more and more bot operators uh switch over their systems from running on the mempool to uh also routing their uh their transactions through uh through flashbots so you asked about you know how do each of the sort of ecosystem members keep track of what's going on here
um i think what's the most interesting for the average ethereum user is to take a look at our transparency reports where we publish a lot of the data on what's going on on chain and we're coming out with a dashboard very soon that's going to be able to sort of live show the state of mev and the goal here is really to help them get more educated but there isn't necessarily any particular action that they can take for bot operators and minors then you know take a look at our github and and and see the content that we've published there on how to to join the network cool um and before we move on from talking about mev geth um can you very quickly uh take a well-known dap
maybe uniswap and talk about an example of using it for good and using it for evil sure so in the context of uniswap i think that's a perfect dap to highlight uh kind of how mev can go both well and poorly for users so the way unit swap works is basically it's a contract that has two pots of money in two different tokens and users can kind of exchange from one pot of money into another by kind of sending tokens into the pot that they want to get rid of and the contract will make sure that the ratio of tokens in the two pots kind of stays the same value-wise over time right so like if you send five dollars to the eath pot you've now unbalanced this ratio so you have to get five dollars worth of
the other pot sent back to you to make this balanced again um and and the contract logic is kind of responsible for doing this automatically of keeping these pots balanced and the nice thing about that is that users can trade at any time you can kind of just come and send money into whatever currency you want without needing someone to trade with because this contract is always holding the other asset for you so how can mev go both well and poorly well one example is if a user wants to come along and make a huge trade let's say they want to to buy a million dollars worth of uh ethereum at the market rate one thing a bot operator can do is they can do what's called sandwiching the user where it can put its transactions around this user's transactions say buy the eth first before the user
gets a chance to then process the user's transaction and then kind of sell the eth at this higher price the user has now created by changing the ratio in these pots and that's kind of an example of a classic market pattern that's known as as basically front running uh in in classical exchanges but it's kind of unique in a blockchain setting because the miners have a very special ability to do this and almost unlimited power to do this with guaranteed profit now how can how can me actually go well for the users here well let's say this user knows that the miner is in this position and they anyway want to pay the miner for their services they could come to an agreed-upon price with the miner before they process their
transaction of how much they want to let's say tip bribe whatever pay in fee to the miner to execute their transaction and uh assuming they that there is a network for them to do this and to enforce this relationship they can then have their transaction mined without other bots or other people on the network kind of being able to do this sandwiching thing to them today on ethereum this kind of transaction would be sent in the public network so any bot that's listening to the public network would be able to try to do this sandwiching as well as any miner involved in mining the transaction so having a separate negotiation for that may in some cases be better than the status quo you're saying that uh someone is going to try to front run your trade if it's on the public network anyone has
access to it if it's on the private network with mev geth you can negotiate directly with the miner to avoid that exactly the miner will always have the technical ability to trade before you if they want to because they can just put their transaction first in that block that's the way cryptocurrencies work today so they can do some definition of front-running you but you could maybe have a more specific marketplace where you knew exactly what the miner would see about your order you knew when they would see it and you had much more specific guarantees about the information flow of your transaction than just broadcasting it to a public message board and hoping for the best so mavgeth and these kind of uh direct bargains with miners can give users protections that are unavailable on the
main network exactly yes if they just broadcast their transaction yeah and i think i think our efforts to kind of deal with mev go even past what happens on the live network so we're also developing tools for dapps to do things like reduce the amount of mev or understand the amount of mev in their dapps uh we're releasing dashboards that are going to educate people on what mev is out there and how it's being extracted so i think it's going to take more than just correcting the incentives on this one part of the stack but i still think having this one layer can let you do many powerful things that dapps don't have the ability to do today one of my questions around this entire topic is like what does it actually do i think i think we've talked about what it does sort of on the
granular level like what it enables but why is is it only good because people don't get front runned or is there any other kind of like global network effect that could be seen as a benefit of using these kinds of systems we predict that there's going to be sort of a wide range of impacts of the type of system that flashback is developing some of them are are more targeted towards the users so we expect there to be less spam on chain we ultimately expect that it will actually reduce the price of that the users pay for for getting their transactions included we also expect there to be a sort of a more efficient uh ecosystem that develops around
the extraction of mev where uh because of this fair marketplace um it's no longer about uh who can have the best you know off-chain uh deal with miners to be able to access the hash rate but instead there's sort of this pure competition for who's able to be the most efficient at finding opportunities on chain and extract the mev that expose at the same time we expect that there's that's going to increase the amount of interest that there is in developing systems that are protecting against enemy extraction and specifically the type of mev extraction that is harmful to users so this is a distinction that we're
working on on on putting together and and as a part of our taxonomy of mev trying to find what is good kinds of mevs and bad kinds of mevs um i think you guys debated this on on your previous previous podcast and it is a very difficult line to draw but there's sort of some things that feel better than other um and the open question is how do we maximize the ones that feel good and the one minimize the ones that feel bad um so i'd say these are all open questions but they're the direction in which we expect the impact of our work to go yeah and i think it's also worth noting maybe this throws it back a little bit to what is good versus bad mev and protocols like a lot of these protocols
actually do need mev to function it's not like we can just eliminate mev and we'll get to an mev free world like the only reason uniswap works for its users is because our bots come and our prices back to market and that's where the liquidity comes from that people are trading against and that is mev like directly mev so uh i think understanding mev is critical for these protocols and that's one of the second order impacts we hope to have other than the direct impacts of kind of increasing efficiency and reducing spam and other kind of commons benefits i'm really interested in phil's point it sounds like you know there's good mev like bringing uniswaps back in line but it's also impossible to express uniswap without some amount of
mev without uh you know the you you can't build a automated market maker that anyone can interact with without this feature yeah i think that's correct uh and i think people want mev like one of the first things that i told uniswap when they came to me in like 2017 or something and they're like or i don't know i read about them on the on the youth forum i don't remember how i originally got in contact with hayden but we were talking about the design and i was like this is terrible i hate this uh it's like exposing way too much mev like it's gonna screw with chain incentives if it becomes popular it's not a good trading ux for users uh they're gonna get kind of exploited in front run by all these bots blah blah blah wouldn't it be so much
better if we just added this batch based system kind of like lib submarine which is what stephan was talking about working on earlier where you kind of secretly commit to what trade you want to do and you reveal it a little bit later so that miners lose a little bit of ability to manipulate the order because you have to have previously committed to any trade that becomes executed so you need kind of two minors over time to collude to manipulate you rather than just one and every minor on the network maybe has to participate in this for it to be successful so that's really a system that i thought would be would be more efficient from an economic standpoint because it wouldn't have this minor ability to exploit users in this direct way but what it also loses is this ability to instantly perform a swap from any
token into any token in real time you may not even know when you make the transaction which token you want to swap into which token it might depend on other things that are going on on the network it might depend on other kind of defy contracts other components that you're composing with so this this ability to instantly swap tokens is both very powerful ux and is exactly the ux people want and the reason that this pro project took off and the reason it became popular and it's also in many ways the bad mev that allows people to get sandwiched and leads to a bunch of bad ux that you can read about uniswap traders having on the network today so it's a double-edged sword it's both powerful but also painful at the same time and finding that balance is really
difficult yeah and you know i think the one of the interesting takeaways here is that uh mev and shared state that we want out of the composable defy experience are intimately connected it is likely impossible to completely eliminate mav and uh it's almost certainly undesirable to completely eliminate it even though we tend to talk about it in this context of like the issue of yeah and here we use all these negative sounding words like bribe and front running and extraction no there is a lot of positive stuff and and if you go on my twitter and see kind of the latest talks i've been giving on defy stuff there's a lot about this that i'm gonna
be releasing with a bunch of co-authors very soon but i think you can almost view the security of these financial instruments and the value they hold and how they compose in terms of mev and like you said it's almost inevitable like like imagine you just have an exchange right and then i place a billion dollar bet on the outcome of this exchange in the next six months uh like an options contract then the kind of composition of those the options contract now affects the security of the exchange in an mev sense um so i think mev is like a very deep way to reason about different financial instruments working together and how the value works when these things actually connect and i hope there will be more about that soon yeah and quantifying the effects they
have on each other and on the underlying chain running them exactly so in the last two days there was this yearn i'm going to call it an arbitra attack i don't know if you would call it a hack i don't know but anyway uh a lot of money was lost or like gained by an attacker based on a flash loan and i just wondered and maybe there's no connection here but i was wondering like how does a flash loan and mev interact with one another does it matter because when you talk about like the one block the one transaction like can people front run the flash loans as well is that happening is it good or is this completely like different universes and are not and are not connected
no there's there's definitely a very deep intimate connection there and uh it's very explored fully in the in the talks on my twitter i just mentioned and the paper that i'm about to fantastic but i will let me let me briefly kind of cover it here uh the basic idea is that when you're talking about mev you can't just ask like what is the mev of an exchange or a contract in general because the mev of that contract or that exchange or that dap or that program or whatever will depend on things like what is the current state of the world like who has what money in the world what money is in the system things like that and also what are people trying to do with the system right now so like what transactions can the miner actually access and reorder um on the system that are that
are going on in real time so what is the state what's happened in the past and what is happening now both affect how much money a miner can extract uh so imagine like a uniswap contract with zero dollars in it obviously there's no mev there there's nothing to extract if you put a billion dollars in that contract that's you're changing the state and suddenly the mev skyrockets same contract same code different uh state different world so basically flash loans change the state of the world so where you have contracts that might not have had mev in a certain state um you now add flash loans and in that same state because maybe before in that state the miner didn't have enough capital to pull off certain governance attacks that might be a very
common restriction on states so you say this contract has no mev like let's say maker dao in any state where the miner has less than a trillion dollars right and you might say that that is secure that means that with regards to mev this contract is secure because no miner is ever going to have a trillion dollars that's ridiculous um but when you have this kind of mechanism for miners to trustlessly access pools of capital that assumption and those states become much more realistic so what you're doing is is like kind of changing the world in a way that yes does change the uh the mev of the situation by just changing who has access to what capital which is a very deep part of what mev is is in the system the thing is with the flashlight it's literally one transaction so then does
it also just like take it away right after there's mev for one transaction you have to catch it in a way it gets extracted yeah exactly yeah as yeah i mean exactly it just it just opens the extraction possibilities by like letting you play with some money for only one transaction um and if you could it could extract it with all that money then go for it you have the transaction to try to extract it and if you do well you can repay the loan it just lowers kind of the capital requirements it doesn't introduce any new attacks but it makes it a lot easier to do the ones that are already there oh cool or i don't know if cool is the right word oh no yeah we talked a little bit just now about you know the flashlight
is changing the state on chain which changes the mev calculation uh does changing off chain state also change the mev calculation um for example if uh eth spikes on coinbase is this going to affect mev that's a great question um so in our current definitions of mev uh we do measure in terms of eth so technically speaking for at least my current on paper definition of mev no but you can change that you can tweak the definition to use whatever value formula you want as like a function of the state basically so like uh if your value function is just like look at how much each the minor has
and that's the mev um then no right but if you if you say like add up all the tokens and there's some way for the miner to say swap eth for usdc at market price based on the transactions it's seeing that are affected by this chain uh state of the world then then in that world yes um so i think like like kind of but it depends how you want to scope your definition because you kind of have to draw the line somewhere and it also depends on you know whether there are any on-chain actors that are making decisions based on that market price via an oracle or something like that exactly so i think oracle extractable value uh is a term i've heard before as a subset of mev that relates to oracle updates
like the um compound liquidations that happened a few months ago yeah and uh i know maker has has had various uh flirtations with oracle extractable value when their oracles have stopped working in the past and things like that so i was thinking we could kind of close out a little bit to in learning about your road map where you're at what's missing maybe still and i do want to touch on the topic of privacy or at least privacy primitives because i know that that's somewhere in your road map but let's start off with where we're at now so as you mentioned there is a kind of proof of concept there's there's a there's a patch it exists it's usable uh what are the like is that is it in its final state
will there be changes to it what do you think is kind of still missing uh on that so i think in many ways mev is the most exciting thing that's happening right now because there's so many unsolved questions for it um and the state of our implementation of mevgeth is not going to be the final one there's so many things that we want to do to improve it both from the user experience of searchers who are operating on it all the way to the core mechanism by which uh the preferences of those searchers is being explored so two particularly sticky points that are at the core of our research and and are actually the reason why
we are calling the system an alpha release right now um are privacy and uh spam resistance um so uh on the network right now right if you just send the transaction through the peer-to-peer network provides uh sort of the spam resistance that you need uh to make sure that the miner node at the other end of the system doesn't get overloaded with a bunch of requests in an mev type of way where you want the transactions to be shielded right you don't want the content of the transaction to be revealed before they reach the chain you need to have a new way to be able to propagate those messages
so doing that in a decentralized fashion that has both privacy and spam resistance is currently an unsolved problem that we're actively looking at so you want enough uh privacy that the miner doesn't know necessarily who sent this or what it's doing but enough uh transparency that someone can't just spam the network and uh denial of service everyone exactly and which which kind of like primitives are you looking at what kind of privacy tech do you think could actually do that oh i mean i think that's a that's a very hard open question and uh we have i guess on our youtube video a recent what we call a roast which is we
have these kind of community sessions where we'll we'll put out these half-baked ideas and people kind of come tear them down and contribute and share their experience um and one of our recent roasts which is on our youtube channel was about this subject of like what technology can we use to get privacy the need for privacy is really clear i think one of the things flashboss wants to do at its very core is build this private kind of auction payment uh bribery whatever you want to call it infrastructure because the public one where everyone can see every transaction is just not efficient and i think economically by adding this layer of privacy where the two parties are separated uh by this barrier
of who can see what information you can build much more efficient economic mechanisms and you don't fall into things like miners being lobbied to like route messages to certain participants before others and all these weird economic pitfalls that happen when you're dealing with open networks or trust-based networks so what we really want is economically speaking we want this private channel so we know that technologically speaking there are many ways to achieve this in theory so like in the crypto theory world if you have this perfect multi-party computation system uh it's one crypto primitive that exists out there maybe you've heard it's called mpc also it could accomplish this um if you have maybe uh threshold encryption of a trust
trusted kind of committee of people who are trusted to keep things secret you could maybe use that plus economic incentives to also build a similar system another straw man proposal we've looked at is trusted hardware and intel sgx and other alternatives there are designs which use systems like that without integrating them into kind of the core of the network where they'll be used for anything but spam resistance on this one channel and while allowing them to kind of degrade gracefully if they're attacked you probably can use that to also provide some version of this it's worth noting we're not the only project looking at these things so what what basically needs to happen is a contract between
minors and bots that is has some privacy and is also executed in a trustworthy way so what you really need is a smart contract with some privacy i think there's a lot of open research questions around what what is the best way and what exactly are the requirements in terms of like latency trust requirements uh deployment requirements and things like that that are best covered probably in our in our roast video but we're highly interested in alternatives and if anyone's interested in researching that please reach out for sure so i'm really glad you mentioned the mev roast i was gonna ask you about that anyways and now i definitely will we'll add a link to that in the show notes if anyone wants to check it out this is an ongoing sort of series right you're doing this
every two weeks or so yeah approximately every two weeks uh and we also have a number of events so like you said we do have a public calendar because we do aim to be a community organization uh so please do check out that link and please subscribe to it so you can know when we have things like roasts or other research workshops or things like conferences that we're planning to have in the future so yeah definitely please subscribe to that public calendar very cool well i want to say thank you so much for coming on the show and answering all of our questions about uh flashbots and mev the sort of state of the research and some of the work that you have planned is there any last message you want to share with the audience or i think we're
going to send a lot of we're going to put a lot of links in the show notes for them to follow i don't know i guess i want to say that with the recent especially with the recent gamestop uh kind of debacle and stocks turning into memes i think we have a real opportunity here to build something different from the current financial system and better than what's going on on wall street in a way that works better for users that's more fair and that's more transparent there are also futures where mev ends up being the opposite and ends up just reinforcing all the payment for order flow and information asymmetries and systematic run extractions we've seen in that world and it's very much my hope that we live in the former universe where
mev becomes a force for good and if you're listening and if you're participating in the ecosystem if you develop a dap or whatever you might do we can definitely use your help in making sure that that's the equilibrium we reach so please definitely reach out and participate in the conversation very cool all right so thank you so much phil and stefan for joining thanks so much for having us this was a lot of fun yeah thank you so much and thank you james for co-hosting always a pleasure and to our listeners thanks for listening