Pages:
Author

Topic: A Beginner's guideline to Bitcoin Lightning Network (Read 1381 times)

hero member
Activity: 1358
Merit: 851
bump
full member
Activity: 154
Merit: 177
I know it sounds complicated. I am working on a thread which will explain it in a more understandable way.

thanks a lot for explaining it. yes it is kinda hard, i try to wrap my head around it, i just need some time to digest that all, it's fascinating - i looked for a save button here, i guess there is none and i just save the url  Cheesy i am looking forward to the thread - it will be a good one
legendary
Activity: 1876
Merit: 3139
is the period of that timelock every time a new commitment is broadcastet updated? so it is a moving timeframe? and that timeframe will be set in stone with the opening transaction on the base layer, is that correct?

I might have phrased that slightly wrong, so let me explain it in more detail. If you are closing a channel uncooperatively, there are actually two on-chain transactions involved instead of just one.

First of all, the timelock is decided before the channel is established. By default, most nodes force the other peer to wait 144 blocks (~1 day). The maximum acceptable value by default is 2016 blocks (~2 weeks). I configured my node to create channels with their_to_self_delay = 432 blocks (~3 days), so if someone decides to close the channel opened to my node uncooperatively, they will have to wait 432 blocks (after the commitment transaction has been included in a block) before they can spend the output belonging to them. Those timelocks are relative which means that you do not have to sign a new commitment transaction whenever a new block is mined. New commitment transactions are signed periodically because their fees need to match the current state of the mempool. There is no point in paying 60 sat/vbyte when 1 sat/vbyte transactions are getting confirmed in just a few minutes. It also applies the other way around.

The first transaction is the commitment transaction. Let's say there's node A(lice) and node B(ob), and node A broadcasts the commitment transaction. That commitment transaction includes two outputs:

- output #0: 3 BTC (spendable by node B's private key) - reflecting node B balance
- output #1: 6 BTC (RSMC) - reflecting node A balance

There is one more important detail before we go any further. Whenever a new commitment transaction is signed, both parties exchange revocation keys for the previous commitment transaction so that they can both be sure that the other party is very unlikely to broadcast an old state of the channel.

RSMC is short for Revocable Sequence Maturing Contract. Such an output contains a relative timelock. This means that you can't spend this output until a certain amount of blocks have been mined since the transaction which includes that output was mined.

Let's say node B didn't change the default value of 144 blocks and the commitment transaction has been confirmed. There are two possible scenarios.

1) Node A attempts to cheat and broadcast an old commitment transaction. Node B has 144 blocks to spend the RSMC output using his and node A's revocation key which he got while they were working on a new commitment transaction.

2) Node A broadcasts the latest commitment transaction. In such a case, node B never got node A's revocation key for that commitment transaction, so he cannot spend that RSMC. Node A can broadcast another transaction spending that output after 144 blocks have been mined.

I know it sounds complicated. I am working on a thread which will explain it in a more understandable way.
full member
Activity: 154
Merit: 177
The other party would very likely close the channel forcefully after some time. It would be possible because channel participants constantly sign new commitment transactions which can be used to settle the balance on-chain once a certain timelock has passed.

is the period of that timelock every time a new commitment is broadcastet updated? so it is a moving timeframe? and that timeframe will be set in stone with the opening transaction on the base layer, is that correct?
legendary
Activity: 1876
Merit: 3139
Curious, How if in the end or bad happened like lost of the private key then not able to make sign signature and the are not able to online, what's the next will be?

The other party would very likely close the channel forcefully after some time. It would be possible because channel participants constantly sign new commitment transactions which can be used to settle the balance on-chain once a certain timelock has passed.

Unfortunately, in this case, the other party could attempt to cheat by broadcasting some old commitment transaction. Normally, you would be able to revoke it and publish a penalty transaction. A watchtower could also do that but it would have had to be set up beforehand.

However, not all participants of the network have malicious intentions. If the channel was closed using the latest commitment transaction, you would get all of your coins back to your on-chain wallet which you should be able to recover using your seed.

I am not sure how mobile wallets behave, but LND generates a backup file which lets you close your channels thanks to data-loss protection (note that in this case your peers have to cooperate with you). C-lightning users can use a backup plugin which makes a copy of the whole channel database whenever it is updated. If you have such a copy, you can easily recover your node without having to close any channels.
newbie
Activity: 16
Merit: 0
Sorry for pumping this the thread.

Curious, How if in the end or bad happened like lost of the private key then not able to make sign signature and the are not able to online, what's the next will be?
full member
Activity: 411
Merit: 199
Join the Bitcoin Lightning Revolution (Ask me How)
Guys,

The LN is a great re-invention and a smart try of bringing back micropayments into the Bitcoin world that faded away when the transfer fees had risen significantly.

I really like this technology and actually I dropped from the btc world about 3 years ago when micropayments became expensive, in 2020  I decided to take another look to see what's going on and discovered the LN.

To get you started, please check out this thread to get your 200 satoshis to play around with the LN bitcoins:
https://bitcointalksearch.org/topic/--5275451

For some more fun, visit my Telegram channel where we occasionally play a simple Lightning Dice doing small quick and easy bets (100-1000 satoshis depending on the mood) via LN:
https://web.telegram.org/#/im?p=g407859681
  
You will see how easy and simple you can send and receive a couple of $$ via the LN.

Word of Caution: For the start, install one of the easiest custodial wallets like Wallet of Satoshi or Blue Wallet. Leave more advance stuff for the future.

GO LIGHTNING GO !!
sr. member
Activity: 1372
Merit: 322
Bob open a 1BTC channel with Alice and send her 0.5BTC. If Alice wants to send Bob 0.5BTC may she uses the same channel or it is just onedirection channel  and she has to open another channel which is in direction Alice->Bob and use this for paying Bob.
What you need to understand is that LN is a kind of settlement. So, yes. Alice can send Bob and vice versa with one channel. But there are some sort of restrictions on receiving fund. If you have started a channel with 1 BTC, as long as you don't send any fund, you can't receive any too. You can only receive fund as the same amount which you sent although it can be increased in some way.
legendary
Activity: 1876
Merit: 3139
Is LN channel bidirectional?

Yes, all Lightning Network channels are bidirectional. There is no reason to artificially change that. Consider reading my "Basics of The Lightning Network" thread if you are still confused. I also updated the FAQ yesterday. You might find these two threads useful.

2) May Bob and Alice open just 1 channel where both fund 1 BTC so the total balance of the channel will be 2 BTC or the only possible way is that Bob opens channel with Alice where he funds 1 BTC so the total balance will be 1BTC and Alice has to opend channel with Bob, where she fund 1 BTC?

Currently, it is not possible for two people to provide funds for the same channel. Theoretically, Bob could open a channel with 2 BTC and push 1 BTC to the Alice's side.
newbie
Activity: 8
Merit: 0
Hi guys,
I would like to ask one question, cause I am a little bit confused. The question is about payment channels and their direction. Is LN channel bidirectional? I read on the Internet tha channel shoul be but I am not pretty sure, if It has been developing or if it has already worked.

Example:

1) Bob opens a 1BTC channel with Alice and sends her 0.5BTC. If Alice wants to send Bob 0.5BTC may she uses the same channel or it is just onedirection channel and she has to open another channel which is in direction Alice->Bob and use this for paying Bob.

2) May Bob and Alice open just 1 channel where both fund 1 BTC so the total balance of the channel will be 2 BTC or the only possible way is that Bob opens channel with Alice where he funds 1 BTC so the total balance will be 1BTC and Alice has to opend channel with Bob, where she fund 1 BTC?

Thank you veru much for response
newbie
Activity: 6
Merit: 2
Thank you for the guide.
Looking for more reallife cases to see it better in application.
I believe however, LN has a good future, especially when it comes to payments made in local shops.
hero member
Activity: 1358
Merit: 851
I have not seen it on reputed exchanges.
Bitstamp and Bitfinex are two of the reputed exchanges which at the moment accepting Lightning Network payments; I don't know how much reputed both the exchanges to you. I had created a thread on exchanges accepting LN payments- Some exchanges accepting Lightning Network
And yeah, LN is very good for the small transactions; big transactions are mostly unlikely to be transacted through LN unless someone needs super fast transaction.
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
The lightning network makes transactions faster at low transaction fee. It is only supported by few wallets now. I have not seen it on reputed exchanges. It is good for small transactions lime the coffee shop used as an example and lastly, it is a bit centralized.
legendary
Activity: 1876
Merit: 3139
Someone (Bitcoin developeers??)  just did an upgrade for wallet and only one point which has to be done is to upgrade wallet (or the provider has to upgrade wallet) and than you are free to use LN. Or what is the process of implementation ?

You have to use a dedicated software wallet in order to be able to use the Lightning Network. Lightning Network wallets can also act as normal Bitcoin wallets. Otherwise, they wouldn't be able to open and close channels which require on-chain transactions. The Lightning Network works on top of the Bitcoin blockchain and is fully optional so I doubt it will be available in every wallet. Each implementation has to follow the specs.

Channels are established and closed using Bitcoin transactions and the transactions inside the channels (they are not broadcast to Bitcoin nodes) are valid thanks to timelocks and pre-signed Bitcoin transactions. I guess that's the shortest possible way of describing how it works.
newbie
Activity: 8
Merit: 0
Hi guys,
I am just curious, how it is possible, that LN is implemented without softfork ( I know that thanks to Segwith LN is implemented) but what is the proces of implementation ? how does it worked ? Someone (Bitcoin developeers??)  just did an upgrade for wallet and only one point which has to be done is to upgrade wallet (or the provider has to upgrade wallet) and than you are free to use LN. Or what is the process of implementation ? Thank you very much.
full member
Activity: 519
Merit: 197
You can also use LN with gambling sites.
Well, there are a lot of usage of LN; in daily life, where you used to purchase your daily necessaries could be a great place for lightning network payments.
I found website storing payment by the lightning network
https://lightningnetworkstores.com/
https://joltfun.com/
Never tried before so do with your own risk.
hero member
Activity: 1358
Merit: 851
However these concepts are hard to grasp for common folk, this won't be easy at all.
I have tested LN with testnet BTC and so far, it's very easy to use & hadn't face much of problem. I have done it with Eclair BTC wallet & I guess this one is very much user-friendly; even for a non-tech guy.
Quote
I see very little reason to use LN in most bitcoin transfers, others will try to (ab)use it for everything including a lambo...
Not true. LN can be used as wide variety of payments where we do transfer BTC in a regular basis. For instance; you can use LN in exchanges for liquidity of your BTC instantly or putting a purchase order of ETH(any alt) faster. Or you can also have the arbitrary opportunity with LN; transferring BTC from exchanges to exchanges made faster with LN. Bitfinex & some other exchanges accept LN payment now. You can also use LN with gambling sites.
Well, there are a lot of usage of LN; in daily life, where you used to purchase your daily necessaries could be a great place for lightning network payments.
No one will use LN for a bigger amount payment of course; LN is designed to focus on micro payments generally.
You have the privacy benefit as well; I'm not certain though but as far as I know, it's not that easy to trace a LN payment of course.

Quote
but you could also have paid the coffee long before going into the shop (such as from your workplace).
I don't know if people would be much of interested to pay advance for a coffee from workplace which is gonna be drunk after a while; Have you ever paid for such items with other available payment network? In my local, I could have paid advance with paytm but I doubt I would ever consider paying advance for a coffee; in fact, I wouldn't for anything other than ordering something online which require advance payment.
legendary
Activity: 2030
Merit: 1573
CLEAN non GPL infringing code made in Rust lang
Two problems we see when you want to pay $2 for a coffee.
- You will not be happy to pay $1 fee for spending $2 worth of BTC.
- Alice will not accept BTC because it requires much time to get confirmed.

This is not true. Alice can wait and not serve you anything until it gets a confirmation, it is you Bob who needs to leave quickly. There is no reason for Alice to reject bitcoin, she could risk it and trust you or make you wait. LN is like a virtual tab that would help alleviate this in the future, but you could also have paid the coffee long before going into the shop (such as from your workplace).

Of course if you are a recurring customer, you would make the most use of it, since you both can leave the channel open and do several more transactions maximizing the LN use before consolidating.

However these concepts are hard to grasp for common folk, this won't be easy at all. Wallets need to be designed very carefully when they support LN. I see very little reason to use LN in most bitcoin transfers, others will try to (ab)use it for everything including a lambo...
full member
Activity: 519
Merit: 197
Because you quated me, look like bitlum.io website has been off. Can't use any more

I have news about bitfinex exchange use LN now.
https://www.bitfinex.com/posts/440
Quote
Bitfinex Launches Support for the Lightning Network

Connect to the Bitfinex Lightning Node https://ln.bitfinex.com/

https://support.bitfinex.com/hc/en-us/articles/360039801053-Lightning-Network-BTC-LNX-Deposits-Withdrawals

Lightning Network BTC (LNX) Deposits & Withdrawals



full member
Activity: 1204
Merit: 220
(ノಠ益ಠ)ノ
LN boxes:

raspiblitz
https://github.com/rootzoll/raspiblitz

Lightning-in-a-box
https://lightninginabox.co/product/lightning-in-a-box-qotom-case/

Nodlbox
https://www.nodl.it/nodlbox/


Raspiblitz right now probably one of the best ways to learn LN. Very easy to deploy, smooth learning curve, will teach you all you need to start) Haven't tried btcpayserver (https://github.com/btcpayserver/btcpayserver) tho, but looks like docs are fine
Pages:
Jump to: