How to accept BTC payments



I'm developing a website that will be accepting BTC as a form of payment.

I (technically) know how to accept payments, I'm currently experimenting with the daemon and the Python-BitcoinRPC library and everything seems to work well.

What I'm asking here is what is, in the opinion of Bitcoins experts, the best way to actually handle the transactions.

I'm currently testing this method:

  • Payment requested
  • Script asks the Bitcoin daemon to generate a new address
  • Show the new address to the user, ask to pay to that address
  • Script monitors the address
  • When the confirmed amount on that address is equal or greater that the amount to pay, mark the transaction as Payed
  • Transfer the amount from the address to another "main" address where all the payments end up

Is this method good and secure? I'm particularly unsure about the last point.

Do you have any experience in this field?

Thank you in advance!

EDIT: I'm having some issues in sending BTC moved to a address from another address in local (without paying fees).


Posted 2013-12-15T15:28:45.667

Reputation: 474



Your work flow looks good, you should wait for a sufficient number of confirmations before you transaction is fully accepted. Not sure if you are delivering physical products or digital products, that could impact how many confirms you choose to wait for.

Check out the following RPC API call:

 move <fromaccount> <toaccount> <amount> [minconf=1] [comment]  
 Move from one account in your wallet to another

This will allow you to move funds from one address to another within the same wallet.

Mark S.

Posted 2013-12-15T15:28:45.667

Reputation: 2 540

Thank you for you answer. I just did some tests with that API call, and it seems to to the work. In your opinion, is it better to keep the BTCs on the different addresses or to move them on a single address with the move API call? – rrrrrrrrrrrrrrrr – 2013-12-15T15:47:14.823

1I guess thats up to you and your reasoning behind storing them this way I could see arguments for both options. Doing so may link addresses that you have used to receive coin thus decreasing your (pseudo)anonymity. – Mark S. – 2013-12-15T16:22:20.887