Overview of Bitcoin Segregated Witness (SegWit)
Segregated Witness (SegWit) is a crucial upgrade protocol implemented on the Bitcoin network via a soft fork in August 2017, initially proposed by Bitcoin Core developers in 2015. Its primary goal is to address Bitcoin's scalability bottleneck and the long-standing transaction malleability flaw.

SegWit works by separating the digital signature (i.e., "witness" data) of a transaction from the core transaction data, storing it in a separate structure. This change offers multiple advantages:
- Increased Block Capacity: By moving signature data out, SegWit introduced the concept of "block weight," allowing each block to effectively accommodate more transactions, thereby increasing the network's transaction throughput.
- Resolved Transaction Malleability: This is one of SegWit's most critical improvements. Before SegWit, transaction IDs (TxIDs) could change due to minor modifications in signature data, posing security risks for second-layer solutions (such as the Lightning Network) that rely on unconfirmed transactions. SegWit fundamentally fixed this vulnerability by moving signature data to a part not used for calculating the TxID, ensuring the stability and predictability of transaction IDs.
- Reduced Transaction Fees: Increasing the effective capacity of blocks helps alleviate network congestion to some extent, thereby lowering per-transaction fees.
Overview of Lightning Network

The Lightning Network (LN) is a "second-layer" payment protocol built on top of the Bitcoin blockchain, proposed by Joseph Poon and Thaddeus Dryja in a 2015 whitepaper. Its main goal is to address the scalability, transaction fees, and transaction time issues faced by the Bitcoin main chain when processing high-frequency, small-value payments, aiming for instant, low-cost transactions.
The Lightning Network operates by establishing "payment channels" between two participants:
- Both parties first lock a certain amount of Bitcoin (BTC) on the Bitcoin main chain to open a channel, which is an on-chain transaction.
- Once the channel is open, both parties can conduct countless instant, almost free transactions off-chain. These off-chain transactions are not broadcast to the Bitcoin main chain; they only update a shared ledger between the participants.
- When the channel is finally closed, only the final net settlement result is broadcast to the Bitcoin main chain, completing the final on-chain settlement.

The main advantages of the Lightning Network include:
- Instant Transactions: Off-chain transactions can be completed almost instantly, significantly improving user experience.
- Extremely Low Fees: Most transactions occur off-chain, significantly reducing transaction costs.
- High Throughput: Theoretically, the Lightning Network can achieve millions of transactions per second (TPS), far exceeding the limits of the Bitcoin main chain.
- Support for Micropayments: It can even facilitate micropayments smaller than one satoshi.

As of March 2024, data shows that the Lightning Network has over 13,000 online nodes and more than 52,000 active channels, with a total capacity exceeding 4,570 BTC, demonstrating its growing adoption and ecosystem scale.
Synergistic Relationship Between SegWit and Lightning Network
Segregated Witness and the Lightning Network do not exist independently; they are closely linked and mutually reinforcing. SegWit laid the critical foundation for the implementation of the Lightning Network, and together, they form an important part of Bitcoin's scalability solution.

- SegWit is a Key Prerequisite for the Lightning Network: Segregated Witness solved Bitcoin's "transaction malleability" issue, which is a necessary condition for the secure operation of second-layer solutions like the Lightning Network. Before SegWit, due to transaction malleability, an attacker could potentially alter the ID of an unconfirmed transaction, thereby compromising the security of Lightning Network payment channels, as the operation and fund security of payment channels rely on the stability of transaction IDs. SegWit fixed this vulnerability by ensuring transaction IDs remain stable before transaction confirmation, providing a reliable and secure underlying foundation for the Lightning Network.
- Jointly Enhance Scalability: SegWit optimizes on-chain block space, increasing the transaction capacity and efficiency of the Bitcoin main chain; the Lightning Network, in turn, significantly boosts overall transaction throughput by moving a large number of transactions off-chain. Together, they address Bitcoin's scalability bottleneck from different layers.
- Complementary Relationship: Segregated Witness enhances the efficiency and security of Bitcoin's base layer, enabling it to better support upper-layer applications. The Lightning Network builds upon this foundation, enabling faster and cheaper everyday payments, extending Bitcoin's use cases from a store of value and large settlements to small, high-frequency daily transactions.





