Bitcoin Forum
December 12, 2019, 04:11:29 AM *
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 2501 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.)
darosior
Full Member
***
Offline Offline

Activity: 209
Merit: 256



View Profile WWW
November 05, 2019, 10:59:29 PM
Merited by samuel-sd (1)
 #141

Hello Samuel,

I'm glad that you are pleased with C-lightning  Smiley

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?

In the `hsm_secret` is stored the seed used to derive all keys (channels and onchain ones). You can consider it as the HD wallet seed.
In the `lightningd.sqlite3` (also available as a postgresql backend) is notably stored the channels state (aside a lot of other things !).

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?
You can backup your onchain funds just by backing up the (potentially encrypted) `hsm_secret`.
You could backup your `lightningd.sqlite3` but it changes often (very often) and you should be very careful with restoring from backups.

For what it worth, efforts are being made for real-time database replication through plugins (some have been proposed) but it's harder than it seems and we have not yet found a satisfiable enough solution.

In order to get the maximum amount of activity points possible, you just need to post once per day on average. Skipping days is OK as long as you maintain the average.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1576123889
Hero Member
*
Offline Offline

Posts: 1576123889

View Profile Personal Message (Offline)

Ignore
1576123889
Reply with quote  #2

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

Activity: 84
Merit: 52


View Profile
November 05, 2019, 11:48:08 PM
 #142

You can backup your onchain funds just by backing up the (potentially encrypted) `hsm_secret`.
Ok, that's clear.

Quote
You could backup your `lightningd.sqlite3` but it changes often (very often) and you should be very careful with restoring from backups.
Is there anything like lnd backup? An independent backup file, which changes every time when channels' balance changes.

Quote
For what it worth, efforts are being made for real-time database replication through plugins (some have been proposed) but it's harder than it seems and we have not yet found a satisfiable enough solution.
Are these plugins available somewhere? What do you use?
darosior
Full Member
***
Offline Offline

Activity: 209
Merit: 256



View Profile WWW
November 06, 2019, 10:57:02 AM
 #143

You can backup your onchain funds just by backing up the (potentially encrypted) `hsm_secret`.
Ok, that's clear.

Quote
You could backup your `lightningd.sqlite3` but it changes often (very often) and you should be very careful with restoring from backups.
Is there anything like lnd backup? An independent backup file, which changes every time when channels' balance changes.
Hmm that's `lightningd.sqlite3`.. I don't think there is much sense in having another file which is updated at the same time `lightningd.sqlite3` is updated and that contains the same informations.

For what it worth, efforts are being made for real-time database replication through plugins (some have been proposed) but it's harder than it seems and we have not yet found a satisfiable enough solution.
Are these plugins available somewhere?
You have a lot of plugins here, the plugin I had specifically in mind is this one by SimonVrouwe which you should not use because the database structure changed since.

What do you use?
In terms of plugins or safeguards ?
For plugins I use:
- summary
- rebalance
- drain
- probe
- reckless
- and soon the JIT routing one

For safeguard I use:
- ..................  Grin

No more seriously I have some hacky and nasty scripts for my database but I think the change has to come from the protocol. For example we now have (and I'm working on making C-lightning default to this) `option_static_remotekey` which allows you to recover your funds after the remote side unilateral close just with you hsm_secret (related but I made a mistake I have a tool for fund recovery which I plan to clean up and re-PR when we default to this).

samuel-sd
Member
**
Offline Offline

Activity: 84
Merit: 52


View Profile
November 06, 2019, 07:21:56 PM
 #144

Hmm that's `lightningd.sqlite3`.. I don't think there is much sense in having another file which is updated at the same time `lightningd.sqlite3` is updated and that contains the same informations.
In this case I can have one lightningd.sqlite3 on my node and another one in a cloud (I used NFS storage on a cloud vps)
lightningd.sqlite3 stores not only channel balances but lots of other stuff. lightningd.sqlite3 changes too often

Quote
For safeguard I use:
- ..................  Grin
Let's imagine my hard drive failed or there was a power outage or something else happened and I am not sure if the lightningd.sqlite3 is intact (or I lost it). I restored onchain data from hsm_secret. What should I do to get my node up and running again? What about my channels and funds in them?

Quote
I think the change has to come from the protocol
Exactly!
samuel-sd
Member
**
Offline Offline

Activity: 84
Merit: 52


View Profile
November 07, 2019, 04:23:14 AM
Last edit: November 07, 2019, 04:37:43 AM by samuel-sd
 #145

I'm glad that you are pleased with C-lightning  Smiley
Yay! It finally works!  Cheesy

I built a network structure with an lnd node as a main hub and many c-lightning nodes as points.
The hub has a few channels with well connected nodes and points have channels only with the hub.
I just sent a few transactions from outside to one of my points and the hub transferred the payments and collected fees.


(A)------>(B)----->(C)----->(D)

As far I got the fee system, if node A sends a transaction to node D, node B will collect a fee from the channel between B and C and C will collect a fee from the channel between C and D, right?
Nodes cannot collect fees from incoming channels, only from outgoing?

By the way, I found that c-lightning daemons use 170Mb of RAM (lnd uses 400Mb) and they use CPU gently when they download the network graph. They don't use all available CPU resources no matter what it takes.
darosior
Full Member
***
Offline Offline

Activity: 209
Merit: 256



View Profile WWW
November 07, 2019, 08:30:17 AM
 #146

Hmm that's `lightningd.sqlite3`.. I don't think there is much sense in having another file which is updated at the same time `lightningd.sqlite3` is updated and that contains the same informations.
In this case I can have one lightningd.sqlite3 on my node and another one in a cloud (I used NFS storage on a cloud vps)
lightningd.sqlite3 stores not only channel balances but lots of other stuff. lightningd.sqlite3 changes too often

Quote
For safeguard I use:
- ..................  Grin
Let's imagine my hard drive failed or there was a power outage or something else happened and I am not sure if the lightningd.sqlite3 is intact (or I lost it). I restored onchain data from hsm_secret. What should I do to get my node up and running again? What about my channels and funds in them?
You cannot derive channel states from the hsm...

Quote
I think the change has to come from the protocol
Exactly!
[/quote]
That being said, it's not __that__ simple: basically tradeof is often taken over privacy..

darosior
Full Member
***
Offline Offline

Activity: 209
Merit: 256



View Profile WWW
November 07, 2019, 08:40:18 AM
 #147

I'm glad that you are pleased with C-lightning  Smiley
Yay! It finally works!  Cheesy

I built a network structure with an lnd node as a main hub and many c-lightning nodes as points.
The hub has a few channels with well connected nodes and points have channels only with the hub.
I just sent a few transactions from outside to one of my points and the hub transferred the payments and collected fees.


(A)------>(B)----->(C)----->(D)

As far I got the fee system, if node A sends a transaction to node D, node B will collect a fee from the channel between B and C and C will collect a fee from the channel between C and D, right?
Nodes cannot collect fees from incoming channels, only from outgoing?
Fees are taken as a delta between received payment and sent payment, basically you receive more on you incoming channel than you send on the outgoing one.
With your above example a simple schema would be:
Code:
# A wants to send 10000msat to D
# D only accepts incoming HTLCs with at least 9 as CLTV value
# A computes a (naive) route backwards

amounts:                      10003msat              10002msat             10000msat
                      (A)      ------>       (B)      ----->      (C)      ----->     (D)
CLTV deltas:                     15                      13                  9
# In this scenario (C) took more fees than (A) and imposes a bigger CLTV delay for outgoing HTLCs

By the way, I found that c-lightning daemons use 170Mb of RAM (lnd uses 400Mb) and they use CPU gently when they download the network graph. They don't use all available CPU resources no matter what it takes.
Recent optimisations have been made with gossip and thus it's now less resource incentive (less bandwidth consumption, so maybe also less CPU consumption ? Didn't benchmark it)

RapTarX
Sr. Member
****
Online Online

Activity: 322
Merit: 341


Crypto Exchange - Secure & Anonymous


View Profile WWW
November 08, 2019, 07:00:31 AM
Merited by The Pharmacist (3), LoyceV (2), xandry (1)
 #148

LN will never be solution, Satoshi said that onchain transactions will support miners in the future, with LN there is no fees for the real miners that support blockchain, with time the fee of one ON-CHAIN transaction will be huge.

LN still need on-chain transaction to open and close channel
As long as I am not closing a channel, I can settle any transaction. Won't it reduce the on-chain transaction heavily? Which is good in some case though but still cfbtcman question is there.

Well, I am a newbie in LN, not much old in Bitcoin as well.

For me, until now, LN is-



Here- Bob (X) is a client who used to shop with BTC. Since the fee is high, he is looking for alternative way, hence he got LN.
He knows if he creates a channel with Y(Route?)- who already have channel with a lot of Bob's favorite shop, he can settle a lot of payments in most of the shops he is used to go daily.

I am trying to learn it from the perspective of a client of a lot of shops so that I can pay micro payments with bitcoin.
Please correct my above statement, for last 3/4 days, I am spending a lot of time into LN. Have read some parts of the whitepaper here- https://lightning.network/lightning-network-paper.pdf



█▀▀▀











█▄▄▄
|
▄▄█████▄▄
▄███████████▄
▄███████████████▄
▄██▀███████████▀██▄
▄█████▀███████▀█████▄
████████▀███▀████████
██████████████████
████████▄███▄████████
▀▀▀▀██████▄██████▀▀▀▀
█████████
▀███████████████▀
▀███████████▀
▀▀█████▀▀
▄▄█████▄▄
▄███████████▄
▄███████████████▄
▄█████████████████▄
▄████████████████▀██▄
██████████████▄██████
█████████████████████
████████████▀████████
▀█████████████▄█████▀
▀█████████████████▀
▀███████████████▀
▀███████████▀
▀▀█████▀▀
.
Trusted by ✔
MONERO
& DASH
|◆  OVER 115 COINS
◆  FIXED RATE
◆  NO REGISTRATION
▀▀▀█











▄▄▄█
█████
██
██
██
██
██
██
██
██
██
██
██
█████
█████
██
██
██
██
██
██
██
██
██
██
██
█████
samuel-sd
Member
**
Offline Offline

Activity: 84
Merit: 52


View Profile
December 01, 2019, 09:52:04 PM
Merited by JayJuanGee (1), ETFbitcoin (1)
 #149

Hi! I have a couple of question about c-lightning
The first question:
As far as I understood, c-lightning wants to run bitcoin-cli executable in order to communicate with bitcoind service. In my case, I would like to run c-lightning in its independent docker container and it would be nice if c-lightning works only with its own files and libraries. Is there any way to use c-lightning without providing bitcoin-cli?
LND, for example, is able to communicate with bitcoind through a tcpip port without using any bitcoind files. Can c-lightning do the same somehow?

The second question
I want to use c-lightning nodes only for receiving funds, in my case a c-lightning node is not going to send any bitcoin, only receive it. I know that lightningd service gathers and processes the graph information from the network. This process consumes lots of memory and CPU resources, but I don't think it’s necessary in my case, because this information is required only for sending bitcoin not receiving it. May I switch the lightningd to the mode, when it will just maintain the only channel it has and provide invoices/wait for incoming transaction without downloading and processing extra network information?
darosior
Full Member
***
Offline Offline

Activity: 209
Merit: 256



View Profile WWW
December 01, 2019, 10:56:59 PM
Merited by vapourminer (1), JayJuanGee (1), ETFbitcoin (1), samuel-sd (1)
 #150

Hi,

Hi! I have a couple of question about c-lightning
The first question:
As far as I understood, c-lightning wants to run bitcoin-cli executable in order to communicate with bitcoind service. In my case, I would like to run c-lightning in its independent docker container and it would be nice if c-lightning works only with its own files and libraries. Is there any way to use c-lightning without providing bitcoin-cli?
There are docker provided, but with `bitcoin[d/cli]` integrated.

LND, for example, is able to communicate with bitcoind through a tcpip port without using any bitcoind files. Can c-lightning do the same somehow?
Not for now, but that might change in the near future.


The second question
I want to use c-lightning nodes only for receiving funds, in my case a c-lightning node is not going to send any bitcoin, only receive it. I know that lightningd service gathers and processes the graph information from the network. This process consumes lots of memory and CPU resources, but I don't think it’s necessary in my case, because this information is required only for sending bitcoin not receiving it. May I switch the lightningd to the mode, when it will just maintain the only channel it has and provide invoices/wait for incoming transaction without downloading and processing extra network information?
This cost has been drastically reduced in the last release, however if you want 0 gossip you can still compile with `--enable-developer` and use the `dev-suppress-gossip` command.

samuel-sd
Member
**
Offline Offline

Activity: 84
Merit: 52


View Profile
December 01, 2019, 11:35:08 PM
Last edit: December 02, 2019, 02:48:59 AM by samuel-sd
 #151

however if you want 0 gossip you can still compile with `--enable-developer` and use the `dev-suppress-gossip` command.
Thanks a lot! You made everything clear.
Is there any way to download clightning binaries which were compiled with `--enable-developer`? Maybe they are shared as a regular version.
Adriano2010
Hero Member
*****
Offline Offline

Activity: 1260
Merit: 513

CryptoTalk.Org - Get Paid for every Post!


View Profile WWW
December 02, 2019, 09:59:14 AM
 #152

Hi. What i want to ask is, if possible can i run a lightning node on my pc 24/7 or i should buy a server or vps for this? Maybe server is safer. And how much bitcoin i need to start a lightning node/channel?

 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
.CryptoTalk.org.|.MAKE POSTS AND EARN BTC!.🏆
darosior
Full Member
***
Offline Offline

Activity: 209
Merit: 256



View Profile WWW
December 02, 2019, 11:00:04 AM
 #153

Is there any way to download clightning binaries which were compiled with `--enable-developer`? Maybe they are shared as a regular version.
No, but building C-lightning is really straightforward.

Hi. What i want to ask is, if possible can i run a lightning node on my pc 24/7 or i should buy a server or vps for this? Maybe server is safer. And how much bitcoin i need to start a lightning node/channel?
Hi,

As you want.
Running one on your host is completely feasible and I think that's what most of people do (according to some stats made by Christian Decker and presented at TheLightningConference).
A server is not "safer", but will make you a better routing node as you will have a far better uptime.
There is minimum required, but in practice some node force a minimum to open a channel with them. You could try out the Lightning Network just by opening a few channels of few millis worth.

LiberOptions
Sr. Member
****
Offline Offline

Activity: 409
Merit: 250


View Profile
December 04, 2019, 04:17:17 AM
 #154

Hi guys,

I have recently decided I had to get a Lightning wallet and wanted to hear from you guys

What are the best wallets compatible with lightning?

Can I use the lightning network for long term storage?

Thanks
LoyceV
Legendary
*
Offline Offline

Activity: 1694
Merit: 5319


ArtIst > AI rtst


View Profile WWW
December 04, 2019, 09:17:53 AM
 #155

I have recently decided I had to get a Lightning wallet
Why?

Quote
What are the best wallets compatible with lightning?
It depends.

Quote
Can I use the lightning network for long term storage?
This question is what made me ask "Why" you want a LN wallet. I use my LN-wallet for small, frequent payments, which is what LN can do much cheaper than on-chain Bitcoin.
However, when you're talking about long-term storage, there's absolutely no reason to do that in an open LN-channel!

Wind_FURY
Hero Member
*****
Offline Offline

Activity: 1302
Merit: 826


Crypto-Games.net: Multiple coins, multiple games


View Profile
December 06, 2019, 09:35:50 AM
 #156

Hi guys,

I have recently decided I had to get a Lightning wallet and wanted to hear from you guys

What are the best wallets compatible with lightning?

Can I use the lightning network for long term storage?

Thanks


I might get some criticisms, but just use BlueWallet. It's the easiest UX to get started in Lightning for newbies.

https://bluewallet.io


▄▄▄████████▄▄▄
▄██████████████████▄
▄██████████████████████▄
██████████████████████████
████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
████████████████████████████
██████████████████████████
▀██████████████████████▀
▀██████████████████▀
▀▀▀████████▀▀▀
   ███████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
███████
BTC  ◉PLAY  ◉XMR  ◉DOGE  ◉BCH  ◉STRAT  ◉ETH  ◉GAS  ◉LTC  ◉DASH  ◉PPC
     ▄▄██████████████▄▄
  ▄██████████████████████▄        █████
▄██████████████████████████▄      █████
████ ▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄ ████     ▄██▀
████ █████ ██████ █████ ████    ▄██▀
████ █████ ██████ █████ ████    ██▀
████ █████ ██████ █████ ████    ██
████ ▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀ ████ ▄██████▄
████████████████████████████ ████████
███████▀            ▀███████ ▀██████▀
█████▀                ▀█████
▀██████████████████████████▀
  ▀▀████████████████████▀▀ 
✔️DICE           
✔️BLACKJACK
✔️PLINKO
✔️VIDEO POKER
✔️ROULETTE     
✔️LOTTO
LoyceV
Legendary
*
Offline Offline

Activity: 1694
Merit: 5319


ArtIst > AI rtst


View Profile WWW
December 06, 2019, 09:38:44 AM
 #157

I might get some criticisms, but just use BlueWallet. It's the easiest UX to get started in Lightning for newbies.
I agree. But for long-term storage it's a terrible idea to use a custodial wallet (similar to using exchanges for long-term storage).

Wind_FURY
Hero Member
*****
Offline Offline

Activity: 1302
Merit: 826


Crypto-Games.net: Multiple coins, multiple games


View Profile
December 09, 2019, 07:50:27 AM
 #158

This tool might be useful for some of you LN "extremists".

https://tip.bigsun.xyz

The developers also need a front-end designer/developer, a volunteer. Cool


▄▄▄████████▄▄▄
▄██████████████████▄
▄██████████████████████▄
██████████████████████████
████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
████████████████████████████
██████████████████████████
▀██████████████████████▀
▀██████████████████▀
▀▀▀████████▀▀▀
   ███████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
███████
BTC  ◉PLAY  ◉XMR  ◉DOGE  ◉BCH  ◉STRAT  ◉ETH  ◉GAS  ◉LTC  ◉DASH  ◉PPC
     ▄▄██████████████▄▄
  ▄██████████████████████▄        █████
▄██████████████████████████▄      █████
████ ▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄ ████     ▄██▀
████ █████ ██████ █████ ████    ▄██▀
████ █████ ██████ █████ ████    ██▀
████ █████ ██████ █████ ████    ██
████ ▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀ ████ ▄██████▄
████████████████████████████ ████████
███████▀            ▀███████ ▀██████▀
█████▀                ▀█████
▀██████████████████████████▀
  ▀▀████████████████████▀▀ 
✔️DICE           
✔️BLACKJACK
✔️PLINKO
✔️VIDEO POKER
✔️ROULETTE     
✔️LOTTO
darosior
Full Member
***
Offline Offline

Activity: 209
Merit: 256



View Profile WWW
December 09, 2019, 09:40:44 AM
 #159

Hi guys,

I have recently decided I had to get a Lightning wallet and wanted to hear from you guys

What are the best wallets compatible with lightning?

Can I use the lightning network for long term storage?

Thanks


I might get some criticisms, but just use BlueWallet. It's the easiest UX to get started in Lightning for newbies.

https://bluewallet.io
If someone wants (need?) to go as far as using a custodial wallet, ACINQ's Phoenix might be a good choice. And, at least, they tend toward removing the custodian (but for sure less toward removing the reliance on their services  Tongue )

ETFbitcoin
Legendary
*
Offline Offline

Activity: 1848
Merit: 2123

Use SegWit and enjoy lower fees.


View Profile WWW
December 09, 2019, 03:33:23 PM
 #160

I might get some criticisms, but just use BlueWallet. It's the easiest UX to get started in Lightning for newbies.
I agree. But for long-term storage it's a terrible idea to use a custodial wallet (similar to using exchanges for long-term storage).

IIRC Blue wallet allows you to connect to your own full node client, so you can have full control over your coin.

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!