Can we transfer existing user saved in sqlite db to web3auth

I currently have a custom authentication system built with Express and JWT that saves users in my database, but now I want to migrate to Web3Auth. Additionally, whenever a new user signs up, I’d like to automatically create a wallet, save the wallet address and other important details in my database, and also handle the migration of existing users. Can Web3Auth help me achieve this?

Hi Arindam, thanks for your detailed question!

Summary of Your Request:

  • You have a custom authentication system (Express + JWT, users in SQLite).
  • You want to migrate to Web3Auth.
  • On new user signup, you want to auto-create a wallet, save the wallet address and details in your DB.
  • You want to migrate existing users to Web3Auth and handle their wallet creation.

Can Web3Auth Help with This?

1. Migrating Existing Users

Web3Auth is designed to be a non-custodial wallet solution that uses social logins or custom authentication for user onboarding. However, direct migration of user accounts from your SQLite DB to Web3Auth is not automatic—you can’t “import” users into Web3Auth. Instead, users need to go through the Web3Auth authentication flow at least once to generate their keys/wallets.

Migration Approach:

  • When an existing user logs in, prompt them to authenticate via Web3Auth (using the same email or identifier as in your DB).
  • Upon successful authentication, Web3Auth will generate a wallet for them.
  • You can then update your DB with the wallet address and other details returned by Web3Auth.

2. Auto-Creating Wallets for New Users

Yes, when a new user signs up via Web3Auth, a wallet is automatically created for them. You can retrieve the wallet address and other info using the SDK and store it in your DB.

3. Handling JWT/Custom Auth Migration

If you want to use your own JWTs for authentication (so users can continue to use your existing login system), you can use the loginWithJWT method from the MPC Core Kit SDK. This allows you to pass your backend-issued JWT to Web3Auth for login.

  • You’ll need to set up a Custom Auth Verifier in the Web3Auth dashboard.
  • When a user logs in, issue a JWT from your backend, then call loginWithJWT on the client side.
  • Web3Auth will verify the JWT and generate a wallet for the user.

4. Saving Wallet Details

After login, use the SDK method (e.g., getUserInfo() or getIdentityToken()) to get the wallet address and user details, then store these in your database.


References & Next Steps


Action Items for You:

  1. Set up a custom verifier in Web3Auth dashboard for JWT.
  2. Update your user login/signup flow to use Web3Auth authentication.
  3. On successful login, save the returned wallet address and user info to your DB.

If you need code samples or have questions about setting up the custom verifier or handling JWTs, let us know your preferred SDK/platform (Web, Node.js, React Native, etc.) and we can provide more targeted guidance!

Let us know if you need further clarification or help with a specific part of the migration!

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours