Search code examples
c#asp.netbitcoin

C# ASP.NET Bitcoin development - Creating and storing multiple wallets


I've been looking around the internet for an answer to this and couldn't find anything using the keywords that I had used anyway.

I'm trying to develop a service in which users can create a wallet to use and control their money from. I don't want to reinvent the wheel and have been looking for public API's and I have found BitcoinLib. The problem I have with this API is that you can only create 1 wallet.

What is the best way I can create multiple wallets (A wallet for each user) and store and control (by control i mean to add addresses, send money, etc) them on my server?

Or is it best to have 1 wallet on the server and write my own code to tie addresses to each user?

I'd prefer not to use an online API for reference such as Blockchain.info C# Library as I do not wish to rely on another service for uptime.


Solution

  • Bitcoin-Core doesn't support an HD wallet, so there's really no point in creating a separate wallet for every single user since behind the scenes they will only control a number of private keys that correspond to the addresses allocated to them. So the best approach in your case is to associate the users with their reserved addresses in your DB. BitcoinLib is an excellent choice for this architecture.