<p>As I mentioned in the comment above, unless you absolutely need your private key to be on the server, I would recommend only storing the address for checking purposes.</p>

<p>I've never used bitcoind before, but the best solution I have seen for accepting bitcoin payments would be to use something like bitaddress.org to generate a huge number of address and private key combos. Upload the addresses into a database on your server, and then when a customer goes through a transaction your server can select a brand new (never before used) key  for them to pay to. Then you can use a bitcoin API like the one provided by Blockchain to validate that the correct number of bitcoins have been sent to this address, and once it confirms, you can release the product to the client. </p>

<p>Then, at your leisure sometime in the future, you can collect your Bitcoins from the addresses having received payments. </p>

<p>This method presents a number of distinct advantages IMO:</p>

<p>1) Private keys are never on the server, you are considerably less vulnerable to an attack.</p>

<p>2) No requirement to keep the entire blockchain on your server, saving space and bandwidth.</p>

<p>3) Funds from each client are held separately (initially) so if you had multiple sales in a short time period, you can still identify each separately (if you used one central wallet, you run the risk of confusing the payments) </p>

<p>4) Your central wallet is <em>slightly</em> safer - the client no longer pays directly to it. Important to note that this makes very little difference because they'd still need your private key, but peace of mind is nice. </p>

<p>I appreciate that this isn't quite the solution you were asking for, but I think it may still fit your usage case &amp; be more secure. </p>

CC BY-SA 3.0
2013-05-02T13:56:18.287Z
2013-05-02T13:56:18.287Z
George Pearce
<p>If you are implementing the web server in Python, you can look at <a href="https://bitcointalk.org/?topic=186.0" rel="nofollow">this BitcoinTalk post</a> where the creator of one of the first Bitcoin Faucets, freebitcoins.appspot.com, shares his implementation.</p>

CC BY-SA 3.0
2013-05-01T22:42:03.590Z
2013-05-01T22:42:03.590Z
Steven Roose
<p>I'm developing a web site which should receive bitcoins and display the amount of received coins. As this is my first bitcoin experience I would like to know if the following scheme is secure enough:</p>

<p>I'm planning to run a web server and bitcoind with the encrypted wallet on a hosted server in a datacenter. No payments will be made through this bitcoind so the wallet will be locked all time and just will be used to monitor the transactions. The front end will communicate to bitcoind by JSON-RPC. There will be regular backups of the encrypted wallet file.</p>

<p>The payments will only be done from another machine which has a copy of the wallet and is secure (both physically and from IT side).</p>

<p>Will this work?</p>

CC BY-SA 3.0
2013-05-01T23:04:51.910Z
If the server doesn't need the private keys, why store them there? You could just keep the addresses so you can monitor incoming payments and then you are even safer.
George Pearce
CC BY-SA 3.0
2013-05-02T08:03:50.370Z
@gsp92 Thank you very much for your input. Can you point me to a reference where I can read how to separate private and public key and make a wallet with public keys only?
Alexey Kalmykov
CC BY-SA 3.0
2013-05-02T13:50:33.593Z
I have very limited knowledge of bitcoind, and my suggestion is a little long for a comment so I will post it as an answer. Stand by.
George Pearce
<client><security><hosting>
How to run a bitcoind on a hosting securely?
Alexey Kalmykov
# How to run a bitcoind on a hosting securely?

(Asked by: username_0 on 2013-05-01)

I'm developing a web site which should receive bitcoins and display the amount of received coins. As this is my first bitcoin experience I would like to know if the following scheme is secure enough:

I'm planning to run a web server and bitcoind with the encrypted wallet on a hosted server in a datacenter. No payments will be made through this bitcoind so the wallet will be locked all time and just will be used to monitor the transactions. The front end will communicate to bitcoind by JSON-RPC. There will be regular backups of the encrypted wallet file.

The payments will only be done from another machine which has a copy of the wallet and is secure (both physically and from IT side).

Will this work?

**Tags:** client, security, hosting

> **Comments:**
> **username_1**: If the server doesn't need the private keys, why store them there? You could just keep the addresses so you can monitor incoming payments and then you are even safer.  
> **username_0**: @gsp92 Thank you very much for your input. Can you point me to a reference where I can read how to separate private and public key and make a wallet with public keys only?  
> **username_1**: I have very limited knowledge of bitcoind, and my suggestion is a little long for a comment so I will post it as an answer. Stand by.  

---

## 2 answers

### Answer by username_1 on 2013-05-02. Score: 2

As I mentioned in the comment above, unless you absolutely need your private key to be on the server, I would recommend only storing the address for checking purposes.

I've never used bitcoind before, but the best solution I have seen for accepting bitcoin payments would be to use something like bitaddress.org to generate a huge number of address and private key combos. Upload the addresses into a database on your server, and then when a customer goes through a transaction your server can select a brand new (never before used) key for them to pay to. Then you can use a bitcoin API like the one provided by Blockchain to validate that the correct number of bitcoins have been sent to this address, and once it confirms, you can release the product to the client.

Then, at your leisure sometime in the future, you can collect your Bitcoins from the addresses having received payments.

This method presents a number of distinct advantages IMO:

1) Private keys are never on the server, you are considerably less vulnerable to an attack.

2) No requirement to keep the entire blockchain on your server, saving space and bandwidth.

3) Funds from each client are held separately (initially) so if you had multiple sales in a short time period, you can still identify each separately (if you used one central wallet, you run the risk of confusing the payments)

4) Your central wallet is *slightly* safer - the client no longer pays directly to it. Important to note that this makes very little difference because they'd still need your private key, but peace of mind is nice.

I appreciate that this isn't quite the solution you were asking for, but I think it may still fit your usage case & be more secure.


---

### Answer by username_2 on 2013-05-01. Score: 1

If you are implementing the web server in Python, you can look at [this BitcoinTalk post](https://bitcointalk.org/?topic=186.0) where the creator of one of the first Bitcoin Faucets, freebitcoins.appspot.com, shares his implementation.


---

