Encrypting the mempool - Luis Bezzenberger (Shutter Network)
ETHMilan 2023 · 9 Nov 2023 · 15:26
Luis Bezzenberger of Shutter Network asks how encrypting the mempool can curb front-running, improve censorship resistance and support base layer neutrality. The talk compares transaction ordering strategies and their cost to users, then explains threshold encryption as a decentralised way to keep transactions hidden until their order is fixed. It covers Shutter's work on shielded voting in Snapshot, a Gnosis Chain integration with Nethermind, an OP Stack module, and how encrypted mempools could offer rollups an alternative route to sequencer decentralisation.
Speakers
Topics
From ETHMilan 2023, hosted by ETH Milan.
Transcript
okay hey thank you um for having me um sorry yeah I'm Louis um with Shadow network uh and I'll be talking about um encrypting the meol essentially and um why and sort of what we're building um more in more practical terms um so yeah so the gist of it is thesis is if we encrypt the M poool we can mitigate front running um we can and and sort of the malicious parts of me we can increase sensorship resistance um and we and Via this sort of I think we can work towards a more sustainable Market architecture in general uh and Bas layer neutrality um yeah um and and so taking
it from sort of the top is I think something that I realize or maybe other people realized um that during this bare Market um yeah people are in the mainstream are fed up right with crypto so people think that crypto in general is is unsustainable ponzi's um the promises of crypto aren't really becoming true and the reverse is true sort of that's um even the malicious stuff is becoming true right um uh so and then and then I think we can build a better base layer I think we need to build a less hostile more friendly sort of um base layer yeah um and maybe going one step deeper is what what do actually
what does it mean right front running me and and and and and all of these things is yeah front running means you jump the queue right you you try to get a trade of some for someone else right you you're trying to steal someone else's trade which causes these amense user losses um this is this measurable sort of impact and if if you're a normal Trader or any Trader trading on Unis swap or anywhere today um that's what you're sort of exposed to um but more importantly I think is is is the people who are not trading who are not getting front run because they're not even sort of entering the space just because they know that it's uh a hostile marketplace right um and and something else that's pretty related is the way we're dealing
currently with me in front running is we are building these types of sort of uh this external and outof protocol infrastructure in front of the the transaction supply chain which actually um sort of quick fixes the problem in the short term but it actually increases long-term the our Reliance on these sort of centralized intermediaries because the the infrastructure components that we're adding to the stack they're actually yeah trusted and centralized usually right um and this is maybe something that shows this uh the censorship issue the most clearly right now um usually when we talk about censorship and measuring it we usually we talked about um the the relays
sensoring right which has actually improved dramatic Bally um so there's actually less relays sensoring but what's rarely talked about is the um the Builder also sensoring right so these are all these three are all sort of transaction intermediaries that your transaction has go has to go through um and and at each point you can censor and you have to trust sort of each entity to a certain degree each step in the transaction supply chain to not censor you and not front run you in a way right and um this is from Tony from the EF built this amazing dashboard showing that yeah Builders are actually censoring sort of to degree of 70% of the builders actually censoring um yeah not not not good yeah and sort of not
not really talked about enough um so we talked about this um so and what we did is kind of starting to uh starting kind of this journey a little bit is or in this presentation is we um are trying try to simulate um various transaction ordering strategy so you can think about how to sort of deal with that transaction queue that's coming in do you do you kind of front run do you order it do you back run um things like this and it's going from sort of increasing so we're going from sort of no um uh interference no sorry we're going from um fully random ordering um to
increasingly that we increasingly um order uh do more with the Trans so front running more and we're sort of sandwiching more and yeah each step sort of uh and the the goal here is to show um what type of transaction ordering kind of environment would be optimal um for especially for users right um so yeah we're starting with this kind of fully random um ordering uh um which would actually be sort of optimal for the users because there's no um user loss but that's kind of just not not not achievable and not realistic because there are arbit Arbitrage opportunities right um this one we would say we still have sort of the no front running um but
we do have Arbitrage so we're sort of back running and not front running and this is um kind of a nice in between where we have um some some user loss but actually kind of manageable and we also have sort of a price that's actually more true to the mean to the actual true price um here it gets sort of we have um uh Arbitrage after every transaction um so similar to the first one where instead of arbitraging after the block we're arbitraging after each transaction and again kind of yeah similar similar outcome um but this one is actually the price is actually then maximally close to the actual the the quote unquote real
real real price um and then here we have sort of the we're maximizing the back back running by reordering um so user loss is increasing even more right again so of the more we're meddling with the transaction order the more the user loss gets and then here we have kind of the extreme example and this is actually a little bit how it's today right we have the sandwiching uh or depends on the transaction infrastructure obviously but um if you sandwich it means um every if you sandwich every trade it means your user loss is Extreme um and and this is sort of the worst outcome right so what's kind of the takeaway is sing and everything so front running and and back
running and sandwiching is is the worst for the user um in in this model right um and and what we think or this just a just our sort of thesis is that this kind of Middle Ground the random ordering with Arbitrage um so after every block is probably the best trade-offs right and then going from there we we would say from this model is if this is an optimal or kind of a good trade-off how can we build something that's a protocol as more me aware and sort of deals with that in a way that or yeah the goal in mind to achieving this random ordering um uh with Arbitrage uh so yeah and one thing we can do is
encrypting the me pool right which means uh in simple terms you encrypt transactions and have them be signed by the Brock producer while they still encrypted because if they um if they are encrypted while you have while the order is sort of finalized already the sequencer or the validator or relay no one basically can can see what's in transactions and so they also can't front run right um and they can they can back run but they can't can't front run is kind of the the whole point and we are using um thres encryption um to decentralize sort of the the um encryption and decryption which is important right again because if you then just have a centralized encryptor then you're reintroducing that
centralized intermediary again so and that's the setup and and if we do do this we hope or that we achieve we can that results in sort of that um random ordering with arbitr which in generally means we think means sort of the highest kind of information um symmetry possible um with sort of generally speaking safe safer trading for users um because no no front running this generally um also then more profitable right if you get get less front run you just get better prices and then you're also adding this type of censorship resistance because very similar so if you can't see what you have to commit to basically in the transactions you also can't really censor um and that hacks back to this
original kind of picture right Builder sensoring um yeah if you can't see um what you're uh what you have to validate you also can't um can't censor um so and even for the so so these are sort of the the benefits for the users um and you could argue that the benefits for the for the validat or transaction supply chain kind of operate um those who operate intermediaries in the transaction supply chain those might be negatively affected for example because they can extract less me because there's no front running still there's still back running but there's no front running right um however there's one maybe one point that from this slide is basically if you are able to front run
um that's something that's probably um a is bad for your image in a way right it's not not something that you that is good to show and also um so regulation wise we're seeing kind of regulators moving in in a direction where they say um if you're able to front run if you're able to meddle with the transaction supply chain um from regulatory point of view for example MAA um this might be seen as you having a role that's more akin to let's say a financial intermediary or like a market maker rather than maybe what you want as an intermediary you want to be perceived as a purely technical role right so not being able to front run and not being able to meddle with the transactions might really give you sort of a good
argument towards the regulator of saying well we are really a neutral intermediary we're not we don't we can't extract Financial profit from our users kind of from a financial point of view um so yeah and we build we're building this right we're building this sort of as a as a plugin to other protocols and infrastructures um the first live implementation actually is um not an meev use case but essentially encrypted shielded voting implemented into snapshot um then we're also working with the with nosis chain um to implement it into the nosis chain uh and we also received a grant from optimism to to build it as a this composable um kind of piece for for the op stack so
any sort of New or Old um op stack roller will be able to yeah choose that as as an option right in their in the the way they um uh configure the rollup and we think this is really good for also for this whole thesis of uh rollup kind of differentiation and and the many rollup Theses because to be honest the rollups we're seeing right now they're not really actually kind of differentiated right there it's kind of just plain vanilla copies of all the other rollups so we think this will be positive for this whole vision of rollup differentiation uh um and and and many rollups there uh yeah I think I have to go quick because
I don't have a lot of time but this is yeah again this collaboration with nosis chain and also nethermind who are working from the client side um that's how that looks like there's yeah the the important Point here is there is the sequencer contract where the transactions enter and by the transactions entering into the sequencer contract they're um considered final and they're they're still encrypted so that's kind of also shows this really we're separating the proposer from the transaction order so so we're essentially taking away a little bit of the power of the proposer by yeah separating these twool and you have sort of the transactions in the sequencer contract are are finalized while they're
still encrypted um yeah and we're taking this pretty practical kind of progressive decentralization approach there to go to market quickly um again it's this coll collaborative effort between shter nosis chain nethermind um and um if you compare it to other um sort of approaches we think it's really the best theal encryption is really a good tradeoff in terms of decentralization um practicality uh and security right um because a lot of the other approaches are rely on Hardware trust assumption strongly rely on Hardware trust assumptions like Intel sgx right yeah um I think I mentioned this
already so if you have a rollup and if you're building it into a rollup in addition to sort of this front running um Ben resistance benefits um you are also improving your censorship characteristics which especially if we're talking about a centralized rollup um that kind of offers you an alternative sequencer decentralization um road map right so currently all the rollups are centralized and they need to or want to decentralize which then you get all the the bad thing to decentral the you have the the increase complexity latency cost of decentralization and you have really these two you have the under L1 you have decentralization and you have another decentralized layer above
it's really not a pretty kind of architecture um so via encrypting your M Pool and adding this this way you are achieving the benefits sort of the key benefits of decentralization which is the key benef one of the key benefits is is sensorship resistance um without having to decentralize right so this offers UPS an alternative sequencer decentralization uh road map which we think should should be yeah really considered if you're thinking about your rollup decentralization road map you should consider this and think about what are the trade-offs right um we're also sort of going forward Outlook we're looking into how does encrypted meol how does that
interact and how does this mesh with um shared sequencing intents um and Order flow auctions and long long story short it all kind of meshes quite nicely just um just depends on how you want to integrate it but it basically works with all of these especially in the case of sort of auctions um yeah we would recommend any rollups to use something like an encrypted manool shutter for the front running resistance but then use something like optimism mea auctions to distribute the remainder of back running related um me um so yeah and that's that's sort of it um follow follow us on Twitter um and especially if you're building a rollup a new rollup maybe or PCH rollup
or any other rollup um or a DB uh sort of a financially AAP that is um kind of financial uh and has a front running problem potentially reach out to us we'd love to hear from you what are your needs and how can we help basically thank you
Related talks
- Encrypt the Mempool!
- DappCon 2023: 5 Principles To Start A Sustainable Market Architecture For Defi - Luis Bezzenberger
- Gnosis Workshop
- Panel Discussion: Who Pays the Provers? moderated by Julian Ma, Ethereum Foundation
- Protecting Users from MEV | ETHDam 2023
- Encrypted Mempools: a path to Ethereum L1
- Information is the New Money - Phil Daian
- MEV for the Next Billion: It's Time to Get Serious... by Philip Daian | Devcon Bogotá
- DAPPCON 2024: Gnosis Chain - From Dencun To Pectra Via Shutter - Phillippe Schommers
