Running lightning in prune mode

7

I am running lightning with the LND implementation and a full node. Nevertheless, I heard that it is possible to use Lighting in pruned mode.

How is this possible?

  1. I read in the LND install documentation that you need the -txindex flag:

In order to run lnd with a bitcoind back-end, the bitcoind instance must be configured with --txindex just like btcd above.

  1. In the Wikipage of Bitcoin it says for pruned mode:

This mode is incompatible with -txindex

I also read here and here the same arguments.

Is this outdated or is it not possible to use prune mode in lightning?

dvg

Posted 2019-01-13T16:39:40.557

Reputation: 95

Answers

1

You are correct in that you cannot run a LND node with a pruned bitcoind server.

Pruning isn't compatible with transaction indexing because the index would point to transactions which have been pruned (no longer in store).

Each lightning node requires transaction indexing, because it will be looking for specific txid's on-chain throughout the lifetime of the payment channel.

Broadcast and confirmation of:

  • Funding transaction
  • Commitment transactions in a unilateral close
  • Closing transaction

The only way to determine whether any of the transactions above have been confirmed, is to query an up-to-date transaction index of the strong chain, which is not possible with a pruned node.

Lightning nodes also subscribe to the ZeroMQ subscription service of the bitcoind node, but this only tells the node about newly broadcast transactions accepted by in the mempool, not whether they have been confirmed yet.

James C.

Posted 2019-01-13T16:39:40.557

Reputation: 2 183

I've not tried it, but what happens when I start a lightning node in pruned mode in practice?dvg 2019-01-13T18:36:28.570

The lightning node will not be able to query bitcoind for transactions (by txid).James C. 2019-01-13T19:38:46.410

When would I get aware of this?dvg 2019-01-13T19:54:18.470

I dont know, the lnd node will through an error, I dont know exactly how the error msg will look like.James C. 2019-01-13T20:13:34.827

Ok, thx for response!dvg 2019-01-13T20:41:00.423

I keep getting conflicting information about this topic. Here it says that LND will just be slower, but it will still work: https://medium.com/lightning-power-users/284bd5034340 Which one is true?

Dmitry Laptev 2019-01-23T12:44:44.183

I researched the issue a bit more. The answer from James C. is correct when working with older versions of Bitcoin Core. 0.16 supports txindex in pruned mode.Dmitry Laptev 2019-01-25T09:39:09.187

5

It is possible to run Lightning (both LND and c-lightning) with bitcoind pruned mode.

There is a lot of conflicting information online, because it became possible only recently in Bitcoin Core 0.16.0. The change that enabled txid lookups in pruned mode is BIP159.

There are already packages turning the pruned mode on when disk space is limited: Lightning Power Node Launcher (works with LND) and BTCPayServer docker (works with c-lightnig).

Dmitry Laptev

Posted 2019-01-13T16:39:40.557

Reputation: 436