<p>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.</p>

<p>Sample code is shown below:</p>

<pre>// 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());</pre>

<p>The Output will be :</p>

<p><code>1L23PHmL38qjqbs75doB1VTSL3CKPwkPbC</code></p>

<p>You can get the public key from <a href="https://iancoleman.io/bip39/" rel="nofollow noreferrer">https://iancoleman.io/bip39/</a> and its all particular derived addresses. You can compare your first generated address from there, to make sure that you are getting correct addresses.</p>

<p>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).</p>

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

<p>You can again compare these addresses from <a href="https://iancoleman.io/bip39/" rel="nofollow noreferrer">https://iancoleman.io/bip39/</a></p>

<p>Good Luck!</p>

CC BY-SA 4.0
2018-05-25T16:22:31.863Z
2018-05-25T16:22:31.863Z
FairyRosie
<p>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.</p>
<p>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.</p>
<p>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.</p>

CC BY-SA 4.0
2021-12-24T15:21:06.837Z
2021-12-24T15:21:06.837Z
Allen Moss
<p>Watch-only wallet can only receive payments but not spend the available coins. I am using bitcoinj (in Java).</p>

<p>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</p>

<bitcoin-core><address><bitcoinj><java><watch-only>
how to create Watching Address from available xPub key
Cleo Indigo
# how to create Watching Address from available xPub key

(Asked by: username_0 on 2018-04-18)

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

**Tags:** bitcoin-core, address, bitcoinj, java, watch-only


---

## 2 answers

### Answer by username_1 on 2018-05-25. Score: 2 | Accepted answer

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!


---

### Answer by username_2 on 2021-12-24. Score: -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.


---

