Bitcoin Forum
December 14, 2019, 06:23:18 PM *
News: Latest Bitcoin Core release: 0.19.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 [7] 8 9 »  All
  Print  
Author Topic: The Lightning Network FAQ  (Read 2564 times)
This is a self-moderated topic. If you do not want to be moderated by the person who started this topic, create a new topic. (3 posts by 3 users deleted.)
Khaos77
Member
**
Offline Offline

Activity: 350
Merit: 59

Flag Day ☺


View Profile
October 23, 2019, 02:48:14 PM
 #121

Lightning FAQ,

It can still lose funds.  Roll Eyes

https://themerkle.com/bitcoin-lightning-network-user-loses-us30000/

Quote
Bitcoin Lightning Network User Loses US$30,000

Quote
A recent Reddit thread confirmed how one Bitcoin Lightning Network user lost roughly 4 BTC due to a wrong course of action. More specifically, he had an open payment channel which he decided to force-close. This is a viable way of terminating a payment channel, yet users need to follow very specific procedures to ensure no funds are lost. It turned out the user forcefully closed the channels by using an older invalid state. As such, the funds in the channel – which is time-locked – can be taken by the other node in the channel if the user decides to do so.

1576347798
Hero Member
*
Offline Offline

Posts: 1576347798

View Profile Personal Message (Offline)

Ignore
1576347798
Reply with quote  #2

1576347798
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1576347798
Hero Member
*
Offline Offline

Posts: 1576347798

View Profile Personal Message (Offline)

Ignore
1576347798
Reply with quote  #2

1576347798
Report to moderator
1576347798
Hero Member
*
Offline Offline

Posts: 1576347798

View Profile Personal Message (Offline)

Ignore
1576347798
Reply with quote  #2

1576347798
Report to moderator
1576347798
Hero Member
*
Offline Offline

Posts: 1576347798

View Profile Personal Message (Offline)

Ignore
1576347798
Reply with quote  #2

1576347798
Report to moderator
samuel-sd
Member
**
Offline Offline

Activity: 84
Merit: 52


View Profile
October 23, 2019, 07:00:10 PM
Merited by LoyceV (4), BitCryptex (2), vapourminer (1)
 #122

Hi everybody, I set up a lightning node (CentOS + bitcoind + lnd + some scripts) and I have some question about configuring LND.
1. The port, which LND uses to listen to incoming connection is 9735. Is it tcp only port or tcp + udp?
2. The same question about watchtowers' port (9911)
3. How to securely backup offchain data? If something goes wrong with my node's software or hardware, how can I make sure if I have actual offchain data? I know that I will be punished for using outdated data even if I don't mean it. I found the channel.backup file but it's stored localy, what would I do if my ssd died?
4. I read about the watchtowers client, that it is supposed to "connect to backup encrypted justice transactions". I don't know what justice transactions are. Are they my offchain data or they are something else? Is watchtowers client help me to backup offchain data?


BitCryptex
Hero Member
*****
Online Online

Activity: 784
Merit: 1114


Write @BitCryptex or quote my post to notify me


View Profile WWW
October 23, 2019, 07:58:53 PM
Merited by vapourminer (1)
 #123

1. The port, which LND uses to listen to incoming connection is 9735. Is it tcp only port or tcp + udp?

TCP should be enough just like for a Bitcoin full node.

2. The same question about watchtowers' port (9911)

Same as above.

3. How to securely beckup offchain data? If something goes wrong with my node's software or hardware, how can I make sure if I have actual offchain data? I know that I will be punished for using outdated data even if I don't mean it. I found the channel.backup file but it's stored localy, what would I do if my ssd died?

There is no safe method of channel backup at the moment. It's much easier for private channels since they don't participate in payment routing. If you lose a backup and don't want to try using the old one, the only "solution" is to wait for the other party to close the channel.

4. I read about the watchtowers client, that it is supposed to "connect to backup encrypted justice transactions". I don't know what justice transactions are. Are they my offchain data or they are something else? Is watchtowers client help me to backup offchain data?

Watchtowers do not store any backups of your channel. They simply monitor the network in case the other party of your channel attempted to cheat by broadcasting an old state of the channel. They store and publish justice transactions when needed.

Every time a Lightning Network transaction is settled, a commitment transaction (a transaction which settles the current balance of the channel) is signed and the revocation key for the previous transaction is shared. The commitment transaction also states what happens if the other party revokes the transaction or if they don't do it in x blocks (x=144 by default). A justice transaction revokes the outdated commitment transaction.

samuel-sd
Member
**
Offline Offline

Activity: 84
Merit: 52


View Profile
October 24, 2019, 12:48:55 AM
Last edit: October 24, 2019, 04:33:54 PM by samuel-sd
Merited by vapourminer (1)
 #124

Thanks for the answer with the explanation!
There is no safe method of channel backup at the moment.
I googled about possibilities to organize an offchain backup. The developers say:

After version v0.6-beta of lnd, the daemon now ships with a new feature called Static Channel Backups (SCBs). We call these static as they only need to be obtained once: when the channel is created. From there on, a backup is good until the channel is closed. The backup contains all the information we need to initiate the Data Loss Protection (DLP) feature in the protocol, which ultimately leads to us recovering the funds from the channel on-chain. This is a foolproof safe backup mechanism.

We say safe, as care has been taken to ensure that there are no foot guns in this method of backing up channels, vs doing things like rsyncing or copying the channel.db file periodically. Those methods can be dangerous as one never knows if they have the latest state of a channel or not. Instead, we aim to provide a simple, safe method to allow users to recover the settled funds in their channels in the case of partial or complete data loss. The backups themselves are encrypted using a key derived from the user's seed, this way we protect privacy of the users channels in the back up state, and ensure that a random node can't attempt to import another user's channels.


Thus, we can assume that the backup file has always actual data about our channels. So, we just need to put it in a safe place. I am thinking of setting up an NFS server somewhere in a cloud. That way I can mount a remote directory on my LND node and backup the offchain data to it.
What do you think about this solution?
BitCryptex
Hero Member
*****
Online Online

Activity: 784
Merit: 1114


Write @BitCryptex or quote my post to notify me


View Profile WWW
October 24, 2019, 05:51:35 AM
 #125

-snip

I totally forgot about this method, sorry! Since SCBs make use of a feature built into the protocol, they should be reliable. Personally, I have never had a chance to restore my node from such a backup. Once the DLP is initiated, the remote node sends the latest commitment transaction and forcefully closes the channel. The only problem with your proposal is that your NFS backup might become invalid anytime unless you stop participating in the payment routing. How often would you backup the file? Every time it was modified?

samuel-sd
Member
**
Offline Offline

Activity: 84
Merit: 52


View Profile
October 24, 2019, 05:17:57 PM
Merited by BitCryptex (2)
 #126

Once the DLP is initiated, the remote node sends the latest commitment transaction and forcefully closes the channel.
I'm sorry, what is DLP?

Quote
The only problem with your proposal is that your NFS backup might become invalid anytime unless you stop participating in the payment routing. How often would you backup the file? Every time it was modified?
You did not get the idea; let me clarify.
I mounted a remote directory to my local directory /mnt/nfsstorage. So, everything I put in there ends up on my NFS server (in amazon cloud). Then I added the backup file path in the lnd.conf file (backupfilepath=/mnt/nfsstorage/lndbackup/channel.backup). The lnd service keeps channel.backup updated constantly. Thus, I do not need to copy anything; the backup file will be updated by lnd directly on the cloud server.

The only problem I might have is with connection to the cloud server. However, the NFS protocol allows to automatically reconnect to a server if the previous connection was interrupted (that's what manual says Smiley.
I installed the NFS server yesterday, It seems to be working fine.

PS I would have gladly put everything on a cloud if I had not needed to store the entire blockchain there. Keeping 300Gb on a cloud server is quite expensive.
BitCryptex
Hero Member
*****
Online Online

Activity: 784
Merit: 1114


Write @BitCryptex or quote my post to notify me


View Profile WWW
October 24, 2019, 05:33:24 PM
Merited by fillippone (1)
 #127

I'm sorry, what is DLP?

Data Loss Protection, it was mentioned in the LND v0.6 changelog which you quoted.

PS I would have gladly put everything on a cloud if I had not needed to store the entire blockchain there. Keeping 300Gb on a cloud server is quite expensive.

Actually, you don't have to run a full Bitcoin node if you are using LND! LND supports neutrino which lets you interact with the blockchain using third-party nodes. Keep in mind that it's still experimental but it's been vastly improved since it was released. You might give it a try. Thanks for clarifying your previous message.

samuel-sd
Member
**
Offline Offline

Activity: 84
Merit: 52


View Profile
October 24, 2019, 08:39:33 PM
 #128

Actually, you don't have to run a full Bitcoin node if you are using LND! LND supports neutrino which lets you interact with the blockchain using third-party nodes. Keep in mind that it's still experimental but it's been vastly improved since it was released. You might give it a try. Thanks for clarifying your previous message.
I thought about it, I really did, but

lnd.conf

[neutrino]
; Connect only to the specified peers at startup. This creates a persistent
; connection to a target peer. This is recommended as there aren't many
; neutrino compliant full nodes
on the test network yet.
; neutrino.connect=


So, LND needs a full node and I can specify the only one of them. What happens to my LND node if that neutrino node stops working? It would be much more convenient if I did not need to specify a node. I wish it could find a compliant full node on the network itself and connect to it. Smiley Like torrent clients do.

One more question about tor nodes. I often see in logs that my node fails to connect to nodes with tor addresses (*.onion). Do I need to choose between Tor and the regular Internet or I can install tor and connect to both of them?
rdbase
Sr. Member
****
Online Online

Activity: 1260
Merit: 316


bustadice.com


View Profile
October 24, 2019, 08:58:22 PM
Last edit: October 24, 2019, 09:23:13 PM by rdbase
 #129

How was it even possible to lose bitcoin using this network?
This user reported they lost 4btc using lightning. https://bitcointalk.org/index.php?topic=5195729.msg52855065
Wasnt it created inorder to not being susceptible for such things to happen? Undecided

bustadice         ▄▄████████████▄▄
     ▄▄████████▀▀▀▀████████▄▄
   ▄███████████    ███████████▄
  █████    ████▄▄▄▄████    █████
 ██████    ████████▀▀██    ██████
██████████████████   █████████████
█████████████████▌  ▐█████████████
███    ██████████   ███████    ███
███    ████████▀   ▐███████    ███
██████████████      ██████████████
██████████████      ██████████████
 ██████████████▄▄▄▄██████████████
  ▀████████████████████████████▀
                     ▄▄███████▄▄
                  ▄███████████████▄
   ███████████  ▄████▀▀       ▀▀████▄
               ████▀      ██     ▀████
 ███████████  ████        ██       ████
             ████         ██        ████
███████████  ████     ▄▄▄▄██        ████
             ████     ▀▀▀▀▀▀        ████
 ███████████  ████                 ████
               ████▄             ▄████
   ███████████  ▀████▄▄       ▄▄████▀
                  ▀███████████████▀
                     ▀▀███████▀▀
           ▄██▄
           ████
            ██
            ▀▀
 ▄██████████████████████▄
██████▀▀██████████▀▀██████
█████    ████████    █████
█████▄  ▄████████▄  ▄█████
██████████████████████████
██████████████████████████
    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
       ████████████
[bustadice.
Play
bustadice]
d5000
Legendary
*
Offline Offline

Activity: 2296
Merit: 1623


Decentralization Maximalist


View Profile
October 24, 2019, 09:32:50 PM
 #130

set up that private Lightning network, and keep it very exclusive to people within a given area. The crucial part would be: don't use it, except in outage situations. Use uptime of the general internet to store BTC in the private network, but use the regular Lightning network for everyday payments while internet remains up.
Thanks for the suggestion. If a mesh network can be established in the region, then this can be a good solution, but it would also be more suitable for urban areas (in most places of Venezuela, however, it should work). As far as I understand the LN architecture, that "private network" would use the same channels (i.e. the same multisig channel opening transactions) than the "real LN", only that the "communication layer" would change, so no additional on-chain TX would be necessary which is the important feature we are seeking ... (correct me if I'm wrong)

@rdbase: Seems to be the same case like the one Khaos77 mentioned, the user simply broadcasted the wrong transaction to close the channel. I would strongly favour to not discuss this topic here as it's the user's fault (it's possible however that the LN software could have been designed to prevent this).

Carlton Banks
Legendary
*
Offline Offline

Activity: 2576
Merit: 2118



View Profile
October 24, 2019, 09:35:08 PM
Last edit: October 24, 2019, 09:53:09 PM by Carlton Banks
Merited by fillippone (1)
 #131

How was it even possible to lose bitcoin using this network?

they didn't know the risks, and screwed up trying to close a channel using an outdated transaction (i.e. an old channel state)


This user reported they lost 4btc using lightning. https://bitcointalk.org/index.php?topic=5195729.msg52855065

yep, that was too risky considering they didn't close their channel competently. Every time you send a large amount of money anywhere, on any system, you should be triple-sure you know what you're doing.


Wasnt it created inorder to not being susceptible for such things to happen? Undecided

nope.

You're probably thinking of the eltoo form of Lightning, which avoids this problem. You cannot make that mistake using eltoo, but it's a long way off (new opcode required, and the details are still being debated, in an already long debate)

Vires in numeris
Carlton Banks
Legendary
*
Offline Offline

Activity: 2576
Merit: 2118



View Profile
October 25, 2019, 12:29:34 AM
 #132

As far as I understand the LN architecture, that "private network" would use the same channels (i.e. the same multisig channel opening transactions) than the "real LN", only that the "communication layer" would change, so no additional on-chain TX would be necessary which is the important feature we are seeking ... (correct me if I'm wrong)

yes, you commit the channel states onchain, but do not connect to nodes on the "main" Lightning network (and so you don't announce your channels on the main network either). Of course, the opening tx's are can only be created using the public internet, but then your alternative Lightning network can be set up on a completely private network (and that comes with all the liquidity and trust trade-offs as mentioned before)

Connecting to the main Lightning network today is like a trip back to the 1990's; you look up a list of LN node IP addresses on a listing site, connect to one, it tells you the current (entire) channel map, then you start making channels at your discretion using the current map. There's absolutely nothing stopping you getting together with a bunch of other people and starting an alternative LN network from scratch, you just need LN nodes and each others IP addresses.

Vires in numeris
samuel-sd
Member
**
Offline Offline

Activity: 84
Merit: 52


View Profile
November 04, 2019, 07:21:22 PM
 #133

Hi, I have been working on a project where I need to run lots of lnd services on a single machine (physical or virtual, does not matter). In theory, it seems easy, I created a directory structure for each node with its own conf file, tcp ports and so on. It was not difficult and I started 16 nodes for a test on a single VM machine. (CentOS 7)
After starting them, each node begins to update network graph (file channel.db in /data/graph/mainnet); this process is quite long and CPU consuming. After the graph is updated, an lnd service is supposed to go into idle mode with low cpu usage. In reality, this happens but not for a long time. At first, CPU usage stays low but only for a couple of hours, then all services one by one started loading CPU heavily with no reason. The lnd services will not stop doing that until I restart them, then everything happens all over again. One interesting thing is that the bitcoind service does not use almost any CPU resourses; it means that lnd services do not use bitcoind, when they load CPU. I could not find anything unusual in the lnd logs, everything seems normal.
I don't understand what's going on and ho to fix it. My host's hardware should be enought for the purpose (Core i3-3.8Ghz/16Gb RAM/SSD) Maybe somenody has already come accross with this issue. I fould the similar issue on the lnd's github page but there is no solution there.
https://github.com/lightningnetwork/lnd/issues/3370
I am interested to listen to everyone who has any thoughts about it or solutions how to fix it.
Carlton Banks
Legendary
*
Offline Offline

Activity: 2576
Merit: 2118



View Profile
November 04, 2019, 07:52:31 PM
Last edit: November 05, 2019, 01:15:41 PM by Carlton Banks
 #134

After the graph is updated, an lnd service is supposed to go into idle mode with low cpu usage. In reality, this happens but not for a long time. At first, CPU usage stays low but only for a couple of hours, then all services one by one started loading CPU heavily with no reason. The lnd services will not stop doing that until I restart them, then everything happens all over again. One interesting thing is that the bitcoind service does not use almost any CPU resourses; it means that lnd services do not use bitcoind, when they load CPU. I could not find anything unusual in the lnd logs, everything seems normal.

as you've seen, this is a known bug in lnd, for which there is currently no fix. I don't know if this is affecting arm64 builds (RasPi nodes are arm64), but if so this is pretty bad news, as most people are opt for lnd because the daemon is provided as a pre-built package (LL have been good in that respect, there are alot of OS's and platforms supported with builds and prebuilt binaries, don't know if that's because golang makes that easy, I suspect so)

try using c-lightning as the fix Cheesy lnd has other resource usage issues right now (uses alot of RAM), if you're running multiple nodes I would guess resource usage per-daemon could be important to you. FWIW, I'm running c-lightning on a Raspberry Pi 3B+ (1GB RAM) with a handful of channels, so no problems on low resource devices. That's not to say that c-lightning is perfect (they've been wrangling bugs too), but resource usage has not been an issue. You'll need to sync the channel map as with lnd, but maybe you'll appreciate that you can use PostgreSql with the db seeing as you're doing something that sounds demanding Smiley

Vires in numeris
samuel-sd
Member
**
Offline Offline

Activity: 84
Merit: 52


View Profile
November 04, 2019, 08:03:56 PM
 #135

if you're running multiple nodes I would guess resource usage per-daemon could be important to you.
You are damn right! 400Mb of RAM is a lot for a single lnd process with no channels at all.

Quote
FWIW, I'm running c-lightning on a Raspberry Pi 3B+ (1GB RAM) with a handful of channels, so no problems on low resource devices.
Tell me about c-lightning service, how reliable and stable it is? How much memory does it need?

PS I have spent so much time on lnd, automation, scripting and so on, and now I came across the bug that pushes me to use something else. Sad
darosior
Full Member
***
Offline Offline

Activity: 210
Merit: 257



View Profile WWW
November 04, 2019, 09:30:52 PM
Merited by LoyceV (1)
 #136

if you're running multiple nodes I would guess resource usage per-daemon could be important to you.
You are damn right! 400Mb of RAM is a lot for a single lnd process with no channels at all.

Quote
FWIW, I'm running c-lightning on a Raspberry Pi 3B+ (1GB RAM) with a handful of channels, so no problems on low resource devices.
Tell me about c-lightning service, how reliable and stable it is? How much memory does it need?

PS I have spent so much time on lnd, automation, scripting and so on, and now I came across the bug that pushes me to use something else. Sad
*Shilling mode on*
How reliable ==> releases are quite stable, but it depends of how much you tweak it with plugins  Wink
How much memory ==> just checked, with around 10-15 channels and more than 300 connections (yeah I'm doing test atm..) it does not use more than 10% of the 2GB of my node. Idle mode, might of course be higher when computing routes (I think that's the more usage incentive thing).

Anyway C-lightning aims at being as minimal (all non-vital things as plugins) and economic as possible : for example Rusty did a lot of performance improvements for last releases (tests are done on a RPi to use the less powerful hardware as possible), and a lot of bandwidth improvements for this one (v0.7.3) (gossip).
*Shilling mode off*

Carlton Banks
Legendary
*
Offline Offline

Activity: 2576
Merit: 2118



View Profile
November 04, 2019, 10:59:16 PM
Last edit: November 05, 2019, 10:30:59 AM by Carlton Banks
Merited by fillippone (1)
 #137

An arguable downside to c-lightning IMO is the lack of available builds (I imagine the devs want to make them reproducible before doing that). That's what's strange about lnd; they're releasing a product that's more like an alpha release than a beta release, yet they're distributing binaries of that alpha-ish product. As I said, I think golang makes this a little too easy to do, and so the LL people are running before they can walk.

Other downsides might be features... lnd probably has more features than c-lightning, but I think they're pretty close as far as the actual spec of the Lightning protocol goes (it seems c-lightning & lnd teams are coordinating development pretty closely along with the ACINQ team doing Zap/Eclair, although I know even less about their clients). But if you look at the work on efficient routing algorithms, it seems as though c-lightning might get ahead of lnd soon, according to what their development priorities seem to be recently. Also, c-lightning has the plugin system that Darosior mentions, I don't know enough to say whether there are not some available plugins that do things lnd can't.

overall, I get the impression c-lightning is in a better state of production-readiness than lnd, despite any lack of extra features (and I might be getting that part wrong).

Vires in numeris
samuel-sd
Member
**
Offline Offline

Activity: 84
Merit: 52


View Profile
November 04, 2019, 11:31:06 PM
 #138

Thanks guys! I will give c-lightning a shot.
darosior
Full Member
***
Offline Offline

Activity: 210
Merit: 257



View Profile WWW
November 05, 2019, 10:44:11 AM
 #139

An arguable downside to c-lightning IMO is the lack of available builds (I imagine the devs want to make them reproducible before doing that).
Being in C (a lot of functionalities used are low level and system dependant, e.g. daemons interop) , I think we'll ever only have builds for POSIX systems.

Other downsides might be features... lnd probably has more features than c-lightning, but I think they're pretty close as far as the actual spec of the Lightning protocol goes (it seems c-lightning & lnd teams are coordinating development pretty closely along with the ACINQ team doing Zap/Eclair, although I know even less about their clients).
Hmmm I'm not sure ? What feature would you like to see on C-lightning ?

But if you look at the work on efficient routing algorithms, it seems as though c-lightning might get ahead of lnd soon, according to what their development priorities seem to be recently. Also, c-lightning has the plugin system that Darosior mentions, I don't know enough to say whether there are not some available plugins that do things lnd can't.
Development priorities are actually on dual funding and v1.1 spec (new invoices, AMP, etc..).
An example of a plugin doing JIT routing (i.e. rebalancing channels if needed while forwarding an HTLC) : https://github.com/lightningd/plugins/pull/66.
About LND pathfinding algorithm, I don't know much. I know however that they implemented scoring...

samuel-sd
Member
**
Offline Offline

Activity: 84
Merit: 52


View Profile
November 05, 2019, 09:37:57 PM
 #140

Hi everybody!
Finally, I installed c-lightning, it uses about 22Mb of RAM and does not load CPU at all, everything looks good.
As far as I got it, c-lightning creates a wallet inside lightningd.sqlite3 file and there is a file hsm_secret, which is some kind of key, right?

So, the first question is how to backup onchain and offchain data? Before I start using it, I need to setup backups. It was quite clear with c-lightning, it gives me mnemonic key and has a backup file with all channel information. What about c-lightning?
Pages: « 1 2 3 4 5 6 [7] 8 9 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!