New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Based Smart Wallets - ETHGlobal London 2024

ETHGlobalWed, Oct 9, 2024, 12:00 AM

Join Carl Fluke from Base for a workshop titled, "Based Smart Wallets." Base and Coinbase recently released some new account abstractions tools. Come learn how to leverage these new tools to improve UX and reduce onboarding friction. This workshop took place at ETHGlobal London 2024, a 3-day hackathon held at the Truman Brewery in London from March 15 to 17, 2024. The event brought together the most skilled web3 developers, designers and product builders from all around the globe for a weekend-long adventure to advance the Ethereum ecosystem! ----------------- Follow us: https://x.com/ethglobal Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

[Music] going so hey everyone nice to meet you um I am Carl fluke I'm a senior developer uh advocate here with the base team been working on it since we launched our T net about a year ago uh and we went live in Late July so what I want to talk about is what is account abstraction so 100% what is account exraction from a 4D 337 EIP level um I want to talk about our coinbase smart wallet which is kind of like a a first party 4337 wallet um talk about our bounties and then talk about some of the fun things that are coming in the next uh base upgrade um so what is account abstraction um there's a lot of people that have a confusion about this some like MPC based wallet keys call themselves account abstraction but I want to focus very much so by what the ethereum foundation says um and that is that truly um account abstraction is using a smart contract wallet so you are switching from using an eoa to having a smart contract ract wallet that um you can have more programmability and more security and better user experiences by doing so um and throughout this you'll kind of see some highlights of that okay so what a smart contract wallet can do is today when you actually have a new person try to do on on chain things with crypto you have these five steps you go to a Dap it says Hey connect this wallet if you don't have one it's Chrome extension or mobile app and then you have to do some wallet connection approval uh then you have to go to some Fiat crypto onramp get some tokens to I can actually do it uh and then I can interact um but with the smart contract wallet um we can simplify that to a drastically shorter onboarding time and it'll be slightly more integrated okay so let's break down from a technical Dev level about what 4337 is and what the pieces are involved um so the main things that we have here are uh instead of user transaction we now have user operations um so these are mostly the same there's like three new fields that have to do with verification guess um so just know they're different um as a developer um they're pretty similar um the next is you have a bundler um so as its name applies is it accepts all these user operations from your user and it bundles them into a transaction so this is a service that goes um before the actual blockchain to where it it's accepting a queue of user Ops it's sorting them um and then it's ultimately submitting it as a transaction to the L1 blockchain um you have the entry point um that is just where the bundler submits a collection of user Ops um all break that down a little bit more in the next slide then you actually have the smart contract wallet so this is a um account Factory that you make your smart contract from and this could have a series of plugins um it could be a first party um there's a bunch of providers in this space and we'll talk a bit about them too um and then lastly you have a pay master so this is a contract on chain that you can send your user up um to the pay master and say hey you want to pay for this so as a developer that's probably like the biggest ux Improvement is that you can you can can pay for gas with an erc20 token you can make it so the first five uh transactions on your dap are just paid for for you um after 4844 um gas is cheap enough now that like if I'm in an F Marketplace um if I want to sponsor one cent if you buy like an over $10 nftd then you can just remove the concept of gas for your users um so from like an e economic cycle um pay masters are much more attractive um after that Denon upgrade um a couple days ago okay so so what are the actual like enduser benefits of using 4337 um the first is a simpler user experience you can just remove gas or what the idea of that is from an end user so they can have much more of like a web to user experience um a big one is multi call so by default when I want to do like a def5 position today I go and I say hey I want to approve eth uh or I want to approve like usdc I want to approve uh usgt then I do my submission into a defi pool and then maybe I it um with 4337 you can actually just make that one approval and you can have four user Ops signed in one signature um so the user experience that is drastically better um I mentioned simplifi gas um the other big one is you can upgrade these smart contracts so if you want to have like a um I can spend a Max of $500 a day as part of your logic for security um you can upgrade that and change that amount so it is a little more future proof uh lastly you kind of have Block Level Security checks um which is very nice if prices are changing um and you want to protect your users uh so this is the flow you have a a user operation you submit them into a MIM pool for the bundler the bundler takes those Aggregates them uh sends them to the entry point uh the entry point essentially goes through a loop of saying hey smart account do you is this a valid transaction can you do this you have the funds is it a valid eth call uh and then lastly does an execution Loop of actually executing that logic um so go do your swap go do your mft go do your onchain transaction all right so high LEL real quick comparison uh on the left is a transaction that you're used to today um you'll notice you you have your 1559 priority fees uh nons value that's all the same uh on the right for user operation the only real differences are can you see my mouse kind of um no uh you have verification gas so that's an additional payment um just to verify that your user op was valid then you also have this pay master and data which would be hey does this pay Master pay the gas for me um and it's just a signature that you can validate on chain okay so high Lev the bundler what it does is it collects those user operations it validates them so it's actually doing like a a debug simulation of your transaction some basic checks here of hey is this a valid thing um it also does a little bit more where it Aggregates them at the pay Master Level to say hey does this pay Master can it afford the 10 user Ops in my bundle um it also does some things about uh you can't call a smart contract that is getting deployed in the same bundle so if you're using a factory to create a smart contract you can't manipulate that smart contract in the same transaction um the other big thing that is still very growing if you want to extend bundlers um is there's a reputation system so if you have like a a pay Master poisoning these user Ops um there's reputation checks around that uh of invalid transactions um things like that um I have the EIP later if you're interested and then lastly to protect itself um it does kind of aggregate error codes in these three buckets um senders pay master and Factory contracts okay lastly our next is our pay Mas this is also an area where things can drastically improve um the basic uh thing pay masters are doing for policies now is saying Hey I want the first five transactions to be free for my users very simple um or I want to pay up to like point I want to pay like $10 a be for transactions um paying with the rc20 is also very common that you can maintain a liquidity pool of hey here's my game token I swap it to eth so I can pay for gas for my users uh something new that's coming um is you can also pay off chain so like if I have a $10 subscription you could make it so that hey somebody just has a credit card they say hey for this wallet I want $10 of gas to just be paid for me um so user experience- wise that's drastically better um that's what they're used to in web 2 um so if anybody is hacking on pay Master policies that's also something I'm super curious what else can be there um I've seen a lot of things with like Dows to where like for my Dow if you're doing a vote on chain the Dow probably can afford to pay for your gas to do your voting things like that to where it makes makes more sense for like the economy you're growing okay cool I ran through that super fast which is good um so smart wallet is a new release we had with coinbase wallet um there's a V4 beta version to where it more or less like white labels a 4337 wallet for you uh the main thing it is doing is it it removes the idea of a private key and it's following kind of like a web2 world pass key so a whole bunch of companies now in web 2 are starting to switch to pass keys for login um like Xbox uh Microsoft um sorry uh Sony like Target a whole bunch of e-commerce is moving to it um so it's kind of like a tricky way to get web two people very used to like not having a private key but it's a pass key um and this is built in with our uh wallet V4 um the main advantage we see with this is that wallet um the coinbase wallet SDK is already in multiple hundred apps um so really just upgrading to that V4 gives you a new Pass Key wallet um and we do want to see some people put this into to uh hackathon projects over this it is already integrated with like wagm vium um so it should be very much so just upgrade the version and you get a free Improvement um only other two things to know that are gotcha uh you do need to make sure that your smart contct tracks follow uh 1271 which is like a signature validation uh the docs that are linked later uh give you good detail about that and then also if you're using the coinbase Chrome extension we do recommend you disable it um just because there is some Collision um we are getting feedback on farcaster um so if you're a m there that's kind of like our preferred support Channel okay uh the real magic feature that we can have with this is uh what we call Magic spend so coinbase has a smart contract that we essentially were calling the piggy bank um to where we let users actually use their retail balance on chain directly um so if they have eth in their retail we kind of just have a piggy bank of like 100 eth sitting on chain and we'll debit their account on chain so you skip the whole like I have to transfer to this wallet to use it um you can just directly use your retail balce um so that's kind of like a a magic unlock that you can do with an EA um we are going to extend that further to where like you can use your payment methods um but retail balance was the starting point all right I made good time um so what's next uh this week 4844 came up uh which was awesome I think right now we're still at like 1 cent inft mins on Base main net um so that was like an order of magnitude Improvement for gas costs um love to see it I was kind of like doubting how much we had seen an improvement uh and it's doing well um specifically for 4337 this also makes it so that the the gas overhead of account abstraction is drastically lowered um something that's coming up in our next upgrade is EIP 7212 which is a pre-compile for the pass key curve um so right now um smart accounts your gas is more or less like 80% more than an eoa um once this pre-compiled goes live it should drop to be like 10% more and that'll make it so like the average user won't really notice the difference in between an EO and a smart account transaction cost um there's a couple eips for talking about migration that we're considering if anybody has thoughts about this come talk at the base Booth but there's two main ones uh one is like hey I have an EA and I want to upgrade it to a Smart contract wallet um so there is an OP code to do that um just to make that drastically easier if we want to make a smart accounts the default um this would help us do that and then lastly um native account abstraction uh is a rollup Improvement um the team has a lot of debate about it um if you have thoughts on that that thread is also uh moving forward okay uh there's also two big plug-in um plugin architectures that are on debate Alchemy is leading 6900 they have a couple plugins out there um bomy is doing the 7579 um if you're hacking we are interested in more people making plugins for smart contract wallets around security around transaction maximums um Auto swapping maybe to where like I want this account to only have usdc in it um things like that at the Smart contract level uh so to to bring it back to like B's Mission about why we care about 4337 um we want to have 1 million developers on chain uh one stat that I still think is crazy is that there's only like 22 million software engineers in the world um and by 2030 it's supposed to be 29 um which is crazy that we have how important of a job it is there's so few uh working on it and then lastly is bringing our coinbase users onchain um and we really believe like a global onchain economy will happen on chain um for 4337 World want to give a big shout out to all the partners that have been building on it for the past year since eth Denver last year um worked with all these guys uh great ecosystem um okay so for our bounties um just to give a little more detail specific here um is our first one is build an onchain product or tool so this is very generic in general um we just want people to build a product on base that a normal person out there in the world uh like go down the street to somebody in London and can they use your product um and hopefully it you know fully uh shows that onchain can be better than like what we currently have in web 2 world um and then yeah lastly try to fill any gaps that are not on base um then the second one is there's kind of very different uh criteria here so you just need to hit one uh best use of 4337 so that can be um using our cloud bundler or pay master um you can use that with like Alchemy account kit um pimo um ether spot any of the providers I should before um you could make a tool that makes it easier to use a account abstraction in your dap um so like make an improvement in using like rainbow kit or some other uh login provider that makes it dead simple to actually use AA by default um and then lastly is use that V4 of wallet um to use kind of like the white labeled version of a passy wallet um if you're doing a consumer product that's probably the most straightforward because you would as a developer it would just be like doing a transaction um here's some QR codes of like the GitHub repos for that if anybody wants them okay and I did that super quick so that was good do have time for questions which is perfect um so anybody have questions of 4337 or of um the very complicated uh multiple choices we have of uh Master bundler regular AA or um using the V4 smart wallet or if anybody has questions of like uh the Bas future road map of what we're working on hey great son great presentation um I'm not used to not hearing myself uh can you like explain a little bit more about what you me around native account obstruction uh maybe you can just expand on that yeah 100% um so this is a proposal to actually make it so that we change the default transaction type in ethereum to include two or three new types that are AA specific so when I showed that user op um example there's like new Fields um this is way back uh there's new Fields so there's three kind of like additional Parts um that would actually be in the default uh transaction signature and then the transaction type has two new ones to say um like simulate and actually do a user op directly so yeah very much so like web 3 ether's VM would all just be user Ops by default there yeah I think realistically that's like a year and a half out but I know the ethereum foundation has been doing a lot of good research on that yeah yeah one thing I don't understand is um we at the beginning you said um we would have a bunch of user operations and they're signed right um does that mean the user still has to create an EO account eoa account to have those signed operations that the um pay must the bundler would then bundle into the smart account how does how does that work yeah um yes so the website will sign them in some way um in the smart wallet example we're using a pass key um there's a bunch of NPC or other key providers out there like um privy is a big one we've worked with to where you can have like the an EA equivalent hidden um based on your dap so you can do like your login with Google login with apple and it'll give you a temporary key and you'd sign with that um but as a developer you can sign that in the background on behalf of your user thank you yep and then the other big thing that relates reles to that is there's also this concept of session Keys as a plugin um and that is kind of like the even better way to do this is uh you could actually make a simp a temporary signing key so like when I start a game session you do one signature saying hey this game session token's valid for an hour up to a certain amount um and then you just sign in the background for the rest of the The Experience yeah all right there's no um sorry um yes for Alchemy and so does bomy i i there's a couple other providers that have it but those were the two that um are leading these um EIP 6900 and 7579 one one more question um so it seems like um 4337 is focused on you have a private key um you can get that through Pass or some other way um and can you touch on how we can connect this with um talking bound accounts with 6551 that um it feels a bit more seamless for for apps because you are only delegating the um ownership and the authentication of an action based on who owns the underlying um nft for example yep is there a way um this two can um we can connect both of them or would it be just completely different you you can give a 6551 I call it a backpack wallet to a Smart contract wallet and the smart contract wallet will own it um it just you can make them work together uh using a smart account it would simplify the whole like transfer ownership or give or delegate control of um I think you would not want to use those interfaces if you're using a smart account um you'd let the smart account take advantage of that yep okay perfect I'm at time thank you all for coming [Applause] [Music]

Automatic transcript — names and jargon may be misspelled.