Skip to content

Instantly share code, notes, and snippets.

@AbdussamadA
Created March 18, 2018 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AbdussamadA/6dc1a09b79f00d7f6a00e91a99d32ef3 to your computer and use it in GitHub Desktop.
Save AbdussamadA/6dc1a09b79f00d7f6a00e91a99d32ef3 to your computer and use it in GitHub Desktop.
converts bip39 mnemonic to bip44 first account xprv. requires electrum.
#!/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