How to Create Multiple Wallets (e.g. Solana + EVM) from the Same Login Session Using Web3Auth?

Issue Summary

I am trying to generate both a Solana and an EVM wallet for a user using the same login (idToken) in NODE mode with @web3auth/single-factor-auth. The goal is to allow the user to sign in once and access both wallets.

What I Tried

I initialize the Web3Auth client with a PrivateKeyProvider (e.g., Solana), and successfully connect using:

await client.connect({
  verifier,
  verifierId: phoneNumber,
  idToken,
});

I can then request the Solana private key successfully:

const solanaPrivateKey = await client.provider?.request({
  method: 'solanaPrivateKey',
});

However, when I try to switch the provider after login to EthereumPrivateKeyProvider in order to request the EVM private key:

client.provider = ethereumPrivateKeyProvider;

const evmPrivateKey = await client.provider?.request({
  method: 'eth_private_key',
});

I get this error:

Error: Not implemented

My Question

Is it possible to generate both Solana and EVM wallets from the same login session, using the same idToken, without needing to call connect() again with a new Web3Auth instance?

If not, what is the recommended way to achieve multi-chain wallet support (e.g., Solana + Ethereum) with a single login?

What I Need

  • Guidance on how to fetch both keys with a single login.
  • Whether provider is supposed to be switchable post-login or if multiple Web3Auth instances are the correct approach.

Environment

  • @web3auth/single-factor-auth
  • Mode: NODE
  • Use case: Server-side generation of wallets for Solana + Ethereum

Thanks in advance!

Thanks for your detailed explanation, Yash! Here’s a summary of your issue for the support team:


Issue Summary
You want to use @web3auth/single-factor-auth in NODE mode to generate both Solana and EVM wallets for a user from a single login session (same idToken), without requiring multiple logins. You are able to get the Solana private key, but when you try to switch the provider to EthereumPrivateKeyProvider and request the EVM private key, you receive Error: Not implemented.

Details Provided

  • SDK: @web3auth/single-factor-auth
  • SDK Version: Not specified
  • Platform: Node.js (server-side)
  • Login Method: Single-factor auth (idToken, phone number)
  • Code Snippets Provided: Yes (see original post)
  • Error Message: Error: Not implemented
  • Goal: Fetch both Solana and EVM private keys from a single login session

Questions for Support Team

  • Is it possible to generate both Solana and EVM wallets from the same login session (single idToken) without initializing a new Web3Auth instance or calling connect() again?
  • Is switching the provider post-login supported, or is the recommended approach to create separate Web3Auth instances for each chain?

Proposed Solution & Resources

Based on the Web3Auth docs on single-factor auth, the provider is tightly coupled with the login session and the chain you initialize with. Switching providers post-login is currently not supported—the provider is set during initialization and cannot be changed after a successful connection.

Recommended Approach:
You should create separate Web3Auth instances for each chain (Solana and EVM), each initialized with the appropriate PrivateKeyProvider, and call connect() for both using the same idToken. This will derive the same underlying private key, but each provider will expose it in the format required for the respective chain.

Example:

// For Solana
const solanaClient = new Web3Auth(...SolanaPrivateKeyProvider...);
await solanaClient.connect({ verifier, verifierId, idToken });
const solanaPrivateKey = await solanaClient.provider.request({ method: "solanaPrivateKey" });

// For EVM
const evmClient = new Web3Auth(...EthereumPrivateKeyProvider...);
await evmClient.connect({ verifier, verifierId, idToken });
const evmPrivateKey = await evmClient.provider.request({ method: "eth_private_key" });

If you have any follow-up questions or need code samples for your specific use case, let us know! If you can share your SDK version, that would also help the team provide the most relevant guidance.

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

To add one important point: when I try to follow the recommended approach of creating two separate Web3Auth instances (one for Solana and one for EVM), and I call connect() a second time with the same idToken, I receive the following error:

Error occurred while verifying params token is used

This suggests that even though the underlying private key is deterministic and should be derivable from the same token, the Web3Auth backend doesn’t allow the same idToken to be reused across multiple Web3Auth instances — even if the chain/provider is different.

Clarification Needed

  • Is there a way to reuse the same idToken across multiple Web3Auth instances for different chains?
  • Or is there a workaround that would allow me to get both EVM and Solana private keys from the same login without this token is used error?

I’d really appreciate any insight or guidance on this. Happy to share more logs or setup details if needed.

Thanks again! Looking forward to your advice — and I’ll also consider joining the Office Hours session to discuss this live.

Hey @yash.m

We have deprecated the Single Factor Auth SDK implementation for Web. I’d recommend you to rather use our Plug and Play SDK instead. The latest version with the connectTo function/ hook gives a very similar user experience while elevating the dev experience and choices you’ll have implementing the SDK.

For connecting multiple wallets at once, I’d recommend following this example of ours: web3auth-examples/other/multi-chain-example at main · Web3Auth/web3auth-examples · GitHub

In this we have followed the approach of taking the standard EVM provider, extracting the secp256k1 key, converting it into an ed25519 key and creating a solana wallet using it. Please follow this approach rather. This is because Web3Auth only works with a single use id token strategy. If you pass a used id token it will reject it. The example demonstrates the best way to utilise web3auth single login with multiple chains at once including Solana and EVM.

I’d recommend looking at these files particularly:

i want to stick to the idtoken approach or similar because i am trying to do this in node server and this connect part will not work in that case