Smart Accounts need Smart Sessions

ETHCC 7 · 9 Jul 2024 · 27:01

Pedro Gomes, founder of WalletConnect, explains why smart accounts need smart sessions. He moves from sign in with Ethereum and the ERC-1271 signature standard to ERC-4337 user operations, paymasters, ERC-5792 and ERC-7677. He then proposes ERC-7715 permissions, such as spending 1,000 USDC for 30 days, so an app can sign for the user without repeated approvals, with passkeys protecting the keys. The Q&A covers regulation, intents and how much responsibility falls on app developers.

Speakers

Topics

From ETHCC 7, hosted by Ethereum France.

Transcript

All right, everyone. Thanks for joining. As you can see from the screen, we're gonna talk about WallaConnect, or more importantly, we're gonna talk about wallets. And you know, the definition of a wallet has changed a lot, and it's gonna continue changing. So we're gonna go a little bit through a journey here. And we're gonna have to be fast. So, first to introduce myself, my name is Pedro Gomez, and I'm the founder of WallaConnect. We connect wallets, as it says in the name. But today we're gonna be talking about how smart accounts need smart sessions. And then we have to ask ourselves what is a smart account and why do we need smart sessions?

But let's start breaking down the lingo. There's a lot of like new names and like Web3 really likes to reinvent the wheel here. And you might see all of these words thrown around, and you basically have to be proficient in all of these words to even reply on Twitter. But what does that actually mean? Like to move from a login to a connect. And actually, authentication is just one step towards that.

So you have to do it in as less clicks as possible. So less clicks is more. That's our mission. That's how we're gonna achieve the superior wallet experience, and now we're actually gonna onboard users with a better wallet. So, why is web 3 different? Why do we need to reinvent the wheel? Why is everything so difficult? Basically, when you look at web 2, you actually have on the left a server, which the application connects to. And a server is a lot of things. Like if you build a server, it's not just one thing, it's actually now we have the term like microservices, and they're all interconnected. It's not a monolithic piece of code.

But one of the most important ones is the authentication part. And that lives on the server. Well, when we moved into a blockchain ecosystem with web 3, that authentication moved into the user's device as a wallet. So, in a sense, authentication is a wallet, and that lives on the user device, and the blockchain does not have authentication in itself. The user is in control of the authentication, and neither does the app has controlled authentication. So let's start by defining what a wallet is. I like to define it as three parameters, and regardless if it's a software, mobile wallet, browser wallet, hardware, or even like some new design with like a cloud wallet and MPC wallets, it all comes down to a set of credentials, which actually enables your wallet to work.

Some signing, which can happen locally, remotely, on device, hardware, software, and then accounts. And as you see from this presentation, we're gonna talk about smart accounts, but all wallets today are pretty much external accounts. And we're gonna talk why. So, in order to authenticate, it used to be really hard before because people would connect their wallets, but you actually didn't know if they are the wallet who they are. So everyone started signing these little like cryptic messages to actually verify them, and it was really a terrible experience. So the sign with Ethereum standard made it much easier and much more human-readable.

It currently looks like the left, and as you can see, this message kind of resembles a little bit the existing Web 2, where it says this website wants to access this account, and you have to accept some terms of service. Hopefully, in the future, wallets will introduce a better user experience where you actually might have something like this. OpenC wants to access this ENS name, and you will be able to send and receive NFT assets on OpenC and you accept the terms of service. So, in a sense, signing with Ethereum is just another Google login, Facebook login, whatever you want to call it, but just for blockchain. So it did solve one problem, but it also introduced another problem, which is now you have to connect to your wallet, and then you have to sign a message.

So at Wallet Connect, we created a standard to solve this problem, which some wallets have supported today. And we with CIP222, we just removed the need from connect and just jumped into signing, which was a big step for you know, less clicks is more. And it looks just like you would when you connect your wallet, but you're also authenticating yourself. So you're essentially signing in with Ethereum when you establish your connection. But is that enough? Like at the end of the day, a wallet is not just a piece of identity, it's also something that manages your accounts with a lot of state and assets. And at the end of the day, you need to sign transactions.

That's actually what makes Web3 really interesting, because you have granular control of every action that is taken that interfaces with your account. And most people just close your eyes and approve. Like, unfortunately, no matter how much you tell yourself that like people are reading these transactions or verifying, they're just like closing their eyes and approving because they just trust the app. But that's not the right way of thinking about it. And we need to kind of like fix this in a way that's both striking a balance between convenience and security, but at the same time is actually making it a better internet. So let's stick to our mission.

Less clicks is more. We can achieve all the features of blockchain and still have as less clicks as web 2. Let's talk about the knee accounts. So we talked about external accounts and smart accounts, but what makes a difference? An external account has a single signer. That singular key is your account and nothing else. You lose that key, you lose your account. In a smart account, you can have multiple signers. Those could be multiple individuals signing, but it also could be multiple devices. It really doesn't matter.

Like a smart account is just a much more programmable account that allows you to manage that account with less risks on a singular key. With that, it comes with the consequence, which is a nice feature, that if you have multiple signers, who is actually paying for that? You actually don't have to pay with the same signer. You actually decouple the idea that the signer is the payer, which is mandatory by design in the external account. And then another feature that it comes with is that the blockchain cryptography is no longer mandatory. You might not know what 256K1 means, and it doesn't matter because that's blockchain responsibility, not our responsibility.

When you support any curve, you basically can support what you as a user support. Whether you're on Android, whether you're on Google, whether you're using a smart TV, whether you're using a hardware wallet, or a YubiKey if you're really proficient. That's what we should be using as signers. And that's what smart accounts can enable us. And when you think about smart accounts, there's actually these terms, you know, blockchain, reinventing the wheel again. Externally owned account or EOAs and smart contract accounts and SECAs, and it's just really hard. So we're just like think external account and smart account.

How can we migrate people to smart accounts? The smart account's biggest definition here is that you need the smart contract to be deployed. But then again, like if you have a smart contract, you don't have a key. So when we had signed with Tyrion, we had to sign a message. So who actually signs this message? Because we can no longer have this tightly coupled verification of one key, one account. And there's a standard called 1271 that fixes this problem, which basically just says, hey, you as an app, don't just like verify the key. Actually, check with my smart contract account if this key is a signer. So once again, another thing that's been solved.

Some apps are not supporting this, which is a big problem for adoption smart account, and we need to fix that by having more 1271 support. But we don't stop there. So things get a little bit more complicated once we actually go into the transactions, because now you have like multiple apps and multiple wallets, and then you have one blockchain, but which smart account are you gonna use? Ideally, you want one smart account everywhere. Like it doesn't matter what wallet on one app, you just have one big smart account that manages your assets. And then you can just like fine-tune the scope of what each one of them can do.

So, what is actually being connected? When you connect, you expose the accounts that you have, you read some blockchain data, you create a session with the signer that will actually be signing on behalf of your account. And for every request approval, you have to submit transactions. But this changed a lot with 437, especially around 2022, where the even the definition of signing transaction was very different. And they even had to once again rename transactions to user operations. The reason they renamed the transactions to user operations is because now we have a concept of a paymaster. As you saw, smart accounts, the signer is not necessarily the payer.

So now we actually can have a third party paying for my gas. So we actually have the wallet sign a user operation sent to the paymaster. The paymaster's counter-signs it that it says, I'm gonna pay for this gas. And then the bundler is actually responsible for taking all of these user operations, which is a nice feature as well, where you actually can send multiple user operations and turns into a single transaction in the blockchain. So now the good thing about this is the wallets don't need to care about the blockchain. And that's why we can use different cryptographic curves because we're not the ones actually submitting the transaction. So yeah, this is a good thing, but how do you actually discover if a wallet supports smart accounts?

This is something that you know, it's not gonna be a smooth transition. Some external accounts would exist, some smart accounts would exist. That's why we have to reinvent how the wallets talk to apps. And with this new standard, 5792, you actually have new formatted get capabilities, send calls, get calls, showed calls. And this allows us, first of all, with send calls to send multiple transactions as user operations. So you can see like this really cool example with our UI, where you actually have depositing, swapping ETH to WEF, and then you actually having buying a Doodle with some of that WEF. And basically that all happens with multiple user operations that is all batched by the bundler.

And then this would also be able to be sponsored by a paymaster. But then the most important part is that you also introduced the idea of get capabilities, and basically you can ask the wallet, do you support Paymasters? Which paymasters do you support? And what is the interface for these paymasters? Well, this was the original idea, but then we realized that every paymaster was doing something a little different, but they were all doing the same thing. So we then create a standard for paymasters. And this is just gonna be a journey of standard and standard because it's so hard to make smart accounts work if everyone is doing everything differently. So now Paymasters all work the same following the 7677 standard.

So this is very competitive because then we can have both wallets paying for gas, we can have, for example, one inch paying for gas, and we have a much more competitive market for gas sponsorship. But even then, like paymaster standardization is only one part of the question. What if all smart contracts work a little differently? Like what if you recover accounts differently? What if you manage your signers differently? What do you if you use your cryptographics differently? That's why we have also the standards being driven mostly by Rhinestone with 7579, but also in collaboration with Zero Dev and by Conomy and Wallaconnect, where we actually have like a more minimal interface of how we actually make smart contracts more module. And then you kind of start making the question of like, wait a second, if we already have all the standardization, like we know how PayMasters can be used by a DAP, we know how the modules can work on a smart contract, we know how to authenticate for a smart account.

Why don't you just let the dApp sign the user operations? Like, what would it take to do that? And that comes to the title of our talk, the smart accounts need smart sessions. Because realistically, today the sessions are dumb. They're just dumb. You just like say, I am who I am, and but then ask me for everything else in the future because I can't tell you more than this. So we want to reduce clicks. We don't want people to go constantly to their wallet and approve, approve, approve, because we already saw that people are just closely closing their eyes and blindly approving stuff. So we could actually set the rules with 7715 where we can grant permissions from the wallets and allow the dApp to sign the user operations.

And this would actually happen very quickly, where you could either do this with signing with Ethereum in a single trip or maybe in a follow-up request. You request some permissions from the wallet, the wallet asks the user, are you okay with these permissions? These permissions could be as basic as you're allowed to spend this many tokens, you can access these NFTs, and you can vote in my DAO for these parameters. Like you just define two or three parameters that you define the attack surface in a sense. Like, how much scope can this dApp do things on my behalf?

And most dApps do two or three things. So they're very easy to put it very simply. So it might look even as basic as this. Uniswap, you're allowed to spend a thousand USDC for 30 days on the Ethereum chain with this account. That's already enough for you to buy pretty much every token, right? You now have the ability to go to a swap feature and not have to go back to your wallet. You sign with Ethereum, you request some permissions, and now that's it. Your wallet is gone because your smart account lives everywhere.

So if the dab has all of the standardization around Paymaster and the modules and the permissions, then basically you can have this experience all embedded into the wallet itself. But can we secure smart session better? Because then again, like we talked about how wallets have multiple signers. We just gave some permissions for the dab to become a signer for my wallet. And now we actually have to think about is the dab responsible enough to actually act as a signer? And I don't know how many of you are web developers. I know that mobile developers, you have an easier time because everything is a little bit more secure, but web is the wild, wild west.

And keys getting stolen is not even like sometimes, it's all the time. So how can we fix key security for these smart sessions? Pass keys. You probably have heard this keyword before. This is not even Web3. We did not invent this word, fortunately. It was actually brought by Apple and Google, and you would have the ability to essentially go through this interface, like our SDK shows, where you can sign in with a pass key, your operating system would actually generate it inside of the secure enclave of your device. So even the app itself does not actually have access to the key material, but it has the ability to ask for signatures.

So in a sense, it is like an embedded wallet in your operating system for that application alone. And that itself, granted the permissions from 7715, would then act as a wallet within the permissions that you've granted, like spending this many tokens and accessing these NFTs. So, how can we make it this better? We upgrade the EVM. If you don't know, we talked about the cryptographic curve in EVM being 256K1. And we can use any curve with smart accounts. But it's actually very expensive, especially on mainnet. So there's actual a standard called 7212.

And you'll notice that this is an EIP, not an ERC. And the difference between an EIP and an ERC is that ERCs don't need hard forks, EIP needs hard forks. So we actually have to ask the core developers to upgrade the EVM. And this has been being pushed by multiple teams. I will tell I would say, thanks to the Clave team to actually give me these slides where they've been tracking the conversations with multiple ecosystems. And 7212 has been catching on very quickly. Not on mainnets for ATR mainnets, but you can see that pretty much all rollups have sewn the value of pass keys. Not just because of smart sessions, but because of its ability to secure a key that is on the operating system level.

This means that now you can actually have much cheaper transaction validation for the user operations by having the signers actually use pass keys. And it's now available on Polygon, on Kakarat, ZK Sync, Evmos, Oasis, Optimism, and Arbitrum is like this close to ship it as well. Done job. We can close this conference and no more conference anymore. We basically have moved the authentication module that used to live in the server, and we moved it away from the wallet as a separate device, and we embedded it into the app. Is this the end game?

What is actually being connected at this point? Like, what is the role of wallet connect? Wallet Connect used to be this middleware between dApps and wallets. But now the even the definition of the wallet itself has become so much more. We are now a middleware for the sessions, for the paymasters, for the signers, for the bundlers. Like the definition of the wallet has now fragmented, and in a sense, it requires even more interoperability. The Wallet Connect glue now is not just a middleware between dApps and wallets, but everything that defines what a wallet is. And with smart sessions, it will have a critical role where Wallet Connect will be able to delegate these permissions from your wallet into the app in a way that the user keeps its control and can enjoy the internet as it should.

So I believe we're redefining the wallet experience in a sense to make it Web3 more usable. That's our mission. And I think with this, we have completed our mission to do less clicks is more. Thank you. If anybody would like to ask any questions, then I will open the floor. Yeah, right here.

Just out of curiosity, are there any projects using this in the wild right now? I was thinking of in Phoenix because they allowed you to onboard with a pass key. What's the most complete UX you can see that in the wild right now, what you just showed? One important thing of Wallet Connect is that, as I said, we're an interoperability, a glue between all of these parties. And a lot of these parties try to build everything in-house and not use standards. And that's why we're so vocal about standards and you see my talk wasn't even about products, it was standards. Because pass keys today are being used, but if they're all being used in different SDKs in different ways, everyone is basically just having direct integrations with different products, infrastructure.

So yes, they are being used today, but I believe that in the future this will be a very competitive market. Just like it happened with Paymasters, where paymasters were just doing everything slightly different, and you had to go to their documentation and use their specific Paymaster. But now with 7677, now Paymasters all work the same way. The same thing, I believe that smart sessions will not succeed its mission if it's like smart sessions by X, smart sessions by Y, smart sessions by Z. Because that completely makes Wallaconnect irrelevant because we cannot be just this aggregator of different flavors of smart sessions. So, in a sense, there is already some prototypes, some things in production that fulfill this mission, but they're all very proprietary and they're embedded in people's products.

And we want to make sure that these smart sessions are more competitive, more interoperable, and all follow all of the standards that have been developed in the last six months. Thanks. Sorry, could you repeat the question? Um so gas payments you use sec per 256k1. Are there plans to ever be able to make those gas payments with with different curves directly? That's a good question.

So that would be like the bundler itself would actually have the ability to use another curve. I don't think that's currently the plan, right? Because what 7212 does is makes smart contract verification of that curve cheaper. But the node still requires you to send a transaction in two five sixk1. So you're basically talking not the pass key curve being supported at the application level, but at the percal level. And that's not currently the case for the ones that I showed in the chains. And I don't think they are incentivized to do that.

In this case, you're having the DAP kind of take control of the wallet, take actions on behalf of the user. Are dApps comfortable with that? And how does that impact kind of the regulatory status of some of these things? I think that the line is still pretty well drawn because the wallets manage the smart account, and the app would only have a smart session. In a way, what a smart session is, it's like an ephemeral smart account or a temporary smart account. It only can do certain amount of things with very defined scope, and it will eventually expire. So I think from a regulatory perspective, this actually does not introduce that much risk because there's only so much that the app can do.

Of course, if the app goes crazy and asks for everything, my first take is wallet shouldn't be accepting that, but it's also the app who's taking more risk. Why not just build a wallet if you want to have all the permissions, right? Right. The goal of the smart sessions is to have as least permissions as necessary just to make the app functional. Firstly, I'd just like to say thank you for the shout out for Infinex.

Um, we are live, we're not a demo, it's an actual app. Um, come get a hat afterwards. Um, my question is where do you see uh smart sessions versus intents and how that sort of crosses the line between custody self-custody and sort of that intent of actioning on the users' yeah actions. The way I see intent is that it's not exclusive, it doesn't necessarily have any conflict with any of the current design for user operations. It's more like a design philosophy.

Currently, applications ask for outputs, not outcomes, right? When you ask for a contract to do X, you exactly set the parameters of how it should do X. You don't tell the app, I want this to happen, do it, whatever it takes to this to happen. So essentially, an intent-based design means the user defines what it wants to happen, not how it should happen. So it's more about how we start the designing our applications more than the wallets themselves, in my opinion. All right, we have time for one more question.

Hello. Um, current state of things, I feel like there are two sets of developers: that developers and wallet developers doing kind of different things, and from my experience of that developers seem to be less interested in how the wallet works. They try to just get the signature at some point in time and continue. And in your models now, it's actually putting a lot of responsibilities in the DAP side. So I've seen some implementations where somebody just copy-pasted a wallet connect snippet from another project that doesn't fit it, or just expect to drop in an SDK and expect the Wallet Connect uh works. So, what kind of additional responsibilities to manage a devolus to bundles paymasters will that bring to the DAP developers?

So I think the best analogy here is Web 2. Like, do actual Web2 developers build authentication today? Maybe you should do a little research because very few of them actually build authentication today. That's why there's massive businesses like off zero who literally just do this for them. And this authentication module that actually exists in the server is never built by the actual application developer. It's just a third-party business who actually handles. Because authentication can be very complex, even in web two.

So in web 3, the way I see it is who's gonna build the wallet module inside of the application developer? Is it the application developer or is it someone else? I think it's all of these. It's a marketplace of infrastructure providers that enable that module. It's a very competitive platform that wallet connect will allow multiple infrastructure providers to compete for those resources. And essentially wallet connect is just putting the pieces together in a very good developer experience so the applications don't have to think about it. Thank you everyone.

Related talks