Understanding ERC-4337: how it works and exploring unknowns
ETHCC 6 · July 2023 · 14:32
Matt Cutler explains ERC-4337 through its transaction flows, an intent layer, alternative mempools, paymasters and bundlers. The EthCC[6] presentation builds a mental model of account abstraction and considers MEV implications, while identifying questions that remained open at the time.
Speakers
Topics
From ETHCC 6, hosted by Ethereum France.
Transcript
[Music] that's the first uh good afternoon everyone uh thank you for joining this basically lightning talk on understanding erc4337 um if you're here in this room you're obviously familiar with it I am Matt Cutler I'm founder and CEO of block native uh we build core infrastructure for the ethereum network we're a block Builder a relay and we provide all sorts of tooling like web3 onboard and a gas estimation and we've been doing a bunch of work in 4337.
um I have been in the space for almost five years and when I started to read about 4337 I was nothing but confused by it and I was really trying to wrap my mind around it and really couldn't and I started to reach out to people far smarter than me in the category and asked them to explain it and what I learned was none of them could explain it either and I realized that we kind of lacked a coherent mental model for 4337 and how it worked and so while I'm doing a deep dive and Publishing a Twitter thread read that kind of blew up that that's now kind of used I think for a large part as the mental model of 4337 as user intents and what I want to do is sort of go through that and dive in as rapidly as we can because we don't have
a ton of time so uh what do we know about 4337 it fundamentally makes transactions programmable and expressive which we believe as an ecosystem will massively improve user experience it does so by abstracting away intense fees authentication and enabling social recovery of keys so we don't need users to worry about managing private keys on their own but it has this super funny property which is no hard Fork required which all of you all know it's an ERC not an EIP and the question is how do you do all of that without changing the network and uh the realization is to figure this out to build the mental model you have to go backwards so if you've ever seen the movie um Ready Player one there's a scene
about why not we go backwards for once backwards really fast and so let's start with the standard ethereum eoa transaction flow that we have today day user uses their non-custodial wallet to engage with an eoa the eoa submits a signed transaction to the public mempool that goes to a builder Builder talks to a relay relay sends block to validator and that goes on chain and there's some extra steps in here associated with Mev for private mempools and search your bundles and stuff like that that's the world we live in today and so what does 4337 change about all of this well you can basically look at the uh the stretched orientation and say 4337 is all up here okay everything before the eoa and that was sort of the big unlock
for me was uh before 4337 we have eoas and after 4337 of eoas and this is why we don't need a hard Fork so we have this new network actor known as a bundler the bundler acts as an eoa proxy on behalf of the user now this is something that I think is super important as we go through all of this is while 4337 brings forward a whole bunch of new possibilities it also adds a bunch of new complexity to the network new characters new actors new incentives new interactions new possibilities new things that can go wrong and so this is why we at block native have been quite active in trying to drive fundamental understanding because we think there's a
bunch of really interesting things happening under the cover a bunch of interesting consequences that we as an ecosystem don't fully understand because 4337 is just really rolling out now it's not widely deployed and many of the thorny issues we think will come out only when we're at significant scale which is pretty interesting so uh the bundler receives user UPS from the alt mempool this is a massive change to the network today we enjoy a single public mempool by the way there's a whole bunch of private mempoles and we're going to move into a network where there are now two mempools but not really tool two because the alt mempool is somewhat of a misnomer they're actually alt mem pools with an S there might be many Alt mempool and so now you're going to have
this issue of mempool fragmentation and mempool's early significant this by the way is what block native does more than anything as mempools if on-chain data represents what happened mempools are why it happened all of Mev is in mempools and so uh today you have this relatively simple model of the public mempool and then private mempools and that model is going to break down into many mempools and therefore observability starts to be a big hassle we'll talk about that in a little bit and there's all sorts of opportunities for one confusion and two lack of trust so we think observability and mempools are going to be significant but by the way this is a trend if we look down the road to the rest of the
ethereum roadmap almost every stage introduces additional mempools so the mempool construct is quite useful because it allows untrusted actors to basically make bids and submit stuff against each other without real concern about denial of service attacks but they have negative properties as well like poor observability for instance and manipulation and so as we go forward with four three through seven we think that's going to be a space to pay a lot of attention to um users don't submit transactions they submit uh intents in the form of user Ops believe it or not not they were not really perceived as intense at least broadly until we sort of went forward with this model so the basic idea is the user intends to do something and the bundler acts as the the uh sort of rolls
them all together and turns them into signed transactions and of course the final step here is a user with the 4337 wallet but as before we had special uh elements of the user transaction flow for Mev we're also going to have additional flows here for Mev so uh whereas before so by the way for those of you who are not nerds about Mev in the way that I am Mev stands for maximal extractable Value it's the value that you can get by controlling uh the contents of blocks it's the contents and inclusion exclusion ordering and so historic now what happens is at the Builder level that's where Mev is controlled Builders are the ones who
determine the contents of blocks but now you have this new actor called the bundler who's going to determine contents of Bund transactions out of the alt mempool so the alt mempool and bundlers represent a new source of Mev and so who the bundlers are what those actors are and what they're doing may largely but may have significant determinations on user settlement and uh um uh you know routing and things like that and then what's also interesting is bundlers submit transaction to the mempool and those may be then subsequently reordered by Searchers and builders for MVPs and I have two order Mev Mev at the user intent layer and Mev at the eoa layer and so again it creates new complexity uh happening on the
network um so there you go this is erc4337 the user intent layer there's some pieces at the end the entry point smart contract would Upstate the wallets and basically this is it so the whole idea is it's a intent layer that happens Upstream of the signed transaction and the net benefit of this is it doesn't require a significant upgrade I.E hard Fork to the network let's dive into this oh so uh changes everything to nothing we talk about that so let's dive in a little bit to each one of these major areas uh the smart contract wallet it communicates via user Ops user Ops are programmable extensible combinable they allow all sorts of new things to happen basically enabling composable transactions so this is one of the things that I think is
most exciting about 4337 is today transactions are fairly fixed they have a fairly narrow definition for a limited scope that you can do with them under 4337 and user opposite opens up the design space quite a bit and we can have all sorts of new and elaborate and uh just just brand new experiences for users at the programmable transaction level this is significant because as far as I know in the history of transaction systems going all the way back credit card stocks you've never been able to program transactions themselves I mean it's a weird thing to think about like what's a credit card transaction so the credit card Network tells you it is what's a stock trade it's what the exchange tells you it is what's an ethereum transaction it's an eoa right and now transactions themselves get
programmable that creates a whole bunch of new developer expressivity that's pretty fun and interesting these user UPS again go into alt mempools and believe it or not I mean this is still pretty nascent the peer-to-peer layer of the alt mempools is still basically being developed right now so while we think about 4337 is here and now there's still a whole bunch of stuff sort of underneath the covers that really matter and and fundamentally the idea is bundlers will each operate their own Alt mempool so for every bundler you may have a distinct alt mempool starts to get confusing as you say which bundlers are being used where which wallets communicate with its bundlers how does that all go it starts to get interesting at that level um uh this will confound observability
we talked about that uh the bundlers then take these user ups and bundle them together and something that looks a lot like an internal transaction right now but that fundamentally uh bundlers start to look a lot like Mev Searcher builders and so our bundler is going to be net new actors who aren't really participants in the network today or are they going to be existing Network actors who are quite active in the Mev space IE Searcher Builders and the reason why we think that's likely what's going to happen is to be a good bundler you need all the same skills to be a good Builder and it turns out it's really really hard to be a competitive Builder and it's quite competitive to Be an Effective Searcher and it's not a whole bunch of extra work for those players to move into this category so if you're not
familiar with the PBS Market if you're not familiar with who the relays are who the builders are who the Searchers are which are a little less a little more opaque we believe that those players will wind up having a pretty significant impact on the world of 4337 um uh pay masters we haven't talked about pay masters yet so pay masters have this cool property of being able to sponsor transactions so uh what you can do is you can a paymaster can basically cover the gas fees of for the the user Ops right um but there's this really interesting property of the paymaster is they see the transaction first because basically the transaction says I want to use this Pit Master and before
anything can happen the paymaster has to say yes I will sponsor this or no I won't in the world of Meb those who see transactions first have an edge so it starts to get kind of interesting is which players may want to operate pay masters and why because they basically sit higher in the stack than other players and the higher in the stack you you have the lower latency you have first crack you have Etc so the paymaster category is sort of interesting and just like everything else in 4337 they're programmable right so you can sponsor uh gas fees with uh erc20 tokens you can sponsor them with off-chain mechanisms like your credit card or even your credit card miles but they can have conditional payments which
is pretty fun so you might say hey my paymaster will sponsor the first 100 intents after that you're on your own or if you have a certain nft in your wallet you get access to this paymaster right and so there's a whole bunch of interesting programmability and infrastructure that can be developed around pay masters to enable new classes of user experiences that go forward um and so finally and I'm moving super quick I hope everyone appreciates just how fast I speak uh is this the great unlock and so here's just a simple example of what we're why we think erc4337 is super exciting so meet Alice um Alice is a super fan of a hypothetical music artist named sailor twift um she's a top listener on Spotify she's active in the Forum she's uh has
attended a bunch of shows and and Taylor sailor twift wants to reward loyalty but in using the existing mechanisms like Ticketmaster there's no really easy way to do so um there's no uh verifiable way there's no uh programmable way and and basically Taylor sailor twift wants to have a direct relationship with her fans Not mediated by the capabilities or limitations of someone like Ticketmaster so what to do nft right super straightforward issue the nft the fan can have it we're all good to go except for one little problem Alice doesn't know about crypto so she doesn't know the first thing
about custodial wallets and metamask or Ledger anything else she's just a regular old person and so now she's sort of locked out and this is this big Gulf that we have um enter 4337 and hypothetically her visa card could be her non-custodial wallet so anything to do anything else but it gets even cooler Alice uses her visa card to pay for her Spotify subscription so sailor twift says hey we'll do a promotion with Spotify which will identify our top fans we'll issue an nft and it will go on to the Visa card that they use to play for their Spotify account easy peasy and then when the Super Fan Alice shows up for her show for for the experience all
she needs to do is present her visa credentials which by the way may be very via her wallet on her phone and she can demonstrate access to the experiences she can prove that she has the nft she could sell or transfer it it suddenly gets super fluid and this we think is this very interesting unlock where now everybody can have a 4337 wallet and this is the key for unlocking the next billion users we're going to do top down and bottoms up or growth for the web 3 category moving forward but let's be honest there's a whole bunch of users with existing experiences and we can meet them where they are using this technology as long as we uh build it in ways that are easy to use for those
individuals so we do 4337 infrastructure and I think I'm out of time so I want to thank you for attending my lightning talk on understanding 4337 and all the implications about it do we have time for questions no we do not okay if you have any questions I'm M Cutler on Twitter or see me down here afterwards thanks everybody cheers [Applause]