Bitcoin Forum
May 26, 2024, 04:15:29 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question about lightning network.  (Read 126 times)
Old layer (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 8


View Profile
January 01, 2023, 10:35:19 AM
Merited by BlackHatCoiner (4), _morghulis (2)
 #1

I'm new to Bitcoin and crypto in general, and I've been doing some reading to get a better understanding of how it works. and I came across "Lightning Network" and I like it, but I have some questions about some things I'm not sure about.

Does a transaction get sent to the Blockchain when you use the Lightning Network to send payment to someone you're not directly connected to via an intermediary node? Because, according to what I've read, only the first and last transaction appear in the Blockchain, I'm not sure if those involving an intermediary node will as well.
Edwardard
Hero Member
*****
Offline Offline

Activity: 1050
Merit: 681



View Profile WWW
January 01, 2023, 11:36:11 AM
 #2

Does a transaction get sent to the Blockchain when you use the Lightning Network to send payment to someone you're not directly connected to via an intermediary node?
Yes, an intermediary node is involved in lightning network. An intermediate node knows the previous hop's identity and the identity of the next hop as well as the forwarded amount, the hash-lock, and the timeout value.
Businesses that invest in Lightning Network nodes may become hubs or centralized nodes in the network by having more open connections with others.

Read more here: 1. Investopedia
2. Lightning network privacy
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1526
Merit: 7433


Farewell, Leo


View Profile
January 01, 2023, 02:31:21 PM
 #3

You're making two questions here:

  • Can you pay someone you're not directly connected to, with the assistance of an intermediary node? - You can, with the use of Hashed Time Locked Contract, as long as the intermediary node(s) have sufficient liquidity.
  • How many transactions do you make on-blockchain when you pay someone either directly or with the use of intermediary nodes? - You make one transaction on-chain, wherein you open the channel with a partner, and once you're done with it (i.e., you don't want to leave funds to lightning anymore) you make another transaction for closing the channel. So, for one channel, there will be 2 transactions on-chain, regardless of how many you two accomplish off-chain.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18565


View Profile
January 01, 2023, 06:23:00 PM
Merited by ABCbits (3)
 #4

Does a transaction get sent to the Blockchain when you use the Lightning Network to send payment to someone you're not directly connected to via an intermediary node? Because, according to what I've read, only the first and last transaction appear in the Blockchain, I'm not sure if those involving an intermediary node will as well.
You are confusing different concepts here.

Lightning transactions are never committed to the blockchain. It does not matter if you pay someone you are directly connected to, or if you pay someone via 20 intermediaries. These transactions do not get broadcast or mined on the main layer.

The "first and last" transactions you have read about are the transactions to open and close your Lightning channel. Let's say you open a channel with me. That opening transaction is broadcast and mined on the blockchain, even though we haven't actually exchanged any coins yet. We can then pay each other back and forth as many times as we like, and if I am connected to other channels too, then you can pay other people using me as an intermediary. None of those payments, either between us or you using me as an intermediary, are broadcast or mined. When one or both of use decides we want to close our channel, then the closing transaction is broadcast, just like the opening transaction was.
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
January 01, 2023, 06:28:04 PM
 #5

Channels remain open until they're closed by the nodes they're created between.

While a channel is open it is essentially able to exchange contracts with other node owners to send and receive bitcoin.

When a channel gets closed, both sides operating it know how much money each should have and can close it based off that (if one broadcasts inaccurately, a penalty is charged though iirc).



Since these contract exchanges happen it means two noeds don't need a channel open between them to pay as payments can hop over several channels/servers.

It's possible for some transactions to fail though on the lighting network too if you open a channel with a node that doesn't have enough connections to be able to route your transaction fully - you'll find out within seconds if this is the case thouugh and you'll keep your funds in your channel.
Old layer (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 8


View Profile
January 01, 2023, 06:32:44 PM
 #6

~Snipped~

Wow now I get it. The number of intermediary node does matter only the opening and the closing transactions are broadcasted to the Blockchain even if I make up to a hundred transactions during the time the channel was still open those transactions wouldn't be broadcasted as long as long as the channel remains open.
Thanks for the explanation.

n0nce
Hero Member
*****
Offline Offline

Activity: 882
Merit: 5829


not your keys, not your coins!


View Profile WWW
January 02, 2023, 04:52:23 PM
 #7

~Snipped~
Wow now I get it. The number of intermediary node does matter only the opening and the closing transactions are broadcasted to the Blockchain even if I make up to a hundred transactions during the time the channel was still open those transactions wouldn't be broadcasted as long as long as the channel remains open.
Thanks for the explanation.
Exactly; you need to open a channel once, can transact as often and as many times as you want on it and close it some time in the future, settling the final balance on the blockchain. Between opening and closing transactions, nothing happens on the blockchain. That's why it's considered an L2 / off-chain protocol.

The 'number of intermediary nodes' only affects routing fees (which are pretty low though, anyway). Only real problem to consider is that sometimes you may find no route to the destination, no matter how many intermediary nodes are tried. You can counteract that by having multiple open channels, keeping them balanced and wisely choosing your channel partners.



We have a Lightning Network FAQ and Lightning Network node experience thread, as well as full node installation guides like here:
[Guide] FULL NODE OpenSUSE 15.3: bitcoind + electrs + c-lightning + RTL

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!