Created
March 18, 2018 17:48
-
-
Save AbdussamadA/6dc1a09b79f00d7f6a00e91a99d32ef3 to your computer and use it in GitHub Desktop.
converts bip39 mnemonic to bip44 first account xprv. requires electrum.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#converts bip39 mnemonic to bip44 first account xprv | |
from electrum import keystore | |
import sys | |
mnemonic = ' '.join( sys.argv[1:] ) | |
if keystore.bip39_is_checksum_valid( mnemonic ) == (True,True) : | |
k = keystore.from_bip39_seed( mnemonic, "", "m/44'/0'/0'" ) | |
print( k.xprv ) | |
else: | |
print ( "Invalid mnemonic" ) | |
print ( "To use this script call it with the seed mnemonic words as the only arguments" ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment