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

  • 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
    Dec 4, 2014 at 23:33

1 Answer 1


The getrawtransaction RPC 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 is what you're looking for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.