<p>Let's assume a <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" rel="nofollow noreferrer">BIP-32</a> compliant HD wallet is also <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" rel="nofollow noreferrer">BIP-39</a> and <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" rel="nofollow noreferrer">BIP-44</a> compliant.</p>

<p>Let's next assume that when you first configured your BIP-39 compliant HD wallet it provided you the following set of words to be used to reconstitute your master seed: <code>small cereal crazy ahead move never galaxy draft draw plunge sort identify embark clerk hard wagon clever torch cruel income episode any debris puppy</code>.  Additionally, let's also assume the wallet requested that you enter an additional BIP-39 related salted password that will be set to <code>I'mAbadASS</code> for discussion purposes.</p>

<p>A 512 bit root seed <code>m</code> could be obtained for the situation above by issuing the following bitcoin-explorer (bx) command: </p>

<p><code>% echo "small cereal crazy ahead move never galaxy draft draw plunge sort identify embark clerk hard wagon clever torch cruel income episode any debris puppy" | bx mnemonic-to-seed -l en -p "I'mAbadASS"</code> 
c64364d5a4175ff506620c3b788633063a2b3808579cd0f074503a365d283fc3a0bfb50d98f1293828e868e865054eff94261c206d35138689ce97efef9ada9c</p>

<p>BIP-44 compliant HD trees use the <code>m/purpose'/coin_type'/ account'/change/address_index</code> convention to derive private keys and associated addresses.  Let's then assume the wallet only has one account 0.  For the Bitcoin the coin_type the private key tree would look like m/44'/0'/0'/c/i where c can be <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" rel="nofollow noreferrer">0 or 1</a> and i is an index used to synthesize the i-th extended private key, i-th extended public key or address.  </p>

<p>m/44'/0'/0'/1/0 could then be synthesized as follows:</p>

<p><code>% echo $root_seed | bx hd-new | bx hd-private -i 44 -d | bx hd-private -i 0 -d | bx hd-private -i 0 -d | bx hd-private -i 1 | bx hd-private -i 0</code>
xprvA3zHj8cyzFJiKAXiqdLqrdjUvMqdxUbrpSpDGfxHA15uk2j3fUknu2GN6rSYpPc3QDhALvLBNtKfNGQTLYLNFJD5FKnuFbDPRoBp5TAHFba</p>

<p>From the resulting extended private key (ext_prv_key) above, the corresponding public address and private key can be found.</p>

<p><code>% echo $ext_prv_key | bx hd-to-address</code><br>
1BLQ28VdYxJ4Y89fjpbNP5ihUvy2hMkGgq</p>

<p>Then determine if any funds have been sent to the address above by issuing <code>% bx fetch-balance 1BLQ28VdYxJ4Y89fjpbNP5ihUvy2hMkGgq</code> on a computer attached to the Internet or have a very fresh bitcoin-server full node server available for your bx on your private computer that is offline.  </p>

<p>If funds are present, to obtain the private keys to import into another wallet try:</p>

<p><code>% echo $ext_prv_key | bx hd-to-wif</code><br>
L3KsdTwat69cMtLTJE4W2G77SgazLGqhzfvMkYQsuwMC96tr3Tj8 </p>

<p>The <code>qrencode</code> command can receive the piped text output immediately above to synthesize a QR image for a smart cell phone or tablet based wallet to easily import from an offline key synthesis computer that retains a network air-gap.</p>

<p><code>% echo $ext_prv_key | bx hd-to-wif | qrencode -o QRwif.png</code></p>

<p>See <a href="https://bitcoin.stackexchange.com/questions/37013/how-to-import-a-hd-wallet-from-an-extended-private-key">how-to-import-a-hd-wallet-from-an-extended-private-key</a> for more Electrum specific details.</p>

CC BY-SA 3.0
2015-07-11T03:34:35.903Z
2015-07-11T03:34:35.903Z
2017-04-13T12:47:36.647Z
skaht
<p>I think it will assume all addresses are empty and generate just the "gap" number</p>

CC BY-SA 3.0
2015-01-11T22:17:31.393Z
2015-01-11T22:17:31.393Z
CONEJO
<p>I know that in the case of electrum there is a gap limit and it will keep generating addresses until it finds a number of consecutive empty addresses equal to the gap limit.</p>

<p>What about if I want to recover my wallet using my seed offline, suppose that electrum servers are not working and I want to recover my wallet. How can electrum know when to stop generating addresses noting that it has no access to the blockchain since the servers are down.</p>

<wallet><electrum><deterministic-wallets>
How to recover a deterministic wallet offline?
ka lin
# How to recover a deterministic wallet offline?

(Asked by: username_0 on 2015-01-11)

I know that in the case of electrum there is a gap limit and it will keep generating addresses until it finds a number of consecutive empty addresses equal to the gap limit.

What about if I want to recover my wallet using my seed offline, suppose that electrum servers are not working and I want to recover my wallet. How can electrum know when to stop generating addresses noting that it has no access to the blockchain since the servers are down.

**Tags:** wallet, electrum, deterministic-wallets


---

## 2 answers

### Answer by username_1 on 2015-07-11. Score: 1

Let's assume a [BIP-32](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) compliant HD wallet is also [BIP-39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) and [BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) compliant.

Let's next assume that when you first configured your BIP-39 compliant HD wallet it provided you the following set of words to be used to reconstitute your master seed: `small cereal crazy ahead move never galaxy draft draw plunge sort identify embark clerk hard wagon clever torch cruel income episode any debris puppy`. Additionally, let's also assume the wallet requested that you enter an additional BIP-39 related salted password that will be set to `I'mAbadASS` for discussion purposes.

A 512 bit root seed `m` could be obtained for the situation above by issuing the following bitcoin-explorer (bx) command:

`% echo "small cereal crazy ahead move never galaxy draft draw plunge sort identify embark clerk hard wagon clever torch cruel income episode any debris puppy" | bx mnemonic-to-seed -l en -p "I'mAbadASS"`
c64364d5a4175ff506620c3b788633063a2b3808579cd0f074503a365d283fc3a0bfb50d98f1293828e868e865054eff94261c206d35138689ce97efef9ada9c

BIP-44 compliant HD trees use the `m/purpose'/coin_type'/ account'/change/address_index` convention to derive private keys and associated addresses. Let's then assume the wallet only has one account 0. For the Bitcoin the coin\_type the private key tree would look like m/44'/0'/0'/c/i where c can be [0 or 1](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change) and i is an index used to synthesize the i-th extended private key, i-th extended public key or address.

m/44'/0'/0'/1/0 could then be synthesized as follows:

`% echo $root_seed | bx hd-new | bx hd-private -i 44 -d | bx hd-private -i 0 -d | bx hd-private -i 0 -d | bx hd-private -i 1 | bx hd-private -i 0`
xprvA3zHj8cyzFJiKAXiqdLqrdjUvMqdxUbrpSpDGfxHA15uk2j3fUknu2GN6rSYpPc3QDhALvLBNtKfNGQTLYLNFJD5FKnuFbDPRoBp5TAHFba

From the resulting extended private key (ext\_prv\_key) above, the corresponding public address and private key can be found.

`% echo $ext_prv_key | bx hd-to-address`  
1BLQ28VdYxJ4Y89fjpbNP5ihUvy2hMkGgq

Then determine if any funds have been sent to the address above by issuing `% bx fetch-balance 1BLQ28VdYxJ4Y89fjpbNP5ihUvy2hMkGgq` on a computer attached to the Internet or have a very fresh bitcoin-server full node server available for your bx on your private computer that is offline.

If funds are present, to obtain the private keys to import into another wallet try:

`% echo $ext_prv_key | bx hd-to-wif`  
L3KsdTwat69cMtLTJE4W2G77SgazLGqhzfvMkYQsuwMC96tr3Tj8

The `qrencode` command can receive the piped text output immediately above to synthesize a QR image for a smart cell phone or tablet based wallet to easily import from an offline key synthesis computer that retains a network air-gap.

`% echo $ext_prv_key | bx hd-to-wif | qrencode -o QRwif.png`

See [how-to-import-a-hd-wallet-from-an-extended-private-key](https://bitcoin.stackexchange.com/questions/37013/how-to-import-a-hd-wallet-from-an-extended-private-key) for more Electrum specific details.


---

### Answer by username_2 on 2015-01-11. Score: 0

I think it will assume all addresses are empty and generate just the "gap" number


---

