How to send & receive bitcoin using bitcoinjs-lib?

1

First I create HD Wallet using BIP32 using mnemonics.

Now I want to generate new child addresses with private key using xpub & xpriv for every receive.

Then for example, I received BTC in 2 child addresses, i.e. 1 BTC & 2 BTC.

Now, I have to send 3 BTC to someone, then How can I send it as I have 3 BTC but in separate account with utxo.

How can I manage these accounts & transaction, and also how can I show the total balance to the user?

I thing it is insufficient to call the api to get balance for all accounts, as for HD wallet user can have thousands of addresses.

So, I understood this theoretically, but don't know how to implement this using bitcoinjs-lib, BIP32, HD-key.

Monarth Sarvaiya

Posted 2019-07-15T04:53:11.583

Reputation: 111

No answers