<p>Some tips:</p>

<p>1) Don't keep the full amount in the wallet on the server (have it on a server that's offline, think of it as an active reserve)</p>

<p>2)Have the actuall bitcoind software and wallet on a different machine from which the webapp is</p>

<p>An alternative to running bitcoind (and dealing with all it's issues) is to use a web wallet with an API, GLBSE (GLBSE.com, note I'm the founder) has a python client for interacting with it.</p>

<p>3)Require at least 8 confirmations before crediting someones bitcoin account.</p>

CC BY-SA 3.0
2011-09-09T14:53:28.743Z
+1 for the good tips - why 8 confirmations when 6 is more usual?
Gary
CC BY-SA 3.0
2011-09-09T14:54:45.107Z
given you're the founder of GLBSE, you may also want to look at this (unrelated) question: http://bitcoin.stackexchange.com/questions/498/what-is-glbse-how-does-one-use-it
Gary
CC BY-SA 3.0
2011-09-09T14:50:49.763Z
2011-09-09T14:50:49.763Z
nefario
<p>All points by Nefario are spot-on.  In addition to these, here are some Bitcoin-specific suggestions from <a href="https://campbx.com" rel="nofollow">Camp BX</a>'s experience so far:</p>

<p>1) Use testnet.
<a href="https://en.bitcoin.it/wiki/Testnet" rel="nofollow">Testnet</a> is an excellent resource, that unfortunately does not see as much use as it should outside the core development team.  Make sure you launch your project on testnet, and test all major subsequent releases there as well.</p>

<p>2) Bounties are overrated.<br>
If you want to find bugs in your Bitcoin project, do not rely on bounties.  Perform L&amp;P testing, Unit testing, System testing on all your code and hire professional security auditors if possible.</p>

<p>3) Use 64-bit architecture
 (This may not apply to all projects.)  Many developers use an old 32-bit server for testing and 64-bit system as production server.  It is worth the extra investment to make sure your test server is 64-bit architecture as well.</p>

<p>Hope this helps.</p>

CC BY-SA 3.0
2011-10-29T23:26:17.313Z
Can you put some description related to the provided link as to why it is relevant to your answer?
ThePiachu
CC BY-SA 3.0
2011-10-30T00:37:47.613Z
link to campbx is pure spam, please read http://bitcoin.stackexchange.com/faq#signatures and http://bitcoin.stackexchange.com/faq#promotion
neofutur
CC BY-SA 3.0
2011-10-31T07:26:30.177Z
I am new at StackExchange so didn't know the rules about including a link to Camp BX.  Thank you David for editing it.
Keyur
CC BY-SA 3.0
2011-10-29T23:04:33.207Z
2012-01-09T16:50:09.897Z
2012-01-09T16:50:09.897Z
Keyur
<p>Depending on what your web application does you might want to consider keeping the private keys off the server entirely. For <a href="https://github.com/gary-rowe/MultiBitMerchant" rel="nofollow">MultiBitMerchant</a> we have gone with an architecture that keeps the private keys on an unrelated machine and only uploads the Bitcoin addresses. </p>

<p>You can verify BTC received and generate payment requests with just the Bitcoin addresses - it all depends on if you want to do bitcoin spends on the server. If you have a deterministic private key structure you can sign your transactions in the browser and use the server to broadcast the transaction. </p>

<p>This appears to be a popular approach eg BCCAPI, blockchain.info.</p>

<p>If the server never knows the private keys it makes it much less attractive as a target. </p>

CC BY-SA 3.0
2012-01-09T17:52:37.970Z
2012-01-11T09:01:04.733Z
2012-01-11T09:01:04.733Z
jim618
<p>Consider the <a href="https://bitcointalk.org/index.php?topic=55842.0" rel="nofollow">Stratum Overlay Network</a> (work in progress) to simplify server code - it allows you to transact securely without managing a blockchain.</p>

CC BY-SA 3.0
2012-01-11T10:13:58.817Z
2012-01-11T10:13:58.817Z
ripper234
<p>Although similar to <a href="https://bitcoin.stackexchange.com/questions/8/how-do-i-develop-mobile-applications-for-bitcoin">this question about mobile app development</a>, I would like to know how I should go about the development of web applications that make use of Bitcoin. It can be assumed that <a href="https://softwareengineering.stackexchange.com/questions/46716/what-should-a-developer-know-before-building-a-public-web-site">all the standard recommendations mentioned in this famous question</a> will have been noted and implemented where applicable. </p>

<p>This question is about <strong>Bitcoin specific design requirements</strong> that experienced developers would like to hand down to those just starting out.</p>

<p><strong>Edit to clarify further</strong></p>

<p>I'm looking for design requirements that a web application using the Bitcoin protocol in some way would be advised to apply before releasing their code to the public. For example</p>

<ul>
<li>additional security arrangements (offline elements? manual interventions?)</li>
<li>network connectivity concerns (what is an appropriate uptime expectation? does Bitcoin introduce greater bandwidth consumption than standard web technologies?)</li>
<li>recommended deployment configurations (distributed via EC2+EBS+S3? personally managed servers? and so on)</li>
<li>data privacy concerns (Know Your Customer?)</li>
</ul>

<p>There have been many issues with Bitcoin web applications suffering from design issues that should have been avoided. Hopefully, the answers to this question will help other developers working on these projects to not repeat them.</p>

CC BY-SA 3.0
2011-09-09T15:13:40.473Z
This question is very vague/broad. Could you make it more specific?
D.H.
CC BY-SA 3.0
2011-09-09T20:18:06.320Z
@D.H. Edited accordingly
Gary
CC BY-SA 3.0
2011-10-30T00:17:59.510Z
As for deploying web apps on the cloud, you have to be extra careful. One exchange lost a lot of coins by accidentally resetting their instance on Amazon and loosing the wallet.
ThePiachu
<development>
How do I develop web applications for Bitcoin?
Gary
# How do I develop web applications for Bitcoin?

(Asked by: username_0 on 2011-09-09)

Although similar to [this question about mobile app development](https://bitcoin.stackexchange.com/questions/8/how-do-i-develop-mobile-applications-for-bitcoin), I would like to know how I should go about the development of web applications that make use of Bitcoin. It can be assumed that [all the standard recommendations mentioned in this famous question](https://softwareengineering.stackexchange.com/questions/46716/what-should-a-developer-know-before-building-a-public-web-site) will have been noted and implemented where applicable.

This question is about **Bitcoin specific design requirements** that experienced developers would like to hand down to those just starting out.

**Edit to clarify further**

I'm looking for design requirements that a web application using the Bitcoin protocol in some way would be advised to apply before releasing their code to the public. For example

* additional security arrangements (offline elements? manual interventions?)
* network connectivity concerns (what is an appropriate uptime expectation? does Bitcoin introduce greater bandwidth consumption than standard web technologies?)
* recommended deployment configurations (distributed via EC2+EBS+S3? personally managed servers? and so on)
* data privacy concerns (Know Your Customer?)

There have been many issues with Bitcoin web applications suffering from design issues that should have been avoided. Hopefully, the answers to this question will help other developers working on these projects to not repeat them.

**Tags:** development

> **Comments:**
> **username_1**: This question is very vague/broad. Could you make it more specific?  
> **username_0**: @D.H. Edited accordingly  
> **username_2**: As for deploying web apps on the cloud, you have to be extra careful. One exchange lost a lot of coins by accidentally resetting their instance on Amazon and loosing the wallet.  

---

## 4 answers

### Answer by username_3 on 2011-09-09. Score: 3 | Accepted answer

Some tips:

1) Don't keep the full amount in the wallet on the server (have it on a server that's offline, think of it as an active reserve)

2)Have the actuall bitcoind software and wallet on a different machine from which the webapp is

An alternative to running bitcoind (and dealing with all it's issues) is to use a web wallet with an API, GLBSE (GLBSE.com, note I'm the founder) has a python client for interacting with it.

3)Require at least 8 confirmations before crediting someones bitcoin account.

> **Comments:**
> **username_0**: +1 for the good tips - why 8 confirmations when 6 is more usual?  
> **username_0**: given you're the founder of GLBSE, you may also want to look at this (unrelated) question: http://bitcoin.stackexchange.com/questions/498/what-is-glbse-how-does-one-use-it  

---

### Answer by username_4 on 2011-10-29. Score: 4

All points by username_3 are spot-on. In addition to these, here are some Bitcoin-specific suggestions from [Camp BX](https://campbx.com)'s experience so far:

1) Use testnet.
[Testnet](https://en.bitcoin.it/wiki/Testnet) is an excellent resource, that unfortunately does not see as much use as it should outside the core development team. Make sure you launch your project on testnet, and test all major subsequent releases there as well.

2) Bounties are overrated.  
If you want to find bugs in your Bitcoin project, do not rely on bounties. Perform L&P testing, Unit testing, System testing on all your code and hire professional security auditors if possible.

3) Use 64-bit architecture
(This may not apply to all projects.) Many developers use an old 32-bit server for testing and 64-bit system as production server. It is worth the extra investment to make sure your test server is 64-bit architecture as well.

Hope this helps.

> **Comments:**
> **username_2**: Can you put some description related to the provided link as to why it is relevant to your answer?  
> **username_5**: link to campbx is pure spam, please read http://bitcoin.stackexchange.com/faq#signatures and http://bitcoin.stackexchange.com/faq#promotion  
> **username_4**: I am new at StackExchange so didn't know the rules about including a link to Camp BX.  Thank you David for editing it.  

---

### Answer by username_6 on 2012-01-09. Score: 1

Depending on what your web application does you might want to consider keeping the private keys off the server entirely. For [MultiBitMerchant](https://github.com/username_0-rowe/MultiBitMerchant) we have gone with an architecture that keeps the private keys on an unrelated machine and only uploads the Bitcoin addresses.

You can verify BTC received and generate payment requests with just the Bitcoin addresses - it all depends on if you want to do bitcoin spends on the server. If you have a deterministic private key structure you can sign your transactions in the browser and use the server to broadcast the transaction.

This appears to be a popular approach eg BCCAPI, blockchain.info.

If the server never knows the private keys it makes it much less attractive as a target.


---

### Answer by username_7 on 2012-01-11. Score: 0

Consider the [Stratum Overlay Network](https://bitcointalk.org/index.php?topic=55842.0) (work in progress) to simplify server code - it allows you to transact securely without managing a blockchain.


---

