Author

Topic: Retrieving Senders address (Read 795 times)

full member
Activity: 235
Merit: 100
November 24, 2013, 02:37:31 PM
#6
I do have a similar system going on... {other msg: maybe we could talk about this? }

I am asking the user to POST their desired receivers address because I am not able to extract the address from the payment.

Here's what I have:
I am receiving BTC from couple of friends now !! Smiley looking to do a  btc-startup

please some advice or help...

Note: using jsonRPCClient and PHP (the basic process could be similar to others lang..  I believe)

The website asks them to POST their address before sending, because I am not able to extract automatically the Senders Address.

1.  Create a new address for each sender, using ->getnewaddress('payments');

2.  Then I listen for payment with -->getreceivedbyaddress()
     This way I do not obtain any information about the Tx

3. Find the txid  ?? how?

4. While a better method is found, using ->listtransactions() to read a received tx

5. I can see the senders address is inside this array, How can I be sure I extract the "correct" senders address without comparing it with the one POSTed via the website?
hero member
Activity: 728
Merit: 500
165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
September 02, 2011, 10:39:54 AM
#5
I see.  I don't think that can be done with the API.

You could use the API to find the transaction ID and confirms, and then query blockexplorer for the transaction ID.  You'd have to parse the HTML since I don't think their API does what you need either.

Note that a transaction can (and frequently will) have multiple "from" addresses.  Also, if they're using a wallet service, the coins might come from the service's common pool - so if you send it back, the service wouldn't know which user to credit.
hero member
Activity: 672
Merit: 500
BitLotto - best odds + best payouts + cheat-proof
September 02, 2011, 08:37:04 AM
#4
Thanks for the reply, but no, I'm actually trying to get the address that sent the money.  Later I will be sending money back to that address, kind of like bit lotto does (although I hadn't heard of bitlotto when I made this post).
To work you HAVE TO BE SURE that certain conditions are met: they only send the BTC running software on their computer and that they are still using the same wallet and haven't deleted it or moved on to a new one.
newbie
Activity: 22
Merit: 0
September 02, 2011, 07:34:04 AM
#3
Thanks for the reply, but no, I'm actually trying to get the address that sent the money.  Later I will be sending money back to that address, kind of like bit lotto does (although I hadn't heard of bitlotto when I made this post).
hero member
Activity: 728
Merit: 500
165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
September 02, 2011, 03:31:17 AM
#2
I assume you're trying to automatically decide if a sale can be marked as paid.  Try doing it like so:

Customer makes a purchase.  You generate a sales order number, 00001.
API: getaccountaddress sale-00001  >> returns: address
You invoice the customer and provide that address.
Customer pays.
API: getreceivedbyaccount sale-00001 6  >> returns: 0 (since we don't have 6 confirms yet)
Wait a while.
API: getreceivedbyaccount sale-00001 6  >> returns: 20 (You're paid!)
Ship the goods.

You can also check:
listreceivedbyaccount  >> returns: array of account records, select the one you want
getreceivedbyaddress  6 >> returns: total received to that address with at least 6 confirms
newbie
Activity: 22
Merit: 0
August 30, 2011, 12:28:16 PM
#1
Is it possible to retrieve the senders address from bitcoind?

I can see it in blockexplorer.com but don't see it in the bitcoind api.  Also, while blockexplorer gives the senders address, it doesn't say how many confirmations there have been, and doesn't appear to be part of the documented api for blockexplorer.  Is there a tool I can use where I specify the receivers address and it will tell me all the incomming transactions along with number of confirmations in a machine-readable format?

Thanks


Jump to: