Bitcoin Forum

Economy => Service Discussion => Topic started by: richiela on November 28, 2013, 04:58:18 AM



Title: blockchain.info Payment API
Post by: richiela on November 28, 2013, 04:58:18 AM
Can anyone help me understand how their payment API works at a bitcoind rpc level?  As far as I can tell, there is no way to see what the balance of an address is, only the number of bitcoins that address has received along with the confirmations for it.

If I were to replicate the blockchain API, i would have to:

* create an address and associated it to an account (destination address)
* check the balance of all accounts
* get a list of all addresses in that account
* check all the addresses looking for the lowest confirmations
    - if value < balance loop back to ensure to check other addresses
* locate callback and call that
* move btcs from account to destination address
* repeat

Is it really that convoluted or am I missing something much simpler?  I currently run a website that processes BTC payments but i'd like to move away from relying on blockchain.info.

Thanks


Title: Re: blockchain.info Payment API
Post by: doof on November 28, 2013, 11:20:23 PM
The simple address method shows you final balance (final_balance) property

http://blockchain.info/address/$bitcoin_address?format=json

Eg http://blockchain.info/address/1Cvy1Exv3y6FT6oLp7va6jmEVqBsM3fTPw?format=json should yield 0.0021



Title: Re: blockchain.info Payment API
Post by: richiela on November 29, 2013, 03:29:12 AM
The simple address method shows you final balance (final_balance) property

http://blockchain.info/address/$bitcoin_address?format=json

Eg http://blockchain.info/address/1Cvy1Exv3y6FT6oLp7va6jmEVqBsM3fTPw?format=json should yield 0.0021



Yup I understand that, but how do I get that same info using JSON-RPC to the bitcoind daemon?  Does blockchain actually keep tracking of every transaction?