4

I'd like to do the following:

  • I use dumpprivkey to get the private key from Litecoin wallet.
  • I import this private key into Dogecoin wallet
  • Which will generate a new Dogecoin address. Both will share the same private key.

The most related post I found is: What happens if you send Bitcoin to a Litecoin address?

However, when I try to directly import, it will give me the error:
{"code":-5,"message":"Invalid private key encoding"}

So now, how can I dump the private key and decode into hex and move the prefix from "L" to "D" and regenerate a WIF for dogecoin?

Is there any existing solution for it?

1 Answer 1

8

Let's assume we have this compressed Litecoin WIF private key: T4DRLwPgnkg9jyivjbbnmqJZjHRxeYTy4idAV5uwEuFdyJBGuxXE.

% echo T4DRLwPgnkg9jyivjbbnmqJZjHRxeYTy4idAV5uwEuFdyJBGuxXE | bx base58check-decode

wrapper { checksum 625264444 payload 22b207aa76eb058876c667dc64ab8eeaa0a073bc018561c2463d438a0444b70501 version 176 }

ANSWER for Doge WIF Key:

% bx base58check-encode -v 158 22b207aa76eb058876c667dc64ab8eeaa0a073bc018561c2463d438a0444b70501

QPn542uVdzBgCfV6nEViShboFTpDd1at8mQpQugEQHgpuLbsgcZe

VALIDATION CHECK:

% echo QPn542uVdzBgCfV6nEViShboFTpDd1at8mQpQugEQHgpuLbsgcZe | bx base58check-decode

wrapper { checksum 2298567751 payload 22b207aa76eb058876c667dc64ab8eeaa0a073bc018561c2463d438a0444b70501 version 158 }

Examine 158, base58check-decode and base58check-encode for more details.

1
  • it is awesome, it really help. and also need the altcoin mapping url is here: github.com/libbitcoin/libbitcoin/wiki/… , However, it is not quite complete, anyone knows how to get the extra WIF version value?
    – temple
    Commented Sep 28, 2016 at 18:50

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.