The power of account abstraction. Technical overview of the xRaise Wallet

xRaise
9 min readJan 14, 2023

It is increasingly evident that current blockchain technologies face limitations that cannot be overcome using traditional methods. The blockchain field requires new and innovative solutions.

The limitations we’re discussing don’t stem from scalability issues. The Ethereum community has been working on a rollup-centric approach for some time, and it’s starting to pay off with multiple layer 2 solutions now live on the mainnet, such as Optimism, Arbitrum, ZkSync, and Starkware. These solutions significantly increase overall chain throughput, from tens to thousands of transactions per second, and also offer low transaction fees, account abstraction, and custom signature verification. However, to fully take advantage of these advanced features, they need to be cooked together properly. We’ll touch on this more later.

Wallet UX is still the major problem

Centralized wallets — cryptocurrency exchanges

Have you ever wondered why many mainstream users prefer to keep their cryptocurrency assets on centralized exchanges? The answer is simple: in addition to instant trading access, centralized cryptocurrency exchanges offer a user experience similar to that of traditional web2 fintech companies, with fast transactions and the ability to recover lost passwords and access funds at any time. This makes it easy for users to use crypto assets without needing to understand the underlying technology. However, the reliance on centralized exchanges to hold funds has had negative consequences, such as major exchanges mismanaging user funds and going bankrupt, leaving thousands of users without a dime and giving the industry a bad reputation.

Self-custodial wallets (Hot and cold wallets)

Although, is a step forward in terms of security, self-custody imply a user understands some technical concepts of blockchain technology like wallet private/public key generation and require to keep seed phrases securely. If the private key is lost, the funds are lost forever, and there is no way to recover. The thought of losing or compromising private keys is still dreadful to industry veterans. Do we expect to onboard the next billion cryptocurrency users with this type of wallet UX? If we want mainstream adoption, there must be something better.

Hybrid approach — account abstraction

Account abstraction has the potential to revolutionize the user experience of cryptocurrency wallets and payments. With native integration of account abstraction on zkSync, custom signature verification and social recovery support, we can create a breakthrough wallet experience that is accessible and easy to use for a wide audience. Let’s break down how we can achieve this.

Fast wallet creation and sign in

Imagine your friend who regularly pays for Netflix subscriptions, rents apartments on Airbnb, and swipes through Tinder on the weekends. They’ve never installed a cryptocurrency wallet and never considered the possibility of incorporating crypto into their life. This friend represents the typical online payments user.

To achieve widespread acceptance of crypto payments, it is crucial to make it easy for users to

  • Create wallet
  • On-ramp funds (or bridge from L2 chains or L1)
  • Access wallet and approve transactions
  • Recover wallet access in case an access is lost

With xRaise solution integrated into merchant’s checkout page, users will be able to create wallet without leaving a merchant website and without downloading any apps or extensions. And it does not come at the expense of security. This can be achieved by using custom signature verification and account abstraction on zkSync. Additionally, the use of WebAuthn, a modern passwordless authentication protocol, can further enhance security by allowing transactions to be signed through fingerprint or system pin confirmation. These signatures can then be verified on-chain. By integrating WebAuthn, we can create a seamless and secure payment experience for users.

It may seem complex, but let us explain what is happening behind the scene.

1.Wallet creation. The client-side requests the browser's API to create a new credential, which is a keypair, for the user within the system authenticator. This keypair consists of an ID (credentialId) and a public key. The credential ID can later be used to ask the browser to sign data with the associated keypair. Then, we deploy the user's account abstraction with the authorization data passed to its constructor. In the case of WebAuthn, we pass the public key. Now, user transactions can be signed using the fingerprint. The user's account abstraction will extract the custom signature from the transactions, and verify that it was signed with the correct key.

2. Wallet sign in. For login, we will generate a random string, have the browser sign it with user fingerprint, and then use the EIP-1271 function “isSignatureValid” in our wallet smart contract to validate the signature. If the signature is valid, it confirms that the user can sign transactions, and we will allow them to proceed to the next step in the wallet. Our implementation uses the signing algorithms used in WebAuthn, such as ES256 and RS256, within the smart contract for validation. This process does not require any communication with backend and the wallet will remain functional as long as the zkSync network is operational. In the future, we plan to migrate the wallet frontend to IPFS to increase the level of decentralization.

Wallet sign in

3. Transaction signing. To sign transactions, we first request the browser to generate a signature for the transaction. The signature is then sent to the blockchain where it is verified. If the signature is valid, the transaction is processed. This process ensures that the transaction is authorized and secure.

Tx signing

To prevent untrusted website to sign data using credential from trusted website, all credentials (keypairs) are bound to some origin. If example.com is generated credential, sample.com can’t use the same credential to sign data.

Social recovery

If a user loses access to their wallet, they can restore it using social recovery. Social recovery is built on the concept of guardians, which are smart contracts or users that can verify the identity of the person attempting to recover their wallet. Guardians can be chosen from a variety of options such as close relatives, email verification, social media verification, phone number verification, etc. The user can define up to 7 guardians for their account, and even if the guardians are not users of xRaise, they can still approve the recovery using email messages.

Guardians are essentially smart contract addresses that approve or reject the user’s authentication request. We have implemented the Raise Guardian as a default guardian. In the future, we plan to introduce a program for independent services to create guardians for our wallet, allowing them to easily be integrated into the system.

The perks of integrating xRaise Wallet

  1. Connect just like with Metamask

We implemented connector for wagmi and web3-react libraries that are used to connect user wallets to decentralized application (dApps) or games. So you can add xRaise Wallet just by adding several lines of code. Our solution can also be integrated into any other library.

2. Transactions batching

Our wallet allows users to perform several transactions at once, which is different from Metamask where only one transaction can be approved. The user can view all of these transactions on the transaction page, where the total assets of the transactions are calculated, making it easy for the user to manage the cost in stablecoins like (USDT/USDC).

xRaise Wallet allows users to purchase items in a web3 store with a single transaction, eliminating the need for separate token approvals. This is made possible by batching the approve and transfer transactions together and makes the process of more convenient for the users.

3. Permissioned sessions

The xRaise Wallet allows users to create a session with specific permissions for web3 applications, such as an NFT game, that require multiple transactions. By creating a new keypair within the RaiseAuthn web worker and calling the wallet smart contract method “createSession” with the new keypair address, the user’s wallet can pass transactions signed by this session signature, which are requested from RaiseAuthn. These sessions can be used to limit the maximum amount of tokens and gas fees that can be spent, as well as define which contracts can be called and what actions can be made. This is similar to the permissions of apps on smartphones or MacOS.

Users can easily share their sessions from their laptop browser to mobile devices or vice versa by sharing the session through a QR code, login code, or login link. This eliminates the need to share the keypair, as only the address of the mobile application’s internal keypair needs to be transferred to the laptop browser, creating a new session for the mobile wallet. This allows for both unlimited and limited access to be granted as per the user’s preference.

Permissioned sessions

Account abstraction eliminates the need for protocols like WalletConnect as it allows for multiple authentications to be used for a single account, rather than relying on a single authentication that is shared using an external bridge which may become unavailable at times. This improves the user experience and security of the wallet.

4. Paying tx fees in USDT/USDC/RAISE

Our wallet concept allows users to use the wallet without the need to purchase Ether. This is made possible by using zkSync, which enables the creation of “paymasters” — smart contracts that can pay for transactions if they are specified in the custom data of the transaction. These paymasters can charge tokens in exchange for the Ether they pay, or they can provide free transactions for users as part of a subsidy model. Currently, we subsidize user account creation and transactions fees can be paid in stablecoins. In the future, we may implement the option for users to pay the account abstraction creation fee using credit card payments, or delegate the payments to merchants who may want to pay a small fee to allow users to create wallets for free on their platform.

Subsidizing paymaster
Raise paymaster

5. Subscriptions

As the user’s wallet is a smart contract, it is now possible to implement regular subscriptions for users. Users can sign up for a subscription by adding it to their wallet. They can easily manage their subscriptions in the subscription section of the wallet. The merchant will be able to take a specified amount of tokens from the user’s wallet at regular intervals, as per the terms of the subscription. This feature allows for a more streamlined and efficient way for users to manage their subscriptions and for merchants to receive recurring payments.

Subscription model

Summary

In this article, we have provided a technical overview of xRaise Wallet. We will delve deeper into each section in upcoming articles and provide more detailed information on how to integrate xRaise Wallet. At xRaise, we are dedicated to creating the most seamless and user-friendly cryptocurrency payments experience in the market. xRaise Wallet is a crucial component of our mission to become the best in the industry.

DISCLAIMER

xRaise develops open-source software but does not independently provide, manage, or oversee the Protocol or any blockchain network. The Services are created to help users engage more conveniently in-game, dApp services.

WE DO NOT guarantee any profits or rewards, and any involvement in this project is entirely at the participant’s own risk. Participation in this project is done solely at the discretion of the individual, and any potential risks should be thoroughly evaluated prior to involvement.

Please note that owning and investing in RAISE token does not guarantee rewards, profits, ownership of company shares, or similar benefits. The value of token can be volatile and is subject to market fluctuations, which may lead to partial or total investment losses. We do not guarantee the future value of our token, nor do we provide investment advice or recommendations. Consequently, we strongly recommend conducting your research and assessing your personal risk tolerance before making any investment decisions. Mentions of potential exchange listings are purely hypothetical, and there is no guarantee that they will materialize. All investments inherently involve risk, and individual investments do not ensure actual results or returns. Investors bear sole responsibility for any investment decisions they make.

--

--

xRaise

A smart contract wallet & SDK platform for blockchain gaming.