Recovering Dogecoin and Litecoin wallets from mnemonic passphrase

621 Views Asked by At

I have to recover Dogecoin and Litecoin wallets from mnemonic passphrase, I have done for Ethereum and Bitcoin but I can't figure out for these two.

Here is my approach for generating Bitcoin wallet from mnemonic, which is being generated from BIP39 in a separate function:

const generateBtcWalletFromMnemonic = async (mnemonic) => {
    const DERIVE_PATH_PREFIX = "m/44'/0'/0'/0/";
    const MNEMONIC = mnemonic;
    const seed = await bip39.mnemonicToSeed(MNEMONIC);
    const root = bip32.fromSeed(seed);
    const children = root.derivePath(DERIVE_PATH_PREFIX + 0);
    const address = getAddress(children);
    privateKey = children.toWIF();
    console.log({ address, privateKey });
}
0

There are 0 best solutions below