0

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

1

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

  • Thank you Andrew for pointing the right direction. I will look into this near time – Alexey Shchur Dec 26 '17 at 21:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.