<blockquote>
  <p>The question is: after several thousands of users will create their wallets, the server's wallet.dat file is going to be really huge. Would that make the bitcoin server slow?</p>
</blockquote>

<p>Yes, it is know that when the wallet.dat file is very large it noticeable slows down Bitcoin Core. However this only happens when there are millions of keys stored in the wallet.</p>

<p>Instead of having all of the private keys in one file, you can use Bitcoin Core's multiwallet feature. This feature allows you to have multiple wallet files loaded into Bitcoin Core so this should avoid the issue of having too large of a wallet file. It will also let each use have their own wallet file so only one user's coins are actually moved when spending any money. The only downside to this is that loading and unloading a wallet requires restarting. Once <a href="https://github.com/bitcoin/bitcoin/pull/10740" rel="nofollow noreferrer">PR 10740</a> is merged, you will be able to dynamically load and unload wallets. Note that having many wallets loaded at the same time may also be problematic.</p>

CC BY-SA 3.0
2017-12-26T21:55:11.080Z
Thank you Andrew for pointing the right direction. I will look into this near time
Alex Shchur
CC BY-SA 3.0
2017-12-26T17:25:34.333Z
2017-12-26T17:25:34.333Z
Ava Chow
<p>I'm building a website for my client, that is essentially a web-based hosted wallet.</p>

<p>I'm going to use bitcoin core and talk to it via its API in order to handle the transactions.</p>

<p>I understand that I can allow users to export their private keys and import them by using </p>

<blockquote>
  <p>dumpprivkey</p>
</blockquote>

<p>and </p>

<blockquote>
  <p>importprivkey</p>
</blockquote>

<p>The question is: after several thousands of users will create their wallets, the server's wallet.dat file is going to be really huge.
Would that make the bitcoin server slow?</p>

<p>I'm thinking about queuing all the requests to the bitcoin server and store there only one key at a time. But that would require to restart the server everytime, and would basically make every request time consuming?</p>

<p>What is the correct approach to this?</p>

<p>Thank you  </p>

<wallet><bitcoind>
Hosted web wallet based on bitcoin core - approach to handling keys
Alex Shchur
# Hosted web wallet based on bitcoin core - approach to handling keys

(Asked by: username_0 on 2017-12-26)

I'm building a website for my client, that is essentially a web-based hosted wallet.

I'm going to use bitcoin core and talk to it via its API in order to handle the transactions.

I understand that I can allow users to export their private keys and import them by using

> dumpprivkey

and

> importprivkey

The question is: after several thousands of users will create their wallets, the server's wallet.dat file is going to be really huge.
Would that make the bitcoin server slow?

I'm thinking about queuing all the requests to the bitcoin server and store there only one key at a time. But that would require to restart the server everytime, and would basically make every request time consuming?

What is the correct approach to this?

Thank you

**Tags:** wallet, bitcoind


---

## 1 answers

### Answer by username_1 on 2017-12-26. Score: 1 | Accepted answer

> The question is: after several thousands of users will create their wallets, the server's wallet.dat file is going to be really huge. Would that make the bitcoin server slow?

Yes, it is know that when the wallet.dat file is very large it noticeable slows down Bitcoin Core. However this only happens when there are millions of keys stored in the wallet.

Instead of having all of the private keys in one file, you can use Bitcoin Core's multiwallet feature. This feature allows you to have multiple wallet files loaded into Bitcoin Core so this should avoid the issue of having too large of a wallet file. It will also let each use have their own wallet file so only one user's coins are actually moved when spending any money. The only downside to this is that loading and unloading a wallet requires restarting. Once [PR 10740](https://github.com/bitcoin/bitcoin/pull/10740) is merged, you will be able to dynamically load and unload wallets. Note that having many wallets loaded at the same time may also be problematic.

> **Comments:**
> **username_0**: Thank you Andrew for pointing the right direction. I will look into this near time  

---

