How to generate an HD wallet or use existing one for generating new addresses

How to generate an HD wallet or use existing one for generating new addresses

I am trying to create a simple application to play with bitcoins. I want to generate a new address every time it is requested. I know what the HD Wallet is, but doesn't have much experience working with all this stuff.

I have two ways, as far as I know.

  1. Create a new HD wallet, maintain it locally and use it for generating new addresses

  2. Using extended public key (XPUB), or what is the valid name for that term.

The main idea is to keep it secure, therefore the second variant will be better I think.

Generally I want to be able to change something (maybe XPUB), that is used to generate new bitcoin addresses, from admin panel and then this "something" will be passed to a script that will be responsible for generating new addresses.

Could someone explain all the steps required to do this from programming point of view?

And please tell me, why it is dangerous to create a new wallet locally (generally this is just a set of private/public key) but why I need to run the full node to have a wallet?

I would be grateful for any help.

https://ift.tt/2IDlf4R

Comments

Popular posts from this blog

sendrawtransaction and txn-mempool-conflict

couldn't connect to server: EOF reached (code 1)