Phil Daian & Stephane Gosselin: Flashbots – The Good, Bad and the Ugly of MEV #389
28 Apr 2021 · 1:38:50
Flashbots co-founders Phil Daian and Stephane Gosselin join Epicenter to discuss MEV, the profit miners can extract by including, excluding, or reordering transactions in the blocks they produce. They walk through how Flashbots' MEV-geth client works with miners and searchers, the project's progress on an SGX-based solution, and how the team has handled spam attacks and chain reorgs. The conversation also covers generalized frontrunning, how MEV differs between Ethereum's base layer and Layer 2s, and Daian's response to the view that MEV extraction amounts to theft.
Speakers
Topics
Transcript
this is epicenter episode 389 with guests phil diane and stefan [Music] gosselin [Music] hi welcome to epicenter this is frida kahn and this is sunny agarwal and today we're here with finland stefan and the co-founders of flashbots which is this very on-trend mev project that we'll talk about in just a bit hi phelan hi stefan hey great to be here
hello hello before we get started um let me tell you about our sponsors today so our first sponsor is exodus exodus is an easy to use wallet which supports hundreds of assets and has native apps for all platforms including ios and android and as a fully non-custodial wallet there are firm believers in the not your keys not your coins mantra go to exodus.com and give it a try we would also like to thank paraswap pariswap is our second sponsor today and they just came out with a huge update that's even faster and more liquid it's cheaper than uniswap and comes with a new gas token that can cut your gas fees by up to 50 percent plus for our listeners paraswap offers 50 gas refunds for
the first swap of at least one eth make your trade and go to paris swap dot io slash epicenter to claim your refund finally we have solana solana is a next generation blockchain with lightning fast blocks and fees less than one cent per transaction scalability is perhaps the biggest challenge facing crypto from becoming the backbone of the world financial system and today solana might well be the best solution we have go to solano.com epicenter to learn more hi fellain stefan um good good to have you guys on the show just for a little bit of background um can you briefly um explain to us um how you entered the crypto arena and i mean both of you have been around for a long
time i know that stefan you were numerai before you started flashbots and phil um i i think everyone knows you from your deck studies um that have been around for a while um so maybe stefan can we start with you sure um i think i've told the story a couple times but i it's always a fun one i think in this context because phil's the one of the first people that i met in this space and i think it was back in 2017 i just showed up at an obscure conference in the middle of nowhere upstate new york and was told about smart contracts and it blew my mind given that i had zero idea what the hell anyone was talking
about but everyone sounded really smart um so i decided to dive in and i haven't looked back so have been working on ethereum since then every layer of the stack and always trying to find the next uh problem to solve um and uh yeah that led me to uh to mev cory what about you phil oh yeah i've been i've been in crypto for a little while so i've always been very passionate about kind of privacy and anonymity technologies i think i first started looking into bitcoin around 2012 uh in the very very early days of the silk road because i was working on tor at the time and obviously it was an application that made some waves in the in the community
and made some uh real world impact uh so ever since then i've been working on various kind of bitcoin related uh black white and gray hat side projects um decided kind of then that i would transition into full-time cryptocurrency and also that i wanted to do it in academia because i thought there was really a need for some deeper longer-term thinking on some hard problems facing the industry that i saw as kind of blind spots and also to kind of forward the the cause of cryptocurrencies in academia and kind of communicate to people that there is something interesting here and there's something unique and like your skepticism is warranted but also suspended for a second and try to imagine
uh kind of how you would redesign things with these abstractions and whether that's useful to your life and so that's kind of been my message ever since i've worked on proof-of-stake protocols i've worked on all sorts of security research on smart contracts and that led me to dexes and that led me to kind of mev and analyzing user fairness and security properties of dexes which is what we're going to talk about today i guess so you mentioned black hat so phil dao attacker confirmed no i'm not the dao attacker i wish we've been trying to get you on for a little while actually so you know you were working on some other cool stuff as well like you know the gas token stuff and like you know this earlier
like you know very a lot of early mev research how did that how did that all like kind of lead you uh to like working on flashbots oh god it's like such a deep rabbit hole and everything connects to everything else like if you're a listener on this podcast and you're kind of new to mev or you just heard about it in the last few months like you will explore all of these topics of like how our resources priced in in blockchains how does this relate to futures and options how does this relate to market fairness what is the market design space how does that relate to computer security how does that relate to economics these are all questions i've spent a lot of time thinking about uh my twitter bio is grasping for tractability because it's just such a huge design space that like
you know you can dabble in kind of any corner of it and have some obvious insights that feed back into production and feed back into people's lives so yeah all my dex work and gas token is kind of an example of just thinking through these problems from first principles and kind of coming to certain conclusions about how we can design mechanisms and where weaknesses are in current mechanisms and trying to communicate that to the community so that led to my initial work on dex arbitrage and how dexes are unfair and also to kind of gas token uh which is kind of almost an economic exploit on ethereum itself that's getting neutered in the upcoming london hard fork uh shout out to anyone who holds gas token
um also yeah i'm sorry for not coming on earlier it's worth noting i've i've you know made my career ignoring pretty much everyone in the space who tries to contact me so if you're listening and that's you it's like truly not personal and i'm sorry i really try my best i feel i feel so honored now so so phil can you talk about flashbots and what the problem was that you were trying to solve here yeah so uh kind of the original thing that brought me to mev was thinking about what is smart contract security and in thinking about that and in thinking about what people really wanted to build in the early days which was decentralized exchanges and permissionless exchanges it kind of naturally brought me to the
question of fairness because i don't consider an exchange secure if it's unfair to users so if there's systematic and kind of patent unfairness built into the design i think we should exclude that from kind of considering it secure as a community so i started trying to define what is security from a formal perspective which led me to thinking about fairness and fairness in early dex designs and kind of where designs fell short which led me into kind of the front-running bots mev kind of consensus layer unfairness and insecurity angle of this and really got me concerned about the possible concentration of power posed to the mining and validation game because of mev so uh we're going to talk more about what mev is but mev is basically money that miners and validators can make by
choosing or manipulating certain aspects of the system they have control over extra money on the table from things like censoring users or reordering their transactions or putting one user's transactions in front of another or putting their own transactions kind of into the transaction stream so because miners and validators have all this power and because the mev world is so complex and so hard to programmatically explore and because it's such a profitable lucrative area it's kind of a triple threat of having the potential to centralize cryptocurrencies and get rid of these fairness properties and these decentralization properties we all enjoy and that all brought us to these systems in the first place and i think that really has the potential to erode the trust guarantees of cryptocurrencies the fairness guarantees of cryptocurrencies and the the
effectiveness of cryptocurrencies in the market um so in solving this problem it became clear to me that we really need an organization that satisfies two properties number one is that it thinks extremely long term and number two is that it's extremely aligned with all aspects of cryptocurrency incentives and we've designed flashbots kind of very defensively maybe stefan can talk more about that for these two goals specifically a big part of that is for example we don't have a token right now and that's because we don't want to bake in certain aspects of the incentive structure or kind of get ahead of ourselves uh in designing this network we want to make sure that any structure we build aligns absolutely everyone in the cryptocurrency ecosystem
and that's why we we've chosen to do this through open source software which is kind of the tradition of cryptocurrencies and free software and open source software before it that just kind of people are incentivized to run and people are incentivized to fork and build off of but also makes people think critically about mev and about what this means and about where the future of this industry is going and establishes flashbacks as kind of a hub for that kind of activity so stefan you want to tell us a little bit about like what are the you know practical products right now that flashbot is building the way that we have been approaching the problem is one we know that there's some extremely long term research questions that need to be
answered and questions for which we we don't have all the answers to yet yet at the same time we have high conviction that there are some immediate costs incurred by all actors in the system as well as risks that will take place in a few years time if the ecosystem around mav extraction goes in certain directions and we believe that the best way to help guarantee the most positive future possible and the most healthy ecosystem of mev extraction is to start building products that that enable the users to define um the kinds of properties
that they want to uh to maintain on their platforms so we sort of dubbed the initial blog post that we released front running the med crisis and that's very much so because we observed a lot of alternative mempool infrastructure being built out so private uh communication channels between bot operators or traders and and miners um and these um we were very worried that these uh communication channels wouldn't have the property of credible neutrality and wouldn't necessarily be aligned with uh the rest of the ecosystem participants including the users so what we set out to build
initially is a communication channel that has those properties so is able to show some level of credible neutrality and efficiency that helps mitigate some of the immediate costs as well as uh is built defensively against some of the more longer term risks of centralization and and consensus and stability so we call this the flashbacks core infrastructure we released that in the beginning of the year so just about january 1st and we've seen a lot of interest from the community to to start running this this open source software um so i think where we stand today we have between 60
to 80 percent of ethereum uh hash rates so ethereum miners uh that have adopted uh uh this system um and uh and and are sort of using it to um to most efficiently extract the the med opportunities that are available on chain let's get to our sponsor exodus exodus is a fantastic cryptocurrency wallet that strikes the right balance between ease of use security and great features you can get exodus on the iphone desktop app web app android whatever platform you use it's a non-custodial wallet and that is so critical because what's the point of crypto
if you don't control your own assets with exodus you always do they're old school and they've been around since 2015. over 1.2 million users rely on exodus so you know that they've stood the test of time they have support for over 100 different crypto assets and from within exodus you can easily change one different asset to the other they also allow you to buy crypto with fiat and they even have a great offer where you can buy up to 500 worth of crypto through their ios app and pay just one dollar in fee so go to exodus.com epicenter and check out their wallet we want to thank exodus for their amazing support of app center
can we quickly talk about what mev is very practically so basically um i mean phil you already said that it has to do with ordering transactions and sandwiching your own transactions and so on can you give an example yeah i can talk a bit about practically the kinds of mev that we've been seeing so mev source stands for minor extractable value but we've been pushing to re rename the the term to maximal extractable value and as phil mentioned it's just any value that can be extracted from the right of ordering transactions and selecting which transactions get included in the block so this exists with miners today but
exists with valid errors in any proof of stake system and with sequencers and any layer 2 system so the idea is typically these uh the incentive for for miners on ethereum is to just order by gas price uh all the transactions coming in and and simply place the the transactions in the block and mine them however um there might be some opportunities that exist on chain based on the state so for example an arbitrage opportunity between two decentralized exchanges which might be underpriced by the incoming transactions in the transaction pool and so
there's sort of a clear incentive for a miner in this case to insert a transaction which takes advantage of of this arbitrage opportunity now perhaps a way to think about mev is not as a single concept and and perhaps phil has some more thoughts on my taxonomy for this um i like to think about it as information spheres um so there's sort of realms of mev strategies that are based purely on the state of the blockchain what is the state of all the different smart contracts that are on ethereum and and where the value are and is there a way to send a transaction that's able to redistribute value around that maximize my gains then there's a layer of information above that
which is the transaction pool so knowing all the state of the chain plus the state of the transaction pool is there some reordering of the transactions that i can do to be able to maximize my [Music] my my benefit my revenues then one step above that would be to look at uh third party ecosystems so for example looking at the price of certain assets and how they're trading on centralized exchanges and then comparing that to the decentralized exchanges um so then we quickly get into a situation where mev encompasses essentially all the information in the world and it's it becomes uh who has the belief on what the
most accurate state of the world is and how to represent that on a immutable blockchain to extract the most amount of value possible you asked about specific examples so i think the categories of mev that we see the most we try to label them on a dashboard called mev explorer it's available at explore.flashbots.com and so far we've seen mostly uh arbitrage uh being the largest source of mev activity but other types of strategies have been on the rise so on the one hand we have liquidations which which happen whether
there's sort of a lot of volatility in the market and large drawdowns in price we've seen a lot of white hat type of rescues that are trying to either secure a protocol or or perhaps uh black hat activity that are trying to exploit a protocol and we've also seen more and more uh decentralized exchange sandwiching so using some of the specific mechanics and and decentralized exchanges like uniswap to be able to uh to make a a cut based on the the mechanisms that are used for um for allowing variable pricing in the quoting
mechanisms um so these are all strategies that honestly change on a daily if not weekly basis so another interesting sort of thread of stories and i recommend you guys follow one of our new product manager robert miller on on twitter he's been putting out really great threads that highlight some of the more uh exotic uh types of mev activity that we've seen uh like uh certain mev bots turning e uh uh evil against other mev bots and trying to attack them for uh for for profit so it changes yeah on a daily basis a weekly basis and
there's always some really interesting uh stories to follow uh in this space yeah to kind of expand on that a little bit uh i i think mev is something that's really fundamental to permissionless systems to get a little bit more philosophical about it um what we're trying to build here is systems that that people can audit that are auditable cryptographically without requiring trust uh in certain third parties and kind of minimizing the trust assumptions that uh that we use and making as many of those trust assumptions kind of automated and easy to audit and verify as possible so that being the philosophical goal and us wanting this concept of decentralization where people all over the world contribute to outcomes and
have a voice there's kind of going to be this natural value distribution among all the possible outcomes of the system right so like whether i get mine before stephon or vice versa that all the possible kind of inputs that all these people have into the system and the related output that comes from combining their inputs has value to kind of everyone in the world as these systems grow so so what's new in these systems is kind of the ability to condition payments based on this fact in a really efficient way that again requires no additional trust assumptions which means fundamentally the security of these systems and this is something vitalik really explored a lot in like 2017 2018 when he was trying to create a framework for how to secure
ethereum ethereum from like a theoretical point of view um the security of a lot of these systems has to be done in a bribery kind of model and while bribery is a dirty word all that really means is that people can really efficiently condition payment on preferences in a way that kind of structurally doesn't really care about necessarily the moral implications of that and we want to use that infrastructure to build systems that are fair for users and build systems that are better than existing financial systems anyway so mev kind of comes from this ability for validators to to kind of have different economic values of their different choices in the systems and it as stefan says it happens in proof-of-work systems i recommend the
paper flashboys 2.0 which was kind of the paper that defined mev it does a deep dive into the arbitrage and decentralized exchange case of mev but as these systems grow mev is kind of everywhere in all of their operations and anywhere different people might prefer different outcomes not only that but it's also fundamental to how a lot of these things are built so the reason why uniswap works as an exchange and the reason why it always offers users a market price at any time without requiring a counterparty is because the counterparty is basically all of these bots and all these miners that are being paid and incentivized through systematic rents to do trading activity that brings the price to a market price or to some reasonable margin um and we've set up these activities and and they kind of
execute because they're profitable and that's a fundamental component of why unisop is permissionless right anyone can come in and anyone can arb unit swap back to the mean and anyone can profit from it that introduces robustness more than having a certain permissioned order or a certain sequencer or a certain centralized source of authority the same is true for liquidations so maker dao is a system that tries to build a stable coin with a token that's uh that kind of floats in price with the dollar against ethereum and the way they do this is through debt positions uh that are collateralized by cryptocurrencies and other assets and as the price of these assets changes sometimes this debt needs to be repossessed in a liquidation event and this collateral needs to be sold to maintain
the stability of the system if that process fails the system collapses so that process is fundamental to the goal of this system now the question is how do we decentralize this process so everyone has input well that's very hard to do without economic incentives and then that's very hard to do without creating this preference distribution over these economic incentives and therefore this value that comes from these validators and which kind of input they provide to the system and this value is kind of where flashbots is focused especially in ethereum today how do miners kind of interact with this value and how does this value flow in the system and it's a very complex space and and there are many many different types basically any kind of smart contract has mev
so i encourage all users and app developers like think very carefully where is the mev in my transaction in my system in whatever i'm interacting with [Music] you know most people book flights on travel aggregators to get more options and the best prices for the travel plans so when you're making d5 swaps use pair swap it beats market prices across all major dexes and thanks to their network of professional market makers you'll get zero slippage on your trades they just pushed a huge update that's even faster and more liquid thanks to a brand new algorithm it's cheaper than uniswap and it comes with a new gas token that cuts your gas fees by up to fifty percent it's no wonder metamask argent
and monolith all rely on the periswap api so give parasop a try at pairswap.io epicenter this url allows you to claim a 50 refund on gas fees for your first swap of at least one eth this offer is available until may 1 2021 and refunds will be made every friday starting april 9th we'd like to thank paraswap for their support of epicenter so would it be fair to define like mev as this sort of edge that miners have in this like value game because they don't play by the same rules as everyone else exactly yeah so miners are in somewhat of a of a privileged position if you want to call it that i don't i think that word is
like legally and trust loaded so maybe not the best one but they're in an advantage position to take advantage of this and that's why it's called minor extractable value right so a lot of people are confused they're like oh there are bots extracting this value the miners are not playing this game uh we have a leaderless protocol there are no miners all these kind of gut reactions to mev the reason that it's called minor extractable value is because in proof proof-of-work blockchains the miners are in the ultimate position to have the ultimate advantage so in the game theoretic long-term equilibrium it's the miners who are able to extract the value right any permissionless value is best extracted by the miners because the miners can do any permissionless stuff from a better vantage point than the users so that's why even if today bots are are
taking it or it's being left on the table or it's a hack no one's discovered it's still value that is able to be extracted by miners and it's still relevant to things like the consensus metagame and the blockchain network security and the properties users are getting from their protocols and how we designed apps and how dapps interact with each other so all these kind of follow from from viewing mev in this framework and thinking through that to its logical conclusion this is super fascinating and um i think we'll dive into the moral consequences of mev in in just a bit but maybe let's take it from the top maybe let's talk about how exactly it actually works so you said that eighty percent of the miners currently run the flash spots the flashbacks of the geth client i
think is probably the the right way to put this so can you tell us about um the ethereum client that you and what exactly it does differently than the uh the regular guest client sure i can get into that so basically flashbots built the system called mev geth which is a patch on top of geth and really what we did was write a reference implementation and each miner actually uh builds their own version of it and we sort of entered a level of sophistication on the minor side where all these these companies have teams of developers in-house that build custom infrastructure
um and so it's very difficult for them to introduce any sort of third-party code uh that's not a core guest code and they'd prefer just write the the the code themselves in many cases um so we essentially published a reference uh implementation for a patch on top of geth that opens a uh a new rpc or a new communication channel for um third parties to submit uh arrays of transactions instead of only being able to submit a single transaction then um inside of the um the death note itself um we uh created a a a new worker um so workers are the um are essentially parts of the the node
they're in charge of producing blocks and validating blocks um and and determining um how much value those those blocks um uh contain so by creating a new worker what we've been able to do is uh uh in parallel create both a regular block as well as a block that contains some of these arrays of transactions that are submitted from from the the flash bots network these arrays of transactions all compete against each other for being included at the top of this new block um so instead of relying on gas price and competing in the memory pool
basically what we're saying is we're replacing the typical gas auction for um that orders by gas price with a new auction which um evaluates the value of each of the bundles and only includes the best one at the top of the block um one of the core properties that this uh this new approach gives us is um users no longer have to pay for reverted transactions um and so this saves a lot of the space that is used by pga bot operators that try to aim for an opportunity but get beat to it that's all block space that can be
re-reused for other types of transactions in the network so to summarize basically mevgeth a patch on top of gas it's a new communication channel which allows for submitting transactions directly to the miner in a private fashion and removes any sort of reverted transactions from uh from the ethereum blockchain and so who who submits the transactions or the ordering of the transactions to the miner can anyone do that so right now we're in the alpha stage of the system so we have some technical limitations around privacy and spam protection that
have to be mitigated through uh trusted uh relay operators so flashbots operates a really that collects uh bundles as we call them arrays of transactions from a network of of different participants these uh these participants we call them searchers and they really are just any ethereum user that wants to for whatever reason communicate their transactions directly to the miner and sidestep the the typical mempool so these can be existing bot operators who are doing arbitrage or liquidations but they can also be regular users who are looking to get their transactions included in the ethereum blockchain without being front
run so without anyone else in the network seeing their transactions in the pending transaction pool so once they submit those transactions to a relayer the relay is able to validate them and and forward them over to uh to the miners and then um what happens then so basically the the miners then get these private orderings and private transactions and how how do they decide what to include in which block sure so they evaluate all the different transactions uh and they look at both the gas price as well as the direct transfers of eth to the coinbase um and they essentially do the sealed bid
auction so without anyone in any of the submitters knowing what is the value of the other bundles that they're being compared against the miner just picks the most uh profitable bundle and includes at the top of the next block and how is the searcher then compensated for this so the searcher is actually the one that defines the price that they're willing to pay to the minor so phil mentioned the concept of a bribe and and that's very much so the equivalent of a fee payment for regular transactions as a searcher what i have to do is i see an arbitrage opportunity or any other opportunity on chain
and i determine how much that opportunity is worth to me then i have to determine how much of that value i'm willing to transfer to the minor to to bid for inclusion in in the block that i want so the payment is conditional on how much the how valuable that opportunity is to the searcher as well as how much competition there is for that opportunity [Music] let's get to our sponsor solana now this is a special ad for me to read because i've been a deep supporter of this project since meeting the solana team back in 2018 i invest personally in the project
and my company course one is super deeply involved in the solana ecosystem including running the biggest validator so what's so cool about solana well we all know that scalability is the single most important issue facing the blockchain industry today and the solana blockchain is an amazing solution for it the network supports thousands of transactions per second with 400 millisecond block times and over 500 validators the special thing about solana is also that it's not a chartered blockchain it's a single blockchain hyper optimized for performance so that makes it really easy to maintain composability between all of the apps on solana so that they work together seamlessly now and forever the solano ecosystem is
growing at a rapid pace and it's a great place to build your project or just get involved with the community so go to solana.com epicenter to learn more so stefan um how how do i would assume that the opportunities are fairly standard and what will kind of find them by just looking at transactions in the mempool so i would assume that different participants kind of find the same opportunities so how do you how do you prevent them from grim triggering each other yeah great question so there's i think a very very very extremely large set of types of opportunities um we have this this nice
graph i think that we put out in our our february transparency report by the way uh you know because we want to make sure we are aligned with the community we publish sort of on a monthly basis or as much as we're capable to stick to that schedule um reports on the the state of the network um and and we're always looking for feedback and and questions uh for how we can improve the transparency of the system so in the fairway transparency report we have this graph that shows um the theoretical um mev uh which is sort of this large circle um the current mev that gets extracted which is a somewhat smaller circle and the mev that we've been able to to map
using with mev explorer as an even smaller circle so the the point that this chart aims to make is that mev strategies is extremely broad um and is defined by the complexity of all the different possible combinations of smart contracts that you have on chain and uh what is the most complex set of interactions that you can have to be able to extract the most value so under this framework an arbitrage and a liquidation are very simple interactions right that only target maybe one or two protocol but you could have mv opportunities that span hundreds of different protocols i think in the typical
financial markets right there was a lot of concerns that too many exchanges would create too much arbitrage opportunities and we were looking at like 10 exchanges or like 15 exchanges but then you go into a a permissionless system like ethereum and anyone can fork uniswap and and create a new exchange out of it so you feasibly have thousands if not hundreds of thousands of different exchanges with arbitrage opportunities between all of them so it becomes extremely computationally complex and and computationally demanding to be able to identify uh what the optimal extraction value is and so there's a lot of room for competition and specialization um now that being said there are very
simple strategies so uh the uh uniswap sandwiches or the uni-swapped sushi swap arbitrage are very uh simple strategies and we've actually published a an open sourced uh trading strategy for uniswap to sushi swap arbitrage and we've seen really interestingly over time right the percentage of the value being transferred to the minor being bid up towards nearly 100 for the miner so this is something that we expect to keep uh happening where um whoever does the most amount of research upfront and discovers quote-unquote new alpha is
able to extract it for a very uh little fee right is able to keep most of the value but over time as other searchers are become aware of of this alpha and the alpha leaks we expect the value to transfer to the minor to be gradually bid up to 100 which is sort of this this grim trigger that you're speaking of so the end results for a lot of the very simple strategies will be to have the full um the full payment being sent to uh to the miners but this might change uh depending on the complexity of the strategies so the speed of the alpha decay may uh will will be strategy specific so hopefully that
gives some some insights on how these different uh strategies evolve over time yeah and it's also worth noting that i think this is the best for all ecosystem participants so as we mentioned our goal is to align incentives i think it's inevitable that miners will extract most simple mev because if we build any system where that's not the case they will build their own bots and they will run their own bots and they will extract the mev because it's more profitable so we actually want it to be the case that mev that's kind of well known in the community is fully extracted efficiently by the miners and all the profit goes to miners that's actually the best for consensus security too it turns mev into the most predictable and stable form of minor fee that that helps rather than hurts potentially network security in some cases
so that's kind of the best case scenario for those simple opportunities we want kind of an efficient engine that at all times is sending as much profit to the miner which is naturally what's going to happen when either you have a lot of bots competing and margins go really low or the opportunity is simple enough that miners actually run their own bots that send all the profit to themselves so when they mine their own blocks they'll kind of make all that money and when other people mind their blocks they'll also kind of be in that competitive landscape so we're not against that kind of participant participation either we want to make sure that even from a minor point of view if they are kind of tempted to develop mev infrastructure they're incentivized to do that in an open permissionless decentralized way as well so that's kind of how we think about uh
incentives of course we also want to incentivize a robust decentralized network of worldwide participants and smart people who are thinking about what is the latest mev and like how do we optimize things if we don't have that it'll actually open all our defy systems up to attack right because any group of smart people like that can then come in and kind of wreak havoc on the entire system so we want to incentivize people to constantly be at that bleeding edge and we think that the the flash bots kind of decentralized searcher competition model at first when there's not that much competition pushes people towards that bleeding edge where all the profit is it incentivizes development of new strategies and a more robust infrastructure and over time that infrastructure kind of gets naturally folded into the open
source and into the kind of uh corpus of mev strategies that's efficiently going to the miner and subsidizing network security so that's kind of how we view uh the incentive landscape playing out in kind of the short to medium term you mentioned that it it's part of it is the it's the most predictable so i agree with a lot of what you said but i don't understand why you think it's the most predictable isn't it actually perhaps one of the most unpredictable uh forms of like minor incentivization where like you know something like block rewards is actually what's you know probably the most predictable and then something like eip 1559 fees are like you know probably more predictable like this seems very unpredictable
because you actually have no idea of like really knowing what the mev on a chain is yeah so mev is inherently less predictable than these things i really meant predictable like from the perspective of mev uh like if you have some blocks where you're extracting 100 of mev and sunblocks where you're extracting 10 of mev depending on the miner i consider that like a less predictable ecosystem than like every single block has 85 percent of available mev um kind of extracted so within the mev infrastructure it also depends how various participants are kind of extracting it where that value is going and how efficiently kind of what's being left on the table is being collected rather than being left to accumulate and fueling kind of more variance and more unpredictability in the system
so what's stopping the miners from just using the information given by the searchers on how to order things in an optimal fashion um and just using that without without paying anything sure so it's really interesting right because miners have this privileged position they would be able technically to front run any arbitrary transaction that uh that gets sent sent to them and one of the challenges that we that we wanted to solve is that we saw a mounting incentive for miners to do so especially as transaction fees could potentially go down as e2 sort of looming around the corner the
incentive for miners to become active participant in this mev extraction becomes greater and greater the best way to mitigate that is to create an efficient auction mechanism that makes sure that the miners are sort of fairly compensated for the opportunities and and have minimal incentive to perform the extraction themselves now within the flashbot system itself there's still some risk of the miner being able to front run the uh the flash boss bundles as they're coming in because at this point in time in the um in the flashbacks alpha it essentially relies on trust and guiding principles to ensure that the system is operating
in a in a stable and fair fashion over time what we want to do is develop some cryptographic uh approaches um that provide the same guarantees uh but without the aspect of trust um so basically what's required for um mev extraction to become completely trustless is a private uh transaction pool where a user of ethereum can communicate a certain set of preferences on transactions and and their order uh their ordering to a um to a minor without the minor having any idea what is the content of the transactions until they are mined in the chain um and at that point it becomes economically
infeasible for um for the miner to uh to to extract it um so there's a number of different approaches to achieving this um some of them use commit reveal uh systems um but some other ones uh use uh sort of purely you could say off chain or or or transaction pool uh encryption to be able to uh to achieve these properties now why aren't why aren't miners doing it today if this is still something that's actively being researched um i think miners uh are very smart and they they um they are actually trying to minimize the amount of uh risk that they pose to their business and they see that uh being compatible with uh uh with a healthy ecosystem for mbv extraction
is actually long-term beneficial to to them um so if they are found to be front-running the transactions of their users users can quite easily decide no longer to send transactions to these miners and instead point transactions to those that operate in a more fair fashion um so there exists some economic reasons why uh miners sort of behave in the way that they do today i know one of the solutions you guys were exploring is this like sgx based solution to do this uh hidden mempool how's like the progress on that and what are other cryptographic solutions you've like considered sure so sunny actually came on and and did an
mev roast uh with us so mev rose are community calls that we have at a regular interval and uh we invite uh great minds in the space to to come host them and and present uh some of the core challenges around mev and what is the potential solution space and i think that's a really interesting uh video to go watch for what are the different alternatives to memphis level privacy um so the one that we're the most excited about right now and the one that we're exploring um is based on an sgx primitive uh that essentially uh performs the validation of transactions on uh the user side in order to mitigate some of uh the concerns that we
have for privacy and and spam protection um the reason why we think sjx is a good solution is it's backwards compatible with ethereum as it functions today without having without requiring any consensus level change and it's also highly it has good latency properties so it doesn't introduce uh unnecessary uh computation that would prohibit some of the more time-sensitive use cases like like arbitrage we'll be releasing a design for uh this mev-sgx approach um very very soon and we encourage community feedback so um we are at sort of the stage of the proof
of concept in uh and determining if this is a viable path forward um i think another interesting approach that has a lot of merit and could be implemented on ethereum is a crypto economic one so instead of having some sort of cryptographic guarantees on privacy um you would have some economic guarantees where the the entities or the searchers that are requesting for block space would be economically bounded for the block space that they're targeting and if they submit invalid requests to the miners they would have to have some kind of slashing mechanism that punishes them for
uh submitting invalid requests um so this is another uh promising path forward um it's not the one that we're exploring immediately and that's because we think that a purely cryptographic one will always be strictly superior to an economic one but it's one that we may we may explore and further in the future if the sgx based approach seems less promising so currently does does flashbots actually increase minor site centralization because basically it um it creates a barrier to entry for anyone new who's not part of the flashbots branch you could frame it that way but i think
it also decreases uh minor centralization by letting people be part of the flashbots uh kind of boat and profit the same as everyone else who's in the flashbots boat proportional to their hash power uh so i think muv really is best and works most efficiently when miners and validators have access to value in proportion to their input their economic input into the network um in kind of a linear way so if you have 10 of the hash power you make about 10 of mev revenue if you have forty percent you make about forty percent that just works the best from kind of a system stability and economic analysis uh perspective what you really don't want is kind of a super linear function where if you have ten percent of the hash power you make five percent of the mev if you have forty percent of the hash
power you make eighty percent of the mev uh you don't want that because that's an enormous upward centralization pressure it's a direct economy of scale and it kind of works against decentralization in many ways um so the goal of flashbots is to keep that curve linear and keep the barrier barrier of entry low um so we are kind of introducing centralization towards this social uh barrier to entry we we basically are kind of uh you know admitting people on the minor side manually into the flashbots network because there is such a trust based component and because we're still building out and testing so many different aspects of the system that's not the ultimate goal and we know we can build something that's not that that has much better decentralization properties and doesn't rely on any central actor or
third party and that is kind of the long-term goal that being said mev is already a centralizing force so because we have so many competitors when flashbot started that curve that we want to be linear was already moving into that super linear mode and we were already seeing larger larger miners and larger pools that had the engineering resources to do so start to both run their own mev bots internally as well as to offer products to people who are running meb bots that were tailored to their bots and tailored to their operation so that was already kind of driving the curve away from linear i think flashbots has flattened that a lot yes at the expense of kind of this momentary faith that uh we will be good actors and that we will decentralize things
and that we will be able to kind of maintain this equilibrium and this balance uh between all these miners to kind of keep this uh keep this curve flat for as long as possible and i think that's to the benefit of all miners and everyone in the ecosystem so how are you looking to decentralize this in the future and what's the time scale on that so i'm not going to start like an e2 meme of trying to define what the time scale for for releasing these hard research questions are but i will say um the the path is is quite clear um it is about uh replacing these these trust guarantees for um for privacy and um and and spam protection um into uh cryptographic guarantees um
and once we're able to uh to do that either cryptographic or crypto economic um and once we're able to do that basically we can set up the network in such a way that it's um it's uh fully uh decentralized um so for what it's worth right we we are actively researching this internally but we're also doing a lot of uh research with third parties and issuing grants to help move forward the different approaches to to uh to transaction pool privacy so if this is a hard problem that you're looking to to work on and interested in contributing to you should definitely reach out to our our research uh team and and and participate in those discussions
so two questions i have about the architecture before maybe we move on to some of more into the mev but um the first is like i guess you could say one of the things that changed here and why this does like you know the the current gas prices on ethereum have dropped you know probably significantly because of flashbacks is the reason this works is because you know the the bribe the fee being paid to minors is not done until after the transaction executes and is successful and this is you know what like you mentioned preventing all these reverted transactions from happening and meanwhile in normal ethereum transactions the the gas fee is paid regardless of successfulness of the
transaction but that's done for a reason in order to prevent spam attacks right like what doesn't this open up a large spam uh vector on flashbox if like the miner doesn't get paid until they execute the transaction and find out that you know if i just spam them with a bunch of transactions that fail they have to execute them to figure out that they fail and realize they don't get paid correct um so that's sort of the trade-off that's being made when you think about privacy is you need a way to validate that the transactions that you're receiving is is a valid one the way that the regular transaction pool does this right is essentially every single node in the network does its part in doing spam protection
so when a node receives a regular transaction it sees the full content of it and is able to uh assert that the account sending it is able to pay for uh the uh amount of gas it requests and has the amount of value sort of on hand um and it like you said it does pay that through um through reverts now by uh creating both a private channel for communication and keeping the reverts off the chain um it uh creates a additional burden on the miners to be able to validate the fire hose of transactions that they'll potentially be receiving so in the short term during the flashback alpha and possibly the beta as well
the solution to that is to have highly scalable relays that are able to do that simulation work by essentially just throwing hardware at the problem and and protect miners from our mining nodes from from that kind of workload in the fully decentralized version either some cryptographic proof or crypto economic bonding would be able to mitigate the the spam factors how would a crypto economic bonding work here because it isn't the challenge that the sender doesn't know whether their transaction will succeed or not yeah so basically what you'd have is uh at a high level again these aren't these aren't designs that are fully thought out
so but at a high level what you need is for the miners to be able to sort of submit a proof that the request made by the searcher was invalid and for that proof to be able to unlock or slash the bonded value of the searcher so obviously those proofs aren't specified and how they actually settle and on uh sort of which layer in which chain they settle is not specified uh but so that's the the sort of high level architectural design that would be required the other question i wanted to talk about as well is how does flashbacks deal with reorgs so you know once a you know ethereum
doesn't have like this like finality that like you know other chains that some other chains have and so like once a transaction is published in a block it's wide widely available what's to prevent another miner from like purposefully reorg that transaction because now that data is already available and they can you know profit off of that i'd say in the spirit of incentive alignment what really stops miners is long-term incentive alignment um you are right it is kind of immediately economically viable in the short term to kind of fight over mev there's kind of two things in the metagame that i think work against this number one and no one's really studied this or formalized it but there's probably some sort of
competitive game between miners that if they're all trying to orphan each other and attack each other for mev uh the profitability of this activity kind of reduces drastically because if they're all ignoring each other they each have kind of success that's proportional to their hash power anyway which is the same probability they would have had of capturing that original opportunity um so in that way it's kind of not it is marginally beneficial to kind of go down that short term uh kind of path in the same way as as like a prisoner's dilemma but for the ecosystem i'd say it's long-term even even less beneficial and not only does it cause instability it erodes kind of the long-term value and it reduces the amount that's like even in the medium term on the table for miners
so economically if there's any stickiness in kind of their hash power investment and their infrastructure and their loyalty to the network or any kind of thing like this they kind of have an incentive to not grief each other and not really degrade service for users and not collapse the mev market in doing so that being said this is kind of a viable attack factor and it's about a viable thing especially if maybe a miner is desperate and they're willing to try some kind of short-term tricks to get out of a hole or some other kind of desperate situation so it is in the long term one that we are thinking about on the research side and that we want to mitigate i don't think it's unique to flashbacks i think mev just introduces this incentive in general in fact that's why we originally defined mev to kind of study
how much incentive there was for reorgs at the consensus level um that being said i do think it's like very important to to come up with mechanisms that formalize this metagame and harmonize these incentives and make sure that there's kind of direct economic incentives for long-term stability as well as indirect incentives and metagame incentives yeah it'll be super interesting to see whether this actually happens because i think um i mean in the short term being the loan defector obviously pays so whether the long term viability of the ecosystem or the long-term flourishing of the ecosystem is good enough a reason against this i'm not sure so i
i guess we'll have to see how this plays out i think a lot of things though are relying on their altruism and are relying on these diffuse incentives right like miners could easily and not that i'm trying to make this alternative uh happen by vocalizing it but like their incentives are not to mind beacon chain transactions in like the margin unless they kind of believe someone else may mine it for like metagame reasons but if they all were acting kind of rationally and colluding through this informal channel even if not directly they would probably not include beacon chain transactions and try to degrade doing things like staking ethan try to mess with this transition in more active ways and try to you know extract as much value as they can while they still can i think miners first of all mine many
other currencies so they have reputation that goes beyond just eth and they have plays that go beyond just eath and second of all i do think that even for people who mind just eat that messing with the system is not likely to be long-term more profitable than participating for anyone who has a significant stake but that is it it remains to be seen like you said cool so this is super interesting i i'd like to kind of move on to the legality and morality of this though um so um arie jewish wrote an article a couple of weeks ago in uh coindesk i think and it was titled front running as a services left and it had this allegory about
the police force of a city um that i would actually kind of like to to quote because it is pithy in many ways so he writes as a suggestion how to see this in real life or parallel in in real life so he writes we'd like to announce a great new idea we've devised free from the police today cities direct their police forces through to prevent and prosecute theft but crime is a tough problem and policing is costly what cities should do and instead is auction off the right to mug people and burglarize homes sure burglaries would become more professional to take advantage of any vulnerable property but on the bright side cities can use theft auction money to pay city workers
salaries offset short falls in tax revenue and fund new policing initiatives including prosecution of unauthorized theft so how how would you guys respond to the assertion that you're kind of institutionalizing exploiting the users yeah you know i think that's a very common gut reaction to things we're doing and one we almost try to bring out in people because it generates interesting and deep moral discussion that we really welcome and embrace here at flashbots ari is my phd advisor obviously he's like a long time collaborator and friend i've talked for many thousands of hours with him on mev i think we have our respective opinions
and our respective positions and conclusions that we both have derived from first principles and we both feel strongly about and we both just like differ on some axioms and some some kind of uh philosophical and kind of qualitative opinions on the world uh that is all to say like i think our viewpoints differ less than is expressed by him you know kind of characterizing flashbots in this way uh and i like to think that that was kind of an attempt at lighthearted trolling to get people in the community to engage these issues and to point them out as serious and you know we we do plan on continuing that threat of discussion in our rose obviously i don't think flashbacks is very similar to theft um i i think you know theft is a very kind of emotional word it kind of relates to using force to
overpower someone's personal property um i don't think flashbots uses force uh we publish code um and i don't think we erode people's personal property in that way like i think if by running if by writing a hundred line very obvious that was kind of being developed anyway patched together and releasing it to minors and saying like here look at what we wrote if that leads to widespread theft and burglary of people's cryptocurrency balances then the experiment has failed and it was never going to succeed because such a weak attack such a small expression of existing incentives was able to lead to loss of value that being said i don't think it's the case like i don't think the real security of value in
cryptocurrency really relies on miners i think there's a number of articles uh going back since i've been in the space debating who really has this power is it the users is it the node operators is it the miners who is responsible for enforcing norms and for enforcing value it's a complex question and the answer is like probably all these parties but ultimately the users and mev does not rob users of control it just changes the landscape in which they're expressing transactions to a more kind of efficient machine that yes may be worse for them when they use certain mechanisms in outcome certainly mechanisms that were not designed to handle this and certainly mechanisms which would be insecure if you kind of left all their mev on the table things like unit swap and like maker dow
that being said i don't think a user using these things in the flashbot's world is getting robbed um i use uniswap all the time you know you can look up my cryptocurrency address i'm very public about it i always have been i use unit swap i use makerdao i use systems that have mev in them and over time and in doing a lot of thinking about these issues and using these systems you realize that really the truth is more complicated than any single gut reaction to what kind of activity looks like or what behavior looks like in the space from a cursory glance is and so i have a very detailed response to kind of those claims and kind of my philosophical argument for for why we need to extract mev and what we should do about it on my blog it's called mev what do it's also on my
twitter uh if you're interested i i encourage you to read that the basic premise is that we're trying to build systems that are economically secure and without extracting mev and without aligning these incentives that's not possible and the cryptocurrency experiment has already failed and so so yeah we do have some philosophical distance differences on this on this kind of point um and on kind of what the best solution is and on how powerful fair protocols are and things like that i encourage people to get into the weeds and to engage us in this conversation but i also encourage people not to kind of go with their first emotional reaction and to let that guide them and to kind of keep that and use it to engage these questions but also kind of engage these questions on
an intellectual level and look at the resources we're putting out and kind of all the thinking we've been doing because i think nobody in flashbots is looking to make a world where theft is normalized i don't think that's an accurate characterization of anyone who's building in the mev space in any organization really uh except maybe on the fringes i'd like to engage with it now then if possible and so it's like you know in your in your blog post like you mentioned that you think mev is unavoidable what i like i don't understand why you think that's the case i guess like for me like the larger thing for me is that like you know it seems that meb
has like all these like negative side effects uh such as a consensus instability these pgas uh like price spikes but then it also like you know i think there's negative impact of the like of the mpv extraction itself not like a externality but it's like you know the entire the term itself is has the word extractable right you know you're clearly extracting something from someone and you know i feel like the flashbox architecture does a really good job at like helping solve some of these externalities but it's not really like doing much to reduce mev at all and like itself and like you know like phil you mentioned at the
beginning like you know you started down this journey with like you know thinking about what makes a secure exchange and like you know making sure everyone has like this like fair pricing and all this kind of stuff but i mean does flashbacks really help solve that i'd say yes and no um so you're right i did start down that rabbit hole and that rabbit hole led me into things like batch auctions it led me into things like traditional financial research uh you know uh papers like eric buddish's uh you know hft's unfairness will the market fix the market which i highly recommend to anyone who's just getting into the tech space or into the market design space uh it led me into like a number of conversations with people at exchanges all around the world on how they viewed
fairness and what their market requirements are it led me to very deep and very long conversations with projects like uniswap and other dexes in the space pretty much all dexes in the space i think have been like yelled at by me at some point or indirectly or directly um so this is a something i feel very passionate about um and and i agree that me v geth itself as a product does not speak to this question that being said i think i i drew two conclusions in my journey of like really trying to show fairness and trying to get batching and get mpc uh and get all these designs that we're now seeing coming out now that mev is accelerating into the mainstream like two years ago right uh and my conclusion is that like some people
like the idea of these dexes but there are ux trade-offs involved in all these mitigations and the ux trade-offs make the systems more complex more often than not so my my thesis following that and like trying to get these projects to adopt fairness even ones that i advised right we we spent some time at at various decks it's like thinking through like how can we combine liquidity from like fair and unfair protocols what does this even mean right and this led me kind of down market design rabbit holes things like why don't batch auctions dominate the world of finance why do we still use continuous limit technology is it really just political inertia or do certain classes of users prefer these market designs is it really just political inertia or
is it possible that this kind of mathematical analysis of fairness in these papers uh is making kind of modeling assumptions which aren't exactly borne out in the real world or there's some kind of misalignment when you combine these systems with other designs or run multiple versions of this single system in parallel that just escapes the on paper analysis so in trying to study these problems i literally went crazy like no joke um i encourage anyone to try and like maybe you'll be better than me at it but my conclusion is that like the design space is infinite and there is a lot we can do to reduce mev and there's a lot we can do for concrete fairness gains right stopping users from being brutally sandwiched or like screwed for like multiple percentage points there's a lot of low hanging fruit there and there's a lot of market designs
uh that are possible in that trade-off space that being said this concept that like we can just promote one solution or that any solution will kind of encompass and bring all mev to zero is not something i view as a realistic outcome anymore something like uniswap where the ux is that you want a trade to be able to be executed in the middle of any function call there's inherent reasons that introduces mev right because you don't want to know what trade you're going to do before the transaction is mined that's the whole point of that ux that being said if you don't know what trade that you're going to make before the transaction is mined you're handing control to the miner to choose that for you and maybe you want to do that in some cases certainly we've seen many many types of bots that do
that every single day on ethereum so that is all to say like i think there's a lot of potential in reducing mev and exploring new more fair market designs especially for different use cases like that's one thing i concluded in my kind of traditional exploration and talking to different exchanges for different products futures exchanges derivative exchanges securities exchanges commodity exchanges they all have different designs they have different rules different pathologies different actors with different trade-off preferences different time horizons different regulating agencies different requirements and i expect the same to be true across fairness protocols i expect the same to be true across any kind of mev mitigation that's not to say these things are useful and that they won't help but i don't personally have faith and i'm open to being challenged on this
but i don't have personally faith that any of this is a silver bullet that reduces me be to zero especially because mev as maximal extractable value really cares about what happens when all your assumptions break and when the only thing that matters is like the brutal reality of the optionality of your decentralized participants and their incentives and in those ecosystems fair market assumptions break down and any kind of bootstrapping assumptions you might make to try to reduce mep also break down and so i think there's a lot of space in the ux for space for mev and a lot of it i i do personally think is fundamental and i encourage people to kind of read my blog post on that if they want more detailed and kind of textualized uh arguments for that but at a high level i really do believe
that uh we can reduce mev and and we want to reduce mv at flash bots that's an open research challenge we're funding something we're working on internally we're thinking about whether to do that at the dap layer we're thinking about whether to do that at l2 we're working with companies like optimism and other kind of mev actors in the space so we're doing a lot of work to try to think through fairness protocols and we're open to working with anyone in the space on that so please reach out have you guys thought at all about you know if you're building this like sort of private mempool using the sgx solution it's you know instead of using it as an mev for mev searchers like why not just open like try or it's more of a positioning thing right anyone can go ahead and
push to this private mempool are you gonna like try to promote like all ethereum users to like push to a private mempool so that way like that that kind of helps solve you know a large amount of the mvp especially at least a large amount of the extractable mev like the one that the amount that's being extracted from users yeah i think that's a really good point um and actually one that is like vastly under recognized um i think the interesting thing about mev is like who is it serving like especially private transaction pool um who is actually going to be willing to pay for like the development of it and and who are the like number one users but is there a way to convert the work that's being done for the for for these entities
and to work that benefits uh the broad population um i think that's generally the the answer to that question is yes um so while flashbots is designed to be incentive compatible for uh all uh sort of parties in the mev game to to utilize um it also opens up a channel for regular users to send their transactions uh and in a way that's protected from any sort of front running now this gets into uh quite a deep sort of requirement of analysis on what are the types of transactions that are going on on ethereum and what do these transactions care about so i think this is quite actually a useful framework for thinking about
the future of ethereum transactions post eip 1559 as well there are some types of transactions that are just inherently more vulnerable to being reordered uh than others for example right a uniswap trade highly sensitive to reordering but a cryptokitty transfer is a relatively low sensitivity to reordering and so these two different transactions and the users that send these transactions care about very different properties right perhaps the uh uniswap trader cares about fastest possible execution and for their execution to sort of be private and for no one to manipulate them
whereas maybe the cryptokitty transfer care mostly about censorship resistance and making sure that their transaction is or propagated through the network and they know for sure that it's going to be mined and there's no sort of intermediary that that can interfere with that i think what we're going to see is different types of transactions will be routed through different networks to be able to reach the miners who ultimately include them on the chain um so these more inclusion transaction i call them the cryptokitty transactions are likely to continue using the uh typical transaction pool and and it will meet their requirements much better under eip 1559 you know they'll probably also get a a
better ux from more stable base fee payments and it's unlikely that they would have to pay a significant amount of tip to be included whereas there's these other transactions the the uniswap trades or the arbitrage transactions that that i refer to as priority transactions these transactions are much more sensitive and likely that the user sending them is willing to pay a lot more for them to be included where they want in in the in the block space so um by pushing these uh out of the transaction pool there's sort of a number of different uh advantages that it causes for everyone else in the network
one of them is that it removes a lot of the variance and transaction fees that we've been seeing lately and it makes inclusion transactions generally more predictable and how much it will cost and the second one is that it provides a channel for competition uh uh of of inclusion to like really tailor itself to the properties that those users provide on uh or care about like do those users who are sending arbitrage transaction do they care about um censorship resistance or do they care about minimal latency and if there's a trade-off in design in the communication channel between them and and miners which one will they prefer
um i think this is where uh having a variety of different solutions that are able to provide different features to various different uh transaction centers becomes particularly interesting well i think one of the other interesting things that you know we learned about like the mev in the last couple months is this whole dark forest thing and this idea of generalized front runners could you like tell us a little bit about what these are and like you know phil you mentioned you had some really fun stories about them i'd love to hear like what are you know some of these wacky situations that we see on on chain yeah i would love to describe it so my journey kind of started i think it was like 2018 or something
like that when i published the ether delta blog post with a bunch of co-authors um uh i think uh if you google etherdelta and my name you'll probably find that piece of uh you know archaeological mev history but basically we'd been running trading bots for some time at that point to kind of validate for ourselves are these real economic flaws in the protocols how much power is there in transaction ordering and can it really be profitable for miners and can it really be profitable for bots through the memphis who aren't directly colluding with miners so those are kind of the questions that that blog post set out to answer through very practical experiments of actually running these spots and measuring our own success rate and pretty early on we noticed that there was a pattern of bot that was
using all sorts of different tricks to kind of profit so there are two kinds of bots that that we noticed very early on one of them was a bot that had a strategy um or an intent that was kind of to extract value in some way and another was a kind of copycat bot which would do a more generalized strategy that was a kind of name that started being introduced for them in blog posts when people started seeing this on chain so early on these generalized strategies were very simple they would be something like every transaction that comes in on the mempool i'm going to run the same transaction with the same data payload and the same contracts and the same everything but i'm just going to replace the sender with myself and if i have more eth at the end of the transaction than at the
beginning then i'm going to calculate how much profit i made let's say 50 and i'm going to fire off this minor auction with like a 50 profit parameter so i'll bid in a certain way depending on like how much profit i get and everything like that so that was kind of the first iteration of bots and there were all sorts of sophisticated techniques even in 2018 we started observing with these bots going back and forth with each other and back and forth with bots that were specifically designed to do certain things a big place people noticed this early was cryptokitties uh birthing because cryptokitty's birthing is very easy to kind of just swap yourself into and make the same amount of money so those kind of early transactions were pretty much always being taken by these copycat bots then people started kind of building protections in to protect against these
bots things like for example when geth simulates uh transactions that aren't in a block yet uh to see whether they're profitable like these front runners would do it might use a simulated value for block hash or it might use a simulated value for the timestamp rather than using the real value and if you condition your transaction flow based on this you can trick these bots into making the wrong transactions that lose them money or into missing transactions that could potentially make them money um and this kind of war back and forth started escalating really really drastically like with etherdelta with 0x with all these early dex protocols um the experience i kind of had with it was i can't really disclose much specifics uh because because they are you know kind of a company in the space
but uh at some point i was called in to help deal with an exploit and this was like about you know six months to a year before the ethereum is a dark forest article came out i'd been kind of dealing with these runners for a while and running bots and like had some experience in like on-chain kind of uh stuff and so i had a company i was advising call me and say look we found a bug in something that we've exposed and like there's kind of this amount of money at stake let's say a straw man five million dollars at stake um and uh and what do we do right and so that's when we started really getting to the hairiness of permissionless systems uh there was an open question of like do we tell people well if we tell people we don't know whose people this money is
it's just random addresses right if the hacker sees this exploit before the people whose money it is the hacker's gonna steal their money and we've contributed to that does that open legal liabilities on our front for like exploiting people's money that are using the network should we instead try to recover it ourselves now that we've found this uh as like the most economically advantageous solution what about the risk that some bot on the mempool or anyone on ethereum will see these transactions especially if they fail and especially if we them up and do something wrong we'll see these exploit attempts because this is a public space and and try to front run and then all the users money will be lost also that way so we spent like two days kind of coding and exploit which was the the eventual decision we went with
uh and adding all sorts of different protections that i could think of for for front-running bots things like doing weird like modular arithmetic on like the block hash exponentiated and like you know just as much as i could think about to use as many inputs as possible and with the idea of tricking their static analysis uh using different contracts different call frames that called each other all things kind of dan described in his article uh we tried to do and then we crossed our fingers and we did all the test net transactions and they all worked and we fired these transactions off to mainnet with 10 million bucks in the mempool and a very high gas price to try to not get mined not get front run and there were four different vulnerable contracts that all had the same code but had different kind of crypto pairs four or five i
don't remember something like that and wait a few seconds to block his mind kind of suspense in everyone's stomach in the war room open the block and of the five transactions we did four of them have the red exclamation point next to them on ether scan which if you run arbots you know that means you up or someone else beats you it's like the last thing you want to see so i was like oh crap we've just lost you know millions of dollars of other people's money ended up not being the case so the r bots got really unlucky they had a bug in their own code it's purely due to a bug they were not able to front run the bulk of the value and actually of our five different transactions they had slightly different interactions with the network so some of them ended up going through some of them
not basically all the money ended up being recovered in like a very lossy stressful process but what really blew me away at that time and it's something i actually wrote a blog post on and never really published it uh but the sophistication really is impressive and in that time period which was about 2018 to 2019 from when i first started dealing with these bots to when this story happened uh like the level of analysis and the level of tooling that was brought was so obviously so much higher that it really speaks to how powerful these incentives are and how robust this ecosystem is so yeah i think that's a cool story and uh you know that's happening on flashbots every day so i'm very excited about that i had i posed a uh philosophical question on twitter
like i think maybe a week or two ago where like if you're running a generalized front runner and you accidentally front run a hack are you like is it ethical to keep the money and the overwhelming answer was like no you're supposed to return it but then you know what if you take it a step further what if you automate the spending of the money as well like what if you know you donated it to get coin and like people like oh okay well you know then the bitcoin people should give it back and i'm like okay fine what if i thought that mev is like you know i'm trying i'm trying to return the value back to ethereum it's something that came from a theorem trying to give it back to ether holder so i take all it convert your eat and burn
the eat and i do this in an automated way so that and now there's like no way for any what if i did this to a hack by accident um is this like ethical and i guess what i'm trying to get at is like is the notion of like inherently automating what you do with money somewhat unethical oh that's a question for vlad so i'd love to hear stefan's ethical perspective on this because i've been talking a lot i will just make a practical point which is that these are all questions that i've like struggled with since we started this in research in the space and that you know in 2018 we were trying to get answers inside cornell from like researchers of like even us running an rbot and measuring how profitable it is that is active intervention that's kind of changing
user outcomes uh in the name of an experiment what should we do with the money should we fund research should we give it back to the users who are front run should we burn it you know uh what if we're not profitable like these are all kind of very heavy moral questions uh that the computer science research and engineering process is very ill-equipped uh to handle um in in across the board in academia in industry everywhere and like that's something i really want to build in flashbots is an organization that's able to robustly tackle in the long term those hard questions super interesting and hard questions i have a i have an easy technical question i guess um so we've we've concentrated on layer one so far so what happens to mev
um on layer two does this is different than layer one mev or is it pretty much the same only in green yeah so for layer twos um i would sort of classify layer twos as a very still undefined uh design space um there's a variety of different approaches to transaction ordering in in those frameworks um but broadly speaking perhaps i can i can give my intuition of how to think about the problem um so mev exists whenever there is some kind of uh ordering and for as long as there's a specific party that has the ability to decide uh the order arbitrarily without any
bounce and that entity is a profit motivated entity and what they're looking for is to generate the most amount of value and so they're rationally incentivized they will have some kind of desire to be maximally extractive so long as it doesn't compromise the system and the guarantees that they provide in in their system so um there's sort of a bounded rationality which is going to be uh how much mev can i extract without losing all my users that's sort of i think the game that a lot of these layer twos or alternative um uh ethereum infrastructures are going to be asking um and so it will be really interesting to see how they tackle this question and and engage with
um uh with answering what what is okay to extract and what is not okay to extract for them and if there's some competition around like providing these various different guarantees that emerges interestingly enough um it's actually much easier to limit the mev extraction in a permissioned uh protocol than in a permission less protocol and so if any of these layer two systems rely on some sort of decentralized approach to sequencing where there's multiple different entities that are able to uh to perform these orders usually that also relies on these entities being profit maximizing and there's some kind of crypto economic incentive for them to play that role these parties can also be expected to
want to extract as much as they possibly can and so there will be sort of a similar dynamic to what we've been seeing and sort of permissionless uh proof-of-work mining uh that that we expect to emerge yeah i mean i have some a lot of thoughts on this as well because you know i've been working on a lot of similar things i mean i i personally think that at l2 i think just because of the amount of flexibility i really like flash watch as like a solution at layer one because i think like the at least ethereum is like very slow moving to upgrade its protocol and like they've made certain design choices that i think like block off the ability to do a lot of like mev reduction
but i think at layer 2 you just have so much more flexibility on your design and like you know just the fact that you can use like finality favoring protocols like tendermint and you can you know you can use like fixed validator sets rather that like you know a you know proof of work and even youth 2.0 wants this like you know more liveness favoring protocol like i think that actually limits you from a lot of things so i i think the muv story on their two is actually going to play out quite differently than uh on base chain ethereum but we'll see how that goes i'm really excited to see how how these systems develop i think we've seen uh definitely a significant amount of interest
in mev both on on eth2 uh proof of stake systems and and uh and layer two systems um the sort of narrative that i think i'm really excited to see if it becomes um more prominent is for uh miners or validator sequencers to subsidize uh essentially all the fees for their users depending on the amount of mev that they expose so you could see a framework where you have a pure mev chain that is completely free to use and users only pay through the exposing some mevu with their interactions um that would be a really interesting chain i think
for uh to have some experiments around i would agree with that and i'm also interested in like the practical comparisons of the different l2 design spaces like arbitrary is trying to use a fair sequencing protocol they're trying to make trust assumptions and see if those trust assumptions can lead to more efficiency for users and if the design trade-offs are worth it optimism is trying to optimize for mev extraction and work with approaches like flashbots and kind of engender similar bot ecosystems in their layer twos so i think in many ways layer twos are like microcosms of the layer one design space these are also all things layer ones can and probably will experiment with i get tagged on twitter
you know at least three times a week of someone who's like here's my l1 protocol it solves mev literally since 2018 at least three times a week so if you've sent me such a message and i didn't reply i apologize it's not because i don't love you it's just because like it's very hard to evaluate all these designs they all have very complex trade-offs the only way to see what will happen is when the rubber meets the road so i think l2 is like a perfect sandbox for that to start happening and i'm very excited to see how those interactions play out on epicenter a couple of weeks ago we had um joey zacker from keeper dao which is a project that kind of allows a group of people or the keeper dow to kind of counteract mvv last night i saw the archer project for
the first time so basically kind of projects that that have grouped around this mev area in kind of trying to counter it in some way or other what are your thoughts on these yeah so i can i can give my perspective here i think it's really interesting uh to see these uh what i would call application level mitigations to mev and i think like this is only the start of the exploration of the various different design patterns that we can do by essentially sandboxing who is able to extract the value from ordering of transactions and redirecting that in various different ways and creating various different financial products
using these cash flows basically the way that i see mev mitigation is there's three potential layers there's the application layer which is where these sort of smart contract based designs are playing there's the transaction pool layer which is where flashbots is playing and then there's the consensus layer which is where a lot of the layer twos and and alternative block chains are playing uh and in trying to insert some kind of uh mitigations and and alternative approaches to to mav i expect the application layer to be where we see a lot of blossoming and experimentation and all kinds of different approaches to creating sandboxes for
for these cash flows so i don't expect these to be able to capture all of the mev that is available on a chain there's just going to be some dynamics where there's some interaction and the interaction space is too large to be able to sandbox everything and so ultimately there will always be some some value that flows back to the ultimate sequencers which which are the miners on on each one cool that's a that's that's a very comprehensive answer so as for your own business model um so i know you guys collected vc money and you're you're collecting another round right now so what what's the flashbacks long-term business model because so far as you said in the beginning you don't
have a token um you're not extracting value yourself so what's the game plan yeah we're like the least interesting vc back company because we don't have a token we don't have a business model and we essentially made zero promises that we will have one anytime soon um and i think that's actually critical for us because what we see ourselves as building is a long-term focused research organization that's tasked with uh trying to answer and solve some of the hardest research questions that the space is faced with and taking such a long-term approach requires all of our stakeholders to be sort of aligned um so our initial capital partner right a
paradigm they sort of we selected them because they both have a proven track record of alignment with the ecosystem they have a very long-term focus and they have a very research-oriented uh team and thesis and so that's that's essentially how we we go about selecting capital partners um and and and bringing them on board to uh to our mission there's uh i think a really interesting approach to thinking about company building which is um it's actually a uh sort of a coordination technology um and it can be used for many different objectives if the core objectives of that organization
is to produce some kind of social good there's nothing that says it can't produce that as well as generate some kind of value for the uh contributors and early backers of that company and i think that's very much so a direction that that we're hoping to go with uh with the organization um so both generate a lot of uh good research build some some really useful products um and and and and create the opportunity for a broad ecosystem of stakeholders to participate in the value we create so what's the plan for flashbacks for the next year or so we'll just keep building um yeah i think you know we started the year with zero hash rate
and now now we're in a very different place and i think as uh as the adoption and ecosystem of mev continues to evolve our sort of roles and responsibilities and and the the stakes that are at play uh continue to increase um we are like extremely focused on building things that aren't reactive but instead take into consideration what we expect the incentives to play out in five to ten years and that continues to be sort of the approach that we take in in solving these problems we think what is the the specific actions what are the specific products and what are the the questions that we need to answer today to be able to make sure that we achieve the the objectives that we have in
in the in the long run um so um you know more practically speaking what are we focused on right now so um some of the questions that we mentioned around sgx um around uh privacy and spam protection are some immediate uh sort of concerns that that uh um we really wanna engage with the community and and and get a whole group of people to help us answer well the way that we sort of think about um our approach to solving these problems is to create the most interesting group for anyone to be working with in the space we sort of see flashbots as being a talent black hole where if your interest in in solving large problems
that have a large impact and have some level of skin in the game and being able to to solve them uh will be will be sort of the the no brainer organization um and so really our focus is continuing to build an organization that's be able to attract these kinds of uh of uh individuals yeah completely echo everything stephan said i think we're entering uh kind of a political minefield and it's only going to accelerate as cryptocurrencies uh increase in value and intensify and become increasingly important to geopolitics and ordinary users and all these kinds of different scenes we have i think a lot of these stories will play out in the mev world
and having an organization that's really focused long term on the ecosystem is super critical and yes we are vc-backed we've been very clear that we don't know what our business model is as stefan said we invite anyone who's listening to this who wants to help us figure it out to come in our discord we're operating as kind of a hacker collective in principles and organization and in how we plug people into our mission our focus right now is kind of solely on solving this this incentive alignment problem that we've identified and our broader agenda is to kind of advance the fairness efficiency and feasibility of cryptocurrency mass adoption from that front i think all of our venture capital partners are extremely
aligned uh we would only consider partners where there was no strong expectation or pressure to profit especially not through certain mechanisms um tokens is a very popular one if anyone's raised vc and crypto you know every vc wants a token because it's an easy liquid exit and blah blah blah we resist that pressure because we don't know if a token is the best design in fact we think we've gotten so far as a credibly neutral organization to 80 hash power in just a matter of months because we don't have a token and because the incentives of our token are not counter to those of eth and because of our our reputations as kind of being aligned with eth um so i think any any partners we choose kind of are going to share that position i think there's a lot of venture capital in this space that has money because of
the bull market and that is aligned with cryptocurrency that believes in cryptocurrency and that's invested in cryptocurrency hundreds of times over what they're invested in flashbots and i think the problems we're solving are so critical for the space and and touch every single investment in every single project in the space to such an extent that any investor we have should understand that the upside on their other projects is much more than like having a specific business model in flashbots so that's kind of how we're thinking about it and and what we're building and how we see the next phase of really laying the groundwork for this long-term unstoppable organization cool i look forward to see where it's going phil and stefan thank you so much for joining us um if people want to join the flash
watch team or find out more about you where should they go check unfortunately we still don't have a website so that's not something that we're good at is building websites but we are good at writing ethereum code um so if you go check out uh on on github you'll find all the information that we have about our organization it's github.compm for uh for product management um and it'll have all the resources you need to learn about mev learn about the organization and uh and start engaging in the conversation perfect thank you both yeah thank you for the conversation appreciate it thanks so much for having us thank you for joining us on this week's
episode we release new episodes every week you can find and subscribe to the show on itunes spotify youtube soundcloud or wherever you listen to podcasts and if you have a google home or alexa device you can tell it to listen to the latest episode of the episode podcast go to epicenter.tv subscribe for a full list of places where you can watch and listen and while you're there be sure to sign up for the newsletter so you get new episodes in your inbox as they're released if you want to interact with us guests or other podcast listeners you can follow us on twitter and please leave us a review on itunes it helps people find the show and we're always happy to read them so thanks so much and we look forward to being back next week [Music]
you