Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: hamburger on August 05, 2012, 07:48:56 PM



Title: How to find address where bitcoin came from
Post by: hamburger on August 05, 2012, 07:48:56 PM
Hi,

How do I find the address and transaction id where the bitcoin came from that is send to my address - using php and bitcoind?

Tnx,

Hamburger


Title: Re: How to find address where bitcoin came from
Post by: gweedo on August 05, 2012, 08:08:10 PM
Use need to make JSON-RPC calls using these commands https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list


Title: Re: How to find address where bitcoin came from
Post by: Pieter Wuille on August 05, 2012, 08:10:44 PM
Bitcoin transactions do not have a well-defined 'from' address.

Every transactions consumes some coins, combines them, splits them again in new coins, and assigns a rule about who can spend those new coins. Those rules can (but do not necessarily) correspond to an address.

It is possible to look up the coins consumed by a transaction, and check which addresses those were assigned to, though.

There is no guarantee that there is just one, there is no guarantee that there is one at all, and there is also no guarantee that sending something to those addresses will end up at the sender of the original transaction.

If you need a refund address for a transaction, the best practice is to just ask for a refund address from the customer/peer/...


Title: Re: How to find address where bitcoin came from
Post by: hamburger on August 05, 2012, 08:51:25 PM
@gweedo

Tnx, but it is not there.

@Pieter Wuille

Tnx, I have notice this and also picked it up for blockchain.info on this while looking around for a solution. It seems that it should not be a problem as long as I do not reuse the the receiving address on my side.

I will in the mean time use a manual process until someone could assist me with this.


Title: Re: How to find address where bitcoin came from
Post by: gweedo on August 05, 2012, 09:42:33 PM
@gweedo

Tnx, but it is not there.

@Pieter Wuille

Tnx, I have notice this and also picked it up for blockchain.info on this while looking around for a solution. It seems that it should not be a problem as long as I do not reuse the the receiving address on my side.

I will in the mean time use a manual process until someone could assist me with this.

no but the standard practice is to have many different address so those become unique so you can easily track transactions that are made to your wallet.


Title: Re: How to find address where bitcoin came from
Post by: Sergio_Demian_Lerner on August 05, 2012, 11:31:49 PM
no but the standard practice is to have many different address so those become unique so you can easily track transactions that are made to your wallet.

With Destination Address Anonymization (https://bitcointalk.org/index.php?topic=98737.0) you don't need to. You can give each client an unique number k. This has the additional benefit that your address is always the same and the user can save it in his address book, as normal.


Title: Re: How to find address where bitcoin came from
Post by: hamburger on August 06, 2012, 04:13:27 AM
@gweedo
@Sergio_Demian_Lerner

Tnx for your input, providing a new address to a user and understanding the different address per transaction is not a problem - I just would like to send bitcoin back to the same address where it came from instead of asking the user for a generated address from their wallet.


Title: Re: How to find address where bitcoin came from
Post by: mem on August 06, 2012, 03:13:14 PM
@gweedo
@Sergio_Demian_Lerner

Tnx for your input, providing a new address to a user and understanding the different address per transaction is not a problem - I just would like to send bitcoin back to the same address where it came from instead of asking the user for a generated address from their wallet.


he wants a satoshidice style payout system I believe.
Im not sure how they do it (abe ?) but I do know you can look up the information using the blockchain.info json api


Title: Re: How to find address where bitcoin came from
Post by: hamburger on August 06, 2012, 07:57:52 PM
he wants a satoshidice style payout system I believe.
Im not sure how they do it (abe ?) but I do know you can look up the information using the blockchain.info json api

I have no idea what the satoshidice style payout system is. - (Checked the site http://www.satoshidice.com/, they also mention it "WARNING: Only use wallets that allow you to receive Bitcoin from the same address you sent from.")

I saw this idea on a site (could be bitlotto or raffle site) that said you must send the bitcoin from an address that you can receive from but not using a site like www.instawallet.org to send the bitcoin from. I like the way it is presented on blockchain.info but I do not want to rely on another party to provide me with the info.

I've changed my process to allow the user to manually enter their bitcoin address (allowing for mistakes) and the user will have to wait for 6 confirmations to complete the process.