<p>If the address is in your wallet, gettransaction includes the input addresses:</p>

<ul>
<li><a href="http://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list" rel="nofollow">http://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list</a></li>
</ul>

<p>If this is done by an agent where the addresses might not be in the wallet, v0.7 getrawtransaction gives you <a href="https://bitcointalk.org/index.php?topic=89725.msg990497#msg990497" rel="nofollow">access to those transactions</a>.</p>

<ul>
<li><a href="http://en.bitcoin.it/wiki/Raw_Transactions" rel="nofollow">http://en.bitcoin.it/wiki/Raw_Transactions</a></li>
</ul>

<p>There are other tools that you can use to build this capability as well.</p>

<ul>
<li>libBitcoin</li>
<li>Armory (see <a href="https://github.com/etotheipi/BitcoinArmory/tree/master/extras" rel="nofollow">Extras</a>)</li>
<li>Bitcoin ABE </li>
</ul>

CC BY-SA 3.0
2012-09-01T03:20:58.553Z
2012-09-01T03:20:58.553Z
Stephen Gornick
<p>I want to get information about the creator of a given transaction through Bitcoin API. More specifically, any or all addresses they sent their Bitcoins from, so I can return some of the money back. Is it possible to do using just the JSON RPC, or do I have to rely on external sources (such as the Block Explorer)?</p>

CC BY-SA 3.0
2012-09-01T08:47:05.627Z
I would strongly urge you not to do this. For one thing, if the money was sent to you from a typical web-based wallet or exchange, the money will *not* go back to the sender.
David Schwartz
CC BY-SA 3.0
2012-09-01T11:30:41.513Z
The only correct way to do a refund, is to ask the sender to provide a refund address. You may be able to observe some of the addresses some of the input coins were previously sent to, but there is no guarantee that the sender expects/accepts refunds to those. Typical standalone Bitcoin clients do, but there are far from the only players on the network.
Pieter Wuille
<transactions><bitcoind><json-rpc><raw-data><api>
How to return Bitcoins to sender through Bitcoin API?
ThePiachu
# How to return Bitcoins to sender through Bitcoin API?

(Asked by: username_0 on 2012-09-01)

I want to get information about the creator of a given transaction through Bitcoin API. More specifically, any or all addresses they sent their Bitcoins from, so I can return some of the money back. Is it possible to do using just the JSON RPC, or do I have to rely on external sources (such as the Block Explorer)?

**Tags:** transactions, bitcoind, json-rpc, raw-data, api

> **Comments:**
> **username_1**: I would strongly urge you not to do this. For one thing, if the money was sent to you from a typical web-based wallet or exchange, the money will *not* go back to the sender.  
> **username_2**: The only correct way to do a refund, is to ask the sender to provide a refund address. You may be able to observe some of the addresses some of the input coins were previously sent to, but there is no guarantee that the sender expects/accepts refunds to those. Typical standalone Bitcoin clients do, but there are far from the only players on the network.  

---

## 1 answers

### Answer by username_3 on 2012-09-01. Score: 3 | Accepted answer

If the address is in your wallet, gettransaction includes the input addresses:

* <http://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list>

If this is done by an agent where the addresses might not be in the wallet, v0.7 getrawtransaction gives you [access to those transactions](https://bitcointalk.org/index.php?topic=89725.msg990497#msg990497).

* <http://en.bitcoin.it/wiki/Raw_Transactions>

There are other tools that you can use to build this capability as well.

* libBitcoin
* Armory (see [Extras](https://github.com/etotheipi/BitcoinArmory/tree/master/extras))
* Bitcoin ABE


---

