What new opportunities will Lightning Network + Smart Contract bring to the Bitcoin ecosystem?
This article is machine translated
Show original
For a long time, the Lightning Network has only been applied to peer-to-peer payments of Bitcoin, and has been alienated by the vast majority of Crypto users due to the lack of smart contracts and token incentives. However, as one of the Bitcoin expansion solutions that best embodies Satoshi Nakamoto's ideas, if the Lightning Network can be organically integrated into the smart contract scenario, it may open up a brand-new Bitcoin expansion paradigm.
Recently, BEVM Core Builder—Gavin has announced on his Twitter how to add smart contract functionality to the Lightning Network, as well as how to design an escape hatch mechanism for the Bitcoin second layer using the Lightning Network, and revealed that the BEVM team has officially launched this solution.
This article will continue this line of thought, and reflect on the basic principles of the Lightning Network and the integration of the Lightning Network and the Bitcoin second layer.
I. Basic Principles of the Lightning Network
The Lightning Network (LN) is one of the earliest Bitcoin second layer expansion solutions, and its main application scenario is to achieve fast and low-cost Bitcoin peer-to-peer payments.
The technical core of the Lightning Network is the state channel, which is the Bitcoin expansion solution mentioned in Satoshi Nakamoto's Bitcoin white paper. Bitcoin developers Joseph Poon and Thaddeus Dryja published related papers on state channels and developed the Lightning Network, which was eventually developed and landed by teams such as Lightning Labs, Blockstream, and ACINQ, and supported and sought after by a group of Bitcoin OGs including Jack Dorsey.
The application of state channels in the Lightning Network has realized the function of fast, almost zero-cost peer-to-peer payments.
Now, let's review the basic operating principles of the state channel:
When the two parties establish a state channel for transactions, only the first transaction (establishing the state channel) and the last transaction (closing the state channel) will be recorded on the Bitcoin chain, and all the remaining transactions will be conducted off-chain, that is, within the state channel.
The Bitcoin transactions conducted within the state channel (which can be understood as the BTC on this "Bitcoin second layer" rather than the BTC on the Bitcoin mainnet) are fast and cost-effective, and the account book of the two parties will show a real-time changing "BTC balance sheet", and each transaction requires a signature to ensure the legality and accuracy of the transaction.
When either party closes the state channel, the system will submit the latest "BTC balance sheet" to the Bitcoin mainnet for verification, and this verification process is generally set to a 7-day verification period, or a "challenge period", which essentially means that both parties can initiate a challenge within these 7 days, and after the time expires, Party A and Party B will receive the BTC amount according to the latest "BTC balance sheet". If both parties can confirm in time, the transaction can be completed immediately.
(The Ethereum second layer expansion solution OP-Rollup is also modeled after the principle of the state channel, with all transactions conducted on the second layer and then submitted to the Ethereum mainnet for verification, with a 7-day challenge period)
Let's give an example:
Suppose there are two LN nodes A and B who want to use the state channel to conduct BTC transactions, the specific steps are as follows:
1. A and B establish a state channel.
A and B both need to deposit a pre-determined amount of BTC into the state channel, for example, A deposits 10 BTC and B deposits 5 BTC, at which point a new multi-signature Bitcoin address will be generated, and the BTC amounts locked by A and B will be reflected in the C address (C address is the multi-signature address generated by A and B, similar to a smart contract address without private keys).
At this point, the "BTC balance sheet" of A and B is:
A: 10BTC
B: 5BTC
C: 15BTC
2. When A and B start trading, the "BTC balance sheet" of A and B begins to update
Suppose the first transaction, A signs to send 1 BTC to B,
The BTC balance sheet is updated to:
A: 9BTC
B: 6BTC
C: 15BTC
The second transaction, B signs to send 5 BTC to A
The BTC balance sheet is updated to:
A: 14BTC
B: 1BTC
C: 15BTC
And so on, as A and B continue to trade, the BTC balance sheet continues to update (essentially the second layer ledger is constantly updating, it just hasn't been returned to the mainnet for verification yet)
3. Close the state channel
Either A or B can close the state channel at any time
Suppose when the state channel is closed, the BTC balance sheet is:
A: 12BTC
B: 3BTC
C: 15BTC
When the state channel is closed, the latest "BTC balance sheet" will be submitted to the Bitcoin mainnet, and a 7-day verification period will be initiated, and if A and B have no objections, the transaction will be completed. If either party fails to verify in a timely manner, the BTC will be distributed according to the "BTC balance sheet" after the 7-day period expires.
The above is the basic operating principle of the state channel.
In summary, the state channel uses a mechanism of mutual signing + time lock to safely realize peer-to-peer Bitcoin payments without a third-party custodian, and achieve fast and low-cost transactions through off-chain transactions + mainnet verification.
II. The Innovative Combination of the Lightning Network and Taproot Consensus
After understanding the basic principles of the Lightning Network, i.e. the state channel, we can then look at the upgrade design of the state channel, which is the integration of the state channel and the Bitcoin second layer and smart contracts, which will give birth to more innovative scenarios.
Taking the Lightning Network + Taproot Consensus proposed by BEVM as an example, let's describe this innovative scenario.
Taproot Consensus is BEVM's Bitcoin second layer solution, where the many nodes of the BEVM network will generate a Taproot contract address on the Bitcoin mainnet based on Schnorr signatures and MAST, and this Bitcoin address is maintained by the BEVM network consensus, similar to the ETH custodial contract address created on the Ethereum mainnet by the Ethereum second layer.
This Taproot contract address can become a Lightning Network node (LN node), which we will call LN node B.
Any Bitcoin user or institution can operate a Lightning Network node, which we will call LN node A.
In this way, the BEVM Taproot contract address (LN node B) can establish a state channel with any Bitcoin user or institution (LN node A), and thus conduct any form of transaction within the state channel in a trustless manner.
Note! At this point, the convenient door to truly secure, trustworthy and user-friendly Bitcoin second layer expansion has been fully opened!!!
Let's see what happened.
A Bitcoin institution (LN node A) and the Bitcoin Taproot contract address of BEVM (LN node B) establish a state channel, at which point a multi-signature contract address C will be generated.
Suppose LN node A (Bitcoin institution) locks 1000BTC, and LN node B (BEVM's Taproot contract address) locks 10BTC, then the "BTC balance sheet" at this time shows:
A: 1000BTC
B: 10BTC
C: 1010BTC (C is the multi-signature contract address generated by A and B)
Because the Bitcoin Taproot contract address of BEVM is one of the nodes of the state channel and one of the multi-signature addresses of C, it represents BEVM's contract address on the Bitcoin mainnet having the management authority of 1010 BTC, so BEVM's mainnet can then display 1010 BTC 1:1. And A's address on the BEVM mainnet can then perform any form of smart contract operation on the BEVM mainnet, and the "BTC balance sheet" within the state channel of A and B will also change accordingly before each mainnet operation.
For example, A uses the lending protocol on the BEVM mainnet, pledging 100 BTC to borrow 1 million USDT, before executing this transaction, A needs to sign to transfer 100 BTC to B's state channel address
At this point, the "BTC balance sheet" of A and B will change as follows:
A: 900BTC
B: 110BTC
C: 1010BTC
For example, A uses the DEX on the BEVM mainnet to sell 100 BTC for 6 million USDT, before executing this transaction, A needs to sign to transfer 100 BTC to B's state channel address.
At this point, the "balance sheet" of A and B will change again:
A: 800BTC
B: 210BTC
C: 1010BTC
A is the LN node of the Bitcoin institution, B is the LN node of the BEVM Taproot contract address, and B can sign and settle the BTC spent by A at any time. At this point, if B has no objections, the transaction is confirmed and settled.
If A has any questions about the settlement, it can initiate a challenge within the 7-day challenge period, and after the Time Lock expires, the transaction will be automatically confirmed and settled.
Even in the most extreme case, such as the BEVM network being paralyzed, A can still retrieve its unspent BTC after the Time Lock expires, which is full of a sense of security. Bitcoin users no longer have to worry about their BTC being lost or unable to retrieve their assets due to chain issues.
In a sense, this is a "Bitcoin second layer escape hatch mechanism" that has already been implemented.
In summary:The solution proposed by the BEVM team, which combines the Lightning Network and Taproot Consensus, essentially treats Bitcoin users or institutions as a Lightning Network node (and Bitcoin institutions can also use multi-signature addresses as nodes), and the BEVM chain itself as another Lightning Network node. By establishing a state channel between the two Lightning Network nodes, Bitcoin can circulate safely in the Bitcoin second layer, as the BTC spent in the second layer essentially circulates within the state channel.
This solution combines the native and orthodox nature of the Lightning Network, while also expanding the application scenarios of state channels, allowing BTC not only for payments, but also for on-chain lending, Swap, and other smart contract operations.
More importantly, users using the Lightning Network to participate in Bitcoin second-layer on-chain activities have no security concerns.
The "Bitcoin second-layer escape hatch mechanism" proposed by the BEVM team solves the security concerns of Bitcoin users.
For a long time, Bitcoin users, especially large Bitcoin holders, have been full of security concerns about any on-chain activities, whether it involves cross-chain, smart contracts, or on-chain interactions. Large Bitcoin holders would rather keep their BTC in cold wallets and forgo any returns than put their BTC on-chain.
According to public data, the total amount of BTC currently on-chain is less than 1% of the total Bitcoin supply, with the top-ranked WBTC at 154,000 and the second-ranked TBTC at around 3,500.
Security concerns are the primary obstacle to the large-scale development of the Bitcoin second layer.
The integration of the Lightning Network state channel and Bitcoin second-layer smart contracts proposed by the BEVM team may solve this problem.
As mentioned above, any Bitcoin user can establish a transaction with the BEVM chain through a state channel, signing only the amount they want to spend; if they don't spend, they don't sign, and the BTC will forever remain in their hands. In other words, Bitcoin users have complete control over the spending of their BTC.
Even if the Bitcoin second-layer network becomes paralyzed or shut down, the BTC will automatically return to the user's original address after the set Time Lock expires, completely unaffected by external factors such as the chain and smart contracts.
This undoubtedly solves the biggest pain point of Bitcoin users and clears the "obstacle" for the large-scale development of the Bitcoin second layer.
The Lightning Network + smart contract mechanism design not only solves the security concerns of Bitcoin users but also promotes the development of the Lightning Network.
In the nearly 10 years of development of the Lightning Network, there have been two problems that have plagued developers.
First, how to add smart contract functionality to the Lightning Network, so that BTC can not only be used for payments but also for lending, Swap, derivative trading, and other complex applications on the Lightning Network. The essence of this problem is "how to give BTC programmable smart contract functionality in a decentralized way".
Second, how to make the Lightning Network have a Byzantine fault-tolerant mechanism to solve the efficiency and security issues brought by the peer-to-peer network.
The solution proposed by the BEVM team, which combines the Lightning Network and Taproot Consensus, provides answers to these two problems.
First, the Taproot Consensus itself is an organic integration of Bitcoin SPV nodes, Schnorr signatures, and MAST, which can ensure the data consistency between the Bitcoin second layer (BEVM network) and the Bitcoin mainnet.
Secondly, by introducing the Lightning Network design, the BEVM chain itself can be used as a Lightning Network node, allowing BTC to circulate freely within the state channel, and further using Taproot Consensus to enable the BTC circulating within the state channel to be used for any smart contract application, so that BTC is no longer limited to payments, but can also be used for lending, Swap, Staking, derivative trading, and other complex scenarios.
This innovative design is a great expansion of the Lightning Network and will play a significant role in the long-term development of the Lightning Network.
Using a BFT consensus network as a Lightning Network node solves the decentralized fault-tolerance problem of the Lightning Network.
It is well known that the Lightning Network is a peer-to-peer network, but not a decentralized Byzantine fault-tolerant network.
A decentralized Byzantine fault-tolerant network relies on BFT network consensus to operate, and users only need to trust the BFT network consensus, not any single point or individual. Users only need to hold the private key generated on the chain to execute any transaction on the chain, essentially transacting with a BFT consensus network, not an individual.
However, in a peer-to-peer network, the transaction parties are individuals or single points, which highly depend on the professionalism, immediate responsiveness, and even node maintenance capabilities of each participating node. The response capability and honesty of a single point determine the efficiency and security of the transaction.
For example, if A and B establish a state channel in the Lightning Network for a transaction, and B is a dishonest node while A is not proficient enough in Lightning Network verification, if B submits a dishonest bill to the chain before the transaction is completed, and A fails to initiate a challenge within the 7-day challenge period due to lack of professionalism, A will face the risk of asset loss or double-spending. The Lightning Network has extremely high requirements for the professionalism of the participating parties.
The above are the practical problems often encountered in the development of the Lightning Network, which is also one of the important reasons for the slow development of the Lightning Network in recent years.
However, the solution proposed by the BEVM team is to use the BEVM chain itself as a Lightning Network node, and the user will no longer be transacting with a single point or individual, but with a blockchain network driven by BFT consensus and verified by 1,000 nodes. The chain itself is guaranteed by the consensus mechanism, and users do not need to worry about the troubles and risks brought by transactions with dishonest nodes, which will greatly solve the decentralized fault-tolerance problem of the Lightning Network.
In summary, the solution proposed by the BEVM team, which combines the Lightning Network and Taproot Consensus, has solved at least three problems in the development of the Bitcoin ecosystem:
1. By designing the "Bitcoin second-layer escape hatch mechanism", it solves the long-standing on-chain security concerns of Bitcoin users.
2. By endowing the Lightning Network with smart contract functionality, it breaks through the limitation of the Lightning Network being only for Bitcoin payments, and from now on, Bitcoin can also have programmable smart contract capabilities through the Lightning Network.
3. By using the BEVM chain as a Lightning Network node and replacing single nodes with BFT network consensus, it greatly alleviates the decentralized fault-tolerance problem of the Lightning Network.
Original link: https://bevm-blog.webflow.io/post/how-to-design-an-escape-hatch-for-bitcoin-l2-using-the-state-channel
Source
Disclaimer: The content above is only the author's opinion which does not represent any position of Followin, and is not intended as, and shall not be understood or construed as, investment advice from Followin.
Like
Add to Favorites
Comments
Share
Relevant content