New wallet created with each login

Perhaps this is my error, but I’m seeing on the web3auth dashboard that each time I execute a login for the same user with a refreshed Firebase JWT, the wallet count sometimes increasesby one. Sometimes it does not.

So I assume that either:

  1. I have missed a step to maintain association with specific wallet
  2. There is a bug

I am using @web3auth/mpc-core-kit version 1.1.3, Chrome browser, running locally using Hardhat. Using Hardhat worked fine for no-modal SDK.

Here is the code:

// The environment file contains all correct values previously used 
// successfully with the no-modal SDK
// I have enabled Core SDK on the dashboard for the project

const chainConfig = {
  chainNamespace: CHAIN_NAMESPACES.EIP155,
  chainId: toHex(1337),
  rpcTarget: environment.rpcUrl,
  displayName: 'Hardhat',
  blockExplorer: environment.explorerUrls.explorerUrl,
  ticker: 'XDC',
  tickerName: 'XDC Network',
  decimals: 18,
};

const coreKitInstance = new Web3AuthMPCCoreKit({
  web3AuthClientId: environment.wallet.web3Auth.clientId,
  web3AuthNetwork: WEB3AUTH_NETWORK.DEVNET,
  uxMode: 'redirect',
  baseUrl: window.location.href,
  enableLogging: true,
  chainConfig,
  storageKey: 'local',
});

await coreKitInstance.init();


// refresh the Firebase JWT and fetch the value of the 'sub' field
const idToken = await user.getIdTokenResult(true);
const verifierId = idToken.claims.sub;
console.log('verifierId', verifierId);

if (!isString(verifierId)) {
  throw new Error('verifierId is not a string');
}

await coreKitInstance.loginWithJWT({
  idToken: idToken.token,
  verifier: environment.wallet.web3Auth.verifierName,
  verifierId,
});

I have used the custom verifier successfully with the no-modal SDK, and now I am migrating to MPC. I am pretty sure the verification of the Firebase JWT is ok.

I am refreshing the JWT directly before attempting web3auth authentication.

My questions are:

  1. Why is a new account created some times when I run this code and sometimes not created? (I refreshed web3auth dashboard stats each time, sometimes it went up, sometimes not)
  2. Did I miss a step, if so what must I do?
  3. I do not get a provider in the value returned from loginwithJWT() - I get void. This doesn’t match the docs - how can I get provider?
  4. Will you add some documentation for MPC that demonstrates all the steps for specific scenarios? It is hard to understand what code must be performed, which code is optional. The React examples are a bit helpful but they don’t describe “why” something is being done.

Thanks for the help.

@jg1 Thanks for your recent post.

Your request has been forwarded to our Dev team and we will get back with further updates.

1 Like

The number of monthly active wallets displayed on the dashboard’s analytics tab keeps increasing. I am only using 3-4 different logins.

Is the dashboard correct?
If it is correct, what must I do to prevent the creation of new wallets?

I am not creating the device factor yet. Just using JWT login with Firebase. Could that be helpful to know?

Would appreciate some input here please! Now over 200+ wallets.

What is happening?

Can I be guaranteed same wallet address when logging in with Firebase credential using sapphire_devnet?

Is it to do with not having a device factor?
Is it because a new Hashed Factor Key is stored in the cloud each time until I login once and then enable mfa? Am using Core MPC SDK.

Sorry for the delay.

Our team are reviewing this issue to find the cause. Could you provide your verifier name, verified ID and Dapp URL. Is your project on the dashboard also on Sapphire Devnet?

Thanks. The project is on the sapphire devnet - the verifier name and verified id I would prefer not to post in a public forum. There is no URL I can share as I’m working locally still I’m afraid.

How does the Core MPC SDK work? Will it always create a new EOA for each login where there is no device factor saved?

Same for me has there been any answer to this seeing same on devnet