<p>The <a href="https://bitcoin.org/en/developer-reference#getrawtransaction" rel="nofollow"><code>getrawtransaction</code> RPC</a> will provide you with details about a particular transaction.  However, answering your question further is complicated by several issues:</p>

<ol>
<li><p>Transactions are not required to have change addresses.  Good wallets will attempt to avoid using change addresses when change isn't necessary.</p></li>
<li><p>Transactions may have more than two outputs, so there's not necessarily a single payment address.</p></li>
<li><p>Transactions may pay a bare (non-P2SH) multisig output which comprises several public keys.  GetRawTransaction will display these as multiple addresses.</p></li>
<li><p>In a well-implemented wallet, change should be indistinguishable from a payment within a single transaction.  You would need to analyze multiple transactions or have information from the party that received payment in order to be able to determine which output is a change address.</p></li>
</ol>

<p>In short, I don't think GetRawTransaction or any other RPC will provide you with the information you want for arbitrary block chain transactions.  However, if you're only interested in information about transactions in the local wallet, the <a href="https://bitcoin.org/en/developer-reference#gettransaction" rel="nofollow"><code>gettransaction</code> RPC</a> is what you're looking for.</p>

CC BY-SA 3.0
2015-01-13T06:45:07.320Z
2015-01-13T06:45:07.320Z
David A. Harding
<p>How to get destination address and amount from result of getrawtransaction and how to distinguish it from "change" address using rpc api.</p>

CC BY-SA 3.0
2014-12-04T23:33:38.617Z
try decoding the raw transaction `bitcoind decoderawtransaction <hex string>` or you can just work with the original transaction in the first place `bitcoind gettransaction  <txid>`
Loourr
<transactions><bitcoin-core><json-rpc>
getrawtransaction - find destination and "change" addresses
Alex
# getrawtransaction - find destination and "change" addresses

(Asked by: username_0 on 2014-12-04)

How to get destination address and amount from result of getrawtransaction and how to distinguish it from "change" address using rpc api.

**Tags:** transactions, bitcoin-core, json-rpc

> **Comments:**
> **username_1**: try decoding the raw transaction `bitcoind decoderawtransaction <hex string>` or you can just work with the original transaction in the first place `bitcoind gettransaction  <txid>`  

---

## 1 answers

### Answer by username_2 on 2015-01-13. Score: 1

The [`getrawtransaction` RPC](https://bitcoin.org/en/developer-reference#getrawtransaction) will provide you with details about a particular transaction. However, answering your question further is complicated by several issues:

1. Transactions are not required to have change addresses. Good wallets will attempt to avoid using change addresses when change isn't necessary.
2. Transactions may have more than two outputs, so there's not necessarily a single payment address.
3. Transactions may pay a bare (non-P2SH) multisig output which comprises several public keys. GetRawTransaction will display these as multiple addresses.
4. In a well-implemented wallet, change should be indistinguishable from a payment within a single transaction. You would need to analyze multiple transactions or have information from the party that received payment in order to be able to determine which output is a change address.

In short, I don't think GetRawTransaction or any other RPC will provide you with the information you want for arbitrary block chain transactions. However, if you're only interested in information about transactions in the local wallet, the [`gettransaction` RPC](https://bitcoin.org/en/developer-reference#gettransaction) is what you're looking for.


---

