I have an address in bitcoind and I would like to receive the first address that bitcoins were sent from in Bitcoin.net.
For example if I have an address 37muSN5ZrukVTvyVh3mT5Zc5ew9L9CBare with a balance of 9.5 coins, I would like to receive the address those coins were sent from. This is a problem since I will have multiple addresses each with a couple of coins and I want to get the addresses the coins were sent from for each address.
The Raw Transactions API will give you this info.
Filter the results of listunspent for the output address to learn the transaction ids. Then get each transaction and pull the first input for each.
use:
getrawtransaction
then for the output of that,
decoderawtransaction
-
http://en.bitcoin.it/wiki/Raw_Transactions[Edit: See the next few posts to tell you why there is no "from" addresses with Bitcoin. The right way to know what invoice a payment is for (or what customer sent the payment) is to give out a new address for each transaction.]
I list the transactions:
[
{
"account": "testacc",
"address": "18LaYLjk4ktP5PvHZ9X2afBW1uoJxhBZWN",
"category": "receive",
"amount": 5E-05,
"confirmations": 213,
"blockhash": "00000000000002ab8a627d4d88385a1c8b11b5bcc1de1ebee90a747e15ed87
d4",
"blockindex": 171,
"blocktime": 1352434315,
"txid": "0601b1b121e2b8c7db0ab57620c97f3a8cefefa626a1838718baa8154f9fea84",
"time": 1352434315,
"timereceived": 1352550740
},
{
"account": "testacc",
"address": "18LaYLjk4ktP5PvHZ9X2afBW1uoJxhBZWN",
"category": "receive",
"amount": 5E-05,
"confirmations": 180,
"blockhash": "000000000000002afc8044a5b98e2634b8058e90e4ee9e22ebd722566c24bf
28",
"blockindex": 268,
"blocktime": 1352457915,
"txid": "b57619177c9cb1031e9e867246751e810593ef1b9520e70de50f09ebb6503b7c",
"time": 1352457915,
"timereceived": 1352551000
}
]
Then I pull a transaction:
{
"amount": 5E-05,
"confirmations": 213,
"blockhash": "00000000000002ab8a627d4d88385a1c8b11b5bcc1de1ebee90a747e15ed87d4
",
"blockindex": 171,
"blocktime": 1352434315,
"txid": "0601b1b121e2b8c7db0ab57620c97f3a8cefefa626a1838718baa8154f9fea84",
"time": 1352434315,
"timereceived": 1352550740,
"details": [
{
"account": "testacc",
"address": "18LaYLjk4ktP5PvHZ9X2afBW1uoJxhBZWN",
"category": "receive",
"amount": 5E-05
}
]
}
Still no relevant information about where did it came from?