What login method would you use for a NFT game?

Good morning,

I was wondering what is the best method to login into a game given the following scenario:

  • The platform is built using react.js and it is hosting a game application that interacts via API with a database
  • The game player will need a NFT to play on it. The metadata associated with it will be stored on the database and will be query via one game API
  • The players will be able to sell/buy game NFTs

There are a couple of login options I were thinking about login access:
A). Create a user account in the game server (user/pass) and link it t with the user metamask wallet.
B). Avoid the need to create users. The web3.js will recognize the wallet address and query the NFTs in his account.

Any suggestions?

Some ideas please? Thank you

I would do it using the web3 method directly, this way you can concatenate the username with the person's wallet address:

Ex:

PersonA: 0xxsxxsxsxsxsxsxsxsx2313123131231

I think for a dapp, it is really common to use a wallet address to login.

1 Like

Thank you!! I was thinking the same, but a little concern about security.

If a user logins using his wallet address, when he has to do some iterations with the game using API, he should send this wallet into the request.

Then, how can we avoid a user just fecth this query and impact directly with his username (withouth the need of the game server) or worst case use this API to send a wallet address from another user into the request?

Thank you the message, then would you use metamaskaddress (blockchain) + username (game server).

Why?

Imagine,

If you need any information related to Person X blockchain address I would do it this way,

It is even possible to integrate common database users like mysql with blockchain addresses.