0

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.

0

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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.