<p>Electrum uses a few different derivation paths for various script types. For example for legacy p2pkh addresses (addresses beginning with 1) it uses m/n/i where m is the extended private key (xprv) derived from the seed, n is 0 for external and 1 for change addresses and i is the address index with addresses being generated sequentially starting from 0. Electrum also lets you create a wallet using any xprv and then it'll assume that xprv is m in the derivation path and generate addresses relative to that. So all you have to do is restore your wallet from a hardened xprv such m/1' and electrum will then generate addresses relative to that. These addresses will not be visible to the person who has the extended public key for m.</p>

<p>To generate a wallet using m/1' you can use <a href="https://github.com/AbdussamadA/electrum-xprv/blob/master/xprv.py" rel="nofollow noreferrer">this script</a> like so:</p>

<p><code>electrum getmasterprivate| python3 xprv.py -m - -d "m/1'" -p|electrum -w wallet_name restore -</code></p>

CC BY-SA 4.0
2018-08-20T11:05:26.710Z
2018-08-20T11:15:07.473Z
2018-08-20T11:15:07.473Z
Abdussamad
<p>I didn't actually understand what you want.</p>

<blockquote>
  <p>Hardened public keys cannot be generated from the master public key, and <em>a priori</em> cannot be attributed to the owner of the non-hardened addresses above.</p>
</blockquote>

<p>There's no "hardened xpub (extended public key)" at all.</p>

<p>There are only "hardened childs" or "normal (non-hardened) childs", of one parent xprv (extended private key).</p>

<p>The normal childs are derived from the parent public key, while the hardened childs are derived from the parent <strong>private</strong> key, so that any hardened childs can only be derived with the knowledge of the parent xprv (which contains  the parent private key and the parent chain code).</p>

<p>Currently, Bitcoin Core uses the hardened childs <em>directly</em> as keys of receiving/change addresses (receiving addresses would be <code>m/0'/0'/0'</code>, <code>m/0'/0'/1'</code>, <code>m/0'/0'/2'</code>, ...etc).</p>

<p>As far as I know, Electrum currently doesn't support such <strong>"hardened address"</strong> option. However, this could be also achieved with other tools, like Ian Coleman's BIP39 tool.</p>

<hr>

<p>Although @Abudussamad had already provided a straightforward method, I think his method is not standard-compliant, though.</p>

<p>If you just followed his guide, your receiving addresses would be derived through "weird" derivation paths, like <code>m/1'/0/0</code>, <code>m/1'/0/1</code> ,<code>m/1'/0/2</code>, <code>m/1'/0/3</code>, ...etc, while your change addresses would be derived through <code>m/1'/1/0</code>, <code>m/1'/1/1</code>, <code>m/1'/1/2</code>, <code>m/1'/1/3</code>, ...etc.</p>

<p>See, your addresses will be actually derived at <strong>the depth of 3</strong>, while regular Electrum wallets derive their addresses at <strong>the depth of 2</strong>:</p>

<p>The receiving addresses would be <code>m/0/0</code>, <code>m/0/1</code>, <code>m/0/2</code>, ...etc, while the change addresses would be <code>m/1/0</code>, <code>m/1/0</code>, <code>m/1/0</code>, ...etc.</p>

<hr>

<p>In my opinion, it's better to achieve this goal with the BIP39/44/49/84 standard scheme.</p>

<p>BIP44/49/84 provide separation among different "accounts". If the xpub of "account 0" has already been compromised, you can simply switch to "account 1", which does not have any observable linkage to the compromised "account 0", as long as the parent "coin" xprv (which derives all the "accounts" from 0 to 2^31) is still kept secret.</p>

<p>This is easy to do with a BIP39 mnemonic, although Electrum always shows warnings about it. After checking "Use BIP39 seed" in the option dialog, Electrum will show you three different address type options.</p>

<p>For example, if you chose the legacy address type, Electrum would automatically fill the derivation path with <code>m/44'/0'/0'</code>. The last <code>0'</code> was the account index number, of the 1st account. You could change this number to other value, like <code>m/44'/0'/1'</code> or <code>m/44'/0'/2'</code>, which corresponded to the 2nd or 3rd account respectively.</p>

<p>If you then chose to use the 3rd account (<code>m/44'/0'/2'</code>), your receiving addresses would be <code>m/44'/0'/2'/0/0</code>, <code>m/44'/0'/2'/0/1</code>, <code>m/44'/0'/2'/0/2</code>, <code>m/44'/0'/2'/0/3</code>, ...etc, while your change addresses would be <code>m/44'/0'/2'/1/0</code>, <code>m/44'/0'/2'/1/1</code>, <code>m/44'/0'/2'/1/2</code>, <code>m/44'/0'/2'/1/3</code>, ...etc.</p>

CC BY-SA 4.0
2019-12-24T11:52:58.910Z
2019-12-24T12:22:53.207Z
2019-12-24T12:22:53.207Z
Chris Chen
<blockquote>
  <p>Is it possible to generate such hardened keys in Electrum, and if so, how?</p>
</blockquote>

<p>It is not possible to generate hardened keys in Electrum because Electrum does not allow you to enter your own BIP 32 derivation paths. The hardening is based upon the derivation paths.</p>

CC BY-SA 3.0
2017-11-03T18:35:30.423Z
2017-11-03T18:35:30.423Z
Ava Chow
<p>Please comment on the accuracy of this explanation.</p>

<p>Scenario: The master public key is compromised and so all non-hardened public addresses can be generated and monitored by a third party. This negates the privacy gained from avoiding address reuse. (The third party cannot spend any bitcoins from these addresses however).</p>

<p>Hardened public keys cannot be generated from the master public key, and <em>a priori</em> cannot be attributed to the owner of the non-hardened addresses above.</p>

<p>Is it possible to generate such hardened keys in Electrum, and if so, how?</p>

<electrum><public-key><bip32-hd-wallets>
Electrum: How to generate hardened public addresses with HD BIP32 wallet
gloome
# Electrum: How to generate hardened public addresses with HD BIP32 wallet

(Asked by: username_0 on 2017-11-03)

Please comment on the accuracy of this explanation.

Scenario: The master public key is compromised and so all non-hardened public addresses can be generated and monitored by a third party. This negates the privacy gained from avoiding address reuse. (The third party cannot spend any bitcoins from these addresses however).

Hardened public keys cannot be generated from the master public key, and *a priori* cannot be attributed to the owner of the non-hardened addresses above.

Is it possible to generate such hardened keys in Electrum, and if so, how?

**Tags:** electrum, public-key, bip32-hd-wallets


---

## 3 answers

### Answer by username_1 on 2018-08-20. Score: 1

Electrum uses a few different derivation paths for various script types. For example for legacy p2pkh addresses (addresses beginning with 1) it uses m/n/i where m is the extended private key (xprv) derived from the seed, n is 0 for external and 1 for change addresses and i is the address index with addresses being generated sequentially starting from 0. Electrum also lets you create a wallet using any xprv and then it'll assume that xprv is m in the derivation path and generate addresses relative to that. So all you have to do is restore your wallet from a hardened xprv such m/1' and electrum will then generate addresses relative to that. These addresses will not be visible to the person who has the extended public key for m.

To generate a wallet using m/1' you can use [this script](https://github.com/AbdussamadA/electrum-xprv/blob/master/xprv.py) like so:

`electrum getmasterprivate| python3 xprv.py -m - -d "m/1'" -p|electrum -w wallet_name restore -`


---

### Answer by username_2 on 2019-12-24. Score: 0

I didn't actually understand what you want.

> Hardened public keys cannot be generated from the master public key, and *a priori* cannot be attributed to the owner of the non-hardened addresses above.

There's no "hardened xpub (extended public key)" at all.

There are only "hardened childs" or "normal (non-hardened) childs", of one parent xprv (extended private key).

The normal childs are derived from the parent public key, while the hardened childs are derived from the parent **private** key, so that any hardened childs can only be derived with the knowledge of the parent xprv (which contains the parent private key and the parent chain code).

Currently, Bitcoin Core uses the hardened childs *directly* as keys of receiving/change addresses (receiving addresses would be `m/0'/0'/0'`, `m/0'/0'/1'`, `m/0'/0'/2'`, ...etc).

As far as I know, Electrum currently doesn't support such **"hardened address"** option. However, this could be also achieved with other tools, like Ian Coleman's BIP39 tool.

---

Although @Abudussamad had already provided a straightforward method, I think his method is not standard-compliant, though.

If you just followed his guide, your receiving addresses would be derived through "weird" derivation paths, like `m/1'/0/0`, `m/1'/0/1` ,`m/1'/0/2`, `m/1'/0/3`, ...etc, while your change addresses would be derived through `m/1'/1/0`, `m/1'/1/1`, `m/1'/1/2`, `m/1'/1/3`, ...etc.

See, your addresses will be actually derived at **the depth of 3**, while regular Electrum wallets derive their addresses at **the depth of 2**:

The receiving addresses would be `m/0/0`, `m/0/1`, `m/0/2`, ...etc, while the change addresses would be `m/1/0`, `m/1/0`, `m/1/0`, ...etc.

---

In my opinion, it's better to achieve this goal with the BIP39/44/49/84 standard scheme.

BIP44/49/84 provide separation among different "accounts". If the xpub of "account 0" has already been compromised, you can simply switch to "account 1", which does not have any observable linkage to the compromised "account 0", as long as the parent "coin" xprv (which derives all the "accounts" from 0 to 2^31) is still kept secret.

This is easy to do with a BIP39 mnemonic, although Electrum always shows warnings about it. After checking "Use BIP39 seed" in the option dialog, Electrum will show you three different address type options.

For example, if you chose the legacy address type, Electrum would automatically fill the derivation path with `m/44'/0'/0'`. The last `0'` was the account index number, of the 1st account. You could change this number to other value, like `m/44'/0'/1'` or `m/44'/0'/2'`, which corresponded to the 2nd or 3rd account respectively.

If you then chose to use the 3rd account (`m/44'/0'/2'`), your receiving addresses would be `m/44'/0'/2'/0/0`, `m/44'/0'/2'/0/1`, `m/44'/0'/2'/0/2`, `m/44'/0'/2'/0/3`, ...etc, while your change addresses would be `m/44'/0'/2'/1/0`, `m/44'/0'/2'/1/1`, `m/44'/0'/2'/1/2`, `m/44'/0'/2'/1/3`, ...etc.


---

### Answer by username_3 on 2017-11-03. Score: 0

> Is it possible to generate such hardened keys in Electrum, and if so, how?

It is not possible to generate hardened keys in Electrum because Electrum does not allow you to enter your own BIP 32 derivation paths. The hardening is based upon the derivation paths.


---

