<p>I have found the way to do it:</p>

<pre><code>    DeterministicKey extendedKey = wallet.getWatchingKey();
    String mpk = extendedKey.serializePubB58(wallet.getParams());
</code></pre>

CC BY-SA 3.0
2016-01-21T14:53:15.887Z
2016-01-22T09:07:33.730Z
2016-01-22T09:07:33.730Z
Ander Acosta
<p>I am trying to get the MPK of a wallet using bitcoinj. Can I get the DeterministicSeed, which is the seed of the wallet and get the MnemonicCode of 12 words. But I can't get the MPK. As I can make it using bitcoinj?</p>

<public-key><bitcoinj><private-key-import>
How to get the MPK using bitcoinj and how to generate the addresses using the MPK?
Ander Acosta
# How to get the MPK using bitcoinj and how to generate the addresses using the MPK?

(Asked by: username_0 on 2015-12-14)

I am trying to get the MPK of a wallet using bitcoinj. Can I get the DeterministicSeed, which is the seed of the wallet and get the MnemonicCode of 12 words. But I can't get the MPK. As I can make it using bitcoinj?

**Tags:** public-key, bitcoinj, private-key-import


---

## 1 answers

### Answer by username_0 on 2016-01-21. Score: 1 | Accepted answer

I have found the way to do it:

```
    DeterministicKey extendedKey = wallet.getWatchingKey();
    String mpk = extendedKey.serializePubB58(wallet.getParams());

```


---

