Author

Topic: Bitcoin API receiving payments (Read 715 times)

newbie
Activity: 49
Merit: 0
January 14, 2014, 04:45:53 PM
#4
Store the majority of the bitcoins offline. Only keep a small amount online. Only transfer to the online wallet when the balance gets low.

Otherwise your really going to be lining yourself up to be the next bad bitcoin news when you get hacked and lose the lot.
newbie
Activity: 2
Merit: 0
January 14, 2014, 04:36:24 PM
#3
Yea that's a good problem but what should you suggest if I need to send Bitcoins as well?
newbie
Activity: 49
Merit: 0
January 14, 2014, 04:02:22 PM
#2
Probably.... but are you sure you really want to be generating a new address to send bitcoins to and store the private key on a server connected to the internet? What happens if the server gets hacked and you lose your wallet?
newbie
Activity: 2
Merit: 0
January 14, 2014, 01:26:16 PM
#1
Hello,

I want to make a similar function like Blockchain's receive payments API but with my own Bitcoin server (https://blockchain.info/api/api_receive). It should generate a new Bitcoin address for the user and if they send the BTC to that address it will notify the user of the amount of confirmations. When the transaction has 6 confirmations then notify the user and move the received Bitcoins to the main account. They can also use the same Bitcoin address again.

I was thinking of this:
1. Generate a Main Bitcoin address for the application and label it.
2. Generate a Bitcoin address for the user: getnewaddress(account=UniqueUserID)
3. In a 5min cronjob check all the transactions for the User's Bitcoin accounts and if an account receives BTC than store the amount&transactionID and the account etc.: listtransactions()
4. In the same cronjob check for confirmations and notify it to the user: gettransaction(TransactionID)
5. If there are 6 confirmations then notify the user and move the received Bitcoins to the main account: move(UniqueUserID, MainBTCAccount, ReceivedBitcoins, minconf=6, comment='Transaction from:'.UniqueUserID)

So will this work?
And do I need a cronjob in step 5? or is one time calling the move command enough?

Thanks in advance!
Jump to: