You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lightning-network-tools/lnd/disaster-recovery.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Once invoked, your node will ask your peers to send you their latest commitment
24
24
25
25
* The most recent channel database
26
26
27
-
The `channel.db` file can be found in `.lnd/data/graph/mainnet` and contains all information about your channels, including your latest commitment transaction. Invoking this file as part of your recovery process can be risky if the channel.db is not up to date. Only use this file if you were able to recover it directly from your [crashed node](safety.md).
27
+
The `channel.db` file can be found in `.lnd/data/graph/mainnet` and contains all information about your channels, including your latest commitment transaction. Invoking this file as part of your recovery process can be risky if the channel.db is not up to date. Only use this file if you were able to recover it directly from your crashed node.
28
28
29
29
* Information about your channels from third parties
Copy file name to clipboardExpand all lines: lightning-network-tools/lnd/macaroons.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -180,7 +180,7 @@ Examples:
180
180
181
181
## Actions and RPC permissions
182
182
183
-
Macaroons in LND may refer to one of seven actions: `onchain`, `address`, `message`, `peers`, `offchain`, `info`, `invoices` and `macaroon`. These actions encompass the following RPC services:
183
+
Macaroons in LND may refer to one of seven actions: `onchain`, `address`, `message`, `peers`, `offchain`, `info`, `invoices` and `macaroon`. These [actions encompass](https://github.com/lightningnetwork/lnd/blob/master/rpcserver.go#L263) the following RPC services:
Copy file name to clipboardExpand all lines: lightning-network-tools/lnd/recovery-planning-for-failure.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
description: '"That''s planning for failure, Morty. Even dumber than regular planning."'
3
3
---
4
4
5
-
# Recovery: Planning for failure
5
+
# Recovery: Planning for Failure
6
6
7
7
In order to achieve near-instant and cheap Bitcoin payments, the Lightning Network makes some tradeoffs in comparison to the Bitcoin base layer. One of those tradeoffs is that its security model is more complex. 
8
8
@@ -24,7 +24,7 @@ If you decide to deploy your Lightning node in the cloud, choose a reputable pro
24
24
25
25
**If your Lightning node is going to run on a device you physically control, invest in a high-quality SSD and consider setting up RAID.**
26
26
27
-
\[[Also read: Operational safety](safety.md)]
27
+
[Also read: Secure Your Lightning Network Node](secure-your-lightning-network-node.md)
Copy file name to clipboardExpand all lines: lightning-network-tools/lnd/secure-your-lightning-network-node.md
+13-8
Original file line number
Diff line number
Diff line change
@@ -36,18 +36,27 @@ How you update your LND will depend on how you installed it. You may for example
36
36
37
37
## Your wallet <ahref="#docs-internal-guid-4d50a2e2-7fff-6a56-4160-813804306ee7"id="docs-internal-guid-4d50a2e2-7fff-6a56-4160-813804306ee7"></a>
38
38
39
-
When creating your wallet with `lncli create`, you are given a 24 word long seed phrase. This seed phrase can be used to recover your on-chain Bitcoin, meaning that if it falls into the wrong hands your bitcoin are at risk of being taken. Similarly, if you are not in possession of this seed phrase yourself, you may not be able to regain control over your funds in the event of an error.
39
+
When creating your wallet with `lncli create`, you are given a 24 word long "aezeed" seed phrase. Similar to a BIP39 seed phrase, it can be used to recover your on-chain Bitcoin, meaning that if it falls into the wrong hands your bitcoin are at risk of being taken. Similarly, if you are not in possession of this seed phrase yourself, you may not be able to regain control over your funds in the event of an error.
40
40
41
41
You may write your seed phrase, in its correct order, on a piece of paper and store it somewhere securely. Alternatively, you may store it in encrypted storage elsewhere, such as your password manager.
42
42
43
+
Never run two separate LND nodes with the same seed!
44
+
45
+
Your private key is contained in your node's `wallet.db`. This wallet database and the macaroon database are encrypted with the password chosen when initializing the wallet using `lncli create`. If you lose your wallet password, you may recreate the wallet and macaroon database using the seed.
46
+
47
+
## Your macaroons
48
+
49
+
Your node uses macaroons to authenticate API calls, including from `lncli`. Make sure your macaroons can only be accessed by authorized applications. To invalidate a macaroon, it is not enough to delete it. Instead, the `macaroons.db` has to be deleted in its entirety. A specific macaroon can be invalidated using `lncli deletemacaroonid` and its macaroon ID.
50
+
43
51
## Your channels <ahref="#docs-internal-guid-8725c728-7fff-9b34-f746-fcdc7a49c5e5"id="docs-internal-guid-8725c728-7fff-9b34-f746-fcdc7a49c5e5"></a>
44
52
45
53
In the event that your hard drive becomes corrupted or the entire device destroyed or deleted, you may recover your on-chain funds using the seed phrase above. Your channels however can’t be backed up directly, though a mechanism exists to recover them separately from your on-chain funds.
46
54
47
-
You can find your channel backups in the file `<lnddir>/data/chain/bitcoin/mainnet/channel.backup`
55
+
You can typically find your channel backups in the file `~/.lnd/data/chain/bitcoin/mainnet/channel.backup`
48
56
49
-
This file is changed every time a channel is opened or closed. You may set up a script that [backs up this file whenever it is changed](https://gist.github.com/alexbosworth/2c5e185aedbdac45a03655b709e255a3), or copy it manually. It is necessary to back up this file whenever a new channel has been opened.\
50
-
For backup purposes the channel.db file is not suitable for such backups. Keeping an up-to-date backup of this file is close to impossible, and you may lose your funds when recovering from an outdated `channel.db` file. This file can only be used when migrating your node, not when restoring.
57
+
This file is changed every time a channel is opened or closed. You may set up a script that [backs up this file whenever it is changed](https://gist.github.com/alexbosworth/2c5e185aedbdac45a03655b709e255a3), or copy it manually. It is necessary to back up this file whenever a new channel has been opened. Invoking the `channel.backup` initiates a force close by your remote peers.
58
+
59
+
The `channel.db` file is not suitable for backups. Keeping an up-to-date backup of this file is close to impossible, and you may lose your funds when recovering from an outdated `channel.db` file. This file can only be used when migrating your node, not when restoring.
@@ -62,14 +71,10 @@ When operating your node, it is important to note that you not interrupt lncli c
62
71
63
72
To safely shut down your Lightning Node, use the command `lncli stop`
64
73
65
-
It is not recommended to prune your Bitcoin node, especially not for transactions occurring after the activation of Segwit, August 2017. 
66
-
67
74
## Your external applications <ahref="#docs-internal-guid-fb6b5911-7fff-e340-f874-86a51944a08c"id="docs-internal-guid-fb6b5911-7fff-e340-f874-86a51944a08c"></a>
68
75
69
76
LND uses macaroons to authenticate external applications. These may be applications running on the same machine as LND or externally.
70
77
71
78
By default you will see the `admin.macaroon`, `invoice.macaroon`, `readonly.macaroon` and `router.macaroon` files in your `<lnddir>/data/chain/bitcoin/mainnet/` directory. They each have their own permissions, and you may create your own macaroons with specific purposes. Only share these macaroons with applications on devices you trust.
72
79
73
80
To recreate macaroons you may delete all of the macaroon files and restart LND. However, this will NOT invalidate old macaroons. To invalidate old macaroons, you will have to delete the `macaroon.db` file as well before restarting LND.
74
-
75
-
[See also our guide on Operational Safety.](safety.md)
0 commit comments