[BUIDL Asia 2023] Starknet Native Smart Accounts - A game changer for blockchain UX
Kryptoplanet Talks · 30 Jun 2023 · 23:21
StarkWare's StarkEx product lead Yael Doweck presents Starknet native smart accounts and argues they are a game changer for blockchain user experience. Given at BUIDL Asia 2023, the talk covers account abstraction on the Starknet Ethereum layer 2 and what built-in smart accounts mean for wallets and everyday users.
Speakers
Topics
From Kryptoplanet Talks, hosted by Kryptoplanet.
Transcript
[Music] foreign thank you so much for coming so I'm Al dweck and I'm a product manager in software for the past three years I'm very excited to be here today my first time in Seoul and today I'm going to talk to you about starket Native smart accounts also known as account obstruction and why this is a real difference in the blockchain ux I'll take my Clicker okay so I'm going to start with the following questions why are people scared of blockchain and I've been searching Google for this
question and what I got was this answer that's the most common answer people just don't understand it and I'm saying why do they need to understand it do they understand the entire banking system so basically what we want is the users to have the same user experience that they are used to so they won't be scared and they wouldn't need to ask what is this new technology this is the agenda for today so first I'm going to explain what is account obstruction and then I'm going to convince you that this is a game changer you bet it is and then we're going to go a bit into the technical details I'm going to show
you two different implementations of account obstruction the first one is done by ethereum also called eap4337 and then I'm going to talk to you about what we did in starknet with Native smart accounts and why we chose to do it like this and finally I'm going to show you three real world applications that exist today and implemented on starkx and use darknet native Native smart accounts okay so first account obstruction in order to understand what is the current obstruction we need to First understand what was before account obstruction
so ethereum traditionally had two types of accounts the first one is eoa externally owned account for this account you need to have a key pair and you must sign each transaction using your private key with a very specific ethereum signature scheme this account can send transactions to the network on the other hand you have the smart contracts that's a different kind of account you can have any general logic quoted into it but this account cannot initiate transaction so we have this limitation if we want to have both General logic and to initiate
transactions we can't do it with one account with the existing existing scheme okay so I'm going to show you two examples of problems that um that their cause is this lack of General computation in EOS first of all who in the audience ever used a seed phrase thank you Sam yeah some people have used it and you see the reward faces why is that because you get the seed phrase It's a 12 or 24 word seed phrase and you write it on a note and then you keep thinking
what am I going to do with it on the one hand I don't want to lose it because then I'm going to lose control over my funds but I don't want anyone else to see it as well because if someone will have my seed phrase they will be able to steal all my funds so people choose this very silly solution where they just stuck the seed phrase under the mattress like we used to do a few hundred years ago with our money before we had Banks and we don't want to move a few hundred years back we want to move forward right we want a better experience another limitation that exists is
subscription payments so let's say that Alice has an account has a subscription to Netflix and she's paying each month but now Alice is going to the mountains she wants to travel and she doesn't have internet connection and now she can't pay her Netflix subscription but she really wants to get home and binge her favorite TV show Emily in Paris so since she doesn't have an internet connection she can't pay and then Netflix cancels her subscription and when she gets back home she won't be able to see the TV show and that's unfortunate for Alice right so we saw all these limitations we have
and there are other problems with EOS and what I'm saying today is that we have a rescue and to the rescue we have account obstruction and the cognitive obstruction offers a few main features the first one is that you can use different signature schemes you don't have to use the ethereum signature anymore so for example this can solve the seed phrase problem that we saw before another thing you can do is pay fees with a different token not necessarily The Ether token and it also enables Atomic multicol which is very useful for D5 operations
for example where you need to do allow first give permissions give allowance to a near C20 contract and then do swapping for example you can also have different replay attack prevention schemes so you don't have to use the sequential nonce that is the traditional way in ethereum and you can you can have any general Logic for example recurring payments for Netflix so let's see what kind of experience you will have with account obstruction so first you remember the confused user with the seed phrase and now see this
user he's sitting he's relaxed he can use his face ID in order to send transactions that's very comforting right and this mobile will sign the transactions for him with a different signature scheme you can have multi-signer multi-signer enables for example a shared account between multiple parties where all parties need to sign each transaction in the account that's useful for organizations for example and you can also have better security in your own account where you have for example two different signers your own signers a Google signer and let's say a
mobile phone signer and then if one of them is compromised you want your funds won't be stolen because you have another signature that is required another thing you can do with multi-signer is fraud detection so here you can see a malicious party a malicious actor stealing your seed phrase and then this actor is trying to make a very big transfer from your account to his account but since we along will designers you can have a fraud detector that is required to sign each transaction in your account and this protector can detect a
suspicious suspicious activity in your account and then call you or send you an email and ask for your approval of this suspicious transaction the last example is for gamers do we have any Gamers here oh we have thank you so this uh this gaming experience can be dangerous for example there might be a monster running towards you one moment and you really need to fight it and if you're playing with your friend you may want to pass in your sword because it doesn't have any weapons and if you will find to get if you're fighting together
you have a better chance to kill the monster but now you get this annoying pop-up saying that you must sign a transfer of your sword to someone else and you need to verify some parameters this is very annoying right you just the the monster is running towards you you can't spend some time in approving the transaction right now so session keys and enables you to delegate the signing task to someone else while you are playing so you can play peacefully and then later on you will get a you're signing you will be the only signer again and you can limit the
signing for weapons only or something like that okay so we saw all these nice things we can do with account obstructions and of course there are other great ideas and uh these like this these features will bring better accessibility and approachability to blockchain in general and then we'll bring to wider absorption of blockchains okay so now that we saw how amazing account obstruction is I'm going to show you two implementations of account obstruction
one was done by ethereum and this is called the ap4337 and the second one was done on starknet and it's called native smart accounts and that's what we did and I'm going to explain why you were chosen the way we did so aip4337 has a few main goals the first goal is well to have account obstruction so users will be able to use Smart contract wallets and they won't have to have an eoa at all the second goal is that these users will have the same guarantees that they would have got if they used EOS so we want to
keep the same decentralization even if we're adding another layer on top of ethereum and the last goal is that we don't want to make any changes to the ethereum consensus layer since ethereum is going through some changes anyway and we don't want to burden the network with more changes okay so this is how it works that's a very basic diagram but that's like that's the high in high level how it works users are sending user operations to a new mempool a user operation mempool and we have a new role in the protocol
this role is called bundler and the bundler is taking user operations from the mempool and bundling them into a bundle this bundle is sent as a transaction to ethereum to a new contract called the entry point contract and this contract will go or go over all the operations in the bundle first it will validate that each operation is valid in terms of the signature it will validate its signature it will validate that there is enough funds in the account to pay for fees and then if the validate function passed
it will execute the operation that the user requested okay another thing you can do with the AP 4307 is called pay Master pay Master enables paying fees with a different token Than The Ether token so in fact the paymaster is a service provider it deploys a smart contract that is going to pay fees for users it needs to make sure it has enough funds all the time to fund the user's fees and then the pay Master pays the fees in ether for uh for the user and the user will pay back after execution
in a different token that he owns for example usdc so this way users don't have to hold ether in their account when they're doing operations something to note here is that the bundler in this scheme is exposed to those attack and this can be performed by both the user and the paymaster the way it the attack works is like this the banner before it inserts the operation into a bundle it needs to simulate the validate function and see if it's going to pass if it's not going too fast then anyway the banter is going to take to throw these this operation
because he doesn't want to put it in the blockchain it's not going to get paid for it if simulation passed then the banner will put the operation into the main pool then the operation is inserted into a block now there's a real-time validation on the blockchain and this validation can fail although the simulation passed before this can happen if the validation re is reading from Summer external storage for example and then storage has changed and then the banner is not getting paid but he did some work so it's not fair
right so aib 407 solves this uh or can I say reduces this attack by putting some limitations on the validation function but I won't get into it right now you can talk to me afterwards if it's um if you're curious about it about it so now I'm going to show you what we did on starknit what we did on stagnet is account obstruction that is baked into the protocol it's one of our architecture decisions and it's called native smart accounts because it is native and the protocol so in starknet we have every count is a
contract that's the only type of account we have we don't have EOS at all the signature in the transaction the signature field is a flexible field it can contain any type of transaction and the sender address if the account contract addressed it doesn't correspond to your private to your public key in any way the account contract structure has two main functions it has the validate function that's very similar to the EAP of ethereum that we saw earlier it has the validate function these functions verifies the account signature and this can be any type of signature
and it has the execute function which executes the operation that the user wanted to execute and this can also be a multiple so now I want to compare the two solutions and explain why we chose to implement native smart accounts here we see the three features that account obstruction offers fee abstraction non-substruction and signature obstruction these three are all supported by the two solution although as a side note on starcat we have it implemented the fiance non-obstruction yet but it will be existent in future versions
but basically the architecture architecture supports the three features then I want to talk to you about the bundlers so eip4337 add the bundle roll into the protocol now this requires additional infrastructure and tooling just for that while in stock net we don't have this role so it doesn't require anything in addition to the basic tooling we have and then there's also the Financial Risk as I discussed earlier the banner is exposed to some dos attacks so the binder is taking the risk that the state will be different when
he's submitting the transaction and some operations May Fail and you won't get paid now there's Legacy EOS so in ethereum all the wallets and applications need to support both eo8 and the count obstruction while on starknet there is only account obstruction that's the first class citizen of starknet so only smart accounts are supported and there's the cost so naturally the layer 1 costs are higher than the layer 2 costs so account obstruction will be costly on layer 1 on
ethereum which means that some users may decide to stick to the eoas after all because they don't want to pay more while on Stark net since it's a layer 2 and there's about 100x reduction in cost the price for account obstruction is negligible so users well they have to use it but they won't fill the difference in the pricing and they will get the improved user experience okay so finally I want to show you three real world Target applications that we have today
on starknet and this will show you that it's very easy and useful and practical to implement all kinds of new features using startnet native smart accounts first we have the Bravos wallet which supports the hardware signer of the mobile if you remember the relaxed man that is using the face ID in order to sign transactions that's what Bravo has implemented so Brothers has three layers of security there's the feed phrase signer and there's the hardware signer which requires the person signing to have both the mobile and his face ID so that's
two-factor Authentication and you can also decide to have an account with an increased security with two signers both the C tray signer and the hardware signer so this is better if you have a large amount of funds the second real world implementation is the Urgent wallet urgent implemented a guardian to their wallet so each user that chooses to have a guardian will have a second sign or to his account the gunny the guardian will monitor the transactions that are happening in the user account and if anything bad happens
it will stop signing and say tell the user or send him an email and tell him that something bad happened and he needs to approve this suspicious transaction now you can say hey this Guardian can censor transactions and just not sign them but that's okay because the user can always remove a bad Guardian from his account it just takes a seven day security period the third and last example is Visa recurring payments so if you're a member poor Alice who wanted to watch her TV show on Netflix and couldn't pay for her subscription in the mountains now
she can do it with recurring payments without being connected to the internet so in this scheme we have Alice's account on the left side and Alice's account give has a white list of contracts that it approved it always approves uh requests that get from these contracts okay and the auto payment contract is a the recurring payments contracts from Netflix now every month Netflix will activate uh will initiate a request from the auto payment contracts to ask Alice's account to make transfer to Netflix and Alice's
account will approve this transaction because um the auto payment account is in the white list so this way Alice is happy she can binge Emily in Paris and see if Emily finally chose Gabrielle Alfie and she's happy and she can go hiking so to summarize what we've seen today is that account obstruction is going to make a huge difference it has different it has all kinds of features for example different signature schemes mold designer which offers better security mobile signer which adds better ux and other great features like fraud
detection session Keys recurring payments and tons of other ideas you probably thought of a few right now and I showed you three reward applications Bravo's argented Visa that show that this is very practical and use useful right now all of this will bring to a better world and improved experience of blockchain and eventually to wider adoption I invite you all to try it on starknet and if you do please contact me and let me know how it was thank you [Applause]
[Music]