1
1
I have a bitcoin address. How do I get it's balance and the amount of BTC (preferably in Satoshi) it's ever sent and received? I don't want to use any third-party bitcoin services, I want to do it as directly as possible. How can I do that?
1
1
I have a bitcoin address. How do I get it's balance and the amount of BTC (preferably in Satoshi) it's ever sent and received? I don't want to use any third-party bitcoin services, I want to do it as directly as possible. How can I do that?
2
If you dont want to use ANY 3rd party service, you will need to parse the entire blobkchain and put it inside a database so you can query whatever information you want.
To do that you have two options:
Another piece of advice: before you start downloading the blockchain, you need to set this in your bitcoin.conf
# look up historical transactions
txindex=1
Which allows you to get detailed information about "old" transactions, but this will make grow the blockchain size in your disk significantly
If I put the entire blobkchain into a db, it'll become outdated in a few minutes, won't it? I'll have to constantly update the db. – アレックス – 2014-09-12T17:01:59.800
Thats why i suggest you using rpcapi: you need to be running a bitcoind somewhere and have a process querying the rcpapi each 10 mins (whatever time you want) and keep your db up-to-date – reiven – 2014-09-12T17:04:40.863
Sorry, my question was "If I put the entire blobkchain into a db, it'll become outdated in a few minutes, won't it?" – アレックス – 2014-09-12T17:29:44.673
The answer is yes, but partially. If you keep a proceses checking for new blocks and their respective transactions and putting it into the db, you are ok. Keep in mind that the 6 confirmation needed gives you some time to parse 6 blocks – reiven – 2014-09-12T17:36:09.613
1
The standard way to to this is to use software that downloads, parses, and indexes the blockchain. While possible to do create your own software using the bitcoin specification, there are a number of ready-built applications that you can use, such as those listed here: https://bitcoin.org/en/choose-your-wallet. It's going to take a really really long time for the initial download, but once that's done, you'll have access to all the information you're looking for and then some.
In addition, you mention that you would prefer to get the balance in Satoshis? Which ever application you decide to use should give you this option, but just in case that it doesn't, simply take the balance in BTC, and multiply it by 100,000,000.
Is it just one address you want info for? Are you saving the transactions for just one address or are you tabulating multiple addresses? More info (including preferred OS, client etc) will help. What is the scope of the project too? Ps what do you define as first party? Eg are you looking at the BitcoinDaemon on an OS and wanting to avoid API? – Wizard Of Ozzie – 2014-09-10T11:34:22.573
@AussieCryptocurrency - the goal is get the info I want using the standard way, not third-party bitcoin services. That's it. Suppose, this is just one or a few arbitrary addresses - doesn't matter. – アレックス – 2014-09-10T12:30:47.750
The standard way, for most people, is to use third-party services. Bitcoin Core (and AFAIK other popular clients) don't support querying arbitrary addresses other than those that are part of the wallet. – Nate Eldredge – 2014-09-10T16:00:19.423
@NateEldredge, that can't be a standard way because the third-party services themselves obtain that information from somewhere. – アレックス – 2014-09-10T16:53:23.747
1It's all in the public block chain, but the third party services have custom software to parse and index for arbitrary queries. You could write your own, but the standard software doesn't do it and I'm not aware of off-the-shelf solutions. If there are I'd be happy to know. – Nate Eldredge – 2014-09-10T17:09:22.430
@NateEldredge, but standard way I mean my own implementation. – アレックス – 2014-09-10T18:25:46.180