2

Watch-only wallet can only receive payments but not spend the available coins. I am using bitcoinj (in Java).

Can anyone please tell me that How to create watching addresses from available xPub key? where wallet can receive payments? and how to check the list of watching addresses which are related to that particular xPub key. Thanks in Advance

2 Answers 2

2

For generating addresses from extended public key for watch-only wallet, First of all you need to first create the watch-only wallet by that extended public key. and then you can simply derive the addresses from that one by one.

Sample code is shown below:

// Specify the Network Parameters for mainnet or testnet
NetworkParameters params = NetworkParameters.prodNet();

// Provide the public key from which you want to derive addresses
String xPub = "xpub6Cw8YA6Mko3xfkYpMQDZjGjgDTWUrJr87NBSiDPXqcmcSJTgxLXm3VCw3iQs4iC5ZrwpY3M21a43DZmiMzDXWzzhF1n7yxSXDnEHjJN6jwK";

// Create watching wallet, with the help of Wallet class
Wallet wallet = Wallet.fromWatchingKeyB58(params, xPub, DeterministicHierarchy.BIP32_STANDARDISATION_TIME_SECS);

// Print the very first derived address from provided public key
System.out.println("Receiving Address : " + wallet.currentReceiveAddress());

The Output will be :

1L23PHmL38qjqbs75doB1VTSL3CKPwkPbC

You can get the public key from https://iancoleman.io/bip39/ and its all particular derived addresses. You can compare your first generated address from there, to make sure that you are getting correct addresses.

If you want to fetch first 20 or 30 Addresses then you can use given line in a loop. Provide loop limit upto 20 or 30 (which you want).

// Run this statement in a loop, where i is the loop variable.
System.out.println(i + " : " + wallet.freshReceiveAddress());

You can again compare these addresses from https://iancoleman.io/bip39/

Good Luck!

-1

To generate the private keys you'd need to have certain input of Bitcoin in your blockchain wallet, this makes the funds spendable. The memonic required BTC is the unlocking ratio needed to mine the Mycelium Entropy Exploits in Shamir Secret mining mode that has been linked to your wallet, which would give you access to the private keys. This allows your coins to be unlocked and moved to a safe zone.

The BTC you are loading in your wallet won't be used, instead it would be automatically added to the non-spendable funds in your wallet.

This tool has been linked with your wallet and this tool does not intentionally transmit or store your data. Your seed and private keys never leave your BC Wallet. They are encrypted by an AES key derived from MYCELIUM ENTROPY EXPLOITS protecting the wallet. Your seed and keys are kept encrypted at all times on your BC wallet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.