Bitcoin Forum
December 11, 2016, 06:23:39 AM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Bitcoin Daemon - List Transactions  (Read 3166 times)
joeyjoe
Full Member
***
Offline Offline

Activity: 224


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).
1481437419
Hero Member
*
Offline Offline

Posts: 1481437419

View Profile Personal Message (Offline)

Ignore
1481437419
Reply with quote  #2

1481437419
Report to moderator
1481437419
Hero Member
*
Offline Offline

Posts: 1481437419

View Profile Personal Message (Offline)

Ignore
1481437419
Reply with quote  #2

1481437419
Report to moderator
1481437419
Hero Member
*
Offline Offline

Posts: 1481437419

View Profile Personal Message (Offline)

Ignore
1481437419
Reply with quote  #2

1481437419
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481437419
Hero Member
*
Offline Offline

Posts: 1481437419

View Profile Personal Message (Offline)

Ignore
1481437419
Reply with quote  #2

1481437419
Report to moderator
1481437419
Hero Member
*
Offline Offline

Posts: 1481437419

View Profile Personal Message (Offline)

Ignore
1481437419
Reply with quote  #2

1481437419
Report to moderator
arsenische
Legendary
*
Offline Offline

Activity: 1116


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
Full Member
***
Offline Offline

Activity: 224


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


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: 1116


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
Full Member
***
Offline Offline

Activity: 224


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: 1116


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
Full Member
***
Offline Offline

Activity: 224


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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!