Skip to main content

User authentication and wallet support

📝In this article, we cover:
  • Why user identity is linked with wallets
  • Wallet options for user identity

Introduction

In web3 games, it is important for user identity and wallets to work together.

By associating users with wallets, game developers can effectively manage assets within the game. In this regard, users have two options: they can either bring their own Metamask wallet or utilize Passport, which offers user authentication and a non-custodial wallet all in one. This allows users to securely manage their digital assets while ensuring a streamlined gaming experience. Whether users opt for Metamask or Passport, the integration of user authentication and wallet support is fundamental in creating a user-friendly and secure web3 gaming environment.

Metamask

The most configurable way to have identity + wallet management in your game is to allow users to bring their own wallet. This would be implemented by having your users authenticate their identity first, then having them click a “Connect Metamask” button in their settings menu.

The advantages of this approach are:

  • Allows users the flexibility to swap out wallets while maintaining the same user identity
  • Allows a many-to-one implementation where users can associate many Metamask wallets with one user identity

The main disadvantage here is the complexity of the setup. Users will need to set up their own non-custodial wallet and manage their own private keys. This approach will be best for sophisticated users that have a lot of experience with web3 tools.

Other disadvantages include:

  • Users must repeat the wallet connection process when switching from one web3 game to another
  • Additional game design considerations will be needed for mechanics such as progress trackers (i.e. in-game exp) and off-chain currencies and how they will persist when users switch wallets

Passport

Passport is a blockchain-based identity and non-custodial wallet system, all wrapped up in one. It offers a persistent identity that accompanies users across Web3 games, and does so in familiar Web2 flows such as email-based login links and social logins.

The advantages of the Passport approach are:

  • Easy onboarding of users using familiar web2 login flows
  • Persistent identity across many Web3 games (unlocks unique marketing and UA capabilities)
  • Users still maintain custody of their assets

The disadvantages are:

  • Can be difficult to integrate if your game already has an identity solution in place
  • Difficult to reconcile situations where a user’s wallet is compromised

Please see Passport technical documentation for details on how to integrate Passport into your game.

Combined (Passport + Metamask)

For the best of both worlds, you can implement both the Metamask and Passport approach into your game, allowing your users to log in with either method. This gives you the advantages of both solutions but can make it difficult to maintain your users' data since it will be very fragmented.