It's pretty standard to use mnemonic phrases, or seed phrases, to create private keys when setting up a wallet. But I've been curious about generating a private key myself directly from the seed phrase without relying on the wallet software. I attempted to use the seed from an HD wallet that follows the BIP-32 standard, but I can't seem to figure out the right algorithm to generate the master key and chain code. Any advice on how to tackle this?
What's the best way to handle this?
7 replies 383 views
For the generation of the master keys and child keys:
Use https://iancoleman.io/bip39/ offline, not online. You can use it to generate the keys and addresses from seed phrase.
For offline usage:
Use the html on a word editor: https://github.com/iancoleman/bip39/releases/latest/
For security reasons, use it offline on a word editor.
Here is a little guide by blue Snow on how to generate your master private key from seed phrase. Make sure you are doing it offline.
Although I dont know why you wish to generate the master private key from the seed phrase but in case of back up there is no point of backing up the master private key even though it will recover the same address as the seed phrase will do but seed phrase back is more convenient than the key.
Thanks alot Charles Tim and Zaguru12
Is there a similar script I can run on phyton?
I do not know much about this. You can wait for other reputed members and see what they will reply. Let me quote nc50lc so that he can see this thread. I believe he will have something good to reply.
It is possible to run this on python aswell. You have to use mnemonic library for the BIP39 functionalities and the bip32utils library for the BIP32 key derivation.
Create a new mnemonic phrase with the mnemonic library. The individual passphrase is optional.
Now use the bip32utils library to derrive the masterkey and the child keys:
I have used "m/44'/0'/0'/0/0" as derivation path since this path is widely used by many wallets and allows a structured way to generate multiple addresses.
Thanks a lot seek3r although I was able to use Charles-Tim help which was very very easy to use I would definitely use this phyton script also .
I do not recommend directly using private keys which are derived from the seed phrase for holding bitcoins because there is a change that you might mess up the generation process which leads to the coins becoming inaccessible. This should be done only for learning purposes. (As you hopefully already know).
Related topics
- Best practices for securely storing newly generated wallets programmatically 14
- How to do this the right way? 11
- bitcoin-qt sync issues and slow speeds 6
- Recovering a Bitcoin wallet and address 8
- Creating a list of non-zero wallets and their balances using Python 4
- CipherSeed: A Comprehensive Guide to Super-Secure Crypto Wallet Backups 5