<pre><code>const ltcnet = {
    messagePrefix: '\x19Litecoin Signed Message:\n',
    bip32: { 
      public: 0x043587cf,
      private: 0x04358394
    },
    pubKeyHash: 0x6f,
    scriptHash: 0xc4, //  for segwit (start with 2)
    wif: 0xef
  }
</code></pre>

<p>use it like this: </p>

<pre><code>var key = bitcoin.HDNode.fromSeedHex(seed, ltcnet)
</code></pre>

CC BY-SA 4.0
2018-05-29T09:21:58.193Z
Do you also know what is the derivation path is (bip32)?
Enzo
CC BY-SA 4.0
2018-05-29T10:18:14.530Z
@EnZo Most coins don't have a separate testnet derivation path, they just change the prefix
Raghav Sood
CC BY-SA 4.0
2018-10-23T11:21:13.207Z
I think you should also consider `scriptHash: 0x3a` to get the testnet p2sh addresses that start with `Q`.
thalisk
CC BY-SA 4.0
2018-05-28T15:30:22.467Z
2018-05-28T15:30:22.467Z
Tailer
<p>I'm creating a wallet that generates address for litecoin mainnet in two ways.</p>

<p>One is using <a href="https://github.com/bitcoinjs/bitcoinjs-lib" rel="nofollow noreferrer">bitcoinjs-lib</a>. This library has an object with all the data need it to create private keys and address:</p>

<pre><code>import Bitcoin from 'bitcoinjs-lib'

console.log(Bitcoin.networks.litecoin)
{
    messagePrefix: '\x18Bitcoin Signed Message:\n',
    bip32: {
        public: 71979618,
        private: 71978536
    },
    pubKeyHash: 111,
    scriptHash: 196,
    wif: 239
}
</code></pre>

<p>This ok for the mainnet, but I am not able to find on internet the same version of this for testnet.</p>

<p>The other way is using derivation paths. But again, I only could find the mainnet version of this.</p>

<pre><code>mainnet: `m/44'/2'/0'/0/${index}`
mainnet_segwit: `m/49'/2'/0'/0/${index}`
</code></pre>

<p>Any idea where I can find it?</p>

<litecoin><testnet><address-generation><bip32-hd-wallets>
How to generate a Litecoin testnet addresses (Segwit also) (Derivation path, bip32)
Enzo
# How to generate a Litecoin testnet addresses (Segwit also) (Derivation path, bip32)

(Asked by: username_0 on 2018-05-28)

I'm creating a wallet that generates address for litecoin mainnet in two ways.

One is using [bitcoinjs-lib](https://github.com/bitcoinjs/bitcoinjs-lib). This library has an object with all the data need it to create private keys and address:

```
import Bitcoin from 'bitcoinjs-lib'

console.log(Bitcoin.networks.litecoin)
{
    messagePrefix: '\x18Bitcoin Signed Message:\n',
    bip32: {
        public: 71979618,
        private: 71978536
    },
    pubKeyHash: 111,
    scriptHash: 196,
    wif: 239
}

```

This ok for the mainnet, but I am not able to find on internet the same version of this for testnet.

The other way is using derivation paths. But again, I only could find the mainnet version of this.

```
mainnet: `m/44'/2'/0'/0/${index}`
mainnet_segwit: `m/49'/2'/0'/0/${index}`

```

Any idea where I can find it?

**Tags:** litecoin, testnet, address-generation, bip32-hd-wallets


---

## 1 answers

### Answer by username_1 on 2018-05-28. Score: 2 | Accepted answer

```
const ltcnet = {
    messagePrefix: '\x19Litecoin Signed Message:\n',
    bip32: { 
      public: 0x043587cf,
      private: 0x04358394
    },
    pubKeyHash: 0x6f,
    scriptHash: 0xc4, //  for segwit (start with 2)
    wif: 0xef
  }

```

use it like this:

```
var key = bitcoin.HDNode.fromSeedHex(seed, ltcnet)

```

> **Comments:**
> **username_0**: Do you also know what is the derivation path is (bip32)?  
> **username_2**: @EnZo Most coins don't have a separate testnet derivation path, they just change the prefix  
> **username_3**: I think you should also consider `scriptHash: 0x3a` to get the testnet p2sh addresses that start with `Q`.  

---

