7

Possible Duplicate:
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:

marked as duplicate by Stephen Gornick, ThePiachu, Pieter Wuille, kirian, Colin Dean Nov 25 '12 at 2:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

5

You can for example check the Block Explorer's info about a given transaction. For example, given transaction 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.

  • OK... Thanks for answering. Where Can I found that here? Is it the "hash" of "prevout"? blockchain.info/api/blockchain_api – flaab Sep 29 '12 at 14:45
  • @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 Sep 29 '12 at 17:04

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