This topic was originally posted by onkast on 1/21/2025.
This content has been migrated from our previous community forum to preserve valuable discussions.
Hello,
We want to pre generate TON wallet once the user signup.
How is this possible using tonweb?
Lets say they’ve signup via google, how will getKeyPairFromPrivateKey work? Can this be used to generate wallet for user?
It sounds like you’re exploring wallet creation with TON and Web3Auth. To pre-generate a TON wallet when a user signs up via a provider like Google, you can follow this general approach:
Integrate Web3Auth: First, ensure you have Web3Auth successfully integrated into your app. This will help you handle user authentication via Google.
Private Key Generation: After the user signs up and authenticates, use Web3Auth to obtain the user’s private key. This private key can then be used to derive the wallet address.
TON Wallet: With tonweb, you can generate the key pair using getKeyPairFromPrivateKey. Once you have the private key from Web3Auth for the authenticated user, you can use tonweb’s utilities to create a TON wallet address.
To answer your question about getKeyPairFromPrivateKey, yes, you can use it to derive the public key and ultimately the wallet address for the user.
Here’s a basic flow:
Authenticate user via Web3Auth with Google.
Once authenticated, retrieve the private key.
Use tonweb and getKeyPairFromPrivateKey to generate and store the TON wallet.
If you face any issues while trying this out, feel free to provide:
Code snippets of your Web3Auth initialization and login.
Any specific error messages or unexpected behavior in the process.
This information can help us guide you more precisely. Happy coding!
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.
I understand you’re looking to pre-generate a TON wallet. Currently, pre-generation is supported only for EVM addresses. Unfortunately, we do not have pre-generation support for TON wallets at the moment, and it’s not on our immediate roadmap.
While I can’t provide a timeline for this feature, I appreciate you bringing it up, and I’ll be sure to pass along your request to our team.