# Multiple wallets per user

**URL:** https://builder.metamask.io/t/multiple-wallets-per-user/1639
**Category:** Embedded Wallets (Web3Auth)
**Created:** [October 29, 2023, 12:00am UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639 "2023-10-29T00:00:18Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![alex3](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@alex3](https://builder.metamask.io/u/alex3)
#### Post date: [October 29, 2023, 12:00am UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/1 "2023-10-29T00:00:18Z")

</div>

> **🏛 Content from Web3Auth Community**
> 
> This topic was originally posted by **alex3** on 10/29/2023.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

We are using web3auth-auth0-twitter-sapphire verifier with twitter user ID as VerifierID and let users login only with twitter. Recently I noticed that I have 2 records in the database with the same twitter ID but different addresses. I am using example from here to get the user address -[Social Login Users | Documentation | Web3Auth](https://web3auth.io/docs/pnp/features/server-side-verification/social-login-users#verifying-idtoken-in-backend). The only way I think this can happen, is if the wallets array has multiple entities, because we take the item at index zero. If it is true, how can should I handle this and what wallet to use?

---

<div class="post-metadata">

### Author: ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.io/u/vjgee)
#### Post date: [October 29, 2023, 1:11am UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/2 "2023-10-29T01:11:29Z")

</div>

@alex3 Thanks for your recent post.

Please migrate to the latest version V7 if you have not yet done so:

 ![](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/4bea15d5fdfd372b2e7fae21263c61fab3da9379.png)

```
  <a href="https://web3auth.io/docs/pnp/migration-guides/modal-v6-to-v7" target="_blank" rel="noopener">web3auth.io</a>

```

### [PnP Modal SDK - v6 to v7 | Documentation | Web3Auth](https://web3auth.io/docs/pnp/migration-guides/modal-v6-to-v7)

PnP Modal SDK - v6 to v7 | Documentation - Web3Auth

---

<div class="post-metadata">

### Author: ![alex3](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@alex3](https://builder.metamask.io/u/alex3)
#### Post date: [October 29, 2023, 3:45am UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/3 "2023-10-29T03:45:13Z")

</div>

I already user version 7. These are lines from package.json

```auto
    "@walletconnect/sign-client": "^2.10.1",
    "@web3auth/base": "^7.0.4",
    "@web3auth/no-modal": "^7.0.4",
    "@web3auth/openlogin-adapter": "^7.0.4",
    "@web3auth/solana-provider": "^7.0.4",

```

---

<div class="post-metadata">

### Author: ![alex3](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@alex3](https://builder.metamask.io/u/alex3)
#### Post date: [October 29, 2023, 5:24pm UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/4 "2023-10-29T17:24:32Z")

</div>

I can give you the twitter ID and the addressed I got for it if it helps

---

<div class="post-metadata">

### Author: ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.io/u/vjgee)
#### Post date: [October 29, 2023, 5:56pm UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/5 "2023-10-29T17:56:01Z")

</div>

Please provide only the wallet addresses that should do.

---

<div class="post-metadata">

### Author: ![alex3](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@alex3](https://builder.metamask.io/u/alex3)
#### Post date: [October 30, 2023, 7:44am UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/6 "2023-10-30T07:44:18Z")

</div>

Here are 4 users with 2 address each.

1. 4FsqCiEJ1qR14S5rnibFKhh2sqDYsJuVP9usqTZ5vHMr, GoBL5YhFfSQSu1ecXXpJ9VUTdGFEDbKPYmMcKYq7QmRn

2. 8CCfipWJ7huW8bBV5ZGodzq9QzDRWux5pDh5dmjDKkva, 6z5NEA5kJkT65TjTj1qhX6uQVEedhGRZjQpbTjy3p7dd

3. 9QuDM2f1yuEjQc8Us2NMoVsudS4q2aRZ9hVrCiWdNv2R, D2vJrrb3WJhC6aFp6RtCWH3jreDtfpu47vXQVWxJNfge

4. GUJ2ssaq3v9ZGcohXD98qnan4ECLzcUcYGt1QN1VBqgn, AA7BY6QmrG6jB3ZHStjSUgpym2bFW1ZWG26xfcMiGhV2

---

<div class="post-metadata">

### Author: ![pepper](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@pepper](https://builder.metamask.io/u/pepper)
#### Post date: [October 30, 2023, 9:31am UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/7 "2023-10-30T09:31:49Z")

</div>

it depends on how you implemented.

 ![](https://github.githubassets.com/favicons/favicon.svg)

```
  <a href="https://github.com/orgs/Web3Auth/discussions/613" target="_blank" rel="noopener">GitHub</a>

```

 ![](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/b3e15b3a8e7c97659f8186b1373ea6544047bf22.png)

### [Derive multiple wallet addresses from the same authentication in web3auth ·...](https://github.com/orgs/Web3Auth/discussions/613)

How can you derive multiple wallet addresses from the same authentication in web3auth?

Check out if your implementation applies to you.

---

<div class="post-metadata">

### Author: ![alex3](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@alex3](https://builder.metamask.io/u/alex3)
#### Post date: [October 30, 2023, 1:24pm UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/8 "2023-10-30T13:24:14Z")

</div>

> [@pepper](#):
>
> [Derive multiple wallet addresses from the same authentication in web3auth · Web3Auth · Discussion #613 · GitHub](https://github.com/orgs/Web3Auth/discussions/613)

This is the code on the frontend that is executed after redirect from the web3auth. Can it be because 235519 curve instead of default secp256k1? The main issue that it happened to 4 users out of thousands.

```auto
const userInfo = await web3auth.authenticateUser()
if (!userInfo.idToken) throw new Error('User info not found!')
const publicKey = await getPubKey(web3auth.provider!)
const token = await login(publicKey, userInfo.idToken) //send to backend
//getToken.ts
import { IProvider } from ‘@web3auth/base’
import { getED25519Key } from ‘@toruslabs/openlogin-ed25519’
export async function getPubKey(provider: IProvider) {
const app_scoped_privkey = await provider.request({
method: ‘solanaPrivateKey’,
})
const ed25519Key = getED25519Key(
Buffer.from((app_scoped_privkey as string).padStart(64, ‘0’), ‘hex’)
)
const app_pub_key = ed25519Key.pk.toString(‘hex’)
return app_pub_key
}

```

---

<div class="post-metadata">

### Author: ![alex3](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@alex3](https://builder.metamask.io/u/alex3)
#### Post date: [November 2, 2023, 2:00am UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/9 "2023-11-02T02:00:02Z")

</div>

I checked the ID token that user sends on the backend and it has only one public key, not 2. But it is different public key. Can you please check on your side if it is possible to generate different public key. The backend was running untouched all this time, so no changes in auth flow happened.

This is an array of wallets

```auto
[{6ae063d61e1475ac47087eba8cd462424b7bf1196edad50e06779a68583209ff web3auth_app_key ed25519}]

```

From this I derived the 8CCfipWJ7huW8bBV5ZGodzq9QzDRWux5pDh5dmjDKkva public key from it.

---

<div class="post-metadata">

### Author: ![alex3](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@alex3](https://builder.metamask.io/u/alex3)
#### Post date: [November 3, 2023, 3:57pm UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/10 "2023-11-03T15:57:32Z")

</div>

Can also provide the JWT token from your side if it can help, the only difference inside is the different wallet for same data. Can send it over email.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/082cfc3a14103b01cfa5ef7d85f1121a23fa3e81.png) [@system](https://builder.metamask.io/u/system)
#### Post date: [November 17, 2023, 3:58pm UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/11 "2023-11-17T15:58:25Z")

</div>

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

---

<div class="post-metadata">

### Author: ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.io/u/vjgee)
#### Post date: [December 18, 2023, 12:40pm UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/12 "2023-12-18T12:40:20Z")

</div>



---

<div class="post-metadata">

### Author: ![thanks.tet173](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@thanks.tet173](https://builder.metamask.io/u/thanks.tet173)
#### Post date: [January 16, 2024, 8:09am UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/13 "2024-01-16T08:09:00Z")

</div>

Same problem here, I’m running with twitter and auth0, library `@web3auth/no-modal@7.0.1`  
web3auth giving me 2 different public key, just logging in and out and then I have a different public key/wallet address

[![Screenshot 2024-01-16 at 15.06.16](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/efdd084b26bacc3b90315d5d8124deeebb8d0c79.png)
Screenshot 2024-01-16 at 15.06.16780×133 15.2 KB
](https://web3auth.io/community/uploads/default/original/2X/e/e876332f6d1bfedd646643d98e16f3c9a058b282.png "Screenshot 2024-01-16 at 15.06.16")
  
This is the comparison between 2 decoded JWTs. The only difference are exp, iat, nonce and public\_key

This scares me to go with web3auth in other projects

---

<div class="post-metadata">

### Author: ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.io/u/vjgee)
#### Post date: [January 17, 2024, 2:43am UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/14 "2024-01-17T02:43:01Z")

</div>

@thanks.tet173 Sorry to hear you are facing issues.

Can you upgrade your package version to 7.3.1 [@web3auth/no-modal - npm](https://www.npmjs.com/package/@web3auth/no-modal) and let me know if you are still facing any issue

---

<div class="post-metadata">

### Author: ![thanks.tet173](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@thanks.tet173](https://builder.metamask.io/u/thanks.tet173)
#### Post date: [January 17, 2024, 3:31am UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/15 "2024-01-17T03:31:16Z")

</div>

The problem’s still there. Nothing changed

---

<div class="post-metadata">

### Author: ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.io/u/vjgee)
#### Post date: [January 17, 2024, 3:32am UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/16 "2024-01-17T03:32:52Z")

</div>

Can you share your pacakage.json file details of all the packages you are using?

---

<div class="post-metadata">

### Author: ![thanks.tet173](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@thanks.tet173](https://builder.metamask.io/u/thanks.tet173)
#### Post date: [January 17, 2024, 3:51am UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/17 "2024-01-17T03:51:02Z")

</div>

```auto
  "dependencies": {
    "@rainbow-me/rainbowkit": "^1.1.3",
    "@web3auth/no-modal": "7.3.1",
    "@zerodev/sdk": "^4.0.30",
    "@zerodev/wagmi": "^4.1.19",
    "next": "13.5.6",
    "react": "^18",
    "react-dom": "^18",
    "viem": "^1.16.6",
    "wagmi": "^1.4.5"
  },
  "devDependencies": {
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "autoprefixer": "^10",
    "encoding": "^0.1.13",
    "eslint": "^8",
    "eslint-config-next": "13.5.6",
    "eslint-config-prettier": "^9.0.0",
    "lokijs": "^1.5.12",
    "pino-pretty": "^10.2.3",
    "postcss": "^8",
    "tailwindcss": "^3",
    "typescript": "^5"
  }

```

I’m using through ZeroDev, but please don’t tell me to ask them. It’s web3auth instance giving me 2 different public key (decoded from JWT, from `web3Auth.getUserInfo()` ).  
The point here is only my account has a problem, not others.

The code is unchanged, the libraries are unchanged, the twitter account is unchanged, but web3auth gave me different public key just by logging in and out.  
So I think it’s on the servers, load balancers, …

---

<div class="post-metadata">

### Author: ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.io/u/vjgee)
#### Post date: [January 17, 2024, 5:10am UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/18 "2024-01-17T05:10:32Z")

</div>

Please share your entire implementation code, web3auth initialization and login code as well as your Dapp URL for me to replicate the issue.

---

<div class="post-metadata">

### Author: ![thanks.tet173](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@thanks.tet173](https://builder.metamask.io/u/thanks.tet173)
#### Post date: [January 22, 2024, 7:16am UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/19 "2024-01-22T07:16:14Z")

</div>

I’d rather not share that info publicly.

As I said, it only happened with my Twitter, so the issue is hard to reproduce.

If you guys consider this issue serious, I can share more details on a private channel. Otherwise, just let it be.

---

<div class="post-metadata">

### Author: ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.io/u/vjgee)
#### Post date: [January 22, 2024, 7:29am UTC](https://builder.metamask.io/t/multiple-wallets-per-user/1639/20 "2024-01-22T07:29:46Z")

</div>

@thanks.tet173 Please navigate to the left hand side Menu . Scroll down to find **Messages** \> **Inbox** \> **New Message** and send me a DM to share your Dapp URL privately. Please also share your implementation code including Web3Auth login, Initialization code as well.
