Unique Identifier in Zerodev + Web3 Authentication Integration

Hello team,

I’m currently integrating zerodev + web3 authentication in Arbitrum Sepolia. As the app includes a backend service, I’ve been using the address generated by zerodev as the unique identifier for managing users on the backend. However, I’ve come to realize that this may not be the most optimal choice for two reasons:

  1. The address can change if we transition from the testnet to the mainnet (for both web3auth and zerodev).
  2. A single owner account (web3Auth account) can generate multiple accounts on zerodev.

Considering these factors, I’d like to inquire whether there are any other fields provided by web3auth that could serve as a unique identifier, instead of relying on the current account address. Thank you.

hi @nhat.work.2024

I hope you are doing well.

  1. Yes, the address will change from test to production networks.
  2. The best way to solve it, is to use an aggregate verifier like Auth0 and your verifierId will be always the email. You can test our example web3auth-pnp-examples/web-no-modal-sdk/custom-authentication/aggregate-verifier-examples at main · Web3Auth/web3auth-pnp-examples · GitHub and notice try to get the User Information with different social logins or with the email_passwordless.

I hope this can solve your problem, if not please get in touch again.

To clarify, I’m currently utilizing Facebook, Google, Discord, Twitter, and MetaMask for login authentication. For MetaMask, I’ll utilize the wallet address as the unique ID. However, I have some inquiries regarding the other methods:

  • Do I need to create custom verifiers for these platforms, and are there any specific configurations required for these verifiers?
  • In the scenario where an account isn’t linked to an email for login, how should I handle the resulting error?

Hey @nhat.work.2024

As I read your question, you’re looking for a constant identifier that will not change across mainnet and testnet for Arbitrum.
What @TomTom mentioned is correct, but for Web3Auth Networks, not the blockchain network. As long as you are on the same network of Web3Auth (sapphire_mainnet, testnet, sapphire_devnet etc.) , with the same verifier, you will be getting the same key across any blockchain network. This means that the Web3Auth address will remain the same across mainnet and testnet for Arbitrum. Hence you can utilise that as a unique identifier for your usecase.

Talking about your further questions, an aggregate verifier will help you get the same key across multiple social logins, ie. Facebook, Google etc. You don’t need to create that until you want the user have the same address with different social accounts. Your standard web3auth verifier will work in that case. If your account isn’t linked to a common email or any particular parameter across different social accounts, your accounts cannot be aggregated. For eg, there is a high chance your Discord cannot be aggregated with your Google account.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.