logo
dummyGradient

6 mins

Last Edited: Sep 04, 2023

Under the Hood: The Architecture & Components of Web3 Wallet

Discover the intricate layers of Web3 wallet architecture, with insights into key management, blockchain connectivity, native functionalities, and user interfaces

Web3 Wallets

Intermediary

This article aims to delve into the fundamental architecture of Web3 wallets, where users hold control over their keys and engage with preferred decentralized applications (dApps). The framework outlined below primarily pertains to conventional wallets but can also be applied to conceptualizing other wallet types. Some well-known examples of Web3 wallets include MetaMask, Coinbase(Web3 wallet), Trust, Frontier, etc.

If you are building in Web3, be it a protocol, chain, or Wallet, this blog post should help you break down the overall Wallet structure and see what's under the hood.

The role of Web3 wallets is pivotal as it empower users to engage seamlessly with their preferred dApps and blockchain networks. Distinct components within these wallets significantly influence users' choices between one Wallet and another. Ongoing innovation are taking place across these layers and components, as per users choice & ever-evolving landscape of Web3.

Let's delve deeper to understand in detail-

Architecture of Web3 Wallets & its components

A high-level framework applicable to the majority of Web3 wallets includes-

  1. Key Management
  2. Blockchain support & dApps connectivity
  3. Native functionalities
  4. User Interface Design

Web3 wallet overall architecture (1).png

These core architectural components define the distinctive nature of each Wallet, resulting in varied use cases achieved through mix and match. These features provides an opportunity for the Wallet market to remain fragmented with no one-player fit approach.

Let's examine each component of the Web3 wallet -

Key Management in Web3 wallet

At the core of Web3 wallets lies the essential element of key management, composed of several interconnected sub-components that collaborate seamlessly. It is the core component, as the complete functionality of the Wallet depends on its existence.

The sub-components of key management are as follows-

  1. Key generation
  2. Key recovery
  3. Key storage & control
  4. Signature generation ( Interconnected to blockchain )

The Key Management (1).png

Public and private keys are familiar to everyone, as they grant users access to their Wallet or Externally Owned Accounts (EOA) across various blockchains, including Ethereum. The public key is a hash that can be shared with others or is visible in transactions, while the private key remains confidential; you are not supposed to share with anyone/external party.

The typical workflow within a conventional wallet like MetaMask unfolds as follows:

  1. You first generate a 12/24 word seed phrase, which can be used later to recover the Wallet.
  2. Subsequently, a pair of keys—a public and a private —are generated.
  3. The private key is stored on your local device- whether your desktop or mobile device—operating through the interfacing application.
  4. Concurrently, the public key is presented to you within the Wallet's interface.
  5. Whenever you engage in on-chain interactions or execute transactions, the collaborative efforts of your public and private keys come into play, that results in the creation of a signature through ECDSG (Elliptic Curve Digital Signature Generation).
  6. MetaMask facilitates the creation of multiple accounts, each linked to a private key derived from the same recovery seed phrase.

Both the seed phrase and the private key represent single points of failure, and losing access to them can indeed result in the permanent loss of funds. Moreover, if these keys are compromised, malicious actors can gain unauthorized access to a user's funds.

Recent innovations related to the key management include -

  1. Multi-signature (Multi-sig) Wallets: This approach involves multiple wallets to sign the transaction. These are popular among institutions.
  2. Social Recovery: It allows you to connect your social profiles like Google and Meta. You need not worry about the keys; it acts as a recovery method. Some conventional Wallets have adopted it; Web3Auth is a good example.
  3. MPC-based Wallets (Multi-Party Computation): Wallets utilize MPC technology to fragment the key into shards and distribute them across various devices for enhanced security.
  4. Smart Contract Wallets: These wallets enable customization, like introducing a guardian to recover the Wallet, sign-transaction, etc. Although not easily categorized, they contribute to easing key management challenges. It cannot be fully categorized, but it still makes some effort to ease key management.

Blockchain Compatibility & Connectivity to dApps

The scope of blockchain support in a Web3 Wallet has far-reaching architectural implications. The range of supported blockchains can significantly differentiate from one Wallet to another. Consider the example of MetaMask that supports any EVM-compatible chain. Similarly, Phantom was initially tailored to Solana, but now it has expanded to EVMs, while Leap Wallet bridges the Cosmos and Near ecosystems.

*When we worked at Frontier Wallet, it was focused on multi-ecosystems like EVMs, Solana, Cosmos, Near, etc. That was a huge target and as well a unique differentiator.

In the realm of blockchain ecosystems, most Layer 1 networks develop official wallets to engage and onboard their community. Such wallets enable users to seamlessly interact with the blockchain and the dApps built atop it. For instance, Aptos introduced the Petra Wallet for this purpose.

Moreover, blockchain can also influence key management, including the key generation and signing. DApps typically offer the flexibility to switch between various supported blockchains. The degree of integration between wallets and dApps—be it direct, or facilitated by tools like WalletConnect, Web3 onboard, Rainbow kits, etc.—substantially shapes user experience and their capacity to engage with dApps. While the dApp connectivity alone will not determine the Wallet capabilities, it's primarily influenced by the underlying blockchain on which they are deployed.

Blockchain Ecosystems Support (3) (1).png

  1. Wallets have strived to encompass support for multiple blockchains or ecosystems through a unified interface. However, I am on the fence about this approach for two reasons.
  2. Every blockchain/ecosystem has uniqueness and use cases; if Wallet doesn't bring this personalization, it's hard. So it takes more effort to achieve this once you spread across.
  3. As an industry, we are early, and this level of simplification or ease might be too early a move. With the effort required to be successful, a multi-ecosystem wallet is an uphill battle.
  4. A significant development in this realm is the advent of Account Abstraction (AA) for the EVM ecosystem. This advancement will continue to shape the landscape of native functionalities, a topic I'll delve into further below.

Native functionalities

Embedded within wallets, native functionalities constitute the third layer of a generic wallet architecture. You must have observed and used these functionalities like Swapping the token inside the Wallet, bridging, on-ramping, etc.

Native functionalities are pivotal in enhancing the user experience, and facilitating the effortless management of assets. Additionally, they can serve as means of ‘revenue generators’ for wallets; considering the fees accrued from each token swap.

Notably, MetaMask exemplifies this by amassing significant revenue through swap fees in the millions. It's a hard nut to crack; only a few players have proven the model.

This could be a key differentiator, but most Wallets are developing basic functionalities in the current landscape. We recently saw some players trying to create differentiation with functions as driving factors, like Wallets focused on Staking. Still, I need to determine the success factor as I see them pivoted already. The importance of these native functionalities spans across various user levels- institutional, retail, and enterprise segments.

Some of the native functionalities offered include-

  1. Swap tokens within an ecosystem/blockchain
  2. Bridge tokens
  3. On-ramp tokens
  4. Staking
  5. IBC ( specific to Cosmos )
  6. Governance voting capabilities
  7. dApp explorer
  8. Revoke allowance

Native wallet functionalities used by different user types (2).png

Recent innovations related to native functionalities have been around-

  1. MetaMask Snaps: Despite not gaining significant traction, the introduction of MetaMask Snaps marked a credible endeavor to integrate native functionalities directly into the wallet interface.
  2. Frontier's Native dApp Integration on Mobile
  3. AA in the EVM ecosystem - The bigger one I am excited about is Account abstraction (AA) in the EVM ecosystem. This could fundamentally shift how the functionalities are consumed and the interaction with blockchain or ecosystem happens. AA is interconnected and might be applicable at both layers.
  4. Avocado Wallet serves as an excellent example. It showcases the practical realization of integrating native functionalities into the Wallet.

User Interface Design

Undoubtedly, the user interface (UI) plays a crucial role in the success of a Web3 wallet. It's the bridge between the complex underlying blockchain technology and the end user, shaping their experience, interactions, and perceptions of the crypto ecosystem.

Among the prevailing options — browser-based extensions, mobile interfaces, desktop apps, and web apps — certain categories have experienced varying levels of popularity. Notably, web apps and desktop apps have witnessed declining interest, while browser extensions and mobile interfaces have garnered substantial user traction.

Can user interfaces be the key differentiators?

Yes, to an extent. For example, mobile can be considered much more secure in storing your private keys. Since, mobile wallets are often encrypted with advanced security features that enables biometric/face-id kind of 2FA to protect against hacking and other threats.

Recent innovations related to the user interface are -

  1. Within the realm of mobile applications, have indeed been notable. These strides in innovation at the wallet architecture layer have focused on enhancing the mobile app experience.
  2. When examining the current adoption of Web3 wallets, major players like MetaMask and Trust have significantly captured user attention. However, a significant challenge in achieving broader adoption lies in the complexity of user interactions across different layers. This complexity can deter users from fully embracing Web3.
  3. Centralized exchanges like Coinbase and Binance are great examples of how abstraction could simplify it but it comes alongwith the cost of losing control of your custody.

Looking Forward

The current state of Web3 wallets is marked by fragmentation, where each wallet operates within its distinct ecosystem, offering unique features, user interface, and other intricacies. This situation makes it challenging for individuals to select the most suitable option. While these distinctive features are understandable in the early stages of tech adoption, but it often results in interoperability issues, that hinders users from seamlessly engaging with various decentralized applications (dApps) and blockchain networks. This confinement within specific ecosystems also steepens the learning curve for users.

A more unified approach could streamline the onboarding process, making it more accessible for individuals to enter the Web3 ecosystem. While centralized exchanges have successfully onboarded a wide range of non-technical users by simplifying core functionalities such as trading, wallet management, and fee structures, but there's a need to broaden our focus.

We should start leveraging technological advancements like Account Abstraction (AA) and Multi-Party Computation (MPC) in Web3 wallets with different use cases by creating a user-friendly, secure, and self-custodial ecosystem that should empower -enterprises, institutions and everyday retail users, to fully embrace Web3. By implementing abstraction at each layer of Web3 wallet development, we can foster the adoption of these wallets, offering a unified experience that caters to the needs of both crypto enthusiasts and newcomers alike.

🔑  Key Takeaway

Simplifying Web3 wallet architecture is crucial for user-friendly custody solutions, & vital for widespread crypto adoption. Achieving a balance between abstraction and user control, akin to centralized exchanges, can help propel Web3 technologies into mainstream use, despite the current dominance of major players like MetaMask and Trust.