Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: shark255 on April 02, 2015, 09:13:58 PM



Title: how to get address(-es) from which I get coins ?
Post by: shark255 on April 02, 2015, 09:13:58 PM
How can I get address(-es) from which I get coins ?

I didnt found it in official API.. Thanks in advance for help!


Title: Re: how to get address(-es) from which I get coins ?
Post by: DannyHamilton on April 02, 2015, 09:19:51 PM
How can I get address(-es) from which I get coins ?

I didnt found it in official API.. Thanks in advance for help!

You didn't find it because bitcoins don't come from addresses, they come from unspent outputs.

There are many websites and services that attempt to make an educated guess as to where the bitcoins might have come from, but the guess isn't reliable and using it can cause you many problems.

If you want to know what unspent output the bitcoins came from you can run getrawtransaction.

If you want to know what address they came from, then you are doing something wrong.  Most of the time when someone is trying to figure out what address bitcoins came from, they are doing it because they want to know where to send bitcoins back to.  This is an absolutely horrible reason to be looking for where they came from (since many times the sender won't be able to receive bitcoins at that address).  Instead you should ask your user to supply you with an address where they would like their bitcoins sent.

If there is some other reason that you want to know where they came from, please explain and perhaps we can help you find a better way to accomplish whatever you are trying to do.


Title: Re: how to get address(-es) from which I get coins ?
Post by: shark255 on April 03, 2015, 07:12:55 AM
Thanks for detailed explanation, all are clear now :)