Bitcoin Forum
May 09, 2024, 03:15:26 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: [2 BTC Reward] How to find out, which address send me bitcoins via an API  (Read 15847 times)
Fredyy (OP)
Full Member
***
Offline Offline

Activity: 143
Merit: 100



View Profile
May 29, 2012, 01:19:05 PM
Last edit: May 30, 2012, 03:00:09 PM by Fredyy
 #1

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
1715224526
Hero Member
*
Offline Offline

Posts: 1715224526

View Profile Personal Message (Offline)

Ignore
1715224526
Reply with quote  #2

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

Activity: 112
Merit: 10


Don't get eaten by wolves!


View Profile WWW
May 29, 2012, 01:21:26 PM
 #2

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.

Shocking, obligatory charity code:
1Gimmiec4KSrcKR3t6xoReJd4rNGt8zM58

Free BTC every hour:
http://mycryptcoin.com/?rid=1CccBJE7BCTJEvRN9Uxfgwbr11fSaUvjFe

And why not free Bitcoins?
https://bitcointalk.org/index.php?topic=83057

Great (read: best) old computer games for BTC:
https://bitcointalk.org/index.php?topic=85347.0
Fredyy (OP)
Full Member
***
Offline Offline

Activity: 143
Merit: 100



View Profile
May 29, 2012, 01:26:40 PM
 #3

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.
Kansattica
Member
**
Offline Offline

Activity: 112
Merit: 10


Don't get eaten by wolves!


View Profile WWW
May 29, 2012, 01:29:34 PM
 #4

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

Shocking, obligatory charity code:
1Gimmiec4KSrcKR3t6xoReJd4rNGt8zM58

Free BTC every hour:
http://mycryptcoin.com/?rid=1CccBJE7BCTJEvRN9Uxfgwbr11fSaUvjFe

And why not free Bitcoins?
https://bitcointalk.org/index.php?topic=83057

Great (read: best) old computer games for BTC:
https://bitcointalk.org/index.php?topic=85347.0
Fredyy (OP)
Full Member
***
Offline Offline

Activity: 143
Merit: 100



View Profile
May 29, 2012, 02:59:16 PM
 #5

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
Fredyy (OP)
Full Member
***
Offline Offline

Activity: 143
Merit: 100



View Profile
May 29, 2012, 03:12:26 PM
Last edit: May 29, 2012, 03:24:29 PM by Fredyy
 #6

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

Activity: 882
Merit: 1005



View Profile
May 29, 2012, 04:03:10 PM
 #7


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.

Fredyy (OP)
Full Member
***
Offline Offline

Activity: 143
Merit: 100



View Profile
May 29, 2012, 05:16:39 PM
 #8

Thank you for your Help anyway.

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

Greetings,
Fredyy
Fredyy (OP)
Full Member
***
Offline Offline

Activity: 143
Merit: 100



View Profile
May 29, 2012, 07:21:04 PM
 #9

*push*
paraipan
In memoriam
Legendary
*
Offline Offline

Activity: 924
Merit: 1004


Firstbits: 1pirata


View Profile WWW
May 29, 2012, 07:27:21 PM
 #10

*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.

BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
Fredyy (OP)
Full Member
***
Offline Offline

Activity: 143
Merit: 100



View Profile
May 29, 2012, 07:47:58 PM
 #11

*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.
paraipan
In memoriam
Legendary
*
Offline Offline

Activity: 924
Merit: 1004


Firstbits: 1pirata


View Profile WWW
May 29, 2012, 08:08:58 PM
 #12

*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  Undecided

BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
Fredyy (OP)
Full Member
***
Offline Offline

Activity: 143
Merit: 100



View Profile
May 29, 2012, 09:12:01 PM
 #13

*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  Undecided


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.
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1010


View Profile
May 30, 2012, 06:09:17 AM
 #14

Might Armory help you do what you are trying to do?

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

Unichange.me

            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █


Fredyy (OP)
Full Member
***
Offline Offline

Activity: 143
Merit: 100



View Profile
May 30, 2012, 01:18:47 PM
 #15

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.
Fredyy (OP)
Full Member
***
Offline Offline

Activity: 143
Merit: 100



View Profile
May 30, 2012, 03:01:19 PM
 #16

I've justed added a 2 BTC reward for the person who, gives me the tip to solve my problem.
bitcoinraffle.co
Member
**
Offline Offline

Activity: 80
Merit: 10


BitcoinRaffle.co


View Profile WWW
May 30, 2012, 03:39:58 PM
 #17

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

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.

50/50 Bitcoin Raffle!: 20 BTC Prize (50% to winner, 50% to winner's favorite charity), 0.01 BTC Tickets!
Fredyy (OP)
Full Member
***
Offline Offline

Activity: 143
Merit: 100



View Profile
May 30, 2012, 05:14:44 PM
 #18

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

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!
bitcoinraffle.co
Member
**
Offline Offline

Activity: 80
Merit: 10


BitcoinRaffle.co


View Profile WWW
May 30, 2012, 06:57:46 PM
 #19

I sent you a PM.

50/50 Bitcoin Raffle!: 20 BTC Prize (50% to winner, 50% to winner's favorite charity), 0.01 BTC Tickets!
Xenland
Legendary
*
Offline Offline

Activity: 980
Merit: 1003


I'm not just any shaman, I'm a Sha256man


View Profile
May 30, 2012, 07:22:21 PM
 #20

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?
Pages: [1] 2 »  All
  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!