This file contains hidden or 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" ) |
This file contains hidden or 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 | |
from electrum import bitcoin | |
import sys | |
if len( sys.argv ) > 2: | |
format,privkey,compressed=bitcoin.deserialize_privkey( sys.argv[1] ) | |
print( bitcoin.serialize_privkey( privkey, compressed, sys.argv[2] ) ) | |
else: | |
print( "Please provide arguments: Usage electrum-convert-privkey <privkey> <target_type>") |