mmgen / mmgen-wallet

An online/offline cryptocurrency wallet for the command line
GNU General Public License v3.0
119 stars 19 forks source link

Need urgent help #12

Closed deveshaggrawal19 closed 2 months ago

deveshaggrawal19 commented 2 months ago

Hi Team,

I had created a mnemonic seed and address using MMGEN wallet but forgot to store the mnemonic seed, but did store the bip 32 root key by using the mnemonic seed on Ian co.

Now I want to derive the same address using a derivation path and bip 32 root key. can you please tell me what would be the derivation path, since it is mentioned in the wiki, that the wallet is deterministically deriving its keys, but uses a non-hierarchical scheme differing from the BIP32.

Please help me, I have a small amount of BTC that is stuck in those addresses.

mmgen commented 2 months ago

Recovering the address and its corresponding key would require you to recover the original mnemonic, or its direct non-BIP39 hex representation, which is impossible if all you have is the BIP39-generated key material.

To generate the seed and root key, BIP39 hashes the mnemonic using the PBKDF2 key derivation function, which is irreversible (refer to the generate_seed() function in mmgen.bip39).

I’m afraid you’re out of luck.

deveshaggrawal19 commented 2 months ago

I appreciate your quick response. But some key points can help me understand if there is any process through which I might be able to gain access.

I created a new MMGEN wallet for testing purposes, exported the mnemonic seed key, and used that mnemonic seed key to create the BIP 39 rook key using the Ian co. I got the key in the following format "7ed1fd256cf0ec861dbcf310c3a9e3e4ddf2011dc907f69821aaf8c2772a8532066020e873f593604a7ebbb7919484ea24130deb07d85338015b9df48412e2b8" ( This is not the actual root key)

Now, I was under the impression that if you have the mnemonic seed key or BIP 39 root key, I can derive the addresses and it's private key using a defined pathway ( I'm able to do the same using the Ian co and my own NodeJS script) . But as you mentioned previously, it is not possible to do so. Does that mean, the MMGEN wallet use some other way to create addresses and their private keys rather than using the standard approach?

Please help me figure this out, I'm not that advanced in this space.

mmgen commented 2 months ago

If, as you’ve described, you’ve irretrievably lost the MMGen wallet you created, its associated mnemonic, and all backups of them you may have made, then there’s no way to recover your MMGen-generated key/address pairs.

The BIP39 seed is derived from the mnemonic via cryptographic hashing as described in the section “From Mnemonic to seed” in the BIP39 specification. The seed is not a representation of the mnemonic: there’s no way to recover the mnemonic from it, or from the root key, which is derived in turn from the seed.

The only thing I could suggest is to use disk forensic techniques to attempt to recover the MMGen wallet or associated mnemonic, assuming you’re in possession of the disk they were created on.

MMGen derives its keys and addresses in a way entirely unrelated to BIP32/BIP39. The derivation is described on the Wiki page Recovering Your Keys Without the MMGen Wallet Software.