2

Is there any web3Auth method which takes email id as input and returns a wallet address as output ? The wallet address returned should be real . By real I mean , if the user logs in with the emailId we get the same address that was our output from the method .

Tried looking for something in the documentation , it is so vast and I have very less time . Will be grateful if I get any sort of help from here. Reference : https://web3auth.io/

1 Answer 1

1

Once you are logged in with your social login you will get your web3AuthProvider. Then you can instantiate a classic ethers.web3.provider like this and get the signer and the associated wallet address

const web3Provider = new ethers.providers.Web3Provider(web3AuthProvider!);

const signer = web3Provider.getSigner();

const address = await signer.getAddress();
const balance = (await signer.getBalance()).toString();

Hope it helps

2
  • Hi @donoso.eth , thanks for answering . But this is not the answer that I expected . I have a DApp , where I want to assign a role to a user of the application . This assigning thing will be done by Admin . I want to create a form like UI where I will enter email address of a person say [email protected] and assign him the role I want . I've implemented this functionality by taking wallet address as input but to make it more web2 like , I want that email input functionality , such that my dapp is able to calculate what address will be generated for [email protected] Apr 19, 2023 at 10:06
  • want that email input functionality , such that my dapp is able to calculate what address will be generated for [email protected] This is not how blockchains work, unfortunately. Blockchains operate on addresses, not on emails, and it is not possible to know person's address by knowing his email. Dec 14, 2023 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.