user1718: In the Daedalus wallet under "Receive" it says

Please note that all of your receiving addresses include your stake
key. When you share a receiving address, the recipient can search the
blockchain using your stake key to locate all addresses associated
with your wallet, and also discover your wallet balance and
transaction history.

Does that mean I can query for any address the stake key and therefore all the child addresses with their total balance?
If yes, how can I achieve this using the cardano-cli and cardano-wallet?
I already know, that I can read the balance of a single address with cardano-cli query utxo --address, but how can I discover the related addresses in the same wallet?

user382: You need db-sync to analyze wallets that you don't have the account public key for. Given an address from a wallet, you can run cardano-address inspect to identify the stake address:
cardano-address address inspect <<< addr1...
This is a sample query to db-sync that lets you query all addresses for a given stake address.
SELECT * FROM utxo_view INNER JOIN stake_address ON stake_address.id = utxo_view.stake_address_id WHERE stake_address.view = 'stake1...';
One caveat is anyone can send funds to a payment address not associated with your wallet that's associated with your stake key. This means there could be some addresses you query that the user doesn't have control, so you cannot assume the user with the wallet with that stake key can access all the addresses provided.

1718: <p>In the Daedalus wallet under &quot;Receive&quot; it says</p>
<blockquote>
<p>Please note that all of your receiving addresses include your stake
key. When you share a receiving address, the recipient can search the
blockchain using your stake key to locate all addresses associated
with your wallet, and also discover your wallet balance and
transaction history.</p>
</blockquote>
<p>Does that mean I can query for any address the stake key and therefore all the child addresses with their total balance?
If yes, how can I achieve this using the <code>cardano-cli</code> and <code>cardano-wallet</code>?</p>
<p>I already know, that I can read the balance of a single address with <code>cardano-cli query utxo --address</code>, but how can I discover the related addresses in the same wallet?</p>
 382: <p>You need db-sync to analyze wallets that you don't have the account public key for. Given an address from a wallet, you can run cardano-address inspect to identify the stake address:</p>
<p><code>cardano-address address inspect &lt;&lt;&lt; addr1...</code></p>
<p>This is a sample query to db-sync that lets you query all addresses for a given stake address.</p>
<p><code>SELECT * FROM utxo_view INNER JOIN stake_address ON stake_address.id = utxo_view.stake_address_id WHERE stake_address.view = 'stake1...';</code></p>
<p>One caveat is anyone can send funds to a payment address not associated with your wallet that's associated with your stake key. This means there could be some addresses you query that the user doesn't have control, so you cannot assume the user with the wallet with that stake key can access all the addresses provided.</p>
