<p>There's also a PR that will make this officially supported: <a href="https://github.com/lightningnetwork/lnd/pull/4717" rel="nofollow noreferrer">https://github.com/lightningnetwork/lnd/pull/4717</a></p>

CC BY-SA 4.0
2021-08-19T09:06:43.803Z
2021-08-19T09:06:43.803Z
guggero
<p>It turns out that the recovery from old wallet.db (or its master private key extracted by chantools) and recent channel.backup, without the seed, is indeed possible, even though there's no way to initiate it with the &quot;official&quot; lnd.</p>
<p>I've applied a quick dirty patch to lnd sources, as follows:</p>
<ul>
<li><p>in walletunlocker/service.go, if a mnemonic's first word is &quot;xprv&quot;, don't go through ToCipherSeed; create an aezeed.CipherSeed with all-zero Entropy and some sensible Birthday (either hardcode or specify as the mnemonic's second word)</p>
</li>
<li><p>in lnd dependency github.com/btcsuite/btcutil/hdkeychain/extendedkey.go, patch NewMaster so it checks for all-zero seed[], and in this case, falls back to NewKeyFromString(&lt;hardcoded xprv, or os.Getenv, or reading a file...&gt;).</p>
</li>
</ul>
<p>Build lnd, run &quot;lncli create&quot; and pretend to have a seed phrase, entering &quot;xprv 3500 lorem ipsum dolor &lt;up to 24 words&gt;&quot;.</p>
<p>Both block scan and static channel backup recovery than succeed.</p>

CC BY-SA 4.0
2021-07-23T04:31:39.463Z
2021-07-23T04:31:39.463Z
Anton Kovalenko
<p>Suppose I have an obsolete copy of lnd database (with unlock password), and an up-to-date static channel backup, but I don't have seed words to attempt normal lnd recovery. I can, however, retrieve wallet xprv with chantools, so on-chain funds are safe.</p>
<p>What can I do to make lnd start recovering off-chain funds with DLP, as if I entered the seed and provided started channel backup during wallet creation? I believe it should be possible because all needed information is there.</p>
<p>What if I do abandonchannel on each channel while lnd is not connected to any peers, then load static channel backup (is it even possible?)</p>
<p>If it's not possible with lnd+lncli as they are, I'd be grateful for directions on how/where should I patch lnd, or how should I tinker with wallet.db to make it possible, etc.. My node is just fine, but having no backup of seed words I have to plan for the future.</p>

<lightning-network><lightning-network-daemon>
lnd recovery with no seed, but with xprv
Anton Kovalenko
# lnd recovery with no seed, but with xprv

(Asked by: username_0 on 2021-07-10)

Suppose I have an obsolete copy of lnd database (with unlock password), and an up-to-date static channel backup, but I don't have seed words to attempt normal lnd recovery. I can, however, retrieve wallet xprv with chantools, so on-chain funds are safe.

What can I do to make lnd start recovering off-chain funds with DLP, as if I entered the seed and provided started channel backup during wallet creation? I believe it should be possible because all needed information is there.

What if I do abandonchannel on each channel while lnd is not connected to any peers, then load static channel backup (is it even possible?)

If it's not possible with lnd+lncli as they are, I'd be grateful for directions on how/where should I patch lnd, or how should I tinker with wallet.db to make it possible, etc.. My node is just fine, but having no backup of seed words I have to plan for the future.

**Tags:** lightning-network, lightning-network-daemon


---

## 2 answers

### Answer by username_1 on 2021-08-19. Score: 0 | Accepted answer

There's also a PR that will make this officially supported: <https://github.com/lightningnetwork/lnd/pull/4717>


---

### Answer by username_0 on 2021-07-23. Score: 0

It turns out that the recovery from old wallet.db (or its master private key extracted by chantools) and recent channel.backup, without the seed, is indeed possible, even though there's no way to initiate it with the "official" lnd.

I've applied a quick dirty patch to lnd sources, as follows:

* in walletunlocker/service.go, if a mnemonic's first word is "xprv", don't go through ToCipherSeed; create an aezeed.CipherSeed with all-zero Entropy and some sensible Birthday (either hardcode or specify as the mnemonic's second word)
* in lnd dependency github.com/btcsuite/btcutil/hdkeychain/extendedkey.go, patch NewMaster so it checks for all-zero seed[], and in this case, falls back to NewKeyFromString(<hardcoded xprv, or os.Getenv, or reading a file...>).

Build lnd, run "lncli create" and pretend to have a seed phrase, entering "xprv 3500 lorem ipsum dolor <up to 24 words>".

Both block scan and static channel backup recovery than succeed.


---

