Bitcoin Forum
May 09, 2024, 06:08:07 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question: how to create deposit addresses without running bitcoind?  (Read 1329 times)
asztar7 (OP)
Member
**
Offline Offline

Activity: 154
Merit: 10


View Profile
May 31, 2015, 09:35:48 AM
 #1

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?
1715278087
Hero Member
*
Offline Offline

Posts: 1715278087

View Profile Personal Message (Offline)

Ignore
1715278087
Reply with quote  #2

1715278087
Report to moderator
"This isn't the kind of software where we can leave so many unresolved bugs that we need a tracker for them." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715278087
Hero Member
*
Offline Offline

Posts: 1715278087

View Profile Personal Message (Offline)

Ignore
1715278087
Reply with quote  #2

1715278087
Report to moderator
1715278087
Hero Member
*
Offline Offline

Posts: 1715278087

View Profile Personal Message (Offline)

Ignore
1715278087
Reply with quote  #2

1715278087
Report to moderator
1715278087
Hero Member
*
Offline Offline

Posts: 1715278087

View Profile Personal Message (Offline)

Ignore
1715278087
Reply with quote  #2

1715278087
Report to moderator
Muhammed Zakir
Hero Member
*****
Offline Offline

Activity: 560
Merit: 506


I prefer Zakir over Muhammed when mentioning me!


View Profile WWW
May 31, 2015, 10:15:42 AM
 #2

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.

coinableS
Legendary
*
Offline Offline

Activity: 1442
Merit: 1179



View Profile WWW
May 31, 2015, 05:27:56 PM
 #3

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:
<?php
$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"];
}
?>

<html>
<form method="post"><input type="text" name="username" placeholder="Username"><br><input type="submit" name="submit" value="buy now"></form>
<?php echo $sendPmt?>
</html>

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:
<?php
$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 "youremail@email.com";
$emailtitle $_GET['user'];
$body "Invoice paid";
$headers "From: sales@yourwebsite.com" ."\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

Muhammed Zakir
Hero Member
*****
Offline Offline

Activity: 560
Merit: 506


I prefer Zakir over Muhammed when mentioning me!


View Profile WWW
May 31, 2015, 05:39:34 PM
 #4

-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.

coinableS
Legendary
*
Offline Offline

Activity: 1442
Merit: 1179



View Profile WWW
May 31, 2015, 06:00:22 PM
 #5

-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.

Muhammed Zakir
Hero Member
*****
Offline Offline

Activity: 560
Merit: 506


I prefer Zakir over Muhammed when mentioning me!


View Profile WWW
May 31, 2015, 07:22:33 PM
 #6

-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?

coinableS
Legendary
*
Offline Offline

Activity: 1442
Merit: 1179



View Profile WWW
May 31, 2015, 08:22:33 PM
 #7

-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?

notlist3d
Legendary
*
Offline Offline

Activity: 1456
Merit: 1000



View Profile
June 01, 2015, 02:09:13 AM
 #8

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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!