<p>Think of <code>cardano-wallet</code> as Daedalus, it can only manage locally created wallets and their addresses and transactions.</p>
<p>If you want to interact with the blockchain as a whole you should be using <code>cardano-cli</code> (I used Lars' <a href="https://github.com/input-output-hk/lobster-challenge#script" rel="noreferrer">Lobster Challenge</a> address as an example instead to have some outputs):</p>
<ul>
<li>Get some tech info:</li>
</ul>
<pre><code>$ cardano-cli address info --address addr1w8433zk2shufk42hn4x7zznjjuqwwyfmxffcjszw5l2ulesdt3jff
{
    &quot;address&quot;: &quot;addr1w8433zk2shufk42hn4x7zznjjuqwwyfmxffcjszw5l2ulesdt3jff&quot;,
    &quot;base16&quot;: &quot;71eb188aca85f89b55579d4de10a729700e7113b325389404ea7d5cfe6&quot;,
    &quot;type&quot;: &quot;payment&quot;,
    &quot;encoding&quot;: &quot;bech32&quot;,
    &quot;era&quot;: &quot;shelley&quot;
}
</code></pre>
<ul>
<li>Get ADA/tokens balance and Plutus stuff</li>
</ul>
<pre><code>$ cardano-cli query utxo --mainnet --address addr1w8433zk2shufk42hn4x7zznjjuqwwyfmxffcjszw5l2ulesdt3jff
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
319752b414804415988fb1165358e69f46095a9e9b1c01ef0830c182dc57f78b     0        1000000 lovelace + TxOutDatumHashNone
4c34feb07e32aa4855a494306aefcf16743356811914d680e112a6ec12214455     0        1000000 lovelace + TxOutDatumHashNone
63091c70aa6f8b402faffd24909d93c7721cbdced7094b62e52d157da8fb44e4     0        5000000 lovelace + TxOutDatumHashNone
67d318fabdd9905033bfe6156c6595716c952d496cabb9d98773c948974780ec     0        1000000 lovelace + TxOutDatumHashNone
cb7b44500fc9145cf5b13a533bc7616eb219b7a080bc49d7ce6204c06b351733     0        1000000 lovelace + TxOutDatumHashNone
cf944108d7130a8d53925ff9903a254d5133d5978b7e69e04c67d5b8776a6fb2     1        2034438 lovelace + 1 cc7888851f0f5aa64c136e0c8fb251e9702f3f6c9efcf3a60a54f419.LobsterNFT + 522 fda1b6b487bee2e7f64ecf24d24b1224342484c0195ee1b7b943db50.LobsterCounter + 501 fda1b6b487bee2e7f64ecf24d24b1224342484c0195ee1b7b943db50.LobsterVotes + TxOutDatumHash ScriptDataInAlonzoEra &quot;45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0&quot;
db250ed5eb4454843af19dea7ca84a8adda170fc88284e7e5e2381b41dab5f9b     1        30768137 lovelace + TxOutDatumHashNone
</code></pre>

CC BY-SA 4.0
2021-10-01T05:07:33.677Z
Would be helpful to see an example output of these commands.
eddex
CC BY-SA 4.0
2021-10-01T14:18:34.027Z
Thank you for the answer!

Any idea why the `cardano-cli query utxo --mainnet --address` would return no utxos, when, for example, pool.pm shows 5?

(cardano-node is fully synced)
K.M
CC BY-SA 4.0
2021-10-01T20:03:23.407Z
I'm not sure but it's like if pool.pm is showing everything regarding the wallet associated with the searched address. Your address shows 522 ADA and 2 NFTs, but if you see the NFTS's info they belong to two completely different addresses. Maybe those 522 ADA are shared among other addresses too because Cardano Explore shows no results neither https://explorer.cardano.org/en/address?address=addr1qyxwlgeux7f8t7552p8uh3de8yfakftt3lwmceuzs9jcw0gw3el5uu8gpznfcsthyvuf558epvsmjl2gmmkvax535tjsaglpn2
Aron Neewart
CC BY-SA 4.0
2021-12-08T06:15:52.587Z
Although it's nice that you put some examples of getting info, there are no examples of how to get the wallet id from a receive address, regardless of what tool you're using.
melchoir55
CC BY-SA 4.0
2021-12-09T19:16:12.163Z
@melchoir55 A "wallet id" only has sense in the cardano-wallet local environment context. On the blockchain the equivalent would be the private key, and it'd be very bad if you can find it from the address. All you can have is the address, i.e. (one of) the wallet's public key(s).
Aron Neewart
CC BY-SA 4.0
2021-09-30T23:47:55.257Z
2021-10-01T19:44:31.320Z
2021-10-01T19:44:31.320Z
Aron Neewart
<p>In JavaScript, from the <a href="https://github.com/input-output-hk/plutus-apps/blob/main/plutus-pab/demo/pab-nami/client/src/Cardano/Wallet/Nami.js" rel="nofollow noreferrer">Nami Wallet PAB demo</a>:</p>
<pre><code>exports.getWalletIdImpl = () =&gt; {
  return Promise.all([window.cardano.getUsedAddresses(), window.cardano.getUnusedAddresses()])
    .then(([walletUsedAddresses, walletUnusedAddresses]) =&gt; {
      const addresses = walletUnusedAddresses.concat(walletUsedAddresses)
      return require('blake2b')(20)
        .update(Buffer.from(addresses.map(a =&gt; a.to_bech32).join('')))
        .digest('hex')
    })
}
</code></pre>

CC BY-SA 4.0
2022-01-04T10:57:04.133Z
2022-01-04T10:57:04.133Z
Mateus
<p>I'm trying to use the <code>cardano-wallet</code> API, but most of the endpoints I want to use are based on WALLET_ID parameter.</p>
<p>How can I find out the WALLET ID when all I have is the addr, for example <code>addr1qyxwlgeux7f8t7552p8uh3de8yfakftt3lwmceuzs9jcw0gw3el5uu8gpznfcsthyvuf558epvsmjl2gmmkvax535tjsaglpn2</code>?</p>

<wallet><address>
How to get Wallet ID from an address?
# How to get Wallet ID from an address?

(Asked by: username_0 on 2021-09-30)

I'm trying to use the `cardano-wallet` API, but most of the endpoints I want to use are based on WALLET\_ID parameter.

How can I find out the WALLET ID when all I have is the addr, for example `addr1qyxwlgeux7f8t7552p8uh3de8yfakftt3lwmceuzs9jcw0gw3el5uu8gpznfcsthyvuf558epvsmjl2gmmkvax535tjsaglpn2`?

**Tags:** wallet, address

---

## 2 answers

### Answer by username_1 on 2021-09-30. Score: 7 | Accepted answer

Think of cardano-wallet as Daedalus, it can only manage locally created wallets and their addresses and transactions.
If you want to interact with the blockchain as a whole you should be using cardano-cli (I used Lars' Lobster Challenge address as an example instead to have some outputs):

Get some tech info:

$ cardano-cli address info --address addr1w8433zk2shufk42hn4x7zznjjuqwwyfmxffcjszw5l2ulesdt3jff
{
    "address": "addr1w8433zk2shufk42hn4x7zznjjuqwwyfmxffcjszw5l2ulesdt3jff",
    "base16": "71eb188aca85f89b55579d4de10a729700e7113b325389404ea7d5cfe6",
    "type": "payment",
    "encoding": "bech32",
    "era": "shelley"
}


Get ADA/tokens balance and Plutus stuff

$ cardano-cli query utxo --mainnet --address addr1w8433zk2shufk42hn4x7zznjjuqwwyfmxffcjszw5l2ulesdt3jff
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
319752b414804415988fb1165358e69f46095a9e9b1c01ef0830c182dc57f78b     0        1000000 lovelace + TxOutDatumHashNone
4c34feb07e32aa4855a494306aefcf16743356811914d680e112a6ec12214455     0        1000000 lovelace + TxOutDatumHashNone
63091c70aa6f8b402faffd24909d93c7721cbdced7094b62e52d157da8fb44e4     0        5000000 lovelace + TxOutDatumHashNone
67d318fabdd9905033bfe6156c6595716c952d496cabb9d98773c948974780ec     0        1000000 lovelace + TxOutDatumHashNone
cb7b44500fc9145cf5b13a533bc7616eb219b7a080bc49d7ce6204c06b351733     0        1000000 lovelace + TxOutDatumHashNone
cf944108d7130a8d53925ff9903a254d5133d5978b7e69e04c67d5b8776a6fb2     1        2034438 lovelace + 1 cc7888851f0f5aa64c136e0c8fb251e9702f3f6c9efcf3a60a54f419.LobsterNFT + 522 fda1b6b487bee2e7f64ecf24d24b1224342484c0195ee1b7b943db50.LobsterCounter + 501 fda1b6b487bee2e7f64ecf24d24b1224342484c0195ee1b7b943db50.LobsterVotes + TxOutDatumHash ScriptDataInAlonzoEra "45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0"
db250ed5eb4454843af19dea7ca84a8adda170fc88284e7e5e2381b41dab5f9b     1        30768137 lovelace + TxOutDatumHashNone

> **Comments:**
> **username_2**: Would be helpful to see an example output of these commands.  
> **username_0**: Thank you for the answer!  Any idea why the `cardano-cli query utxo --mainnet --address` would return no utxos, when, for example, pool.pm shows 5?  (cardano-node is fully synced)  
> **username_1**: I'm not sure but it's like if pool.pm is showing everything regarding the wallet associated with the searched address. Your address shows 522 ADA and 2 NFTs, but if you see the NFTS's info they belong to two completely different addresses. Maybe those 522 ADA are shared among other addresses too because Cardano Explore shows no results neither https://explorer.cardano.org/en/address?address=addr1qyxwlgeux7f8t7552p8uh3de8yfakftt3lwmceuzs9jcw0gw3el5uu8gpznfcsthyvuf558epvsmjl2gmmkvax535tjsaglpn2  
> **username_3**: Although it's nice that you put some examples of getting info, there are no examples of how to get the wallet id from a receive address, regardless of what tool you're using.  
> **username_1**: @melchoir55 A "wallet id" only has sense in the cardano-wallet local environment context. On the blockchain the equivalent would be the private key, and it'd be very bad if you can find it from the address. All you can have is the address, i.e. (one of) the wallet's public key(s).  

---

### Answer by username_4 on 2022-01-04. Score: 0

In JavaScript, from the Nami Wallet PAB demo:
exports.getWalletIdImpl = () => {
  return Promise.all([window.cardano.getUsedAddresses(), window.cardano.getUnusedAddresses()])
    .then(([walletUsedAddresses, walletUnusedAddresses]) => {
      const addresses = walletUnusedAddresses.concat(walletUsedAddresses)
      return require('blake2b')(20)
        .update(Buffer.from(addresses.map(a => a.to_bech32).join('')))
        .digest('hex')
    })
}


---

