HD Wallet usage on my server?


(Stuart Radforth) #1

One more question…

Essentially I’m trying to create a new HD wallet for each user on my server. I would like to be able to detect payments into that HD wallet and payout funds from that same wallet.

It looks like the pieces are all here but not sure if I’m making a mountain out of a molehill as what sounds a pretty common request seems non-trivial to do.

E.g. getting an HD wallets balance seems we have to derive all addresses incrementally and test each in succession to see if it’s been used and tally the totals

When making a payment, do the same as a get an address but when we find a positive balance manually add the UTXOs to create a new transaction to payout to the new address.

Is this right or is there an easier way to use HD wallets on my node.js server where there are two simple calls like
e.g.
hdwallet.get_balance( min_confirmations )
hdwallet.send_funds_to( satoshis );


(Braydon Fuller) #2

A good source to look at is https://github.com/bitpay/bitcore-wallet-service as it handles many HD wallet related needs and is the backend for Copay.