<p>The cardano-cli (what the JS library wraps) has no notion of what a wallet is, how to derive addresses from mnemonic/public key, etc... cardano-wallet-js wraps the cardano-wallet process and can get information about a wallet and it's state on the network (which is required if you want to know unused addresses as a process needs to scrape entire chain to see if an address has been used or not). If you're looking for a simple library to derive addresses and don't care about state, there's a GHCJS build of cardano-addresses <a href="https://www.npmjs.com/package/cardano-addresses" rel="nofollow noreferrer">https://www.npmjs.com/package/cardano-addresses</a> which provides the ability to derive addresses from a root key, account public key or your 24 word mnemonic for the wallet. However; to identify if an address was used or not, you would need a db-sync or explorer API (like graphql, blockfrost, rosetta, etc...) to check the state of the chain for that particular address.</p>

CC BY-SA 4.0
2021-12-14T17:46:07.270Z
Thanks for clearing this up... kinda confusing if you ask me. Why not work on ONE JS Library which can do it all?
rx2347
CC BY-SA 4.0
2021-12-23T18:02:47.873Z
Mainly because running js code is slow.
Samuel Leathers
CC BY-SA 4.0
2021-12-14T14:16:26.503Z
2021-12-14T14:16:26.503Z
Samuel Leathers
<p>I am trying to generate a list of (unused) payment addresses with CardanoCLI-JS, but how to do it?</p>
<pre><code>    const wallet = cardanocliJs.wallet(&quot;Main&quot;);
    const address = cardanocliJs.addressBuild(&quot;Main&quot;, {
      paymentVkey: wallet.payment.vkey,
      stakeVkey: wallet.stake.vkey,
    });

console.log(address);
</code></pre>
<p>This outputs the location of the vkey, which gets updated on execution, but contains the same address as before?</p>
<p>Is this something CardanoCLI-JS just can't do right now?</p>
<p>Cardano-Wallet-JS has <code>wallet.getAddresses()</code>, which returns an array of 20 addresses, but I'd really like to stick to one JS library...</p>
<p>(Can someone pls create the tags cardanocli-js and cardano-wallet-js? thanks...)</p>

<wallet><cardano-cli>
Generate list of payment addresses using CardanoCLI-JS
# Generate list of payment addresses using CardanoCLI-JS

(Asked by: username_0 on 2021-12-05)

I am trying to generate a list of (unused) payment addresses with CardanoCLI-JS, but how to do it?
    const wallet = cardanocliJs.wallet("Main");
    const address = cardanocliJs.addressBuild("Main", {
      paymentVkey: wallet.payment.vkey,
      stakeVkey: wallet.stake.vkey,
    });

console.log(address);

This outputs the location of the vkey, which gets updated on execution, but contains the same address as before?
Is this something CardanoCLI-JS just can't do right now?
Cardano-Wallet-JS has wallet.getAddresses(), which returns an array of 20 addresses, but I'd really like to stick to one JS library...
(Can someone pls create the tags cardanocli-js and cardano-wallet-js? thanks...)

**Tags:** wallet, cardano-cli

---

## 1 answers

### Answer by username_1 on 2021-12-14. Score: 2 | Accepted answer

The cardano-cli (what the JS library wraps) has no notion of what a wallet is, how to derive addresses from mnemonic/public key, etc... cardano-wallet-js wraps the cardano-wallet process and can get information about a wallet and it's state on the network (which is required if you want to know unused addresses as a process needs to scrape entire chain to see if an address has been used or not). If you're looking for a simple library to derive addresses and don't care about state, there's a GHCJS build of cardano-addresses <https://www.npmjs.com/package/cardano-addresses> which provides the ability to derive addresses from a root key, account public key or your 24 word mnemonic for the wallet. However; to identify if an address was used or not, you would need a db-sync or explorer API (like graphql, blockfrost, rosetta, etc...) to check the state of the chain for that particular address.

> **Comments:**
> **username_0**: Thanks for clearing this up... kinda confusing if you ask me. Why not work on ONE JS Library which can do it all?  
> **username_1**: Mainly because running js code is slow.  

---

