<p><code>listreceivedbyaddress</code> (and the other transaction listing RPCs) list logical transactions, not physical transactions. So it really lists transaction outputs. Additionally, they share a lot of code. Because these are logical transactions, there are some things that are hidden so that the output is not confusing to the user. One of those things are change outputs, as those are not the same kind of transaction as a send or receive.</p>
<p>Since you used <code>getrawchangeaddress</code>, the address you have is marked as a change address. So the code that fetches the logical transactions for listing will filter the transaction outputs for the address you specify, but later code (that is intended for other RPCs), will filter out those outputs that belong are marked as change. Thus you see no results.</p>
<p><code>getreceivedbyaddress</code> is a balance fetching RPC, and so it uses different code paths from <code>listreceivedbyaddress</code>. It does not filter out change addresses in the same way as balance calculation (for other RPCs) actually needs to include change outputs. So you see the balance of the change address in <code>getreceivedbyaddress</code></p>
<hr />
<p>This is intended behavior, but it is clearly confusing. However most users are not aware of change addresses and are unable to even see what their change addresses are, so fixing this is fairly low priority.</p>

CC BY-SA 4.0
2021-12-22T06:54:16.973Z
Thanks for your answer, pretty clear now. But is it even possible to list transactions of change address?
ddenuvo
CC BY-SA 4.0
2021-12-21T21:15:51.010Z
2021-12-21T21:15:51.010Z
Ava Chow
<p>Everything was done on regtest network.</p>
<p>So I've generated a new address using <code>getrawchangeaddress</code> on <code>wallet 2</code> and made a 0.1 BTC transaction from <code>wallet 1</code> to <code>wallet 2</code> and tried check this address balance on <code>wallet 2</code> using <code>getreceivedbyaddress</code>.</p>
<p>Well, it says that address received 0.1 BTC, but when I try to execute <code>listreceivedbyaddress</code>, it returns an empty list.</p>
<p>NOTE: This transaction have above 6 confirmations.</p>
<pre><code> &gt; bitcoin-cli --rpcport=19011 --rpcuser=admin --rpcpassword=123 listreceivedbyaddress 1 true true bcrt1qn858fc33j9f6w83vu6vglk2d3e5th3zhrxj9lg
[
]

 &gt; bitcoin-cli --rpcport=19011 --rpcuser=admin --rpcpassword=123 getreceivedbyaddress bcrt1qn858fc33j9f6w83vu6vglk2d3e5th3zhrxj9lg
0.10000000
</code></pre>
<p>Weird thing also is that I've marked <code>include_empty</code> to <code>true</code>, but the answer is an empty list.</p>
<p>EDIT: <code>listtransactions</code> shows the transactions, but there is a lot of other transactions.</p>

<transactions><json-rpc>
Weird Bitcoin RPC listreceivedbyaddress behaviour
ddenuvo
# Weird Bitcoin RPC listreceivedbyaddress behaviour

(Asked by: username_0 on 2021-12-21)

Everything was done on regtest network.

So I've generated a new address using `getrawchangeaddress` on `wallet 2` and made a 0.1 BTC transaction from `wallet 1` to `wallet 2` and tried check this address balance on `wallet 2` using `getreceivedbyaddress`.

Well, it says that address received 0.1 BTC, but when I try to execute `listreceivedbyaddress`, it returns an empty list.

NOTE: This transaction have above 6 confirmations.

```
 > bitcoin-cli --rpcport=19011 --rpcuser=admin --rpcpassword=123 listreceivedbyaddress 1 true true bcrt1qn858fc33j9f6w83vu6vglk2d3e5th3zhrxj9lg
[
]

 > bitcoin-cli --rpcport=19011 --rpcuser=admin --rpcpassword=123 getreceivedbyaddress bcrt1qn858fc33j9f6w83vu6vglk2d3e5th3zhrxj9lg
0.10000000

```

Weird thing also is that I've marked `include_empty` to `true`, but the answer is an empty list.

EDIT: `listtransactions` shows the transactions, but there is a lot of other transactions.

**Tags:** transactions, json-rpc


---

## 1 answers

### Answer by username_1 on 2021-12-21. Score: 1 | Accepted answer

`listreceivedbyaddress` (and the other transaction listing RPCs) list logical transactions, not physical transactions. So it really lists transaction outputs. Additionally, they share a lot of code. Because these are logical transactions, there are some things that are hidden so that the output is not confusing to the user. One of those things are change outputs, as those are not the same kind of transaction as a send or receive.

Since you used `getrawchangeaddress`, the address you have is marked as a change address. So the code that fetches the logical transactions for listing will filter the transaction outputs for the address you specify, but later code (that is intended for other RPCs), will filter out those outputs that belong are marked as change. Thus you see no results.

`getreceivedbyaddress` is a balance fetching RPC, and so it uses different code paths from `listreceivedbyaddress`. It does not filter out change addresses in the same way as balance calculation (for other RPCs) actually needs to include change outputs. So you see the balance of the change address in `getreceivedbyaddress`

---

This is intended behavior, but it is clearly confusing. However most users are not aware of change addresses and are unable to even see what their change addresses are, so fixing this is fairly low priority.

> **Comments:**
> **username_0**: Thanks for your answer, pretty clear now. But is it even possible to list transactions of change address?  

---

