Bitcoin Forum

Other => Beginners & Help => Topic started by: Fredyy on May 29, 2012, 01:19:05 PM



Title: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: Fredyy on May 29, 2012, 01:19:05 PM
Hi,

I'm looking for a solution to find out, who send me bitcoins.

Websites like http://www.satoshidice.com/ use exactly this, they get a transaction and find out where it came from.

Is this done via the bitcoind api or via blockexplorer? How can i do this?

Greetings,
Fredyy


Title: Re: How to find out, who send me bitcoins.
Post by: Kansattica on May 29, 2012, 01:21:26 PM
You can always see the bitcoin address that the payment originated from, and this is what Satoshidice uses. If you're looking to track who sent you a payment, then I would suggest that you create a new address for each payment you want to recieve.


Title: Re: How to find out, who send me bitcoins.
Post by: Fredyy on May 29, 2012, 01:26:40 PM
The address where the bitcoins came from would be exactly what i need but i cant find out how to do this. Maybe i just didn't find the right api call until now.


Title: Re: How to find out, who send me bitcoins.
Post by: Kansattica on May 29, 2012, 01:29:34 PM
Try looking up the receiving address at http://blockexplorer.com/ or blockchain.info or looking under 'transactions' in the Bitcoin client. This should be able to tell you


Title: Re: How to find out, who send me bitcoins.
Post by: Fredyy on May 29, 2012, 02:59:16 PM
Hi,

i created a test address to see, whats happening with 1 transaction:

In bitcoin-qt the "From Field" of this Transaction is "Unknown".
On Blockchain in looks okay http://blockchain.info/address/13s7qNB3EaKhRtAqAPrQbhgiE6K3hBpPyA but the json output is a mess and shows me a lot of addresses i don't know and the value is totally wrong : http://blockchain.info/address/13s7qNB3EaKhRtAqAPrQbhgiE6K3hBpPyA?format=json

On Blockexplorer i could also find out, which address sent the bitcoins, but the website is horrible slow at the moment and i think i need a pretty responsive system so blockexplorer could not help me to continue http://blockexplorer.com/address/13s7qNB3EaKhRtAqAPrQbhgiE6K3hBpPyA


Title: Re: How to find out, who send me bitcoins.
Post by: Fredyy on May 29, 2012, 03:12:26 PM
Hi,

i created a test address to see, whats happening with 1 transaction:

In bitcoin-qt the "From Field" of this Transaction is "Unknown".
On Blockchain in looks okay http://blockchain.info/address/13s7qNB3EaKhRtAqAPrQbhgiE6K3hBpPyA but the json output is a mess and shows me a lot of addresses i don't know and the value is totally wrong : http://blockchain.info/address/13s7qNB3EaKhRtAqAPrQbhgiE6K3hBpPyA?format=json

On Blockexplorer i could also find out, which address sent the bitcoins, but the website is horrible slow at the moment and i think i need a pretty responsive system so blockexplorer could not help me to continue http://blockexplorer.com/address/13s7qNB3EaKhRtAqAPrQbhgiE6K3hBpPyA

Quote
"inputs":[
         {
            
            "prev_out":{
               "type":0,
               "addr":"1PTmgodUdrxHsdYgnAPUydMRrLRV4iPupU",  
               "value":80760000,
               "tx_index":7154573,
               "n":2
            }
         }

You want the addr part, which is the input(s).

Thats right, but the value is wrong, it should be 0.001 but not 80760000


Basically im want to create a backend similar to satoshidice, i need to get new transactions on a specific address and value and sender of this transactions.
Everything but receiving the senders address could be easily be done via the bitcoin jsonrpc api.


Title: Re: How to find out, who send me bitcoins.
Post by: Blazr on May 29, 2012, 04:03:10 PM

Thats right, but the value is wrong, it should be 0.001 but not 80760000


Basically im want to create a backend similar to satoshidice, i need to get new transactions on a specific address and value and sender of this transactions.
Everything but receiving the senders address could be easily be done via the bitcoin jsonrpc api.

The 80760000 is the total number of Satoshi's taken out of that address in the transaction. If you look on blockchain, you'll see there are many other recipients in that same transaction.

There is a way of doing it with the Bitcoind RPC, but I'm not familiar enough with it to give advice. Hopefully somebody else can be of more help.


Title: Re: How to find out, who send me bitcoins.
Post by: Fredyy on May 29, 2012, 05:16:39 PM
Thank you for your Help anyway.

So I'm hoping rightnow, that somebody of you can help me to solve my problem.

Greetings,
Fredyy


Title: Re: How to find out, which address send me bitcoins via an API
Post by: Fredyy on May 29, 2012, 07:21:04 PM
*push*


Title: Re: How to find out, which address send me bitcoins via an API
Post by: paraipan on May 29, 2012, 07:27:21 PM
*push*

why the bump ? the answer to you question would be they return the coins to sender, nothing more. Look at the warning on http://www.satoshidice.com .

Quote
WARNING: Only use wallets that allow you to receive Bitcoin from the same address you sent from. If you're not sure, test with .001 Bitcoins. If you get nothing back, then your wallet is not compatible.

It's not recommended in case a person uses web-wallets, and not a desktop client, because they don't associate addresses to any user but internal bitcoin accounts. In exchange the desktop wallet has control over all the input addresses so in theory is safe to send the coins to where they came from. Use the inputs of the transaction, when the coins came to your site, as destination but make sure you put a warning somewhere or else someone may lose some coins.


Title: Re: How to find out, which address send me bitcoins via an API
Post by: Fredyy on May 29, 2012, 07:47:58 PM
*push*

why the bump ? the answer to you question would be they return the coins to sender, nothing more. Look at the warning on http://www.satoshidice.com .

Because i were afraid, that this thread is going to lose attention in this big forum. Yes, they return them to sender, but i see no reliable way to get the sender address via the bitcoind rpc api.


Quote
WARNING: Only use wallets that allow you to receive Bitcoin from the same address you sent from. If you're not sure, test with .001 Bitcoins. If you get nothing back, then your wallet is not compatible.

It's not recommended in case a person uses web-wallets, and not a desktop client, because they don't associate addresses to any user but internal bitcoin accounts. In exchange the desktop wallet has control over all the input addresses so in theory is safe to send the coins to where they came from. Use the inputs of the transaction, when the coins came to your site, as destination but make sure you put a warning somewhere or else someone may lose some coins.

I see the problem, but as this is atm no public project, this should not be a problem.


Title: Re: How to find out, which address send me bitcoins via an API
Post by: paraipan on May 29, 2012, 08:08:58 PM
*push*

why the bump ? the answer to you question would be they return the coins to sender, nothing more. Look at the warning on http://www.satoshidice.com .

Because i were afraid, that this thread is going to lose attention in this big forum. Yes, they return them to sender, but i see no reliable way to get the sender address via the bitcoind rpc api.


You're right there, i don't see it either. Tried getting the tx by hash, no inputs there. Then getting the block by hash and list all the tx's, no luck. Probably someone that has more extensive knowledge could bump in and shed some light on this because i'm clueless  :-\


Title: Re: How to find out, which address send me bitcoins via an API
Post by: Fredyy on May 29, 2012, 09:12:01 PM
*push*

why the bump ? the answer to you question would be they return the coins to sender, nothing more. Look at the warning on http://www.satoshidice.com .

Because i were afraid, that this thread is going to lose attention in this big forum. Yes, they return them to sender, but i see no reliable way to get the sender address via the bitcoind rpc api.


You're right there, i don't see it either. Tried getting the tx by hash, no inputs there. Then getting the block by hash and list all the tx's, no luck. Probably someone that has more extensive knowledge could bump in and shed some light on this because i'm clueless  :-\


Even a try to complete use BlockChain seems to fail, because I can't find a way to get the bitcoin value of a transaction via their json api. But i would be a lot happier if there is a way, on which i have not to rely on an external provider.


Title: Re: How to find out, which address send me bitcoins via an API
Post by: Stephen Gornick on May 30, 2012, 06:09:17 AM
Might Armory help you do what you are trying to do?

 - http://bitcointalk.org/index.php?topic=77650.msg864720#msg86472


Title: Re: How to find out, which address send me bitcoins via an API
Post by: Fredyy on May 30, 2012, 01:18:47 PM
Might Armory help you do what you are trying to do?

 - http://bitcointalk.org/index.php?topic=77650.msg864720#msg86472

Maybe this could help as a last alternative, but I've never worked before with python and would be happy if there were a php alternative to this.


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: Fredyy on May 30, 2012, 03:01:19 PM
I've justed added a 2 BTC reward for the person who, gives me the tip to solve my problem.


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: bitcoinraffle.co on May 30, 2012, 03:39:58 PM
Have a look at this transaction for someone who purchased 2 raffle tickets yesterday (0.02 BTC):

http://blockchain.info/tx-index/a1679b53884c61db994edc58ac1a9440952b88007efbd3dc692fcf327a5fad25?format=json (http://blockchain.info/tx-index/a1679b53884c61db994edc58ac1a9440952b88007efbd3dc692fcf327a5fad25?format=json)

The prev_out: addr: is the field you want.  In this case "17vBxXJUHVnCdDUvdG4ULUbEzipBRiPMyd" is the address that purchased the tickets. "1AfBK6SeZEeMehmZH831SbdAyrsWfRZUD9" is the raffle address.

You mentioned the value in Satoshi is wrong.  It is and almost always will be.  Each transaction has two parts: an amount sent to you, and an amount sent back to the sender in the same transaction.  In this case, the total is 100000000 Satoshi: 2000000 to me, and 98000000 back to the sender.

Notice the same address "17vBxXJUHVnCdDUvdG4ULUbEzipBRiPMyd" received the 98000000 Satoshi.

If you're still confused or need some PHP code that does this for you, just let me know.


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: Fredyy on May 30, 2012, 05:14:44 PM
Have a look at this transaction for someone who purchased 2 raffle tickets yesterday (0.02 BTC):

http://blockchain.info/tx-index/a1679b53884c61db994edc58ac1a9440952b88007efbd3dc692fcf327a5fad25?format=json (http://blockchain.info/tx-index/a1679b53884c61db994edc58ac1a9440952b88007efbd3dc692fcf327a5fad25?format=json)

The prev_out: addr: is the field you want.  In this case "17vBxXJUHVnCdDUvdG4ULUbEzipBRiPMyd" is the address that purchased the tickets. "1AfBK6SeZEeMehmZH831SbdAyrsWfRZUD9" is the raffle address.

You mentioned the value in Satoshi is wrong.  It is and almost always will be.  Each transaction has two parts: an amount sent to you, and an amount sent back to the sender in the same transaction.  In this case, the total is 100000000 Satoshi: 2000000 to me, and 98000000 back to the sender.

Notice the same address "17vBxXJUHVnCdDUvdG4ULUbEzipBRiPMyd" received the 98000000 Satoshi.

If you're still confused or need some PHP code that does this for you, just let me know.

Would be great if you create a little sample for me, thank you for your help!


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: bitcoinraffle.co on May 30, 2012, 06:57:46 PM
I sent you a PM.


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: Xenland on May 30, 2012, 07:22:21 PM
If you have the money and knowledge to run a 1.5gb server you can run Bitcoin-abe and then query SQL commands against it as if you are querying the Bitcoin blockchain so you can potentially get any transaction information you require.. Is that what your looking for?


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: bitcoinraffle.co on May 31, 2012, 09:03:48 PM
I'm pretty sure he wanted exactly what I showed him on a sample page on my site, but I haven't heard back from him even though he logged in today. 


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: Xenland on June 01, 2012, 04:24:39 AM
I'm pretty sure he wanted exactly what I showed him on a sample page on my site, but I haven't heard back from him even though he logged in today. 
I actually figured that :) but just in case the OP needed something different or someone else was looking for alt solutions searching around the forums i posted it any ways. Cheers mates!


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: Fredyy on June 01, 2012, 02:21:11 PM
Sorry, that i've not answered earlier.

But i found out, that that blockchain.info API is limited to 800 Requests in 8 Hours. That's properly enough for the beginning of my project but could become a problem in the future, so i would not like to relay on it.

So i'm still looking for another solution.

Bitcoin-abe looks nice to, but right now i'm limited to a webserver, so i could not run this on my server.


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: bitcoinraffle.co on June 01, 2012, 02:29:42 PM
Sorry, that i've not answered earlier.

But i found out, that that blockchain.info API is limited to 800 Requests in 8 Hours. That's properly enough for the beginning of my project but could become a problem in the future, so i would not like to relay on it.

So i'm still looking for another solution.

Bitcoin-abe looks nice to, but right now i'm limited to a webserver, so i could not run this on my server.

Do you have physical access to your server?  Or can you at least have software installed?


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: Fredyy on June 01, 2012, 02:42:19 PM
Sorry, that i've not answered earlier.

But i found out, that that blockchain.info API is limited to 800 Requests in 8 Hours. That's properly enough for the beginning of my project but could become a problem in the future, so i would not like to relay on it.

So i'm still looking for another solution.

Bitcoin-abe looks nice to, but right now i'm limited to a webserver, so i could not run this on my server.

Do you have physical access to your server?  Or can you at least have software installed?

I've only access to the webserver via ftp.
But maybe i could get some software installed via the sys-admin. But i would be very happy if i could stuck to bitcoind rpc api and some other 100% relayable webservice.


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: bitcoinraffle.co on June 01, 2012, 05:53:28 PM
Well, if you can install/run bitcoind on your own server, you can do the JSON queries there with no limit and (probably) faster performance.

PM me with more detail about what you're actually trying to do and why (transaction wise, I don't need to know your business idea).  I may have another solution to your problem.


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: Xenland on June 01, 2012, 09:33:20 PM
Replying to this quote:
Well, if you can install/run bitcoind on your own server, you can do the JSON queries there with no limit and (probably) faster performance.

PM me with more detail about what you're actually trying to do and why (transaction wise, I don't need to know your business idea).  I may have another solution to your problem.


....but right now i'm limited to a webserver, so i could not run this on my server.

I've only access to the webserver via ftp.

Looks like he doesn't have the requirements(which is full root Shell access, or a connection with the owner of the webhosting service... :P)


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: Fredyy on June 04, 2012, 02:42:31 PM
Replying to this quote:
Well, if you can install/run bitcoind on your own server, you can do the JSON queries there with no limit and (probably) faster performance.

PM me with more detail about what you're actually trying to do and why (transaction wise, I don't need to know your business idea).  I may have another solution to your problem.


....but right now i'm limited to a webserver, so i could not run this on my server.

I've only access to the webserver via ftp.

Looks like he doesn't have the requirements(which is full root Shell access, or a connection with the owner of the webhosting service... :P)

I just change to a VPS where i've got root acces, so right now i'm able to try different ways like bitcoin-abe.
Does anybody use it? Could i do what i want with the help of bitcoin-abe?

Greetings,
Fredyy


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: Xenland on June 04, 2012, 04:34:57 PM
Replying to this quote:
Well, if you can install/run bitcoind on your own server, you can do the JSON queries there with no limit and (probably) faster performance.

PM me with more detail about what you're actually trying to do and why (transaction wise, I don't need to know your business idea).  I may have another solution to your problem.


....but right now i'm limited to a webserver, so i could not run this on my server.

I've only access to the webserver via ftp.

Looks like he doesn't have the requirements(which is full root Shell access, or a connection with the owner of the webhosting service... :P)

I just change to a VPS where i've got root acces, so right now i'm able to try different ways like bitcoin-abe.
Does anybody use it? Could i do what i want with the help of bitcoin-abe?

Greetings,
Fredyy

Bitcoin-abe's database is basically a mirror image of the Block chain in a SQL database form. The only issues with it is that it takes up just about 9gb of harddrive space and requires about 1.2gb of ram :/


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: Fredyy on June 04, 2012, 05:33:22 PM

Bitcoin-abe's database is basically a mirror image of the Block chain in a SQL database form. The only issues with it is that it takes up just about 9gb of harddrive space and requires about 1.2gb of ram :/

Harddrive is no problem but 1,2 GB of RAM and the blockchain is getting bigger everyday sound not like a good solution on a VPS with 2 GB of RAM in total.


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: Fredyy on June 04, 2012, 06:14:59 PM
Rightnow i think the most important feature i'm looking for is a notification when a new payment occurs.
Blockchain.info uses this for the wallets hosted on their servers.

Is there a way to get bitcoind to send notifications or start a command when there is a new transaction, on my linux box?


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: Stephen Gornick on June 05, 2012, 01:00:05 AM
Rightnow i think the most important feature i'm looking for is a notification when a new payment occurs.
Blockchain.info uses this for the wallets hosted on their servers.

Is there a way to get bitcoind to send notifications or start a command when there is a new transaction, on my linux box?

Once one is in the memory pool? (i.e. on 0/unconfirmed?)

Or are you asking about after it confirms?  If so:
 - http://bitcoin.stackexchange.com/a/1356/153

I believe this will do 0/unconfirmed:
 - http://www.bitcoinmonitor.net
 - http://www.bitcoinmonitor.net/apidoc  (see req_confirmations - Required confirmations)

Or perhaps:
 - https://bitping.net


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: fuxianhui888 on June 05, 2012, 06:00:18 PM
blockchain.info


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: Fredyy on June 05, 2012, 06:01:41 PM
Rightnow i think the most important feature i'm looking for is a notification when a new payment occurs.
Blockchain.info uses this for the wallets hosted on their servers.

Is there a way to get bitcoind to send notifications or start a command when there is a new transaction, on my linux box?

Once one is in the memory pool? (i.e. on 0/unconfirmed?)

Or are you asking about after it confirms?  If so:
 - http://bitcoin.stackexchange.com/a/1356/153

I believe this will do 0/unconfirmed:
 - http://www.bitcoinmonitor.net
 - http://www.bitcoinmonitor.net/apidoc  (see req_confirmations - Required confirmations)

Or perhaps:
 - https://bitping.net
blockchain.info

thank you for your suggestions but i would like to do this without external providers. i would like to get som software running on my linux box to take care of this.


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: sixes1p4 on June 05, 2012, 09:56:27 PM
whats you're steam id Freddy? I Need to talk to you.


Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: bitcoinraffle.co on June 11, 2012, 03:15:40 PM
Freddy,

Did you get a working solution for your problem yet?



Title: Re: [2 BTC Reward] How to find out, which address send me bitcoins via an API
Post by: Spitteler on August 21, 2012, 04:14:37 PM
bitcoinraffle.co i am unable to send private messages for some reason, but i would be greatly appreciative of your php example to get the sender address of a transaction.  If you could please email it to cold.spitteler @ gmail.com