I´m trying to recover a wallet from which the Master Private Key (mpk) in hex format and the number of used addresses is known.

Till now I could manage to convert the hex mpk to the wif format and import this to electrum. But here to history seems to be totally lost.

Is there any way to recover the full wallet and history (not neccessary with electrum)?

  • are you sure it's the master private key and not the seed? the seed in hex is 32 characters. if it's the seed do a restore from seed and paste in the hex instead of the words.
    – Abdussamad
    May 25, 2018 at 10:53
  • sorry for the late respnse. yes, I`m sure that the key is a mpk and not a seed in hex. It seems that the problem is based on compressed vs. uncompressed keys.
    – Michael
    May 29, 2018 at 7:48

1 Answer 1


The problem is based on the generating method I used from the the Bitwasp library.

$key = PrivateKeyFactory::fromHex($hex, true);
$wif = $key->toWif();

Will return a WIF assuming the hex key was compressed. Restoring the history while importin in electrum failed.

$key = PrivateKeyFactory::fromHex($hex, false);
$wif = $key->toWif();

Will return a WIF from an uncompressed hex key an electrum was able to restore the history of the address.

  • master private key doesn't lead to an address in the wallet on its own. you have to run it through hash functions and do ec math to generate child keys at various indices. that's what the type2 deterministic thing is all about. so it seems like you have a regular private key and not a master private key.
    – Abdussamad
    May 29, 2018 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.