<p>Yeah, you can do that since the only difference between all bitcoin forks addresses is just the prefixes.</p>

<p>For example for Litecoin and bitcoin you could do something like that to generate address from XPUP on Bitcoinjs:</p>

<pre><code>var bitcoin = require('bitcoinjs-lib');
import HDNode from "../../bitcoinjs-lib/src/hdnode";

const litecoin = bitcoin.networks.litecoin
const xpub = "YOUR XPUP HERE";
const node = HDNode.fromBase58(xpub, litecoin);
const address = node.derive(0).getAddress(litecoin);
// Bitcoin
const bitcoin = bitcoin.networks.bitcoin
const xpub = "YOUR XPUP HERE";
const node = HDNode.fromBase58(xpub, bitcoin);
const address = node.derive(0).getAddress(bitcoin);
</code></pre>

CC BY-SA 3.0
2018-02-26T07:18:08.327Z
Can you provide link for java library that does the same functionality
Ajit Soman
CC BY-SA 3.0
2018-02-26T08:19:01.247Z
https://github.com/bitcoinjs/bitcoinjs-lib
Tailer
CC BY-SA 3.0
2018-02-26T07:03:28.780Z
2018-02-26T07:03:28.780Z
Tailer
<p>Is there any way i can generate private key and address of bitcoin and bitcoin forks(litecoin,dogecoin etc...).</p>

<p>For bitcoin I have used <code>BitcoinJ</code> to generate private key and address but for litecoin and dogecoin I can't find any. Is there is any algorithm or code available to generate private key and address for all bitcoin forked coin.</p>

<bitcoin-core><litecoin>
How can i generate private key and its address of bitcoin,dogecoin,litecoin etc
Ajit Soman
# How can i generate private key and its address of bitcoin,dogecoin,litecoin etc

(Asked by: username_0 on 2018-02-26)

Is there any way i can generate private key and address of bitcoin and bitcoin forks(litecoin,dogecoin etc...).

For bitcoin I have used `BitcoinJ` to generate private key and address but for litecoin and dogecoin I can't find any. Is there is any algorithm or code available to generate private key and address for all bitcoin forked coin.

**Tags:** bitcoin-core, litecoin


---

## 1 answers

### Answer by username_1 on 2018-02-26. Score: 1

Yeah, you can do that since the only difference between all bitcoin forks addresses is just the prefixes.
For example for Litecoin and bitcoin you could do something like that to generate address from XPUP on Bitcoinjs:
var bitcoin = require('bitcoinjs-lib');
import HDNode from "../../bitcoinjs-lib/src/hdnode";

const litecoin = bitcoin.networks.litecoin
const xpub = "YOUR XPUP HERE";
const node = HDNode.fromBase58(xpub, litecoin);
const address = node.derive(0).getAddress(litecoin);
// Bitcoin
const bitcoin = bitcoin.networks.bitcoin
const xpub = "YOUR XPUP HERE";
const node = HDNode.fromBase58(xpub, bitcoin);
const address = node.derive(0).getAddress(bitcoin);

> **Comments:**
> **username_0**: Can you provide link for java library that does the same functionality  
> **username_1**: https://github.com/bitcoinjs/bitcoinjs-lib  

---

