Skip to content

Instantly share code, notes, and snippets.

@nc50lc
Forked from AbdussamadA/bip39-bip44.py
Last active March 7, 2022 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nc50lc/600f2e1034c0898bb127f998258e3bda to your computer and use it in GitHub Desktop.
Save nc50lc/600f2e1034c0898bb127f998258e3bda to your computer and use it in GitHub Desktop.
converts bip39 mnemonic to bip49 first account xprv. requires electrum.
#!/usr/bin/python3
#converts bip39 mnemonic to bip49 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/49'/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