Author

Topic: Question: how to create deposit addresses without running bitcoind? (Read 1349 times)

legendary
Activity: 1456
Merit: 1000
Hey, I am just a beginner in the world of developing applications so I have a question.
I want to make it possible for users to deposit btc on my site. But of course I need to know which amount has been deposited by who.
As I read online it is typically solved by creating a new deposit address for each payment. I want to run the site without any server (just online hosting) so I do not want to use bitcoind or any other thing like this, I want an online wallet. Anybody knows how to create this / which online wallet to choose?

No matter what one you choose be careful.  It does sound like you might need hot wallets.  I highly suggest looking into moving them from hotwallet to a cold one (paper wallet, usb with it, etc).   Just want to get those coins out of hot wallets.

It is sad but sites using online wallets are big targets for "bad guys".   So I highly suggest checking security.  And if it's a lot of money you will be dealing with hire security consultant to test website.
legendary
Activity: 1442
Merit: 1186
-Blockchain.info payment receive API-

I highly recommend not to depend on another site when you have an easy (but time consuming) alternative. You should give more importance to security than accessibility.

That is correct depending on what site the OP plans on running. If he's selling jars of jelly for $3 each, it's unlikely that he will become a target or have to worry about security. Also where's the security issue with receive payments API? As I recall the times bc.info had issues was with their mobile wallets not generating a random address. The receive payments API uses deterministic addresses based on your receiving address so there's no risk of generating the dreaded "1Bn9ReEocMG1WEW1qYjuDrdFzEFFDCq43F" address.

 - What will happen if Blockchain.info goes down? OP will lose customers, but no security issue.
 - What will happen if there is some errors in Blockchain.info?(known thing which happens) Not sure which errors you are referring to, but again that sounds like a scenario where OP will lose customers not security.
 - Moreover, it's an online wallet service. They are generating addresses, not us. The addresses they generate are only used for a few seconds, the payment is immediately forwarded to the owners address which could be a cold wallet or HD/trezor etc.

Isn't it better to generate addresses ourselves and don't rely on Blockchain.info blindly?

I agree, absolutely it's better to generate them ourselves.

OP's request:
Quote
I want an online wallet. Anybody knows how to create this / which online wallet to choose?
hero member
Activity: 560
Merit: 509
I prefer Zakir over Muhammed when mentioning me!
-Blockchain.info payment receive API-

I highly recommend not to depend on another site when you have an easy (but time consuming) alternative. You should give more importance to security than accessibility.

That is correct depending on what site the OP plans on running. If he's selling jars of jelly for $3 each, it's unlikely that he will become a target or have to worry about security. Also where's the security issue with receive payments API? As I recall the times bc.info had issues was with their mobile wallets not generating a random address. The receive payments API uses deterministic addresses based on your receiving address so there's no risk of generating the dreaded "1Bn9ReEocMG1WEW1qYjuDrdFzEFFDCq43F" address.

 - What will happen if Blockchain.info goes down?
 - What will happen if there is some errors in Blockchain.info?(known thing which happens)
 - Moreover, it's an online wallet service. They are generating addresses, not us.

Isn't it better to generate addresses ourselves and don't rely on Blockchain.info blindly?
legendary
Activity: 1442
Merit: 1186
-Blockchain.info payment receive API-

I highly recommend not to depend on another site when you have an easy (but time consuming) alternative. You should give more importance to security than accessibility.

That is correct depending on what site the OP plans on running. If he's selling jars of jelly for $3 each, it's unlikely that he will become a target or have to worry about security. Also where's the security issue with receive payments API? As I recall the times bc.info had issues was with their mobile wallets not generating a random address. The receive payments API uses deterministic addresses based on your receiving address so there's no risk of generating the dreaded "1Bn9ReEocMG1WEW1qYjuDrdFzEFFDCq43F" address.
hero member
Activity: 560
Merit: 509
I prefer Zakir over Muhammed when mentioning me!
-Blockchain.info payment receive API-

I highly recommend not to depend on another site when you have an easy (but time consuming) alternative. You should give more importance to security than accessibility.
legendary
Activity: 1442
Merit: 1186
Personally I think you should use blockchain.info's receive payments API if you want to create addresses on the fly without running bitcoind.

More info:
https://blockchain.info/api/api_receive

What kind of site are you running and why are they depositing? If you are keeping track of balances you'll need to run a database.
If you just want to accept payments for something you can just have them fill out a form with their name.

This can be your buy page, save as buy.php
Code:
$secret "1234abcd"//secret can be anything you want it's intended to prevent hackers trying to spoof your callback
$my_address "1J9ikqFuwrzPbczsDkquA9uVYeq6dEehsj"//Replace this with your BTC address, payments will get forwarded here
$username $_POST['username']; 
$callback "http://yourdomain.com/callback.php?user=".$username."&secret=".$secret//change to your domain
if(isset($_POST['submit'])){
$response json_decode(file_get_contents("https://blockchain.info/api/receive?method=create&address=".$my_address."&callback=".urlencode($callback)), true);
$sendPmt "Send your payment to ".$response["input_address"];
}
?>




echo $sendPmt?>


Below can be your callback page, save as callback.php. It will send you an email that payment was received and notify blockchain.info it was received by your web server with *ok*
Code:
$secret "1234abcd"//This needs to match your other secret from the buy page

//checks to make sure secret matches
if($_GET['secret'] != $secret){
 echo 
"Quit hacking hacker!";
 return;
}
//send yourself an email to notify that payment was received
$youremail "[email protected]";
$emailtitle $_GET['user'];
$body "Invoice paid";
$headers "From: [email protected]."\r\n";
        
$headers .= "Content-type: text/html\r\n";

$mail mail($youremail$emailtitle$body$headers);

//notifies blockchaininfo that you received the callback
if ($mail) {
echo 
"*ok*";
}

?>


There's also this video that might help.
https://www.youtube.com/watch?v=vWt9wRZ3Hhk
hero member
Activity: 560
Merit: 509
I prefer Zakir over Muhammed when mentioning me!
I don't know how easily it can be made as you are a beginner.

The alternate way I know is to use HD wallet. Create addresses using master public key but save private key somewhere safe(not in server). You can see tools to create addresses from master public key here -- https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Implementations. The problem, however, is that you will have to make process withdrawals manually which is time consuming. If you are willing to take this time consuming work, you can proceed with this. You should also remember that it is not easy process each and every withdrawals manually and on time.
member
Activity: 154
Merit: 10
Hey, I am just a beginner in the world of developing applications so I have a question.
I want to make it possible for users to deposit btc on my site. But of course I need to know which amount has been deposited by who.
As I read online it is typically solved by creating a new deposit address for each payment. I want to run the site without any server (just online hosting) so I do not want to use bitcoind or any other thing like this, I want an online wallet. Anybody knows how to create this / which online wallet to choose?
Jump to: