34

I have a private key for my wallet and also a keystore for it. I want to use it in MEWConnect. Is there a way to get a mnemonic phrase from a private key?

Paul Razvan Berg
  • 17,902
  • 6
  • 73
  • 143
Incrediblez7
  • 453
  • 1
  • 4
  • 10

3 Answers3

30

No, a mnemonic is generated using an hd wallet - a hierarchical deterministic wallet. Private keys are "children" of this mnemonic and there can be millions of them, but there's no way to go back to the parent having only a child private key.

You can generate a new mnemonic if you install MetaMask or most of the other Ethereum wallets out there (Status, Coinbase Wallet etc).

Paul Razvan Berg
  • 17,902
  • 6
  • 73
  • 143
5

I concur with Paul Berg that there is no way to represent a single private key as a mnemonic, with the qualification that there is no STANDARD way which will automatically work with existing wallets or other utilities. If you wanted to create a mnemonic for backup with a custom algorithm you can use the BIP39 word list, which has 2048 words, and manually map bits of your private key to the corresponding word.

2048 equals 2^11 so you need to split up the 256 bits of your private key into 11-bit segments with padding/checksum added to make it a multiple of 11. A good way is to take the sha256 checksum of the private key and append the last 8 bits of it to the private key, so you get 264 bits, which map to 24 words.

gernot
  • 155
  • 7
0

I disconcur with Vega (sorry) for the way to create a mnemonic manually from private key. That's not the actual mnemonic for that private key, but using that pkey as a random seed generator which transforms into mnemonic. It's not the issue about existing wallets or other utilities, or custom algorithm. It's just the process logic, for anybody.

You have no way to go back to mnemonic from even root pkey because the process uses one-way cryptography, which is PBKDF2 with HMAC-512. HMAC-512 uses hash and hash is irreversible.

If you use pkey to make mnemonic and derive a new HD key pairs tree, those new private keys will not be the old private key, and you will not find any digital asset in that wallet.

Metta
  • 1