Pages:
Author

Topic: The Lightning Network FAQ - page 20. (Read 33426 times)

legendary
Activity: 2898
Merit: 1823
January 19, 2022, 09:55:23 AM
I have had enough of my share of debates against franky1 about the Lighting Network, or anything, that many other people in the forum got annoyed because the topics ended with the both of us debating. He has been gaslighting/spreading disinformation everywhere. He always denies the fact that all Bitcoins in Lightning are actual Bitcoins, calling them IOUs. I give him an explanation why they’re not IOUs, he replies with a VERY LONG “technical” post of confusion to troll you.
legendary
Activity: 1876
Merit: 3139
January 18, 2022, 07:38:11 PM
We have been having quite a heated argument in the [self-moderated] Is LN Bitcoin? franky1: About scaling, on-chain and off-chain thread with franky1, who has been banned from this section, about some technical aspects of the Lightning Network.

We have been mostly arguing about the way payments are routed through the network. Feel free to join our discussion as both of us might be wrong. Here's a quote from my recent message:

Here's my current understanding of how the system works:

0) Lightning nodes constantly use the gossip protocol (bolt07) to forward/receive "node_announcement", "channel_announcement", "channel_update" messages and maintain a local view of the whole network.
1) Alice receives a payment invoice from Eric which includes information like: Eric node's public key, payment hash, amount, expiry (date) and cltv expiry.
2) Alice constructs a path to Eric using her local map of the network. She tries to find the cheapest and the shortest route. The longer the route, the higher the risk that funds will get stuck during routing.
2a) She prepares "onion_routing_packet" which includes encrypted routing information for each hop.
3) Alice sends "update_add_htlc" message to Bob, which includes the "onion_routing_packet" (which is the same for all peers), the amount, the payment hash and cltv expiry.
4) Alice and Bob sign a new commitment transaction with an HTLC output.
5) Bob sends "update_add_htlc" to Carol with the same "onion_routing_packet".
6) Carol and Diana, Diana and Eric do the same.
7) Eric sends "update_fullfil_htlc" message to Diana, which includes the payment secret.
8) Eric and Diana remove the HTLC output and update balances by signing a new commitment transaction.
9) Diana sends "update_fullfil_htlc" to Carol with the same payment secret and they update the commitment transaction.
10) Carol and Bob, Bob and Alice do the same.

Comments:

3) The amount Alice sends is actually bigger than the one in the invoice as she must account for the fees. Each hop forwards the HTLC with a smaller amount and keeps the difference. If some hop tries to claim higher fees than Alice expected, the next node in the route will fail the payment as the routing instructions say how much one's node is supposed to forward.

If Bob doesn't have enough coins to forward the payment on his side of the channel with Carol, he must send "update_fail_htlc" message and Alice needs to try sending the payment through another route.

All channels use the same payment hash. It is safe because HTLC outputs require both the payment secret and HTLC signatures, which can be produced only by channel partners, to be spent. See this post for explanation.

hero member
Activity: 1274
Merit: 681
I rather die on my feet than to live on my knees
January 18, 2022, 06:50:24 PM
Is there anyone who understands what's wrong with my node?
[~]
Do you already have a channel from your C-Lightning node to your Electrum node?
Because a reason for the C-Lightning node to reject a channel opening could be that it is configured not to allow more than a single channel between two peers.

Other than that, it's possible as mentioned by darkv0rt3x that sometimes the gossip network doesn't propagate the IP of nodes completely so in addition to the node ID you need to specify the IP as well. However, if this was the issue, I'd expect an error message more akin to 'Could not find node' or something of this sort, and not a connection reject.

Side question: why are you trying to use Electrum for Lightning all the time? Why not whip up a second C-Lightning or lnd node?

Another reason I asked for the node URI is because that pub key that my node returns in the logs seems to me pretty odd. It looks like the code of an invoice. ln1............. I never seen one like that!
hero member
Activity: 910
Merit: 5935
not your keys, not your coins!
January 17, 2022, 06:48:27 PM
Is there anyone who understands what's wrong with my node?
[~]
Do you already have a channel from your C-Lightning node to your Electrum node?
Because a reason for the C-Lightning node to reject a channel opening could be that it is configured not to allow more than a single channel between two peers.

Other than that, it's possible as mentioned by darkv0rt3x that sometimes the gossip network doesn't propagate the IP of nodes completely so in addition to the node ID you need to specify the IP as well. However, if this was the issue, I'd expect an error message more akin to 'Could not find node' or something of this sort, and not a connection reject.

Side question: why are you trying to use Electrum for Lightning all the time? Why not whip up a second C-Lightning or lnd node?
hero member
Activity: 1274
Merit: 681
I rather die on my feet than to live on my knees
January 17, 2022, 04:08:41 PM
This should work for you:

Code:
lightning-cli multifundchannel -k destinations='[{"id": "node1" ,"amount": amount1},{"id": "node2" , "amount": amount2}]' feerate=1000perkb minchannels=2

Make sure to change minchannels if you add more destinations.
I never tried this one before, but if even like that, it doesn't work, you may have to escape the double quotes with a backslash. I usually run into problems when I use these commands that requires arrays of json objects.
For instance, to create a raw transaction I actually have to use:
Code:
bitcoin-cli createrawtransaction "[{\"txid\":\"tx_hash_here\", \"vout\":1}]" "[{\"bitcoin_adress_here\":0.05},{\"bitcoin_change_adress_here\":0.049}]" 0 true

As you see, there are some double quotes that needs to be escaped (the ones inside the json array object), otherwise, bash will "consume" a layer of them and then, the json object is "sent" to the RPC command wrongly constructed!

Since command mentioned by @Rath_ use single quote as boundary of the array, you don't need to add backslash before double quote inside the array.

Indeed. One more thing I just learn!


Is there anyone who understands what's wrong with my node? While I can create channels with other nodes I can't create a channel from Electrum as it can't establish a connection: https://1ml.com/testnet/node/039a7e0982d3b0f967dfc18b8b69c9e8cafd035985eff1832258daf08de119b10e

I keep getting this when I enter my node_id@onion_url:


And it's weird, because it doesn't return the problem. It just says there is one, which makes me believe the developers aren't aware it exists.

I couldn't connect to your node using only the pub key! Can you provide your node URI?

What I can see in my debug file is:
Code:
302030 2022-01-17T21:10:20.272Z DEBUG   connectd: Now try LN connect out for host ln1qwd8uzvz6wc0je7lcx9ck6wfar906q6eshhlrqeztrd0pr0prxcsuagtc2y.lseed.darosior.ninja
302031 2022-01-17T21:10:20.273Z DEBUG   039a7e0982d3b0f967dfc18b8b69c9e8cafd035985eff1832258daf08de119b10e-connectd: Connected out, starting crypto
302032 2022-01-17T21:10:20.540Z DEBUG   039a7e0982d3b0f967dfc18b8b69c9e8cafd035985eff1832258daf08de119b10e-connectd: Failed connected out: Error connecting to ln1qwd8uzvz6wc0je7lcx9ck6wfar906q6eshhlrqeztrd0pr0prxcsuagtc2y.lseed.bitcoinsta       ts.com: Tor server reply: host unreachable. ln1qwd8uzvz6wc0je7lcx9ck6wfar906q6eshhlrqeztrd0pr0prxcsuagtc2y.lseed.bitcoinstats.com:9735: Connection establishment: Connection refused. ln1qwd8uzvz6wc0je7lcx9ck6wfar906q6eshhlrqeztrd0pr       0prxcsuagtc2y.lseed.darosior.ninja:9735: Cryptographic handshake: peer closed connection (wrong key?).
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
January 16, 2022, 02:30:12 PM
Is there anyone who understands what's wrong with my node? While I can create channels with other nodes I can't create a channel from Electrum as it can't establish a connection: https://1ml.com/testnet/node/039a7e0982d3b0f967dfc18b8b69c9e8cafd035985eff1832258daf08de119b10e

I keep getting this when I enter my node_id@onion_url:


And it's weird, because it doesn't return the problem. It just says there is one, which makes me believe the developers aren't aware it exists.
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
January 16, 2022, 06:41:26 AM
This should work for you:

Code:
lightning-cli multifundchannel -k destinations='[{"id": "node1" ,"amount": amount1},{"id": "node2" , "amount": amount2}]' feerate=1000perkb minchannels=2

Make sure to change minchannels if you add more destinations.
I never tried this one before, but if even like that, it doesn't work, you may have to escape the double quotes with a backslash. I usually run into problems when I use these commands that requires arrays of json objects.
For instance, to create a raw transaction I actually have to use:
Code:
bitcoin-cli createrawtransaction "[{\"txid\":\"tx_hash_here\", \"vout\":1}]" "[{\"bitcoin_adress_here\":0.05},{\"bitcoin_change_adress_here\":0.049}]" 0 true

As you see, there are some double quotes that needs to be escaped (the ones inside the json array object), otherwise, bash will "consume" a layer of them and then, the json object is "sent" to the RPC command wrongly constructed!

Since command mentioned by @Rath_ use single quote as boundary of the array, you don't need to add backslash before double quote inside the array.
hero member
Activity: 1274
Merit: 681
I rather die on my feet than to live on my knees
January 16, 2022, 05:50:14 AM
How do you insert an array, or in this situation the destination, properly? There are lots of ways I can think of...

This should work for you:

Code:
lightning-cli multifundchannel -k destinations='[{"id": "node1" ,"amount": amount1},{"id": "node2" , "amount": amount2}]' feerate=1000perkb minchannels=2

Make sure to change minchannels if you add more destinations.


I never tried this one before, but if even like that, it doesn't work, you may have to escape the double quotes with a backslash. I usually run into problems when I use these commands that requires arrays of json objects.
For instance, to create a raw transaction I actually have to use:
Code:
bitcoin-cli createrawtransaction "[{\"txid\":\"tx_hash_here\", \"vout\":1}]" "[{\"bitcoin_adress_here\":0.05},{\"bitcoin_change_adress_here\":0.049}]" 0 true

As you see, there are some double quotes that needs to be escaped (the ones inside the json array object), otherwise, bash will "consume" a layer of them and then, the json object is "sent" to the RPC command wrongly constructed!
legendary
Activity: 1876
Merit: 3139
January 15, 2022, 12:24:50 PM
How do you insert an array, or in this situation the destination, properly? There are lots of ways I can think of...

This should work for you:

Code:
lightning-cli multifundchannel -k destinations='[{"id": "node1" ,"amount": amount1},{"id": "node2" , "amount": amount2}]' feerate=1000perkb minchannels=2

Make sure to change minchannels if you add more destinations.

legendary
Activity: 1512
Merit: 7340
Farewell, Leo
January 15, 2022, 11:27:36 AM
How do I open multiple channels in one transaction? Probably with multifundchannel, it's just that I can't understand the proper way to run it. It doesn't give an example in docs and I didn't find anything at github.

How do you insert an array, or in this situation the destination, properly? There are lots of ways I can think of...
Code:
node1, node2
{node1, node2}
[node 1, node2] etc.

None of the above works.
legendary
Activity: 1876
Merit: 3139
January 11, 2022, 07:01:31 PM
For example, I have read about instances in which an LN node failed, the user restored from a backup that did not have the correct channel state, which resulted in the backup-restored node trying to close the channel via an old channel state.

You're right. Although, it's fairly uncommon to run an old backup, even unintentionally. LND by default generates static backups, which can be only used to request the other party to close a channel. C-lightning's backup plugin backups the whole channel database to a remote directory/drive and it constantly overwrites old backups.

What's the best channel_capacity/network_contribution ratio? For instance, would it be more contributive to open 100 of 0.01 BTC rather than 2 of 0.50 BTC?

100 channels sound better. If someone undercut (in terms of fees) only some of your channels, it should not impact your routing effectiveness greatly. Also, you are more likely to get more routing attempts through you as long as you choose channels and set your fees reasonably.

Also, how do I choose the proper nodes to do this?

That's one of the trickiest parts of running a Lightning node. I usually select some random medium-sized nodes from either amboss.space or 1ml.com and then check the shortest path from my node to theirs using lnrouter.app. Don't forget that path finding algorithms also take the route length into consideration.

Also, how do I choose the proper nodes to do this? I had read about triangles, but I'm not sure if that's what I'm talking about.

You can learn about liquidity triangle/square/pentagon swaps here. Once you set up a mainnet node, you can use that website to find partners for the swap. Liquidity swaps might actually improve your routing performance.

Yesterday, I performed a triangle swap with two other bitcointalk members. Each of us opened a 0.05 BTC channel to the other person. This way, we gained additional 0.10 BTC capacity, which means that this swap has doubled my node's capacity. I paid 222 sat for the opening transaction. We dropped the fees to 0 and TheJuice's script took care of the rebalancing. On the same day, I routed 6 transactions from the channel I opened and I got paid 222.76 satoshi. The channel paid itself off in just a few hours.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
January 11, 2022, 04:00:37 PM
What's the best channel_capacity/network_contribution ratio? For instance, would it be more contributive to open 100 of 0.01 BTC rather than 2 of 0.50 BTC? Also, how do I choose the proper nodes to do this? I had read about triangles, but I'm not sure if that's what I'm talking about. Are there any helpful guiding threads in here?

I just want to increase the capacity in testnet. I have few tBTC lying around (~4.5 tBTC) and I prefer using them in a way to be useful than having them in my dusty cold storage.
copper member
Activity: 1666
Merit: 1901
Amazon Prime Member #7
January 09, 2022, 02:57:44 PM
If you ever wondered how often someone is penalized for fraudulent behaviour, forkmonitor keeps track of all penalty transactions ever broadcast. Apparently, there have been 419 unsuccessful cheat attempts with a total of ~5.13 BTC at stake since the end of 2017.
I don't think all these transactions are necessarily "cheat attempts". For example, I have read about instances in which an LN node failed, the user restored from a backup that did not have the correct channel state, which resulted in the backup-restored node trying to close the channel via an old channel state.
legendary
Activity: 1876
Merit: 3139
January 07, 2022, 06:58:41 PM
If you ever wondered how often someone is penalized for fraudulent behaviour, forkmonitor keeps track of all penalty transactions ever broadcast. Apparently, there have been 419 unsuccessful cheat attempts with a total of ~5.13 BTC at stake since the end of 2017.
legendary
Activity: 2898
Merit: 1823
January 07, 2022, 06:06:05 AM
Plus Chain Anals’ tracking of Lightning transactions actually helps increase the liquidity in the network and helps it scale, and makes it function better. Cool
Just like scammers and governments support the Tor network by running their own compromised nodes Wink As long as enough scammers and competing governments join, and as long as users are aware of the risks, none of this stops the network.


But there’s a big difference between routing traffic in TOR, and routing transactions in the Lightning Network. Eventually, a node operator will need to take opportunity costs into account, and must be incentivized to maintain “staking” his/her capital. Chain Anals’ increasing need to montior Lightning = demand for Bitcoin.

Plus with their business model, they should be telling everyone to use Bitcoin. No users = no transactions to monitor = no Chain Anals. Cool
hero member
Activity: 910
Merit: 5935
not your keys, not your coins!
January 06, 2022, 03:26:09 PM
Well, it's as the messages say. You have no route to Boltz.
I successfully opened a channel with Boltz to make it work. It appears that the lightning daemon just needed a restart. Okay, so I sent them 0.0025 LN-tBTC and have probably increased my receiving capacity. Shouldn't I now be able to send my node a few sats? Why do I still get the same error?
I'm not sure I fully understand your setup. You have Electrum on a different machine than the one running your LN node and try to send Lightning BTC from Electrum to your node? Unfortunately, I am not 100% sure how Lightning works in Electrum. From the error message, it seems that Electrum tries to open a new channel to your node, instead of going through an existing Lightning route. Especially with the transaction screen that you're showing. With mining fee and stuff; that's clearly an on-chain transaction.

Is there any other client you advice me to use instead of Electrum? No matter how much I've googled I haven't understood why this happens...
For my testing on testnet, when I need to try connections from different machines (same network, different network etc.), I usually use pruned Core with normal c-lightning or - what I once had on a laptop - lnd with Neutrino backend. Very quick to setup and light on storage.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
January 06, 2022, 02:20:25 PM
Well, it's as the messages say. You have no route to Boltz.
I successfully opened a channel with Boltz to make it work. It appears that the lightning daemon just needed a restart. Okay, so I sent them 0.0025 LN-tBTC and have probably increased my receiving capacity. Shouldn't I now be able to send my node a few sats? Why do I still get the same error?




Is there any other client you advice me to use instead of Electrum? No matter how much I've googled I haven't understood why this happens...

For a quick hack, you can kind of 'force detach' it by adding a & at the end like this: ./lightningd &
Nice! I didn't know that.
hero member
Activity: 910
Merit: 5935
not your keys, not your coins!
January 05, 2022, 04:53:03 PM
Can someone solve me these queries that I have? So, I've gone to testnet.boltz.exchange to increase my receiving capacity as a lightning node. You just give LN-BTC and receive BTC, hence you've increased your receiving capacity by spending some your channel's reserve.

Alright, so I've tried this with my Electrum. I opened up a channel with somebody, sent the LN-BTC got my BTC, everything went fine. But, what exactly happens when I try the same with my lightning node?
Well, it's as the messages say. You have no route to Boltz. Might be due to them having / having had a maintenance today; not sure if it's over yet. If it is, you need to either create a channel with them directly or with someone who does.

Secondly, why does my lightningd log show these?
These are the various attempts to route the payment. Regarding the 'parts'; payments can / are split and sent through various routes and nodes. Especially if from one hop to the next there exists no single channel with sufficient capacity to route the whole sum.

Thirdly, why does the lightning daemon closes when I close the Windows' cmd? Normally, when I'm ssh-ing using the cmd and close it, nothing changes from the RPi.
Because if you start lightning via ./lightningd, the process runs inside the SSH process; when that one is killed (by closing the SSH session), LN does as well. Probably in your other experiences with SSH, you started stuff as a service or the binaries detached into independent processes by themselves.
For a quick hack, you can kind of 'force detach' it by adding a & at the end like this: ./lightningd &; however I'd recommend setting up a systemd service for your node.

For creating such service, you can refer to my OpenSUSE node setup guide, last line of step 8 as well as step 9 and 10.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
January 04, 2022, 10:05:07 AM
Can someone solve me these queries that I have? So, I've gone to testnet.boltz.exchange to increase my receiving capacity as a lightning node. You just give LN-BTC and receive BTC, hence you've increased your receiving capacity by spending some your channel's reserve.

Alright, so I've tried this with my Electrum. I opened up a channel with somebody, sent the LN-BTC got my BTC, everything went fine. But, what exactly happens when I try the same with my lightning node?

Code:
./lightning-cli --testnet pay lntb10m1psagh4lpp5guw6fusvvxhy95auhscnh78s3sq6jmax5038n2smqsvst0r5xwmsdql2djkuepqw3hjqsj5gvsxzerywfjhxuccqzptxqrrsssp5fzl2n8tp23vrmlaza8pahr4hgn26gjy9uqxxrwmyvuhwz59khgwq9qyyssq9d9lx3y6ewauzke4uf0zelfc565e66kk95cq6gm7cufg3ruk8gwjznrpvrmf92t7vx8tzcqvchmjnggx9mhhhs97f7eg59yf05we93cpc2c3sp
{
   "code": 210,
   "message": "Ran out of routes to try after 971 attempts: see `paystatus`",
   "attempts": [
      {
         "status": "pending",
         "partid": 1,
         "amount": "1000000000msat"
      },
      {
         "status": "failed",
         "failreason": "failed: WIRE_UNKNOWN_NEXT_PEER (reply from remote)",
         "partid": 2,
         "amount": "181272680msat",
         "parent_partid": 1
      },
      {
         "status": "pending",
         "failreason": "No path found",
         "partid": 195,
         "amount": "181272680msat",
         "parent_partid": 2
      },

...

And lots of “No path found” messages.

Secondly, why does my lightningd log show these?
Code:
...
2022-01-04T14:51:11.145Z INFO    plugin-pay: id 0 partid 878: No path found
2022-01-04T14:51:11.145Z INFO    plugin-pay: id 0 partid 882: No path found
2022-01-04T14:51:11.146Z INFO    plugin-pay: id 0 partid 883: No path found
2022-01-04T14:51:11.146Z INFO    plugin-pay: id 0 partid 887: No path found
2022-01-04T14:51:11.146Z INFO    plugin-pay: id 0 partid 888: No path found
2022-01-04T14:51:11.147Z INFO    plugin-pay: id 0 partid 892: No path found
2022-01-04T14:51:11.219Z INFO    plugin-pay: id 0 partid 894: No path found
2022-01-04T14:51:11.343Z INFO    plugin-pay: id 0 partid 896: No path found
2022-01-04T14:51:11.400Z INFO    plugin-pay: id 0 partid 901: No path found
2022-01-04T14:51:11.401Z INFO    plugin-pay: id 0 partid 903: No path found
2022-01-04T14:51:11.401Z INFO    plugin-pay: id 0 partid 921: No path found
2022-01-04T14:51:11.402Z INFO    plugin-pay: id 0 partid 930: No path found
2022-01-04T14:51:11.402Z INFO    plugin-pay: id 0 partid 931: No path found
2022-01-04T14:51:11.402Z INFO    plugin-pay: id 0 partid 936: No path found
2022-01-04T14:51:11.402Z INFO    plugin-pay: id 0 partid 941: No path found
2022-01-04T14:51:11.403Z INFO    plugin-pay: id 0 partid 869: No path found
2022-01-04T14:51:11.403Z INFO    plugin-pay: id 0 partid 870: No path found
2022-01-04T14:51:11.403Z INFO    plugin-pay: id 0 partid 691: No path found
2022-01-04T14:51:11.422Z INFO    plugin-pay: id 0 partid 970: No path found
2022-01-04T14:51:11.446Z INFO    plugin-pay: id 0 partid 722: No path found

Thirdly, why does the lightning daemon closes when I close the Windows' cmd? Normally, when I'm ssh-ing using the cmd and close it, nothing changes from the RPi.
legendary
Activity: 1612
Merit: 1608
精神分析的爸
December 29, 2021, 08:40:14 AM
Plus Chain Anals’ tracking of Lightning transactions actually helps increase the liquidity in the network and helps it scale, and makes it function better. Cool
Just like scammers and governments support the Tor network by running their own compromised nodes Wink As long as enough scammers and competing governments join, and as long as users are aware of the risks, none of this stops the network.

Agreed. Thought I'd add the following article showing the dimensions in which these TLAs are operating:

Since at least 2017, a mysterious threat actor has run thousands of malicious servers in entry, middle, and exit positions of the Tor network in what a security researcher has described as an attempt to deanonymize Tor users. The Record reports:
Tracked as KAX17, the threat actor ran at its peak more than 900 malicious servers part of the Tor network, which typically tends to hover around a daily total of up to 9,000-10,000.
...


TL;DR: You are not as anonymous and private on tor as you might think hope.
Pages:
Jump to: