<p>You can for example check the Block Explorer's info about a given transaction. For example, given transaction <a href="http://blockexplorer.com/tx/1c480aad976c61b51ae47401a554b09f65efe6f95f644041f838d9129e09167c" rel="noreferrer">1c480aad976c61b51ae47401a554b09f65efe6f95f644041f838d9129e09167c</a>, you can see that the only input was associated with address 1HnjAo2nbHGFDto86smcFiF3uUwfvNJ4cS.</p>

<p>However, generally you should avoid using transaction inputs for basically any purpose - they do not uniquely identify a user, sending Bitcoins back to the user might be problematic with just this information and so forth.</p>

CC BY-SA 3.0
2012-09-29T14:45:56.617Z
OK... Thanks for answering. Where Can I found that here? Is it the "hash" of "prevout"?
https://blockchain.info/api/blockchain_api
flaab
CC BY-SA 3.0
2012-09-29T17:04:05.633Z
@flaab You'd have to parse the website, not the raw Tx, as a Bitcoin transaction does not encode the previous transaction. If you want to use raw Tx, you would need to take the `prev_out` `hash` and `n`, go to the transaction of that hash and check the `out` with an index `n`.
ThePiachu
CC BY-SA 3.0
2012-09-29T14:24:08.157Z
2012-09-29T14:24:08.157Z
ThePiachu
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="https://bitcoin.stackexchange.com/questions/3896/how-to-findout-the-sender-of-a-transaction">How to findout the sender of a transaction</a>  </p>
</blockquote>



<p>I am trying to use blockchain.info API to receive a payment and store the sender's address. However, the API only indicates the transaction hash, not the sender's address. Perhaps this is simply ignorance about the BTC Protocol, but <strong>how can I find the sender's address from any given transaction hash?</strong></p>

<p>The two API's I am using:</p>

<ul>
<li><a href="https://blockchain.info/api/api_receive" rel="nofollow noreferrer">https://blockchain.info/api/api_receive</a></li>
<li><a href="https://blockchain.info/api/blockchain_api" rel="nofollow noreferrer">https://blockchain.info/api/blockchain_api</a></li>
</ul>

<payment><api>
How can I find the sender's address from the transaction hash?
flaab
# How can I find the sender's address from the transaction hash?

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

> **Possible Duplicate:**  
> [How to findout the sender of a transaction](https://bitcoin.stackexchange.com/questions/3896/how-to-findout-the-sender-of-a-transaction)

I am trying to use blockchain.info API to receive a payment and store the sender's address. However, the API only indicates the transaction hash, not the sender's address. Perhaps this is simply ignorance about the BTC Protocol, but **how can I find the sender's address from any given transaction hash?**

The two API's I am using:

* <https://blockchain.info/api/api_receive>
* <https://blockchain.info/api/blockchain_api>

**Tags:** payment, api


---

## 1 answers

### Answer by username_1 on 2012-09-29. Score: 5 | Accepted answer

You can for example check the Block Explorer's info about a given transaction. For example, given transaction [1c480aad976c61b51ae47401a554b09f65efe6f95f644041f838d9129e09167c](http://blockexplorer.com/tx/1c480aad976c61b51ae47401a554b09f65efe6f95f644041f838d9129e09167c), you can see that the only input was associated with address 1HnjAo2nbHGFDto86smcFiF3uUwfvNJ4cS.

However, generally you should avoid using transaction inputs for basically any purpose - they do not uniquely identify a user, sending Bitcoins back to the user might be problematic with just this information and so forth.

> **Comments:**
> **username_0**: OK... Thanks for answering. Where Can I found that here? Is it the "hash" of "prevout"? https://blockchain.info/api/blockchain_api  
> **username_1**: @username_0 You'd have to parse the website, not the raw Tx, as a Bitcoin transaction does not encode the previous transaction. If you want to use raw Tx, you would need to take the `prev_out` `hash` and `n`, go to the transaction of that hash and check the `out` with an index `n`.  

---

