user137141: The listunspent Bitcoin Core RPC method by default works only for addresses loaded in the wallet.  Does it work for any address if the node has full index (txindex=1)?
(Technically it could I think, but since this is a 'wallet' RPC, it may be restricted.)

user121614: Correct, this is a wallet RPC, so it only deals with outputs belonging to the wallet.
If you want to query the entire unspent transaction output set, you can use the scantxoutset RPC. It doesn't even depend on txindex=1.

user5406: The Bitcoin Core Wallet tracks addresses associated with its own keys. listunspent is a wallet RPC that refers to the wallet data only.
Beyond the wallet's tracking of its own data, Bitcoin Core does not have functionality to keep an address index regardless of whether txindex is used or not. I surmise that address tracking was never prioritized by a Bitcoin Core contributor (or even pushed back upon by others) due to the intended single-use nature of addresses.
If you want to keep track of UTXOs per address you may want to look into blockchain explorer projects such as esplora or mempool.space.

137141: <p>The <a href="https://developer.bitcoin.org/reference/rpc/listunspent.html" rel="nofollow noreferrer"><code>listunspent</code></a> Bitcoin Core RPC method by default works only for addresses loaded in the wallet.  Does it work for <em>any</em> address if the node has full index (<code>txindex=1</code>)?</p>
<p>(Technically it could I think, but since this is a 'wallet' RPC, it may be restricted.)</p>
 121614: <p>Correct, this is a wallet RPC, so it only deals with outputs belonging to the wallet.</p>
<p>If you want to query the entire unspent transaction output set, you can use the <code>scantxoutset</code> RPC. It doesn't even depend on <code>txindex=1</code>.</p>
 5406: <p>The Bitcoin Core Wallet tracks addresses associated with its own keys. <code>listunspent</code> is a <em>wallet</em> RPC that refers to the wallet data only.
Beyond the wallet's tracking of its own data, Bitcoin Core does not have functionality to keep an address index regardless of whether <code>txindex</code> is used or not. I surmise that address tracking was never prioritized by a Bitcoin Core contributor (or even pushed back upon by others) due to the intended single-use nature of addresses.</p>
<p>If you want to keep track of UTXOs per address you may want to look into blockchain explorer projects such as <em>esplora</em> or <em>mempool.space</em>.</p>
