Web3Auth return different wallet address from Torus wallet

Hi everyone, recently Iā€™m just follow the web3auth tutorial and Im cloned the code and replace the API keys with my own, when I run the code with local machine, no issues occur from the login process, but the wallet address return by the web3auth is different from my registered account wallet address (Gmail), How can I solve this issue?

I donā€™t understand, so what you expect is the wallet address be your gmail address?

When a user login with web3auth, the user will get a wallet keypair that associate with the gmail account, that is what I mean.

yes it is, but what address are you comparing to that is different?

The wallet address (starting with 0x030ā€¦, 0 balance) shown in the web3auth tutorial app is different from the address (starting with 0x090ā€¦, with some test net balance) that shown in the Torus wallet.

Hm I think itā€™s best to join their discord and ask as we are just integrating them and donā€™t know the details to be honest about their inner working

When you learn the answer by speaking to Web3Auth - please post it here so others can see too :pray:

2 Likes

Maybe a new wallet address is generated per account. In case that you compare some address from a tutorial with your address.

No, Iā€™m not comparing the address from the tutorial video, the tutorial app is my own cloned version.

I had the same issue and found out that web3auth and Torus wallet are 2 different things (you wonā€™t get the same address for the same email) :slightly_smiling_face:

How can I get new address after web3auth login?
I want to get address without metamask or any other wallet login.
Is it possible?

Web3Auth generates an address for you if you sign in with unique credentials e.g. email for the first time.

You can get it with Moralis.User.current().get('ethAddress'). Or if youā€™re using react-moralis, account from useMoralis hook.

No, we canā€™t get ethAddress because we only logged in using email.
Without wallet login, new address wouldnā€™t be created automatically.
My users donā€™t have any kinds of wallets like metamask.
So I wanted to create public address without wallet login,

Just email login, I need to create public address from web3Auth.
Is it possible?

you could try to look in local storage to see if is anything saved there

Sorry, you didnā€™t get my point.
Is it possible to create public address from web3Auth without wallet login?

Currently I can get ethAddress from metamask wallet login.
I need to get ethAddress without metamask wallet login. (because my users donā€™t like to use wallet. they only have email for now)

Without wallet login, new address wouldnā€™t be created automatically.

Is it possible to create public address from web3Auth without wallet login?

Web3Auth generates a wallet address for you even if you login only via normal email - that is the main idea for using Web3Auth (onboarding Web2). For example, if I authenticate with:

await Moralis.authenticate({
  provider: 'web3Auth',
  clientId: '',
});

And I sign in with my email (ā€œContinue with Emailā€) and click the ā€œVerify your emailā€ email link, I can get the generated address with Moralis.User.current().get('ethAddress').

Any transactions I then make e.g. with Moralis.executeFunction() are signed automatically and made from this Web3Auth address if I stay connected.

How are you trying to get the address? Try clearing your browserā€™s cache and localStorage items for your app, and then authenticate again. You can also check your localStorage after signing in for the current user data as cryptokid mentioned - the address can also be checked there.

Being able to sign automatically is definitely a cool feature. Although Iā€™m pretty sure hes talking about

The account address associated with the email account being different across multiple different applications.

https://demo-app.web3auth.io/?auth=default&whitelabel=no&chain=polygon

image

when i used web3auth to sign in on another app such as Kash, it gave me a new address as well

like how would one go about reusing their address across multiple different platforms without exporting it to another wallet, if you cant authenticate across multiple applications using the same credentials.

I found this link:

wonder if it is because the projects are using different client Ids or something of that nature