Lightning Network

in lightning •  4 years ago 

The Lightning Network mainly improves the transaction channels under the Bitcoin chain by introducing the idea of ​​smart contracts. Technical features:
One is Recoverable Sequence Maturity Contract (RSMC), and the other is Hashed Timelock Contract (HTLC). The former solves the confirmation problem of off-chain transactions, and the latter solves the problem of payment channels.

RSMC defines a transaction to establish a micro-payment channel through multi-signature, one is a revocable contract when the sequence expires. A part of the funds is deposited in the micro-payment channel, and the channel also records the allocation plan of the two parties. When the channel is first established, the initial value may be {Alice: 0.4, Bob: 0.6}, which means that the total funds injected into the channel are 1.0 BTC, of ​​which Alice owns 0.4 BTC and Bob owns 0.6 BTC. The establishment of the channel will be recorded on the Bitcoin blockchain.

If Alice does not need to use the 0.5 BTC that belongs to her in the channel as payment for the time being, she does not need to update the channel balance distribution plan recorded on the blockchain in time, because it is very likely that Alice will need to pay Bob 0.1 BTC in reverse in a minute , At this time, they still only need to agree on the new balance distribution plan under the chain, and try to invalidate the previous version of the balance distribution plan.

If Alice intends to terminate the channel and use her share of funds, she can show the balance distribution plan signed by both parties to the blockchain. If Bob does not raise an objection within a period of time, the blockchain will terminate the channel and transfer the funds to their respective pre-established withdrawal addresses according to the agreement. If Bob can submit evidence within this period of time that Alice is attempting to use a balance allocation plan that both parties have agreed to void, Alice's funds will be fined and given to Bob.

HTLC defines an agreement in which both parties have time or a high limit. Through HTLC, Alice and Bob can reach such an agreement: the agreement will lock Alice's 0.1 BTC, before the arrival of time T (T is expressed by a certain blockchain height in the future), if Bob can show Alice an appropriate R( Called secret), so that the hash value of R is equal to the previously agreed value H®, Bob can obtain the 0.1 BTC; if Bob still fails to provide a correct R until the time T has passed, the 0.1 BTC will be automatically unfrozen and returned Alice.

Of course, the Lightning Network payment channels are much more than that.

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!