Pages:
Author

Topic: Get the address sent from - page 2. (Read 2393 times)

kjj
legendary
Activity: 1302
Merit: 1026
November 03, 2012, 06:43:50 PM
#7
Look at the transaction that you got.  The input part of that transaction will have a list of transaction outputs redeemed.  For each of them, look up the transaction and check the scriptpubkey part of that output.

But you really should figure out a way to do whatever you are doing that doesn't require that, because no matter how much you think you need it, the system totally doesn't work that way.  Transactions do not have From: addresses.
hero member
Activity: 740
Merit: 501
November 03, 2012, 06:01:57 PM
#6
If you want to distinguish separate incoming payments, the advised way is creating a separate receive address for each.

Bitcoin transactions do not really have 'from' addresses. All transactions do is consume coins, merge and split them, and produce new coins, potentially assigned to new address(es). It is indeed possible to retrieve where the input coins for your transaction were previously sent to, but in the general case this is not very useful information, as it only tells you which address previously controlled the coin, which is not necessarily the one who sent it. In the case of e-wallets with shared wallets, for example, it only tells you an address that belongs to the provider's wallet, and sending something to it will not necessary mean it ends up on the account of the one who sent it. If you want to do return payments, ask for a return address.

This is what I do at the moment, how can I check from which address was the payment sent to mine?

How is this possible then:http://blockchain.info/address/37muSN5ZrukVTvyVh3mT5Zc5ew9L9CBare    ?

I understand that the last address received from may not be the correct one and if you send there they might be lost but I still need it.
legendary
Activity: 1072
Merit: 1181
November 03, 2012, 05:48:15 PM
#5
If you want to distinguish separate incoming payments, the advised way is creating a separate receive address for each.

Bitcoin transactions do not really have 'from' addresses. All transactions do is consume coins, merge and split them, and produce new coins, potentially assigned to new address(es). It is indeed possible to retrieve where the input coins for your transaction were previously sent to, but in the general case this is not very useful information, as it only tells you which address previously controlled the coin, which is not necessarily the one who sent it. In the case of e-wallets with shared wallets, for example, it only tells you an address that belongs to the provider's wallet, and sending something to it will not necessary mean it ends up on the account of the one who sent it. If you want to do return payments, ask for a return address.

This is what I do at the moment, how can I check from which address was the payment sent to mine?
hero member
Activity: 740
Merit: 501
November 03, 2012, 05:41:29 PM
#4
If you want to distinguish separate incoming payments, the advised way is creating a separate receive address for each.

Bitcoin transactions do not really have 'from' addresses. All transactions do is consume coins, merge and split them, and produce new coins, potentially assigned to new address(es). It is indeed possible to retrieve where the input coins for your transaction were previously sent to, but in the general case this is not very useful information, as it only tells you which address previously controlled the coin, which is not necessarily the one who sent it. In the case of e-wallets with shared wallets, for example, it only tells you an address that belongs to the provider's wallet, and sending something to it will not necessary mean it ends up on the account of the one who sent it. If you want to do return payments, ask for a return address.

This is what I do at the moment, how can I check from which address was the payment sent to mine?
legendary
Activity: 1072
Merit: 1181
November 03, 2012, 05:01:54 PM
#3
If you want to distinguish separate incoming payments, the advised way is creating a separate receive address for each.

Bitcoin transactions do not really have 'from' addresses. All transactions do is consume coins, merge and split them, and produce new coins, potentially assigned to new address(es). It is indeed possible to retrieve where the input coins for your transaction were previously sent to, but in the general case this is not very useful information, as it only tells you which address previously controlled the coin, which is not necessarily the one who sent it. In the case of e-wallets with shared wallets, for example, it only tells you an address that belongs to the provider's wallet, and sending something to it will not necessary mean it ends up on the account of the one who sent it. If you want to do return payments, ask for a return address.
legendary
Activity: 2506
Merit: 1010
November 03, 2012, 04:00:26 PM
#2
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.]
hero member
Activity: 740
Merit: 501
November 03, 2012, 10:56:41 AM
#1
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.
Pages:
Jump to: