Pages:
Author

Topic: Electrum Lightning Network walkthrough - page 5. (Read 4930 times)

legendary
Activity: 1876
Merit: 3132
March 04, 2021, 05:08:51 AM
#83
[...]and waited for 3 confirmations. (Not sure why they've chosen 3)

It's a hardcoded value which you can freely choose in other implementations for each channel separately. Three is the most common value as far as I remember.

But this is what I get when I send money from "Charlie" to "Alice": "Failed after 10 attempts".

What is going on?

Did you make sure to spend some coins from Alice's channel? As I wrote in my previous post, you won't be able to receive any coins unless you make some room for incoming funds first. You can use the testnet version of yalls.org for that. Also, you can double-click on a channel and you should see how much exactly you can receive through that channel.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
March 04, 2021, 04:18:55 AM
#82
"Charlie" needs to open a channel to either the same node or any other node that is connected to your node through other channels.

I connected "Charlie" with the same node "Alice" is connected. I broadcasted a transaction from "Charlie" to "STRANGESET" and waited for 3 confirmations. (Not sure why they've chosen 3)

I try to send funds to "Charlie" and returns me "No path found":


But this is what I get when I send money from "Charlie" to "Alice": "Failed after 10 attempts".


What is going on?
legendary
Activity: 1876
Merit: 3132
March 03, 2021, 04:31:04 PM
#81
Correct me if I'm wrong but in order to spend from that address, two signatures are needed. One mine and one node's. That's why it is larger than the others. (?)

Correct.

How can Charlie join this? Does he need to open his own channel? Or join mine? From my second wallet I generate a lightning address and I paste it on my first's "Pay to". Once I do, it probably decodes it to its HTLC form (256-bit in hex). [...] And that's reasonable. They probably have to connect somehow with "Bob" or in this case "STRANGESET".

You cannot join an existing channel. Right now, payment channels are established only between two people (channel factories are kind of close to what you mentioned, but they are not a thing yet). "Charlie" needs to open a channel to either the same node or any other node that is connected to your node through other channels.

Note that you won't be able to receive any funds through that channel unless you spend some coins (both parties need to maintain a channel reserve which is equal to about 1-3% of the channel's capacity, so a part of your initial payment will be used to fill other parties' reserve). If "Charlie" does not open a channel with the same node as you then his payment will need to be routed through other channels and it might fail due to lack of routes or enough liquidity in the intermediary channels.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
March 03, 2021, 07:53:30 AM
#80
Hi, I'm new to the Lightning Network and I'd like to try it firstly with my favourite wallet, electrum, even if I haven't heard the best about its LN functionalities. I believe that this is the thread to discuss my problems/queries about it.

I've opened Electrum Testnet and I've enabled LN. I want to open a channel to transact some funds with my other wallet. Thus I have two electrum wallets opened. So I do create a transaction with an output of 0.003 tBTC to a multi-signature address. Correct me if I'm wrong but in order to spend from that address, two signatures are needed. One mine and one node's. That's why it is larger than the others. (?)


Okay so now I have broadcasted a transaction between me and the node. Anytime I can close it and return my money back. How can Charlie join this? Does he need to open his own channel? Or join mine? From my second wallet I generate a lightning address and I paste it on my first's "Pay to". Once I do, it probably decodes it to its HTLC form (256-bit in hex).




Once I click "Pay" it returns me this:

And that's reasonable. They probably have to connect somehow with "Bob" or in this case "STRANGESET". Excuse me if I wrote anything stupid. I'm new at this and I'm willful to fully understand it, just like I did with Bitcoin once I found out about it.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
February 24, 2021, 10:46:36 PM
#79
I know it is possible manualy with other (Blue) Wallet, but I'd like to know if it is possible in Electrum and automatically?
That's technically not possible but since Blue wallet's lightning is custodial, funding the channel is as easy as depositing the change to your "lightning external refill address".

Electrum however doesn't work that way, you'll have to fund your channel(s) through lightning transaction from a third-party that accepts on-chain funds.
It has the "swap" feature but it wont accept small amounts like the typical change and it comes with a (third-party) fee.

We don't want to mix input addresses to avoid weakening our privacy.
In comparison, sending to the same address also "mix" or rather "link" those addresses, blue wallet's lightning refill address doesn't change AFAIK.
hero member
Activity: 1246
Merit: 708
February 24, 2021, 06:10:53 AM
#78
Thanks for great manual!
I would like to ask if is there any way to set Lightining Network address as a change address  or addresses of on-chain transaction?
Let's assume we have 0,01 btc to pay to merchant, network fee is about 0,0005 and we have on input address 0,0113 so  we will get 0,0008 change, which will be practically useless..
We don't want to mix input addresses to avoid weakening our privacy.
I know it is possible manualy with other (Blue) Wallet, but I'd like to know if it is possible in Electrum and automatically?


legendary
Activity: 1876
Merit: 3132
February 12, 2021, 03:22:06 AM
#77
Look at the recent commits, like e.g. this 'receiving MPP' commit. Looks like MPP has been added. I haven't tested it.

Only receiving capability has been added. You still won't be able to split your payment when sending it. It looks like it's a matter of time before they add it, though.
newbie
Activity: 10
Merit: 3
February 12, 2021, 02:25:51 AM
#76
Electrum's implementation lacks quite a few things already, for example, multi-part payments, so I wouldn't expect them to implement dual-funded channels as soon as the official specifications are updated.

Look at the recent commits, like e.g. this 'receiving MPP' commit. Looks like MPP has been added. I haven't tested it.
legendary
Activity: 1876
Merit: 3132
February 04, 2021, 09:17:59 AM
#75
How do I open a channel between 3 nodes?
I explored Electrum but found the option to enter only one remote node id. I want to open a channel with 2 of my friends to try how this works.

You cannot open a single channel between three participants in any implementation. You need to open a separate channel to each of your friends. Note that you won't be able to open a channel with any of them if they are using Electrum as well. They need to be running a c-lightning, LND or eclair node.

Also, I read that dual funded channels will be available soon. Can we expect that on Electrum soon ?

I don't think so. Also, I am not sure what the priorities of Electrum developers are. Electrum's implementation lacks quite a few things already, for example, multi-part payments, so I wouldn't expect them to implement dual-funded channels as soon as the official specifications are updated.
hero member
Activity: 2702
Merit: 716
Nothing lasts forever
February 04, 2021, 09:09:18 AM
#74
How do I open a channel between 3 nodes?

I explored Electrum but found the option to enter only one remote node id. I want to open a channel with 2 of my friends to try how this works.
Is this feature available on Electrum yet ?

Also, I read that dual funded channels will be available soon. Can we expect that on Electrum soon ?
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
December 16, 2020, 10:00:31 AM
#73
Thank you, it works perfectly.
It's as expected  Wink
and I'm glad you've also considered the warning about the channel force-closure if you've done any lightning transaction in the other copy then opened the other (outdated) copy.
If that happened, your channel will end up with a "BAD" status and then force-close; that won't reflect to the other copy and that may cause confusion, just the "close channel" transaction.
newbie
Activity: 28
Merit: 18
December 16, 2020, 08:47:32 AM
#72
When moving the wallet: Instead of importing the channel backup, just copy the wallet file itself to the other machine.
It's in Electrum's data directory (location)

But be warned that lightning transactions made by one copy will not reflect to the other that will cause the channel to be force-closed when launched by the outdated one.
So it's best to use an individual LN wallet in a single machine.
I think it's because the channel and the LN transactions are saved in the file itself and it must reflect the other party's copy (need clarification).


Thank you, it works perfectly.

I would add this to the general guide, written for newcomers:
how to migrate Electrum wallet on another device, including LN channels (maintaining them operative):

PC1 = computer with Electrum wallet
PC2 = computer where you want to migrate the wallet

1) On PC1 access “wallets” folder containing the “.dat” file. The filename is the name you gave to the wallet upon creation (in the screnshot, it's “wallet_8”)

  • Windows: path: \Users\YourUserName\AppData\Roaming\Electrum (to find it faster, open the windows search and type: %APPDATA%\Electrum)
  • Mac: Finder -> Go to folder (shift+cmd+G) and type ~/.electrum
  • Linux: Home Folder -> Go to Location and type ~/.electrum

https://www.albertodeluigi.com/wp-content/uploads/2020/12/46-e1607827409173.png

2) Copy the file (“wallet_8”) and bring it on a USB or whatever other secure support to transfer it on PC2. You can also transfer using internet, but only if you encrypted the file before.
3) On PC1 close the Electrum application, better to turn off your computer or disconnect from internet network. be sure you don't open anymore the wallet on PC1, until you finalized point 6.
4) Install Electrum on PC2 and open the wallets folder. Drag or paste here the file (in my case it's “wallet_8”) copied from PC1
5) Open Electrum app on PC2, connect to internet and check if your balance (onchain and offchain) is correct and updated. Now that you are sure the migration has been effectively done, you can proceed with point 6.
6) Go back to PC1 and delete your wallet (in my case it's “wallet_8”) to be sure you'll never open the same wallet on PC1, which could trigger a channel force closure. Once deleted that wallet, you can still use the Electrum app on PC1, but only for onchain funds or different LN wallet than the one you migrated.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
November 29, 2020, 12:32:32 AM
#71
When moving the wallet: Instead of importing the channel backup, just copy the wallet file itself to the other machine.
It's in Electrum's data directory (location)

But be warned that lightning transactions made by one copy will not reflect to the other that will cause the channel to be force-closed when launched by the outdated one.
So it's best to use an individual LN wallet in a single machine.
I think it's because the channel and the LN transactions are saved in the file itself and it must reflect the other party's copy (need clarification).
newbie
Activity: 28
Merit: 18
November 28, 2020, 08:13:40 PM
#70

There are two types of channel backups in Electrum. The first one ('File -> Save backup') backs up only information required to reestablish the connection with the other party and request a forced channel closure. This kind of backup is called a Static Channel Backup. Data-loss protection discourages the other party from providing the old state of the channel. The second method is backing up each channel individually. Apparently, such backups contain the latest commitment state of the channel so a force-close is not required.

I tried to backup a single channel and "restore" it on another computer. What I did:
I took my second pc, installed electrum, imported the seed -> I  see my correct onchain balance, but not Lightning balance.
Then went back on my first computer's electrum -> right-click on my channel -> export. I see the message saying that the channel backup can be used only to force-close the channel, not to restore it on another device (what a pity!).
Anyway, I copied the string "channel_backup:.....hereMyChannelBackupString.....", I pasted it on the second pc, right-clicking inside the blank frame of "channels" tab.
I now see the channel on my second pc, it says: "BACKUP of ...IDhere..." with STATUS = FUNDED. The only thing I can do is force-closure of  the channel.

my thoughts:

Your lightning network wallet is strictly tied to a single device (at least, for the moment). Which is a huge limitation imo if compared to onchain operability of lightwallets. Indeed, you'll never lose your funds if that device is lost/sold etc., thanks to the backup, but changing device will cost you time and onchain fees for channel closure and re-opening. Also, you won't be able to use at the same time a wallet on desktop and mobile.

I wonder why it is technically so difficult to develop a process of "migration" of the entire wallet, channels included, to a second device. It's not just for electrum light wallet, I'm pretty sure it's the same for LND and c-lightning.

I know that Lightning channels are linked to the public key, not the IP. I think that if your IP address changes, then the updated IP is communicated through a node_announcement message to your channel counterpart (and also propagated over the network).
So what is preventing me from using the same wallet on many different devices? Why can't I easily send to my peer an immediate update and switch to another fully operative device? The only risk I can see from my side is that if I send a wrong (past) commitment transaction I could incur in a penalty (my peer thnks of a fraud and broadcasts a breach remedy transaction). But the wallet should just warn me of the risks, not stop me from switching between devices. So I think there are other technical obstacles I ignore...

ps: I'm not even sure about what is going to happen on my electrum wallet if the IP changes. What will happen to the channels? Will I only be able to force-close them, like it happens when I import a channel backup on a new device? Or this entire IP story is completely unrelated to that? Thanks for your thoughts and feedbacks.


legendary
Activity: 1876
Merit: 3132
November 01, 2020, 02:54:22 PM
#69
any atomic swap services that accept lightning payments.....that you would recommend a lightning newbie look into?

I have only used Lightning Conductor to refill my channels and send on-chain transactions. I have never swapped my LN balance for some altcoin, so I can't recommend any such service.
newbie
Activity: 26
Merit: 5
November 01, 2020, 02:10:50 PM
#68
Thank you Rath_

any atomic swap services that accept lightning payments.....that you would recommend a lightning newbie look into?
legendary
Activity: 1876
Merit: 3132
November 01, 2020, 05:00:54 AM
#67
Am i correct to understand recent release of electrum wallet has standard functionality to open/fund lightning channels - all you must do is turn the functionality on??!!

That's correct.

Only btc or other channels/crypto's can have lightning channels on electrum?

Since Electrum is a Bitcoin client, its Lightning implementation is limited to Bitcoin. Some forked versions of Electrum might already support the LN. At least, Electrum-LTC does.

Is electrum capable of being a true lightning node or like the standard wallet, electrum uses an existing lightning node?

It will work fine for receiving and sending payments (note that there is no multipart payments support yet), but you won't be able to route payments. Electrum uses third-party nodes only to check the current state of the channel (opening, closing, closed etc.). Technically, it's a standalone Lightning Network node with some limitations.
newbie
Activity: 26
Merit: 5
October 31, 2020, 09:51:29 PM
#66
Am i correct to understand recent release of electrum wallet has standard functionality to open/fund lightning channels - all you must do is turn the functionality on??!!

Only btc or other channels/crypto's can have lightning channels on electrum?

Is electrum capable of being a true lightning node or like the standard wallet, electrum uses an existing lightning node?  (chosen from a list)

  Anyone with experience successfully running current electrum on debian can verify it works now?  Any patches needed to make it work? 

Does lightning functionality work on debian systems, in current electrum release? 

full member
Activity: 170
Merit: 108
September 05, 2020, 08:33:18 PM
#65
Thanks for the great guide!

Here's a Twitter thread where I explain how you can get a free incoming lightning channel to your electrum:
https://twitter.com/citlayik/status/1276029870837915651?s=19
legendary
Activity: 1876
Merit: 3132
September 03, 2020, 10:09:04 AM
#64
Are these block numbers also arbitrarily chosen by Electrum or are they part of the LN protocol?

The exact numbers were chosen by Electrum but they are required by the LN protocol.

It doesn't make sense to me why parties need to wait for 144 or 2016 blocks to get back their funds. These are real mainnet blocks, and the funds are in a multisig wallet, so by my intuition the funds should arrive in the first block that contains the closing transaction.

Every time you send, receive or forward a payment over the Lightning Network, the state of the channel updates. A new commitment transaction is signed by both parties when that happens. The commitment transaction can be broadcast in case the other party is offline when you decide to close the channel. As a counter cheating measure, there is a customizable timelock which gives the other party time to come back online and verify if an old state of the channel was not broadcast to the network. If you close your channel when the other party is fully cooperative then there is no timelock.

Also, do these numbers only apply to force-closed channels? So in that case 144 blocks is the usual delay and 2016 is the maximum, right?

Yes.
Pages:
Jump to: