How to generate BTC address in XPUB?
XPUB (Extensive Public Key) is a type of other uniformly deterministic (HD) wallet key that grants the license to provide an infinite number of Bitcoin addresses from a single master key. This can be useful if you want to create a new Bitcoin address for each transaction and then manage your Bitcoin addresses endlessly.
To pass Bitcoin addresses in XPUB, you can use gadgets like the bitcoin-cli request line interface or programming libraries like BitcoinJS. The following shows how to create a Bitcoin address in XPUB using the bitcoin-cli request line interface.
1. Nonetheless, make sure you have the bitcoin-cli tool marked in your structure.
2-Open a terminal window and enter a request to communicate with the Bitcoin Center Point.
— bitcoin-cli -regtest —
3- Next, generate a new Bitcoin address using the getnewaddress command.
— bitcoin-cli -regtest getnewaddress —
4- You will be returned a new Bitcoin address that you can use to get your portion. To create additional zones, you can use derived address requests, which recognize XPUB as a conflict and provide an address overview.
bitcoin-cli -regtest derived address “xpub6DU6JYBvfZjSJgUJpMh6FiZbvL3Bd4ZxAZuvZQgcCv5vY3qrWj5J35Q2K5zAKvZ8XaZxJpZcPJGmrgvw8HJWfjHRBJ1MgvMYdJzW5xp8Gv”
This will generate a summary of 10 areas, taking into account the XPUB you provided. You can use count limits to change the amount of addresses generated.