1

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.

1

What you're describing is one way to do it but there are much better ways. Take a look at https://bitlab.co/wallet which is an open source real-time wallet API that you can learn from. The back-end source that interfaces with the bitcoind service is at https://github.com/bitlabco/bitlab-nodejs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.