<p>Direct answers to your questions:</p>

<p>I) Technically this is not too difficult. Looping through every new transaction on each received new block does not take too many resources and checking each transaction against 100,000 public keys is no problem at all. However, I do not know of a tool that would do exactly so. (For example, <a href="https://github.com/znort987/blockparser" rel="nofollow">blockparser</a> can output all the balances of all the addresses in the entire block chain in under a minute.)</p>

<p>II) No. You can not transfer all the received bitcoins in one transaction as the maximum size for a transaction is 1 megabyte. That would be able to spend the money on, say, 4000 different addresses at once, but no more. Of course, you can give all the private keys to somebody else "all at once", which enables them to spend the coins - but such a party would be unlikely to accept the sale as successful before transferring all the coins in to new addresses, just in case you kept the private keys as well.</p>

<p>III) No, if you keep the attacker from learning all the public keys. If, for example, the public key currently on the web server is easily viewable, the attacker can just poll your website, note down all the public keys seen and then check all the transactions for the keys. However, if you reveal the public keys only to legitimate buyers (or something) or do not reuse keys ever, the attacker has no way of knowing the full set of keys that belong to you. This also requires some care on the spending side of the coins - if you do a transaction that links the coins to your site somehow, this can be observed.</p>

<p>However, there are some more advanced methods of using bitcoin public keys that will achieve more than what you have asked here. You can see for example <a href="https://en.bitcoin.it/wiki/BIP_0032" rel="nofollow">Hierarchical Deterministic Wallets</a>. The choices are numerous and the best way to achieve your goals might not be the most obvious one.</p>

CC BY-SA 3.0
2013-08-23T19:12:42.103Z
2013-08-23T19:12:42.103Z
Nakedible
<p>In order for your server to monitor all the addresses, you'll need to have all of them on the server which contravenes your requirement that a hacker not be able to see your combined balance. </p>

<p>With that in mind, as far as I see it you have two options: </p>

<p>1) Use a desktop app. Armory, QT, etc - though I'm not sure how well they would cope with 1M+ addresses or keys, and I'm 75% sure they don't have a bulk import.</p>

<p>2) Use another server - hosted or even in your home network (Raspberry Pi anyone?) that knows all of your public keys but is completely separated from your frontend server. It can then use a Bitcoin API (Blockchain, BTCBalance.net, blockexplorer) and periodically work its way through all 1M keys checking their balance. From within your network (this is ideal as very low chance of external access without being on site) you can call up the server and it'll tell you how many Bitcoins you have in total at your last count. I currently have a Raspberry Pi setup to do similar repetitive operations (though with backups not Bitcoin) and it does a fantastic job. </p>

<p>You would also likely be able to route option 2) through a proxy.</p>

CC BY-SA 3.0
2013-05-25T10:27:36.727Z
Thanks but none of the answers helped me. 1) Using an external server for bitcoin API exposes us to the attack as those services can aggregate our requests and see how much we earn. 2) I also asked if there is a way to SELL (or at least transfer to another bitcoin address) the sum of all bitcoins from all the private keys. You say "Use Armory but not sure if it does what you want"... Thanks but my questions are not really answered.
Inqier X
CC BY-SA 3.0
2013-05-25T10:33:36.497Z
That's why I suggested using something inside your own network, like a Raspberry Pi. You could use different APIs if you are worried about them aggregating how much money you have,
George Pearce
CC BY-SA 3.0
2013-05-25T09:59:21.377Z
2013-05-25T09:59:21.377Z
George Pearce
<p>We plan to accept bitcoins on our eshop website. What we want plan on doing is:</p>

<p>1) Keep all private keys always offline (cold storage).</p>

<p>2) Generate at least 100,000 keypairs of which only one will be stored on our web server.</p>

<p>3) Frequently change our Bitcoin addresses on our webserver to prevent third parties from knowing how many Bitcoins we have received in total. The web server will only contain our public key (Bitcoin addreses), not any of the private keys.</p>

<p>Now my questions are:</p>

<p>I) Is there a way to monitor the SUM of all bitcoins sent to ALL of our addresses? </p>

<p>Something like a wallet that supports import of a huge number of "watch-only" addresses without requiring the import of the private keys? If the wallet is an application, it must support SOCKS proxy connections. (Armory allows watch-only keys, but I don't know if it supports mass bulk import and SOCKS proxies? Also, it seems to be suffering severe RAM overuse bugs as of now, according to its developer...).</p>

<p>II) Is there a way to sell the SUM of all bitcoins ever sent to ALL of our addresses AT ONCE? </p>

<p>III) Will an attacker be able to find out how many bitcoins we have earned in total?</p>

<p>Thanks! </p>

CC BY-SA 3.0
2013-05-25T23:06:04.313Z
`Is there a way to sell the SUM of all bitcoins ever sent to ALL of our addresses AT ONCE?` This seems like an unrelated question. I think you might want to [ask it separately.](http://bitcoin.stackexchange.com/questions/ask)
Nick ODell
<privacy><coldstorage><offline>
Watching and spending from a huge number of offline private keys
Inqier X
# Watching and spending from a huge number of offline private keys

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

We plan to accept bitcoins on our eshop website. What we want plan on doing is:

1) Keep all private keys always offline (cold storage).

2) Generate at least 100,000 keypairs of which only one will be stored on our web server.

3) Frequently change our Bitcoin addresses on our webserver to prevent third parties from knowing how many Bitcoins we have received in total. The web server will only contain our public key (Bitcoin addreses), not any of the private keys.

Now my questions are:

I) Is there a way to monitor the SUM of all bitcoins sent to ALL of our addresses?

Something like a wallet that supports import of a huge number of "watch-only" addresses without requiring the import of the private keys? If the wallet is an application, it must support SOCKS proxy connections. (Armory allows watch-only keys, but I don't know if it supports mass bulk import and SOCKS proxies? Also, it seems to be suffering severe RAM overuse bugs as of now, according to its developer...).

II) Is there a way to sell the SUM of all bitcoins ever sent to ALL of our addresses AT ONCE?

III) Will an attacker be able to find out how many bitcoins we have earned in total?

Thanks!

**Tags:** privacy, coldstorage, offline

> **Comments:**
> **username_1**: `Is there a way to sell the SUM of all bitcoins ever sent to ALL of our addresses AT ONCE?` This seems like an unrelated question. I think you might want to [ask it separately.](http://bitcoin.stackexchange.com/questions/ask)  

---

## 2 answers

### Answer by username_2 on 2013-08-23. Score: 2

Direct answers to your questions:

I) Technically this is not too difficult. Looping through every new transaction on each received new block does not take too many resources and checking each transaction against 100,000 public keys is no problem at all. However, I do not know of a tool that would do exactly so. (For example, [blockparser](https://github.com/znort987/blockparser) can output all the balances of all the addresses in the entire block chain in under a minute.)

II) No. You can not transfer all the received bitcoins in one transaction as the maximum size for a transaction is 1 megabyte. That would be able to spend the money on, say, 4000 different addresses at once, but no more. Of course, you can give all the private keys to somebody else "all at once", which enables them to spend the coins - but such a party would be unlikely to accept the sale as successful before transferring all the coins in to new addresses, just in case you kept the private keys as well.

III) No, if you keep the attacker from learning all the public keys. If, for example, the public key currently on the web server is easily viewable, the attacker can just poll your website, note down all the public keys seen and then check all the transactions for the keys. However, if you reveal the public keys only to legitimate buyers (or something) or do not reuse keys ever, the attacker has no way of knowing the full set of keys that belong to you. This also requires some care on the spending side of the coins - if you do a transaction that links the coins to your site somehow, this can be observed.

However, there are some more advanced methods of using bitcoin public keys that will achieve more than what you have asked here. You can see for example [Hierarchical Deterministic Wallets](https://en.bitcoin.it/wiki/BIP_0032). The choices are numerous and the best way to achieve your goals might not be the most obvious one.


---

### Answer by username_3 on 2013-05-25. Score: 1

In order for your server to monitor all the addresses, you'll need to have all of them on the server which contravenes your requirement that a hacker not be able to see your combined balance.

With that in mind, as far as I see it you have two options:

1) Use a desktop app. Armory, QT, etc - though I'm not sure how well they would cope with 1M+ addresses or keys, and I'm 75% sure they don't have a bulk import.

2) Use another server - hosted or even in your home network (Raspberry Pi anyone?) that knows all of your public keys but is completely separated from your frontend server. It can then use a Bitcoin API (Blockchain, BTCBalance.net, blockexplorer) and periodically work its way through all 1M keys checking their balance. From within your network (this is ideal as very low chance of external access without being on site) you can call up the server and it'll tell you how many Bitcoins you have in total at your last count. I currently have a Raspberry Pi setup to do similar repetitive operations (though with backups not Bitcoin) and it does a fantastic job.

You would also likely be able to route option 2) through a proxy.

> **Comments:**
> **username_0**: Thanks but none of the answers helped me. 1) Using an external server for bitcoin API exposes us to the attack as those services can aggregate our requests and see how much we earn. 2) I also asked if there is a way to SELL (or at least transfer to another bitcoin address) the sum of all bitcoins from all the private keys. You say "Use Armory but not sure if it does what you want"... Thanks but my questions are not really answered.  
> **username_3**: That's why I suggested using something inside your own network, like a Raspberry Pi. You could use different APIs if you are worried about them aggregating how much money you have,  

---

