Main menu

Pages

Payment Channels in the Lightning Network

 

Payment Channels in the Lightning Network
Payment Channels in the Lightning Network

Funding Transaction

To show how the Lightning Network works, let's use an example of a transaction between two parties (A, B). To initiate transactions on the Lightning network, the two parties (A, and B) open a bitcoin deposit channel at a 2-term multi-address. Multiple Sig works like a dome and requires two special keys to authorize and cancel each user's funds. This means that both parties must be present to agree on the money. This first deal, called funding, is on the chain and is registered on the Bitcoin blockchain.

 

Commitment Transaction

If this deal is confirmed, the lightning channel will be created. The amount of funding treatment is the maximum of the channel, is the maximum amount of money that can be transacted through the channel. Commitment to treatment After opening the channel, the two parties (A, B) can start signing transactions multiple times with each other. times they want. These transactions take place outside of the blockchain and are called commit transactions. Cheap and instant transactions as they should not be mined and released through the Blockchain Bitcoin 1 network.

 

Closing Transaction

Both parties keep a private local copy of the teacher's book to match their account balance and update it for each transaction. Transactions move between two points at lightning speed; Therefore, each time a deal is made between them, the state of the channel will be updated and the previous state will no longer be valid. This prevents fraud as the first party (A) or the second party (B) cannot refer to the previous state of the channel when deciding to settle the transaction on the blockchain. Closing When
the two parties decide to settle the funds, they can enter into a closing treatment called equalization treatment. The final transaction is mined and recorded on the blockchain.


The final treatment only reflects the final balance between users. Lightning doesn't require the cooperation of each of them to get out of the channel. Either the first two parties (A) or the second (B) decide to close the channel and end the relationship. This prevents fraud because it prevents one of them from moving to a position without communication and blocking the other's money within the channel.

 

Routing Bitcoin Transactions on LN

Routing

The guide can act even when not directly connected. Since all parties have multiple signature channels with different users on the network, users can manage any other party over the network as long as there is a channel connection path between them. If the user wants to negotiate with a user but is not connected to a direct channel, he does not need to create another payment channel. It may be indirectly linked through one or even multiple contracts; Therefore, the sender
can route the transaction using other contract paths. There must be enough liquidity in the channel paths for it to work properly on the Lightning Network.


As long as there are enough interconnected channels and boxes in the channel path, transactions can take place. Let's say the second party (B) wants to pay for another (C) but has no direct payment channel between them. However, (B) has a payment channel with (A), which has a payment channel with (B). If (B) wants to send 1000 SAT to (C), 1000 SAT (plus token charges) will be shifted along channel bob. Then (A) transfers 1000 SAT from his side to (C).


This leaves the scale (A) untouched and (B) able to send a pulse to (C). How can (B) pay for (C) without (A) stealing bitcoins? To avoid fraud in the system, closed contracts (HTLC) are used. HTMLCS allows transactions to be routed across multiple contracts. HTMLCS allows two parties to trade without a direct channel between them, using intermediate channels instead. HTLC is a normal treatment of Bitcoin with a single text program inside it, also known as Smart Nodes.

 

How can Alice pay Charlie without Bob stealing the bitcoin in the process

It is a conditional stack, where the transaction is blocked for a certain period of time. HTLCs work as a promising mechanism by producing conditional payments in Bitcoin. HTLC hashlocks and timelocks are used to request the future of payment as approval to receive payment before the deadline by creating a crypto guide to pay or lose the ability to claim the amount and the motivation to send it back.

 

  1.    Time locks are used to shorten the duration it stays open. This prevents the user from disappearing from the network and keeping the wallet closed. If one party is absent, the other party can still get their money back when the schedule ends.

  2.     Hashlock: Hashlock is a type of mechanism that restricts output until a specific piece of data is encountered. 

     

تعليقات