Bitcoin Forum
December 12, 2024, 04:54:33 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Retrieving Senders address  (Read 796 times)
skubeedooo (OP)
Newbie
*
Offline Offline

Activity: 22
Merit: 0


View Profile
August 30, 2011, 04: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


Revalin
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g


View Profile
September 02, 2011, 07: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

      War is God's way of teaching Americans geography.  --Ambrose Bierce
Bitcoin is the Devil's way of teaching geeks economics.  --Revalin 165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
skubeedooo (OP)
Newbie
*
Offline Offline

Activity: 22
Merit: 0


View Profile
September 02, 2011, 11: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).
bitlotto
Hero Member
*****
Offline Offline

Activity: 672
Merit: 500


BitLotto - best odds + best payouts + cheat-proof


View Profile WWW
September 02, 2011, 12:37:04 PM
 #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.

*Next Draw Feb 1*  BitLotto: monthly raffle (0.25 BTC per ticket) Completely transparent and impossible to manipulate who wins. TOR
TOR2WEB
Donations to: 1JQdiQsjhV2uJ4Y8HFtdqteJsZhv835a8J are appreciated.
Revalin
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g


View Profile
September 02, 2011, 02:39:54 PM
 #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.

      War is God's way of teaching Americans geography.  --Ambrose Bierce
Bitcoin is the Devil's way of teaching geeks economics.  --Revalin 165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
danystatic
Full Member
***
Offline Offline

Activity: 235
Merit: 100


View Profile
November 24, 2013, 06: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?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!