Flashbots 🛠Suave Workshop
ETHGlobal·Wed, Oct 9, 2024, 12:00 AM
Join us for a Suave workshop! From November 17-19 2023, ETHGlobal welcomed developers from around the globe to take part in shaping the future of Ethereum at ETHGlobal Istanbul. Over $600,000 USD in prizes were given away at the prestige Istanbul Congress Center... thanks for an amazing weekend hackers! ----------------- Follow us: https://x.com/ETHGlobal?s=20 Check us out: https://ethglobal.com/ Email us at: hello@ethglobal.com
Transcript
[Music] so I'll be um uh explaining how to use Unis Swap and Suave together uh Suave is a platform from flash Bots uh to do confidential computation and have private data storage uh catered towards me use cases I'll explain all of this shortly reasons to use Suave uh right now there's a lot of applications that utilize white lists so like running offchain auctions for State accesses I won't name any of the specific ones um but you know this this really isn't like the defi ideal in many cases that we had imagined uh sort of these lists that we hold on private servers and you may or may not have access um so we're hoping Suave can help fix that um remove or reduce staking requirements so there's some examples of solver platforms that um are unable to um sort of like protect protect or properly enforce um uh like correct Behavior so they like resort to slashing and in some of the most popular uh cases of this like in solving for example uh there's like over 100k uh USD requirements to stake in order to participate and so using a like credible computation platform where we can sort of Ensure uh that a solution you had submitted is correct and obeys the rules of the protocol we can actually lower staking requir ments um and therefore creating a more competitive market um cheap proofs so um right now I I think everyone's exploring ZK proofs um stuff like FH uh MPC all some of those are more uh multi-party computation as opposed to like a proof platform um we eventually hope to migrate Suave towards uh one of these new technologies but the idea is right now that we use an sgx or trusted execution environment to sign off on computation uh and that's basically extremely cheap uh and we'll get into that um and then to share users so um everything is basically uh basically swab exists as like code deployed on these sgx machines uh and uh you can basically ensure that people are running auctions fairly if you've ever heard of the credible Auctioneer problem um one example right now is the doj is suing Google for manipulating ad auctions um and there's something like 30% increased Revenue because not only are they the auctioneer but they also set your bidding strategies and so they're able to basically uh inflate profits um cool so yeah so uh at flash Bots we've had a couple meev applications um we have flash Bots protect we have Mev share there's been various other protocols that have come online to handle me and me redistribution um but each of them in like we can even zoom into Mev share Mev share has about like four parameters how much a user gets refunded uh on their me what is the distribution of the refunds like say a Searcher extracts 0.5 eth uh how much does the Searcher get they actually did work how much does the protocol get how much does the user get maybe there's even another party involved um so there's all these parameters um and also we have this model of programmable privacy where uh say you send a swap to one of these platforms you can purposefully leak some subsets of the information to Searchers um the less you leak the harder it is to search on it and so the big question is like where is the Privacy efficiency Frontier um and this is all to basically say there are many many many me application designs and every person is basically rewriting from the ground up their own like private servers to handle these things so in that sense like swab is designed as an Open Marketplace for Mev applications which we call swaps uh Suave applications um some examples of existing Mev applications include private rpcs orderflow auctions block Builders relays shared sequencers and basically whatever you could imagine um here's roughly what Suave looks like so um basically if you're who here is familiar with sgx okay okay two two raises okay so um sgx is basically a type of Hardware designed by Intel where they essentially bake the private key into the hardware on its construction and then if you've ever seen uh you know someone try like uh the the like uh bank robbery deterrence where they have a sort of like ink inside the money so when you steal it it basically ruins the money uh and gives away that you stole the money uh that's sort of how an sgx works if you try and pry it open you actually ruin the device and uh it's un it's no longer usable and so yes we're essentially placing a lot of trust in Intel because they're putting these private keys in at manufacturing but um there's arguments that uh Intel is very incentive aligned with this design because uh we're basically driving more people to purchase sgx um it would be a very weird end game if they wanted to control all private keys and then suddenly just like rug everyone it's probably much less money than they make just from selling you know chips like they normally do um so yeah uh Suave is basically a network of these sgx nodes um sgx is also a subset of something called uh trusted execution environments or te so we call a node a kettle it's a t Kettle it's a little joke um and so yeah so the nodes on the network are called kettles they run on this trusted hardware and they also have access to um eth L1 state that is also located on sgx Hardware uh the user then interacting with their front end will have some type of order flow maybe it's a transaction maybe it's an EIP 712 message they encrypt it to the the public key associated with this trusted hardware and then they send it there and this is how you ensure that uh no one can basically like you know monitor your order flow in the middle try and steal it and put it on chain before and like front run you um and then the second thing to point out is that um the swab Network these kettles can put out both bundles and blocks so if you're unfamiliar with what a bundle is um right now there's about eight block builders on the ethereum network um the main units of like uh the main unit that they they they work on in order to create these uh blocks are bundles and this is basically you can send in three transactions in a bundle and you're basically specifying I want this to go into the slot into the block and in the in this three orders um and so you can think of back running as an example where you have a swap and then you also have the back run on the swap um so the swap leaves a pool um mispriced with another Pool A Searcher then creates a back run which uh arbs this pool back and they they want them to go together because if someone else is inserted in the middle of that they might lose out on the Arbitrage opportunity so that's it's basically they want these two or nothing um cool so swap provides Three core benefits to me applications the first is um private data storage and I'm going to show in a bit a uh a little bit more of a zoomed in diagram um on how these actually interact in a kettle um but so private data storage um so your me application on Suave has access to a place where you can instore encrypted information and then also process encrypted information when you upload a program to Suave such as a Mev application um confidential computation that was the second part as I just alluded to you can basically put a program on there it operates on this private data and ideally it leaks no information out although you can design a Mev application to purposefully leak information there are use cases for that and then sub eel1 coordination time there's a little bit of a marketing term uh it's it's essentially we do have a chain uh on these Suave kettles um but it's it's much shorter and then also a lot of the computation is done offchain so um you can basically Pro you can coordinate uh eth L1 activity faster than eth L1 um so yeah the private data storage utilizes the confidential data store um and basically the key here is that swaps Define the shape and operations uh performed on user data um the kettles transfer this confidence idential data between each other um so that if you hit one you can still uh do a second part of your computation potentially another one uh data modeling so you can include anything uh transactions user Ops 712 messages bundles simulation results intermediate values partial and full blocks if you wanted to do maybe like a shared sequencer uh and social security number just kidding don't put that on there um it points out though that you could put a Social Security on number on there um but if you're familiar with like the hacks that have gone on with sgx you should sort of assume there's one like every two years and so um and maybe that'll get larger but the idea is we are running uh auctions on this platform and so if you run an auction and suddenly all your bids get leaked a year later it's not really a big deal whereas if you put your Social Security on there number on there that's definitely a big deal um cool and then access control so when you put confidential data in the confidential data store you actually specify which programs are allowed to operate on your data like explicitly um so you don't have to worry about like accidentally giving you know access to uh like some Builder who will just start front running you left and right um confidential computation utilizes the Suave chain and confidential compute requests so Suave chain is you can think of it as a Marketplace uh I said that earlier you think give it sort of like the app store right in that when you go to the App Store on your phone you download an app and then you start running it locally maybe it makes you know calls to a cloud but let's ignore that for now um so in this sense that's exactly what we use the Suave chain for is that you upload solidity contracts to swaave with some additional pre-compiled to do like cool things like simulating bundles or maybe sending it to a block Builder um and then um what was I saying yeah so you you upload these to the swab chain and all of the kettles keep in sync with the latest contracts and when you do a computation it basically uses your program on the Suave it uses the program from the Suave chain but it doesn't do the computation on chain but you can Define in your Suave application to push something back to the chain so if you uh one example of this is um uh there's there's this like thing uh where it's actually more efficient if you're making like a crazy large trade like 100 million or something we saw this on coww an example of this where some Dow is like dumping a very large amount of tokens and they got a very subpar price because they just tried to dump it all at once and like the the idea is there weren't uh buyers of the tokens like ready to come in and buy it so if you sort of announce like two days ahead of time like hey I'm going to sell these tokens then you sort of incentivize the market to be like okay there's going to be this big sell event and now we can go buy it if the uh you know if if that's the case that's maybe not for all tokens um and then lastly would be a confidential compute request which is a new transaction type to um basically Define uh how this computation is performed uh and we can get I'm happy to get into the weeds another time on how this works if you're um working on a swap um and then sub e L1 coordination time so again although the programs are on chain you're not actually executing them on chain and needing to go through consensus in order to Output it um and so yeah this is how bring it all together also I'm realizing this is like quite hard to see so apologies for that um so yes we can see a swapd maybe you they upload programs to the chain um inside of the kettle we have something called the mm it's a modified version of the evm which basically gives you access to This Confidential data store um and then as well we maybe have some eel one state so say you wanted to control something about your swap based on what the underlying pool looks like on eth L1 you can actually query L1 from the smart contract and then do some logic based off of it um and again in this example you can output a bundle um so some quick ideas uh I'm just going to run through these so um you can do Dynamic fees such as an MCM or a DMC amm these are E3 search posts definitely check them out I don't have time to explain all of them um there's there's essentially the idea is in most pools that have high volume the first transaction in the block is an arbitrager so you can essentially auction off the first transaction in a pool uh on Suave and so Suave will spit out a signed message and you as the arbitrager need to present that signed message in order to be the first one to swap and the idea is the pool would then charge you a higher fee and so this is how you could integrate something like a uh the before hook in uni ev4 um yeah you could also tag your orderflow with like proofs or like maybe a reputation proof in nft a cool idea would be like use Axiom and create some type of like proof of your trading history and like show that you were you know always treating LPS uh very fairly therefore you should get a good fee um and then act active liquidity balancing that's sort of been around for a while oh no oh cool I thought I kicked something uh okay side quest lvr we won't do that um some Gort tweets check out Gort on Twitter um yeah so lvr minimization and redistribution um I'll skip over most of these we already talked about the first access auction um an lvr Oracle and Suave would be really cool where basically you can you can LP in Unis swap but then you could also have uh preferences on Suave where say like if it's high volatility I'm happy to actually take prices in this range if it's low volatility I'd rather take a price in this range and that's much more like expressive than what you can currently do on the ethal one chain and for much cheaper um payment for order flow is another fun idea so you could basically sell the rights to uh Arbitrage a pool for like an entire month or fill all of the orders in a pool for the entire month by staking and making some commitment that you're always going to fill a user's trade uh like 20 bips above what the underlying L1 amm price curve gives you at any given time so the example of that would be you know a user trade comes in um someone then you know you submitted these preferences which would then try and fill the trade um and you would fill it at a price 20 bips higher than the L1 pool by querying the L1 pool and then uh giving the best price you can and then maybe you could slash someone if they uh misbehave retroactively um lastly intense and rfqs so you could just send RFQ uh intents into Suave any of the current intent designs work so there's um user Ops are sort of like intense they're not exactly like intense um there's also the enoma intense design which is really cool I'd check that out um there's also the essential intense design which is super cool as well so you could basically just send intense into Suave and have a program that combines them and then spits out a swap on L1 um yeah so that's that's like mostly what you can do with Suave here's g a QR code to the um docs and then I'll just quickly go through our prizes a bit um so yeah best intent Unis swab design and POC uh up to two teams can receive $1,000 for this um so we have some heavy caveats on on using uniswap uh or sorry Suave um it's still a you know in beta platform and so um if your prototype doesn't exactly work but you have most of the design uh that also can like qualify for these things and especially if you identify a reason why something doesn't work then that's extremely valuable to us as well and so we're happy to uh you know still give you a prize um best peof design and PC as we as I just previously got into that's a $1,500 prize um best Unis swab lvr design in PC we have three for this this is like a really rich design space um I would check Che out some talks on lvr or I'm happy to get into that later um but essentially lvr is the framing of like why LPS don't make as much as on you know on chain as they do being like market makers on a centralized exchange so this is like one of the most important problems in crypto um best use of suave is then also 2.5k and there's up to three winners of that and that can just be anything you want uh you could even share Netflix you could do a sharing Netflix password uh application uh someone actually the other day built a extra data auction so you can actually sell on the eth execution blocks there's an ex extra data field where you can put uh arbitrary text someone made an auction where you can basically bid on the next blocks extra data and it's already live on gley and then lastly best use of univ V4 um hooks as well and so any anything in that regime cool and that is time that's all I got um yeah I will be around and happy to answer any and all questions happy hacking
Automatic transcript — names and jargon may be misspelled.