0
Various block explorers exist, which offer REST APIs. So far been using blockchain.info and btc.com
Here is what we have:
- List of bitcoin addresses
Here is what can easily be got with that info:
- Historic list of transactions (hashes, or IDs) for the given addresses
- I can also discover which input or output was OUR address, and therefore:
- value, and whether the transaction was being sent or received
Now, here's what we need to obtain:
- the OTHER (to/from) address!
So:
How can you use a transaction ID to obtain BOTH the sender's and receiver's wallet address - with some kind of REST API preferably?
(...knowing that sometimes transaction IDs are associated with multiple inputs and multiple outputs)
Endpoint references:
https://blockchain.info/q
https://btc.com/api-doc
On BTC: signature script field --- "script_hex" ,
– Bill – 2018-05-18T18:57:40.647pubkey script field --- addresses:
2THIS IS NOT THE SENDER'S ADDRESS! Suppose Alice deposits bitcoins into an exchange and then Bill asks the exchange to pay Charley, if the exchange uses the coins Alice deposited, the "sender's address" will be Alice's deposit address even though Bill is the sender. Sending to that address will credit Alice, not Bill. – David Schwartz – 2018-05-18T21:20:40.387
What do you mean "THIS"? – Bill – 2018-05-18T21:33:04.703
The address you get if you follow the procedure above. It is actually the receiving address of the transaction that funded the wallet that made the payment, which is not always the sender's address. See my example above. – David Schwartz – 2018-05-18T22:27:43.667
Thanks for insights so far: "You can get the sender's wallet address from the public key"
1@Maz Bitcoin does not have a concept of a "sender address". If you want to know who paid you, give a different address for each invoice/expected payment. If you want to be able to refund people, ask them for a refund address before they pay you. Do not guess the sender's address based on the transaction; the information is not there. – Pieter Wuille – 2018-09-04T22:11:36.047