user29515: 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?

user10377: 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.

29515: <p>I'd like to do the following:</p>

<ul>
<li>I use <code>dumpprivkey</code> to get the private key from <code>Litecoin</code> wallet.</li>
<li>I import this private key into <code>Dogecoin</code> wallet</li>
<li>Which will generate a new Dogecoin address. Both will share the same private key.</li>
</ul>

<p>The most related post I found is: <a href="https://bitcoin.stackexchange.com/questions/16933/what-happens-if-you-send-bitcoin-to-a-litecoin-address">What happens if you send Bitcoin to a Litecoin address?</a></p>

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

<p>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?</p>

<p>Is there any existing solution for it?</p>
 10377: <p>Let's assume we have this compressed Litecoin WIF private key:  <strong>T4DRLwPgnkg9jyivjbbnmqJZjHRxeYTy4idAV5uwEuFdyJBGuxXE</strong>.</p>

<pre><code>% echo T4DRLwPgnkg9jyivjbbnmqJZjHRxeYTy4idAV5uwEuFdyJBGuxXE | bx base58check-decode
</code></pre>

<p><strong><code>
wrapper
{
    checksum 625264444
    payload 22b207aa76eb058876c667dc64ab8eeaa0a073bc018561c2463d438a0444b70501
    version 176
}
</code></strong></p>

<p><strong>ANSWER for Doge WIF Key:</strong></p>

<pre><code>% bx base58check-encode -v 158 22b207aa76eb058876c667dc64ab8eeaa0a073bc018561c2463d438a0444b70501
</code></pre>

<p><strong><code>QPn542uVdzBgCfV6nEViShboFTpDd1at8mQpQugEQHgpuLbsgcZe</code></strong></p>

<p><strong>VALIDATION CHECK:</strong></p>

<pre><code>% echo QPn542uVdzBgCfV6nEViShboFTpDd1at8mQpQugEQHgpuLbsgcZe | bx base58check-decode
</code></pre>

<p><strong><code>wrapper
{
    checksum 2298567751
    payload 22b207aa76eb058876c667dc64ab8eeaa0a073bc018561c2463d438a0444b70501
    version 158
}
</code></strong></p>

<p>Examine <a href="https://github.com/libbitcoin/libbitcoin/wiki/Altcoin-Version-Mappings#bip44-altcoin-version-mapping-table" rel="noreferrer">158</a>, <a href="https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-base58check-decode" rel="noreferrer">base58check-decode</a> and <a href="https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-base58check-encode" rel="noreferrer">base58check-encode</a> for more details.</p>
