Running Lightning in Prune Mode with LND: A Guide
As a Lightning network (LN) user running on a full node, you’re probably aware of the limitations imposed by traditional Bitcoin-based nodes. One of these limitations is pruning, which significantly reduces the complexity and costs associated with validating transactions. In this article, we’ll explore how to run Lightning in prune mode using the LND implementation.
What is Prune Mode?
Prune mode, also known as “pruning”, is a technique used to reduce the amount of data that needs to be stored on a node, making it more efficient and cost-effective. By pruning transactions, nodes can skip redundant or unnecessary data, such as transaction IDs, block hashes, and fees. This approach allows for faster validation times, lower maintenance costs, and improved security.
LND Prune Mode
LND is a popular Lightning network implementation that supports prune mode out of the box. In fact, LND was designed with pruning in mind from the outset. To run LND in prune mode, follow these steps:
- Update your Node: Ensure you’re running the latest version of LND. You can check for updates by visiting the [LND GitHub page]( and following the instructions for updating the node software.
- Create a New Wallet
: Create a new wallet using the
--prune
flag when installing LND. This will allow you to specify the prune mode when creating your wallet.
Example Usage
Here’s an example of how to create a new wallet with LND in prune mode:
lnd --wallet-dir ./lightning-wallet-prune --prune 1000000 --prune-type=block --prune-fee 2.5
In this command:
--wallet-dir
specifies the directory where you want to create your wallet.
--prune
enables prune mode and sets a maximum number of transactions to be stored (in this case, 1 million).
--prune-type=block
specifies that only block-level data should be pruned.
--prune-fee
is the fee in satoshis per transaction that LND will charge when validating transactions.
Pruning with a Full Node
To prune all Lightning channels on your full node, you can use the following command:
lnd --wallet-dir ./lightning-wallet-prune --prune 1000000 --prune-type=channel
This command will remove all channel-level data from your full node.
Conclusion
Running Lightning in prune mode with LND is a powerful way to optimize your network’s performance and reduce costs. By following these steps, you can easily enable prune mode when creating new wallets or modifying existing ones. Remember to consult the [LND documentation]( for more information on LND-specific commands and options.
Tips and Variations
- To prune data from a specific wallet directory, use the
--wallet-dir
option with the prune flag.
- You can also specify a custom prune threshold using the
--prune-threshold
option. For example:lnd --wallet-dir ./lightning-wallet-prune --prune 50000 --prune-type=channel
- To disable pruning for specific transactions, use the
--tx-included
flag with the prune type. For example:lnd --wallet-dir ./lightning-wallet-prune --prune 1000000 --tx-included block
By following these guidelines and experimenting with different options, you can efficiently run Lightning on your LND implementation and enjoy improved network performance.