<p>Yes, you can query balances with both <code>cardano-cli</code> and <code>cardano-wallet</code>. The developer portal shows this for different languages, but you can also read out the raw command-line query there.</p>
<p><code>cardano-cli</code>: <a href="https://developers.cardano.org/docs/integrate-cardano/listening-for-payments-cli#query-utxo" rel="nofollow noreferrer">https://developers.cardano.org/docs/integrate-cardano/listening-for-payments-cli#query-utxo</a></p>
<p><code>cardano-wallet</code>: <a href="https://developers.cardano.org/docs/integrate-cardano/listening-for-payments-wallet#retrieve-wallet-balance" rel="nofollow noreferrer">https://developers.cardano.org/docs/integrate-cardano/listening-for-payments-wallet#retrieve-wallet-balance</a></p>

CC BY-SA 4.0
2021-08-15T18:09:37.327Z
2021-08-15T18:09:37.327Z
adatainment
<p>How does Dedalus know what is my balance on given wallets? Is there a way I can do the same thing using <code>cardano-cli</code> or <code>cardano-wallet</code>?</p>
<p>Edit:</p>
<p>I have found <a href="https://iohk.zendesk.com/hc/en-us/articles/360034118013" rel="nofollow noreferrer">Wallet UTXO Distribution screen</a> that:</p>
<blockquote>
<p>When you receive ada to your Daedalus wallet, it simply means Daedalus has identified a UTXO that can be spent with the keys managed by your wallet... Daedalus determines your balance by scanning the Cardano blockchain and aggregating the value of any UTXO the wallet is able to spend with the keys associated to your wallet.</p>
</blockquote>
<p>Does that mean that Daedalus checks (has access to keys so can validate if the address belongs to a wallet(?)) all transactions and just sums up the balance?</p>
<p>And given that it's true I would need to somehow scan my copy of the blockchain to get the same information?</p>

<wallet><cardano-cli>
How to check wallet balance using cardano cli?
# How to check wallet balance using cardano cli?

(Asked by: username_0 on 2021-08-13)

How does Dedalus know what is my balance on given wallets? Is there a way I can do the same thing using `cardano-cli` or `cardano-wallet`?

Edit:

I have found [Wallet UTXO Distribution screen](https://iohk.zendesk.com/hc/en-us/articles/360034118013) that:

> When you receive ada to your Daedalus wallet, it simply means Daedalus has identified a UTXO that can be spent with the keys managed by your wallet... Daedalus determines your balance by scanning the Cardano blockchain and aggregating the value of any UTXO the wallet is able to spend with the keys associated to your wallet.

Does that mean that Daedalus checks (has access to keys so can validate if the address belongs to a wallet(?)) all transactions and just sums up the balance?

And given that it's true I would need to somehow scan my copy of the blockchain to get the same information?

**Tags:** wallet, cardano-cli

---

## 1 answers

### Answer by username_1 on 2021-08-15. Score: 3

Yes, you can query balances with both `cardano-cli` and `cardano-wallet`. The developer portal shows this for different languages, but you can also read out the raw command-line query there.

`cardano-cli`: <https://developers.cardano.org/docs/integrate-cardano/listening-for-payments-cli#query-utxo>

`cardano-wallet`: <https://developers.cardano.org/docs/integrate-cardano/listening-for-payments-wallet#retrieve-wallet-balance>


---

