<aside> 📘 TL;DR;
为了解决 BTC 网络拥塞的问题,Lightning Network 协议类似于交易所,但是比交易所更加去中心化,并且是 P2P 的。支持 Lightning Network 的双方可以生成一个 BTC 主网上的多签钱包质押一定数量的 BTC,建立一个 Lightning channel,然后在这个 Channel 上进行高效、低成本的转账。即使双方没有直接的 channel,也可以通过第三方节点进行路由。在 Lightning channel 上的每一笔转账都需要钱包私钥的签名,所以无需担心抵赖。当双方决定关闭 channel 时,会根据 channel 上的交易历史计算出最终的余额分配,然后将 BTC 主网上的多签钱包按比例分配。
</aside>
<aside> 📘 Relates
Bitcoin’s UTXO Model: What Is It and How to Manage UTXOs | River
What Is the Lightning Network?
</aside>
Bitcoin’s blockchain can only process an average of 7 transactions per second. This is not enough to make Bitcoin a suitable platform for handling the millions of transactions humans make every day. Thus, if Bitcoin is to become a medium of exchange, payment systems must be built which allow users to transact bitcoin quickly and cheaply. The Lightning Network is one such payment system.
Bitcoin itself cannot scale to have every single financial transaction in the world be broadcast to everyone and included in the block chain. There needs to be a secondary level of payment systems which is lighter weight and more efficient.
– Hal Finney describing the need for layered scaling solutions, BitcoinTalk Forum
The Lightning Network is a second-layer protocol designed to enable off-chain Bitcoin transactions, which are not recorded on the blockchain. Because they are not recorded on the blockchain, and thus require no mining, Lightning payments are extremely fast and cheap.
River Financial uses the Lightning Network to enable users to instantly deposit or withdraw. (Youtube)
Similar to the Bitcoin network, the Lightning network is made up of nodes running the Lightning Network software. Unlike the Bitcoin network however, Lightning transactions are not publicly broadcast and stored by all members of the network. Instead, individual Lightning nodes transact with one another privately. Lightning nodes use channels to execute such payments.
A Lightning channel is a bidirectional payment channel, meaning both parties can send and receive payments across the channel. Lightning channels comprise the Lightning Network and have a defined bitcoin capacity. This capacity is split between the two parties to the channel, and bitcoin is moved from one side of the channel to the other by Lightning transactions.
Two parties open a Lightning channel by depositing bitcoin in a 2-of-2 multisig address. This transaction is recorded on the Bitcoin blockchain, and when this transaction is confirmed, the Lightning channel is opened. Once open, a Lightning channel enables both parties to execute any number of transactions cheaply and instantly. When the two parties are done transacting, they can close the channel with another on-chain Bitcoin transaction, which will reflect the net change in both of their balances.
A payment channel is a pool of funds divided between two parties. These funds are always stored in the multisig address—there is no extra token or representation of the bitcoin created by the Lightning Network. Lightning transactions occur over this channel by redistributing the funds stored in the multisig address. Whenever bitcoin is spent through the channel—from party A to party B—the channel’s balance updates. However, these updates are not recorded on the blockchain.
In the example below, Alice and Bob open up a channel and deposit 1 BTC each in a multisig address. Then Bob pays Alice 0.5 BTC on the Lightning Network. The shared balance is still 2 BTC, but 1.5 BTC belong to Alice, and 0.5 to Bob.
A Lightning Channel allows users to transact off of the Bitcoin blockchain.