Bitcoin Forum
May 08, 2024, 12:07:32 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: how lightning network works off chain  (Read 104 times)
cafter (OP)
Full Member
***
Offline Offline

Activity: 448
Merit: 222



View Profile WWW
March 11, 2023, 01:45:25 PM
 #1

my question is how lightning network works offchain,
does it functions like real blockchain ?, and all transaction data where being stored,?
lightning network also creates transaction history in real blockchain?

1715126852
Hero Member
*
Offline Offline

Posts: 1715126852

View Profile Personal Message (Offline)

Ignore
1715126852
Reply with quote  #2

1715126852
Report to moderator
1715126852
Hero Member
*
Offline Offline

Posts: 1715126852

View Profile Personal Message (Offline)

Ignore
1715126852
Reply with quote  #2

1715126852
Report to moderator
The network tries to produce one block per 10 minutes. It does this by automatically adjusting how difficult it is to produce blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715126852
Hero Member
*
Offline Offline

Posts: 1715126852

View Profile Personal Message (Offline)

Ignore
1715126852
Reply with quote  #2

1715126852
Report to moderator
mendace
Sr. Member
****
Offline Offline

Activity: 462
Merit: 613


Pizza Maker 2023 | Bitcoinbeer.events


View Profile WWW
March 11, 2023, 06:31:20 PM
 #2

my question is how lightning network works offchain,
does it functions like real blockchain ?, and all transaction data where being stored,?
lightning network also creates transaction history in real blockchain?



The Lightning Network is not a blockchain in its own right, but rather a network of off-chain payment channels (outside the block chain) that exploits the blockchain as a security and guarantee system.

 In practice, transactions on the Lightning network are made through payment channels between users, which are made up of blockchain transactions locked by smart contracts.  These contracts ensure that parties involved in the channel can only exchange funds up to the amount of money initially blocked.
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1512
Merit: 7357


Farewell, Leo


View Profile
March 11, 2023, 07:49:27 PM
Last edit: March 11, 2023, 10:58:30 PM by BlackHatCoiner
Merited by ABCbits (1)
 #3

Lightning doesn't work like a blockchain, no. Transaction data is shared only between channel partners, and is updated throughout. The only history lightning leaves on-chain is the opening and closing channel transactions.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
based52
Newbie
*
Offline Offline

Activity: 11
Merit: 7


View Profile
March 14, 2023, 03:37:16 AM
 #4

Lightning network works through a concept called Atomic Multi-Path Payments:
https://bitcoinops.org/en/topics/atomic-multipath/

These are effectively payment channels secured by multi-signature, they start on chain with a channel opening commitment:
https://docs.lightning.engineering/the-lightning-network/liquidity/manage-liquidity#channels

This is the start of the on chain portion of lightning.

The off chain lightning network is enabled once these channels are established, re-balancing channels is an example of an off-chain task you can do with the established channels:
https://docs.lightning.engineering/the-lightning-network/liquidity/manage-liquidity#rebalancing-channels

Once a user wants to settle the funds back on the main bitcoin chain they need to initiate a channel close:
https://docs.lightning.engineering/the-lightning-network/liquidity/manage-liquidity#closing-channels

There are two options for this, a cooperative close:
Quote
In a cooperative close both nodes are signing a new commitment transaction and publishing it to the network. The on-chain funds created in such a transaction will become available for a new channel opening almost immediately. In such a case it is also possible to set the fee with the --conf_target or --sat_per_byte arguments and define which address the funds should be sent to via --delivery_addr (unless this was already specified at the channel opening).

And a force close:

Quote
When closing a channel unilaterally, known as a force close, the funds will be locked up for a period of time before they can be redeemed by the closer, while the other party can redeem their funds immediately. Unless an anchor channel was created, you are unable to change the transaction fee of the closing transaction. To force close a channel use the --force flag.

Both of these closes involve finalizing the state of the atomic multi signature script committed to by the members of the channel on chain.

(closing channel quotes are from https://docs.lightning.engineering/the-lightning-network/liquidity/manage-liquidity#rebalancing-channels)
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!