<p>The ask seems fundamentally wrong, as unused wallets - by definition - are not on-chain and can only be derived using root public keys (in case you haven't, could be helpful for you to check <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" rel="nofollow noreferrer">BIP-44</a> spec that is used by <a href="https://input-output-hk.github.io/cardano-wallet/design/Notes-about-BIP-44" rel="nofollow noreferrer">cardano-wallet</a> ). The derivation of addresses can be easily achieved via one of the SDK/libs offline (you can find many of them at <a href="https://developers.cardano.org/tools?tags=library" rel="nofollow noreferrer">developer portal</a> - most popular ones being  <code>cardano-serialisation-lib</code> and <code>cardano-multiplatform-lib</code>).</p>
<p>Some notes tho about these (adding here, tho it may not be relevant for your context):</p>
<ol>
<li>There can be close to infinite unused addresses for a given stake account. You may see limited number of addresses because of default BIP-44 address gap (20), but that will not be all-inclusive list.</li>
<li>One can only derive addresses at different address idx if they have the root pub key, wouldn't be a good practice to rely on external services, especially when you have libraries to do it locally.</li>
<li>Even if you were to use a remote service that would provide list of addresses , from query pov - it would never be guaranteed to include different combinations of payment and stake key credentials , as they can also be merged across from different wallets.</li>
</ol>

CC BY-SA 4.0
2022-07-19T15:08:03.553Z
Thank you for taking the time to answer.
When I use:

> http://localhost:[port]/v2/wallets/[wallet id]/addresses?state=unused' | jq '.[0]

on my local instance of cardano-wallet, I get the first addr for the wallet that has state=unused

I was hoping for something similar from the blockfrost api - so I could avoid having to setup something that provides it to my web app from my local linux box where I have cardano-node & cardano-wallet running
RelevantData
CC BY-SA 4.0
2022-07-21T06:39:51.320Z
You do not need cardano-node/cardano-wallet/etc running, the links above refer to SDKs/libs that should allow you to do this on the device where private keys , while fetching tx-in/UTxO details can be from blockfrost.io/koios.rest/etc
RdLrT
CC BY-SA 4.0
2022-07-18T08:05:01.977Z
2022-07-18T08:05:01.977Z
RdLrT
<p>So the correct answer appears to be: &quot;That's not possible&quot;.
The Blockfrost API does not have a utility call of any kind that returns an unused address of a given wallet.</p>
<p>The Blockfrost API does have a call that returns known used addresses from the blockchain though.</p>
<p>To generate an address for a given set of private keys, I can use one of the libraries as mentioned by RdLrt, thank you.</p>
<p>cardano-serialisation-lib or cardano-multiplatform-lib.</p>

CC BY-SA 4.0
2022-07-21T14:06:11.223Z
2022-07-21T14:06:11.223Z
RelevantData
<p>Using Blockfrost API, I can query a stake address, and receive known addresses that have &quot;state=used&quot; like when I query them on my local node via Cardano-Wallet.
I am interested in &quot;state=unused&quot; though.
How can I get unused receiving addresses for a stake key using Blockfrost API?</p>
<p>EDIT:
When I use:</p>
<blockquote>
<p>localhost:[port]/v2/wallets/[wallet id]/addresses?state=unused' | jq '.[0]</p>
</blockquote>
<p>...on my local instance of cardano-wallet, I get the first addr for the wallet that has state=unused I was hoping for something similar from the blockfrost api - so I could avoid having to setup something that provides it to my web app from my local linux box where I have cardano-node &amp; cardano-wallet running</p>

<wallet><blockfrost>
How to get unused address for stake key via Blockfrost API
# How to get unused address for stake key via Blockfrost API

(Asked by: username_0 on 2022-07-18)

Using Blockfrost API, I can query a stake address, and receive known addresses that have "state=used" like when I query them on my local node via Cardano-Wallet.
I am interested in "state=unused" though.
How can I get unused receiving addresses for a stake key using Blockfrost API?

EDIT:
When I use:

> localhost:[port]/v2/wallets/[wallet id]/addresses?state=unused' | jq '.[0]

...on my local instance of cardano-wallet, I get the first addr for the wallet that has state=unused I was hoping for something similar from the blockfrost api - so I could avoid having to setup something that provides it to my web app from my local linux box where I have cardano-node & cardano-wallet running

**Tags:** wallet, blockfrost

---

## 2 answers

### Answer by username_1 on 2022-07-18. Score: 1 | Accepted answer

The ask seems fundamentally wrong, as unused wallets - by definition - are not on-chain and can only be derived using root public keys (in case you haven't, could be helpful for you to check [BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) spec that is used by [cardano-wallet](https://input-output-hk.github.io/cardano-wallet/design/Notes-about-BIP-44) ). The derivation of addresses can be easily achieved via one of the SDK/libs offline (you can find many of them at [developer portal](https://developers.cardano.org/tools?tags=library) - most popular ones being `cardano-serialisation-lib` and `cardano-multiplatform-lib`).

Some notes tho about these (adding here, tho it may not be relevant for your context):

1. There can be close to infinite unused addresses for a given stake account. You may see limited number of addresses because of default BIP-44 address gap (20), but that will not be all-inclusive list.
2. One can only derive addresses at different address idx if they have the root pub key, wouldn't be a good practice to rely on external services, especially when you have libraries to do it locally.
3. Even if you were to use a remote service that would provide list of addresses , from query pov - it would never be guaranteed to include different combinations of payment and stake key credentials , as they can also be merged across from different wallets.

> **Comments:**
> **username_0**: Thank you for taking the time to answer. When I use:  > http://localhost:[port]/v2/wallets/[wallet id]/addresses?state=unused' | jq '.[0]  on my local instance of cardano-wallet, I get the first addr for the wallet that has state=unused  I was hoping for something similar from the blockfrost api - so I could avoid having to setup something that provides it to my web app from my local linux box where I have cardano-node & cardano-wallet running  
> **username_1**: You do not need cardano-node/cardano-wallet/etc running, the links above refer to SDKs/libs that should allow you to do this on the device where private keys , while fetching tx-in/UTxO details can be from blockfrost.io/koios.rest/etc  

---

### Answer by username_0 on 2022-07-21. Score: 0

So the correct answer appears to be: "That's not possible".
The Blockfrost API does not have a utility call of any kind that returns an unused address of a given wallet.

The Blockfrost API does have a call that returns known used addresses from the blockchain though.

To generate an address for a given set of private keys, I can use one of the libraries as mentioned by RdLrt, thank you.

cardano-serialisation-lib or cardano-multiplatform-lib.


---

