Thanks alot Charles Tim and Zaguru12
Is there a similar script I can run on phyton?
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.
from mnemonic import Mnemonic
mnemo = Mnemonic("english")
words = mnemo.generate(strength=128) # 128, 160, 192, 224, 256 bits
seed = mnemo.to_seed(words, passphrase="INSERT_PASSPHRASE_HERE")
print("Mnemonic:", words)
print("Seed:", seed.hex())
Now use the
bip32utils library to derrive the masterkey and the child keys:
from bip32utils import BIP32Key
master_key = BIP32Key.fromEntropy(seed)
child_key = master_key.ChildKey(44 + BIP32Key.HARDENED) \
.ChildKey(0 + BIP32Key.HARDENED) \
.ChildKey(0 + BIP32Key.HARDENED) \
.ChildKey(0).ChildKey(0)
print("Master Key:", master_key.ExtendedKey())
print("Child Key:", child_key.Address())
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.