Bitcoin Forum
May 11, 2024, 12:16:26 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin Daemon - List Transactions  (Read 3544 times)
joeyjoe (OP)
Full Member
***
Offline Offline

Activity: 224
Merit: 100


View Profile
August 24, 2011, 08:42:28 AM
 #1

Hi,

When i use List Transactions, it only returns the address the coins were sent to, how do i list the sending addresses of the transactions?

I need it for my PHP game.

thanks

Bitcoin PHP programmer for hire! (HTML / CSS / JQuery / AJAX / .NET).
1715429786
Hero Member
*
Offline Offline

Posts: 1715429786

View Profile Personal Message (Offline)

Ignore
1715429786
Reply with quote  #2

1715429786
Report to moderator
Make sure you back up your wallet regularly! Unlike a bank account, nobody can help you if you lose access to your BTC.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
arsenische
Legendary
*
Offline Offline

Activity: 1199
Merit: 1012


View Profile
August 24, 2011, 09:30:50 AM
 #2

When i use List Transactions, it only returns the address the coins were sent to

I think this is done intentionally to prevent bad practices (in some cases the sender's address might not correspond to the sender, and the sender might want to receive bitcoins to a new unique address). Moreover in one transaction there can be several sender's addresses.

But if you really need it, I think it is possible to get it from blockexplorer.com or to use the getblock patch by jgarzik yourself. You can find the transaction in the block and get its inputs. Inputs reference the outputs of previous transactions (which contain the desired sender's addresses).

joeyjoe (OP)
Full Member
***
Offline Offline

Activity: 224
Merit: 100


View Profile
August 24, 2011, 12:30:33 PM
 #3

Well the senders address gets listed on many sites like bitcoinduit, bitlotto.com and on the bitcoin app itself. I simply just need to list the transactions and their return addresses for a lotto game Smiley

Bitcoin PHP programmer for hire! (HTML / CSS / JQuery / AJAX / .NET).
vv01f
Sr. Member
****
Offline Offline

Activity: 314
Merit: 250


View Profile
August 24, 2011, 12:39:19 PM
 #4

Like arsenische already mentioned. There can be both multiple receivers and senders, like in http://blockexplorer.com/tx/75c906e12f52e1eff5d0f59fbff5dd97a6448b3b04d6b018a09274aa01b9e2c1

So you can rely on blockexplorer and fetch senders (or just the first) from the transaction you received. Or reuse some reviewable code to inspect the blocks yourself: https://bitcointalk.org/index.php?topic=22785.0;all

donations to me please send via bitcoin 1vvo1FDwSAwNdLVA1mFkM7v76XPZAAUfb
a good European exchange: bitcoin.de (ref-link)
arsenische
Legendary
*
Offline Offline

Activity: 1199
Merit: 1012


View Profile
August 24, 2011, 12:43:26 PM
 #5

Well the senders address gets listed on many sites like bitcoinduit, bitlotto.com and on the bitcoin app itself. I simply just need to list the transactions and their return addresses for a lotto game Smiley

Oh, now I see why they write something like "DO NOT SEND COINS FROM AN EWALLET.(Online service) Only send the 0.25 BTC from Bitcoin software running on your computer. If you send the BTC from an EWALLET, you will not get the winnings." Smiley

I am not sure, but I don't think they do it via standard bitcoin API. Probably they use jgarzik's patch I mentioned before or rely on blockexplorer.com as vv01f already mentioned Smiley Update: oh, didn't notice the link to Abe..

joeyjoe (OP)
Full Member
***
Offline Offline

Activity: 224
Merit: 100


View Profile
August 24, 2011, 12:51:44 PM
 #6

It seems like they must be getting the senders address another way. Realised bitcoinduit just asks for your payout address and asigns you a deposit address... but thats effort!


Also when displaying the transactions, is it best to display them from a mysql database, or directly from the api?. Maybe its best to run a script every 10 seconds that checks for new deposits and updates a database...

Bitcoin PHP programmer for hire! (HTML / CSS / JQuery / AJAX / .NET).
arsenische
Legendary
*
Offline Offline

Activity: 1199
Merit: 1012


View Profile
August 24, 2011, 01:10:16 PM
 #7

Also when displaying the transactions, is it best to display them from a mysql database, or directly from the api?. Maybe its best to run a script every 10 seconds that checks for new deposits and updates a database...

To my mind if you are using mysql database anyway, it is better to run the script which will update the database with new transactions. In this case your site won't depend on bitcoind (only the script will depend on it).

joeyjoe (OP)
Full Member
***
Offline Offline

Activity: 224
Merit: 100


View Profile
August 24, 2011, 09:36:22 PM
 #8

yeah thats the best way i think. Now need to re-write the script to make a desposit address for each person with them choosing the payout address.... just gotta think of the best way to this. Have 1 account on the daemon for each round, and multiple addresses for each deposit, then match it to the payout address via mysql db?


Bitcoin PHP programmer for hire! (HTML / CSS / JQuery / AJAX / .NET).
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!