<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>

CC BY-SA 3.0
2016-09-28T18:50:24.347Z
it is awesome, it really help. and also need the  altcoin mapping url is here: https://github.com/libbitcoin/libbitcoin/wiki/Altcoin-Version-Mappings#bip44-altcoin-version-mapping-table , However, it is not quite complete, anyone knows how to get the extra WIF version value?
temple
CC BY-SA 3.0
2016-09-09T00:36:55.523Z
2016-09-09T00:36:55.523Z
skaht
<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>

<litecoin><dogecoin><private-key-import>
How can I generate a Dogecoin address from a Litecoin private key?
temple
# How can I generate a Dogecoin address from a Litecoin private key?

(Asked by: username_0 on 2016-09-08)

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?](https://bitcoin.stackexchange.com/questions/16933/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?

**Tags:** litecoin, dogecoin, private-key-import


---

## 1 answers

### Answer by username_1 on 2016-09-09. Score: 8 | Accepted answer

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](https://github.com/libbitcoin/libbitcoin/wiki/Altcoin-Version-Mappings#bip44-altcoin-version-mapping-table), [base58check-decode](https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-base58check-decode) and [base58check-encode](https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-base58check-encode) for more details.

> **Comments:**
> **username_0**: it is awesome, it really help. and also need the  altcoin mapping url is here: https://github.com/libbitcoin/libbitcoin/wiki/Altcoin-Version-Mappings#bip44-altcoin-version-mapping-table , However, it is not quite complete, anyone knows how to get the extra WIF version value?  

---

