0

I'm using the blockchain.info/api/api_receive

I have everything working fine but when I made a payment I can't find (in the callback) the bitcoin address of the payer, only the address of the payee...

callback example:

{  
   "input_transaction_hash":"0a11043d6e067bad827d4c82da2c45e99323f3a0b28f843fae156bcbd7e8a1d2",
   "shared":"false",
   "address":"1MVSoHC5M875Pbz5FfzckA35A6LpbmNcpo",
   "destination_address":"1MVSoHC5M875Pbz5FfzckA35A6LpbmNcpo",
   "input_address":"1NjbP7RFN6sQbEp6wVc21ZpKRhoR4PaLbR",
   "invoice_id":"40",
   "anonymous":"false",
   "secret":"eijfei4333",
   "confirmations":"4",
   "value":"1407217",
   "transaction_hash":"0d28f482f56c784c3f09be9e49ea45de76a49ae91efbeab43a7bfec417c37005"
}

How can I find out the payers address? Thanks

  • You can't, unfortunately. You have to ask them to give you a separate refund-address. – morsecoder May 11 '15 at 14:32
2

You can use blockchain.info's API to look this up, specifically you're looking for the inputs of the "input_transaction_hash" tx:

https://blockchain.info/rawtx/0a11043d6e067bad827d4c82da2c45e99323f3a0b28f843fae156bcbd7e8a1d2

Result:

{
   "ver":1,
   "inputs":[
      {
         "sequence":4294967295,
         "prev_out":{
            "spent":true,
            "tx_index":86277579,
            "type":0,
            "addr":"1JfkMijQTFsRbfDhqTU8Sacx2JVGiSs8af",
            "value":20470771,
            "n":1,
            "script":"76a914c1ce233e2d34facb69aa2b1233db07929586691388ac"
         },
         "script":"49304602210091a3b8759a99abcf4eaa1d3205f5d89e5243faa9ea166c3a9d2f34889dd5f86c02210080738b0beb1cbede15061d2ba5e37033bcc16848b06807e6c3ab2837ef281a99012102665ea1fd74fdb940be0245633ee276bb2abc4a650a16eb77601ed0c3ffd37293"
      }
   ],
   ...

Please be aware that actually using the "from" addresses (there are often multiple) for any purpose is dangerous and strongly discouraged, please see Can a bitcoin transaction be reversed from the receiving end? for more details.

If you have a need to collect a return address for some purpose, you should consider using BIPs-70/71/72 instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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