Lightning network transaction

in lightning •  4 years ago 

Content

Suppose, Bob thinks that he could get 7btc before, but now only 6btc is left, and he wants to broadcast the old transaction in breach of contract. So, what are the consequences of breaching appointments under this mechanism? Bob will lose all btc! ! ! First, Bob can only broadcast transaction 1, and Alice instantly gets 3btc; next, Bob broadcasts transaction 2 and waits for 1,000 yuan to get 7btc. But because Alice has the private keys of A1 and B2, she can immediately use the 7btc in the A1B2 address and transfer the funds to herself immediately before transaction 2 takes effect. This kind of show operation makes Alice get all 10 btc, and Bob will not have any money left. Therefore, under this ingenious design, the Lightning Network can still complete fast transactions smoothly without mutual trust and transactions on the chain.

What if Alice and Bob want to end the lightning channel? In the case of peace, each sign the latest transaction for the other party and broadcast it to get coins immediately. When one party wants to forcibly end the channel, it only needs to sign two transactions that are beneficial to the other party, and the other party will get the coins immediately, and the party that has to end the channel forcibly needs to wait for 1,000 blocks before getting its own coins. This is the penalty for the forced end.

Lightning network transaction
The above are all the details of the peer-to-peer transaction between Alice and Bob. If Jack wants to join their transaction, do Jack and them also need to establish a channel? If everyone builds a point-to-point channel, the cost is very high. The Lightning Network will find the shortest path through the entire point-to-point network and complete transactions through routing nodes. For example, Jack only establishes a peer-to-peer channel with Bob, and wants to conduct transactions with Ailce, then Bob is required to act as a routing node to assist the transaction, and the technology to achieve this function is HTLC.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!