-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore private key from it's seed or mnemonic phrase #1594
Comments
You could try something like
|
I'll add the label "Feature Request" because I would like to support this. |
@pau1m Your code did not work for me on the go I had to tweak it into something like this, function generateAddressesFromSeed(mnemonic, count) { let accounts = []; return accounts; |
Thanks for your reply. It helped me. 2 little things I needed to change to make it work on my machine: remove the last |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions |
The Here is the result
|
Is there a browser solution for this? |
Hello friend, the web3.js doesn't have this tool installed natively. We use the HD Wallet Provider for this. Check: https://www.npmjs.com/package/@truffle/hdwallet-provider You solve this in Web3 as follows: Install:
Don't forget to install web3.js and truffle I created the code below that will generate multiple accounts from Mnemonico in your web3.js.
You can check about retrieving the private key here: https://ethereum.stackexchange.com/questions/102090/retrieving-the-private-public-key-with-web3js-for-a-specific-wallet-provided-by |
I investigated web3.js and, as I understood, the lib doesn't provide method for restoring a private key from it's seed or mnemonic phrase (e.g bip39 mnemonic/seed).
Is there another method to restore account from 12-word-phrase?
Example restoring method is web3j MnemonicUtills.java
https://github.com/web3j/web3j/blob/master/crypto/src/main/java/org/web3j/crypto/MnemonicUtils.java
Thanks in advance for answering.
The text was updated successfully, but these errors were encountered: