Why Account Abstraction is a Game-Changer for Dapps | Devcon Bogotá
Devcon·Sat, Oct 7, 2023, 12:00 AM
Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on Swarm, IPFS and more. https://archive.devcon.org/archive/watch/6/why-account-abstraction-is-a-game-changer-for-dapps/ Native account abstraction on L2 is a breakthrough for the usability and security of crypto. It’s also the only way to scale self-custody. This talk explains what account abstraction is and why it matters for Dapps and their users. We’ll provide specific examples of features that it uniquely enables, such as session keys, fraud monitoring, multicall, social recovery and more. The end result is the unlocking of new experiences and use cases that can move the needle for crypto’s adoption. Speaker(s): Julien Niset, Itamar Lesuisse Skill level: Intermediate Track: UX & Design Keywords: UX,security,Dapps Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum Learn more about devcon: https://www.devcon.org/ Learn more about ethereum: https://ethereum.org/ Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. Devcon 6 was held in Bogotá, Colombia on Oct 11 - 14, 2022. Devcon is organized and presented by the Ethereum Foundation, with the support of our sponsors. To find out more, please visit https://ethereum.foundation/
Transcript
foreign [Music] is kind of a challenge but hopefully we'll make it fun so my name is julianize I'm one of the three co-founder at Arjun and this morning I'll be talking about account abstraction why it's it's a game changer for the ux of of dapps but I think uh an alternative title of my talk could it be how to scale self-care study so let me start with a pretty obvious statement and I hope we all agree in this room that self-cue study matters right blockchain is an amazing technology that for the first time can enable true digital ownership but of course you don't really own an asset if you give coustative to someone else to a third party and I think the the recent event of of this summer with the problem with Celsius is kind of a good wake-up call of what bad things can happen if we rely on custodial Solutions but of course we all know that self-key study is hard right if we look at crypto Twitter we'll see everyday users you know explaining how they lost access to their assets or the assets got got stolen and I mean sometimes these people are are expert if you look at the tweet on the top right it comes from huge yoga of the founder of a well-known D5 project so even expert are making mistake and are basically struggling with with self-custody so the question is why circus studies so hard right and and we believe that Arjun that the problem lies in how ethereum accounts were a design uh at the beginning of of ethereum it really lies at the heart of of the evm so let me dig a little bit into ethereum account to try to understand why there are a problem and and then Theo we can fix that so this is pretty basic I'm sure all of you know about ethereum account but I think sometimes it's always good to take a step back and see things with a different perspective so we all know that on ethereum there's two type of account externally on accounts or EOS in short that can initiate transactions and then you have contract accounts that can contain logic and we know that in eua has an address for identification announced to make transaction unique and the balance to in ease to pay transaction fees and we say that the user owns an account through a pair of cryptographic keys also called a signer right and what's the link between the two well the address of the account is derived from the public key of designer and transaction from the account can only be initiated by the private key of the signer so there's really a link between the two and on ethereum that cling is not is not random we need to use a very specific signature scheme called the cdsa on a very specific elliptic curve SEC p256 K1 the details are not that important but what matters is that all of this is are coded all of that logic is out coded in DVM and so if we take a step back we see that in the user space we have designer the key pair and then on ethereum we have the eoa with all the evm logic to validate and execute transactions and we see that there's video type coupling between the two right these are basically two sides of the same coin and that's kind of the problem because on ethereum we have merged the concept of designer the object that's authorized to spend your token with the concept of the account the object all the your tokens on ethereum they are basically two sides of the same coin and that's of course a problem because if the signer is the account and vice versa that means that if you lose your signer you've lost everything if I have your assigner I have your tokens right that basically means that on ethereum the entire security relies on users managing a secret this private key designer at all cost and as a user you cannot make a mistake if you make a mistake you lose everything and I mean if there's one thing we've learned from 40 Years of the internet is that we humans we suck at managing passwords and we humans we make mistake so of course I mean this is absurd and and this this concept is Paradigm will never work for mainstream users I mean do we really expect the next billions of users to basically being able to manage that single Secret at all cost I mean we're pretty convinced that the answer is no so can we do better and fortunately yes we can do better and there's something called account abstraction the idea of account attraction is is really to decouple that relation between the signer in the account with account abstraction every account is a smart contract that can contain its own Logic for example you you may want to use a different signature scheme or you may want to use a different elliptic curve or maybe you want to use multiple signers to validate transaction think of a native multisig or maybe you want to rotate your signer based on some logic that you've defined with account abstraction all of this is possible another way to see it is that on a with account abstraction every account is a smart contract with custom logic that can initiate transaction so no smart contract can become top level accounts and the good news is that with true account abstraction there's no more EOS right because every single account is a smart contract and you may have heard about account abstraction lately but actually it's not a New Concept if we look back we see that vitalik started talking about account abstraction as early as 2016 with the first EIP being proposed early 2017 the ip86 we at Arjun and people like it knows this with diagnose is safe we started building smart contract wallet in 2018 which basically were a form of account abstraction the idea was really to solve these these ux problem for self-custody using smart contract but we did so at the application layer and we came with ID like social recovery from monitoring and so on in 2020 there was a new EIP again led by vitalik EIP 2938 where the idea was to add a new type of transaction to let smart contract become first top level account so enabling smart contract to basically make transaction and pay for transaction fees soon after there was the ip3074 which took actually the opposite approach which was trying to enable some of the smart contract feature on existing EOS and then recently there was a new EIP again led by his italic eip4337 which basically is a generalization of smart contract quality the idea is to decentralize some of the infrastructure that is needed to make uh to to write and to operate orchest Smart contract wallet and I think eip4337 is very interesting uh for different reasons first of all it does not require a fork so it lacks smart contract quality it works at the application layer and and it's actually a good architecture I think which can lead us in what Native account abstraction should be in the future so let me dig a little bit into 4337 rapidly so on 4337 users they send they don't make transaction they send user operation and they send this user operation to a highly level mempool on which you have bundlers like miners that can basically take a bunch of these user operation and building them into a normal L1 transaction and that transaction is sent to a specific contract a single term called the entry point when that transaction reach the entry point contract the entry point will basically orchestrate the validation and the execution of this user operation and it does so by calling two method of the on the wallet a first method to validate the transaction basically asking the wallet are you okay to execute that operation and will you pay you know will you pay the fee to do so and then a second call to execute so we see that with 4337 there's a clear separation between validation and execution okay I mean all this is great but is this really the end of account abstraction I mean every Ridge the Holy Grail of course the answer is no each of these VIPs that have been proposed over the years they all bring some of the features of account abstraction but they also all have limitation if we look at the ip4337 the main limitation is that it leaves that the application layer so basically e4337 wallet lag smart contract wallet there are second class citizen because they still live on a chain which relies on the OAS every single depth the tooling I mean the way developer thinks about account we all think in terms of uas and that makes Smart contract quality of 437 wallet second class Citizen and that's actually a blocker for their adoption so what can you know what can we do next well what would be ideal of course is to bring four three three seven one layer down to bring it from the application layer to the protocol and actually the people who propose 4337 are working on that right now but what we think at origin is that we shouldn't wait for that to happen on L1 I mean we are knowing an era where the layer twos are picking up it's actually an amazing opportunity to fix some of this limitation of of ethereum I mean the evm is a great VM but we know that there are stuff there are some limitations there are stuff that we now know can be improved and so we believe that layer 2 is actually the great moment to do so and that's why I mean we've been really excited lately because two of the major layer 2 providers namely stocknet and ZK sync have committed to ship with Native account abstraction and so at origin we've been working with them uh quite closely for the past year trying to bring our experience as a smart contract a wallet company and making sure we can really design a kind of abstraction the way it's needed for for users and for the next wave of of users so in the remaining of the talk I'll basically focus on stacknet and give you some some example in the stagnet ecosystem but just remember remember that everything I will say applies to Z casing as well so with account abstraction every account is a smart contract but of course it cannot be any smart contract right the protocol or the VM needs to know how to interact with that account contract that means that the account must comply to a certain interface and so we've been working with starknet and open Zeppelin and defining that interface for stacknet and we came up with the following interface it's written in Cairo so don't worry is that you know the style might be a bit a bit surprising but what's important to note is that just like in the ip4337 we have a method to validate a transaction so every account must expose a method to say to to validate and decide what kind of signature schemes it wants to use you know what kind of nodes mechanism and so on and there's a method to execute to really execute the call and interact with other contract and because we are starting with a blank page on stagnet we did something very cool is that we introduce multicol natively so on stock net every transaction is actually a multi-call by definition natively and I'll come back on why that is exciting in a few minutes on top of these two method we also have a method to validate the deployment of an account that means that no account contract on stagnet can pay for their own deployment that again it's something that enables a great user experience and finally we have one last important method called is valid signature uh in the idea of his body signature is to basically verify off-chain transactions all right again I'll come back to that but smart contract they cannot sign but they can delegate signature to signers to keys but they must expose a way to say okay this signature is actually valid for myself and on on ethereum this is the equivalent of VIP 1271. okay since this is a developer conference there's basically five things that you need to remember as a developer if you want to build for account abstraction the first one is that accounts are smart contract and so they need to be deployed thankfully this is something that wallet will take care of but you still need to think that there is a an account behind every every wallet the address of this account is computed like a smart contract so there's no link between the signer like on ethereum it's it's a new address for a smart contract being deployed transactions can have multiple signature so we need to think that you cannot assume that for an account has only one signer maybe it's a native multisig so you shouldn't make any assumption and signatures can basically be an array and then if you want to verify option signature you cannot use a local EC recovery that you've been used to you need to actually ping the account and say is this signature valid and finally you can and you should use multiples because it improves the user experience by a 10x Factor at least and that's basically all you need to remember so if you are the developer if you come out of this talk by remembering this five point I think we are in good position okay so as I said we've been you know working with starknet on the defining account abstraction there and of course we built a wallet because at Urgent that's what we do and so we actually built the first wallet with Native account abstraction collagen X I promise you this is the only slide where I will chill Argent but it's still needed since I'm on Main stage so our Gen X first wallet on stagnet Native account abstraction which is quite of amazing works as a browser extension so it works on on Chrome and Firefox you can have multiple accounts it works on stagnet testnet and stagnet mainnet and it does the usual over one of a wallet you can send and receive token you can interact with dapps but as I will show it does much more than that also and it's 100 open source so if you are interested please check the repo feel free to contribute and if you haven't tried the wallet do so as well and it's been actually an amazing ride you may not know uh the stagnant ecosystem is going but actually since we started our Gen X in January we've had more than 250k downloads so that's I think that's kind of impressive and we are securing more than 90 of the funds on starknet mainnet today so all this RJ next work so typically when you think of a wallet for example like metamask you think about the client and you think about the key that can sign transactions well with account abstraction you need to think about the account contract as well so rgnx is really these three things a client front-end keys that can sign transaction and then account contracts that live on chain and it works from a user or tab developer's point of view it works exactly like like you would expect from your metamask for example when you connect your wallet and you do an action the wallet will pop up you can review the action approve the extension will use a key to sign the authorization all this is sent to the account contract on chain which will validate and then execute the operation and call the Target contract okay so now let's get to the interesting part the unique features that I enabled by account abstraction so I mentioned that on stacknet we have native multi-call the idea of a multicool is that you can actually make a sequence of operation at as one Atomic transaction think for example of the infamous erc20 approved end call right on ethereum if you want to interact with adapt that requires a token you need to First make a first transaction to approve your token wait for that transaction to be mine then you can actually make your call well with multicall because your account is a smart contract you can orchestrate these different operations in sequence so you can actually in one transaction do your approve annual call or maybe you can do your approve and then five calls and we're seeing on stagnet the developers are experimenting with that for example if you if you go on aspect which is an nft Marketplace on Stark net when you want to buy nfts you can add them to your shopping cart which is an experience that we all know and so you see all the nfts that you want to buy you finish your session then you go and you actually buy this nft in one transaction because your account will orchestrate the buying all of these these nfts so in terms of ux it's an amazing Improvement another thing that we are doing on stagnet that you can do because of account abstraction is social recovery the idea of social recovery in a nutshell is to get rid of seed phrases oh do you do that because your account is a smart contract you can program it to support a second key and you can Define that that key cannot transfer token it cannot interact with depth you can actually only do one thing which is to replace the signer key in case of a problem and you can imagine that no you give that recovery key to a party that you trust that we call a guardian think of it for example as a service and the day you lose your computer you lose access to your wallet well instead of having to think about a seed phrase private key no you just contact your guardian this service you authenticate with whatever mean you've agreed with him and the service will make the only transaction it can do on your account and reprogram your account with a new key and of course you can use a service but you can decide to be your own Guardian you can use a ledger to do so for example and we are working on ledger to enable exactly that so social recovery is really a way to get rid of seed phrase to provide a ux that users normal users can understand and it's 100 non-custodial because you as the owner of the the main key you can decide who's your guardian and you can change that Guardian at any point if you want to so that's really cool what what else can we do well we can do front monitoring with 2fa imagine that again on your account your program is second key and you decide that that second key must cost Okay so I was talking about the new cool feature the idea to do fraud monitoring with 2fa I think I was explaining that you can add a key to your account and that key must cosine every transaction so you turn your account into a two of two multisig and you can just you can choose to give that key to a service now imagine that every time you make a transaction with your origin X wallet the call data so the raw call that will be executed on chain can be sent to that service for analysis and that service based on some business rules that you may have decide you know maximum daily limit or you know trusted up and so on so it can use whatever logic you've decided to decide if the transaction is secure it's something that we know is legit or if he doesn't know if we if it knows the transaction it can co-sign automatically transparent to the user right you've just made one approve automatically the transaction is sent but if for some reason the service detects that it's a call to a contract like that he doesn't know for example he may ask you to confirm who you are using a second Factor just to make sure that no one is abusing your account so suddenly you can bring fraud monitoring with 2fa on chain thanks to a account abstraction what else this one is something that I'm very excited about the idea of session keys and I think it's particularly relevant now for on-chain games so if you play non-chained games you've I guess all been frustrated by the need to sign transaction every time you make an action having your wallet pop-up you approve and then you come back to the game so Unchained games today is basically going on and off of the game to approve transaction well the idea of session Keys is to say no imagine that your game the dab the client generates a temporary key in your browser and ask you to approve that key but he asks you to approve that key with a set of constrained policies for example the DAP will say I want to sign transaction but only for 25 minutes the duration of a session and I will only call this contract and that contract and descend that method that's the only thing that I want to do as a user you can approve so yes that's one confirmation with your wallet you say yeah I want to start a session on that game under this condition and next when you start playing the game every time you click on a button you make a game action the dab can send the transaction directly to your account and the transaction will be approved so you no longer need to sign you're no longer need to confirm you can actually focus on playing the game but you know that your account and your tokens are secure because the key you approved can only do a very construct set of actions that you have approved that's something that several games are actually now integrating into their logic on stagnet so I do believe that that's a pattern that will come and that really will enable the ux of of unchain games another thing is that we are experimenting and it's a collaboration with cartridge and Ledger is the idea to make the account much more modular so imagine that your account is kind of a base contract on top of which you can add plugins and each plugin can have a different logic to validate and execute transaction so you can imagine that there's a plugin which contains the session keys that I just showed there's another plugin that may work as a new a just a signer but then there's another plugin which much stronger security that we'll use that will be a multi-sig or that will do social a recovery as a user you can actually pick and choose the plugins that you want for your wallet and really design your wallet for the purpose the use case that you want to use it if a wallet for gaming where you know you will spend maximum 50 dollars does may not need the same security requirements as your the wallet you use for trading on D5 for example and by making the account modular user can really choose pick and choose the experience that that they want and finally one last feature that we are exploring is the ability to use the secure Enclave of your phone because your account can be programmed you can actually program it to verify signature on a different elliptic curve and for example you can use it to verify signatures a curve that's approved by the nist and that is implemented in the secure Enclave of your phone and suddenly you are turning every single smartphone into a hardware wallet and that's actually something that someone has done on stacknet so he built an account that uses that logic to verify signature so you can really now turn smartphone into Hardware wallet the use cases that I showed you are the stuff that we are you know building and exploring at urgent but I believe that icon abstraction opens a completely new design space for for user experience and so we're only scratching the surface of what can be done so I hope that I've convinced you that icon abstraction is needed for the ux of the blockchain but I think more importantly to really scale the user experience of self-q study and the thing is that if we don't do that and if we stick to the eoa model that we have today my bet is that the next wave of users they will turn to centralized Solutions I mean most of us in this room we are using it already a coinbase or an FTX or you know binance account because yes it's simpler so can we really expect the next wave of billion users to not do that of course they will so we need to find a way to build a user experience that is on power with these centralized exchanges so that would be big certificate study at the heart of every interaction on the blockchain and and I'm personally convinced that only account abstraction can do that so let's make it happen and build that together thank you Julian thank you very much for this I also was looking at your twittering jokes actually wrote that what the is account extraction so that's super cool if you want to read more about it yes just if you if you want to know more there's a three-part series called what the is a con abstraction you can find it on Twitter and also if you're interested we are actually having a panel on this main stage at 5 pm today with vitalik Dan Finley from metamask and then you have which has been pushing for eip4337 so if you want to know more please stick around and come at 5 PM perfect Jillian thank you very much co-founder of Art and giving a round of applause again please thank you Julian thank you very much
Automatic transcript — names and jargon may be misspelled.