Bitcoin Magazine
The Witness Discount
Les witness discount refers to the reduction in data “weight” given to the witness portion of a Bitcoin transaction — the part that contains the signatures used to prove ownership. Implemented as part of the 2017 segregated witness (SegWit) upgrade, this discount effectively lowered the fees for SegWit transactions by making the witness data count for less when calculating the total size of a transaction.
In simpler terms, the witness data gets a 75% discount, meaning that it only counts as one-quarter of its actual size when determining how much space it takes up in a Bitcoin block. This allows for more transactions per block and reduces costs for users who adopt SegWit-enabled wallets.
But why does the Witness Discount exist in the first place? What’s the point of giving the witness data this special treatment? The answer ties back to Bitcoin’s long-standing scalability challenges, and the need to increase transaction capacity without overhauling the network with a risky hard fork. In this article, we explore the purpose behind the witness discount, how it works, and why it continues to matter today.
Key Takeaways
- Witness Discount: A discount applied to the size of the “witness” (or signature) portion of a Bitcoin transaction, reducing fees.
- Part of SegWit: Witness discount is part of segregated witness (SegWit), which solved the long-standing transaction malleability issue and effectively increased Bitcoin’s block size.
- Scalability: It helps make Bitcoin transactions more efficient, allowing for more transactions per block.
Purpose of the Witness Discount
The witness discount was introduced as part of SegWit, a major upgrade to the Bitcoin protocol that separated the transaction data into two parts: the core transaction data and the witness data (mostly digital signatures). In essence, the witness data was given a “discount” in terms of how much it counts toward the overall block size.
Prior to SegWit, Bitcoin’s block size was capped at 1MB. SegWit brought an indirect block size increase by applying a lower “weight” to the witness data — thus enabling more transactions per block without exceeding the 1MB limit for non-SegWit nodes.
The witness discount accomplishes a crucial goal: It allows for more transactions to fit into a block while maintaining compatibility with older nodes that haven’t upgraded to SegWit.
How It Works
When a Bitcoin transaction occurs, the core elements of that transaction — such as the amount of bitcoin being sent and the addresses involved — are recorded. However, there’s another component called the “witness,” which stores the signatures that prove ownership of the transferred bitcoin.
- Pre-SegWit: Before SegWit, all parts of a transaction were treated equally in terms of how much space they consumed in a block.
- Post-SegWit: After SegWit, the witness data (signatures) was stored separately from the rest of the transaction data. This separation allows for more transactions to fit into a block, as the witness data is assigned a lower weight, effectively giving it a 75% discount. A full transaction under SegWit, which could previously take up, say, 300 bytes, now only contributes a smaller amount of that size to the block’s total weight.
This reduces fees for users who opt for SegWit-enabled wallets since fees are calculated based on the virtual size of the transaction, which now discounts the witness data.
History and Rationale
The story behind the witness discount dates back to the block size wars in 2015-2017. At that time, the Bitcoin community was embroiled in heated debates about how to scale the network. Larger block sizes would allow for more transactions per block, but increasing the block size directly (via a hard fork) was controversial. It risked centralizing the network, as bigger blocks are harder to propagate and store for nodes with less bandwidth and storage.
SegWit, proposed by Pieter Wuille, was introduced as a compromise. It addressed the scaling issue by creating more “effective” block space without requiring a hard fork. This is where the witness discount became important. By discounting the witness data, SegWit effectively expanded the number of transactions that could fit into a block while maintaining backward compatibility.
In simpler terms, SegWit allowed Bitcoin to have its cake and eat it too: more transactions per block without the risk of destabilizing the network.
Pros and Cons
Pros:
- Increased Block Efficiency: The witness discount allows for more transactions per block, indirectly increasing Bitcoin’s block size while keeping it backward-compatible with non-upgraded nodes.
- Lower Fees for SegWit Users: Since witness data is given less weight, SegWit transactions tend to be smaller in size, meaning lower transaction fees for users.
- Enhanced Security: SegWit solved the transaction malleability problem, making Bitcoin transactions more secure, which is especially important for second-layer solutions like the Lightning Network.
- Improved Scalability: By reducing the data burden on each transaction, the witness discount improves the scalability of the Bitcoin network.
Cons:
- Complexity: The SegWit implementation, including the witness discount, adds layers of complexity to the protocol, which some purists in the community view as unnecessary.
- Not Fully Adopted: While the witness discount encouraged the use of SegWit, many wallets and exchanges have been slow to adopt it, meaning its benefits aren’t universally experienced.
Witness Discount vs. Block Size Increase
One of the major debates in the Bitcoin scaling saga was whether to increase the block size directly or to implement a solution like SegWit, which indirectly increased the block size. So, how does the witness discount compare to simply raising the block size?
Block Size Increase:
- Direct increase in the number of transactions a block can hold.
- Increases the burden on nodes, requiring more storage and bandwidth to keep up with the network.
- Requires a hard fork, which can split the network (as seen in the case of Bitcoin Cash).
Witness Discount (SegWit):
- Achieves a similar result (increased transaction capacity) without a hard fork.
- Reduces transaction costs for users taking advantage of SegWit.
- Doesn’t impose additional burdens on nodes, making it more sustainable long-term.
Essentially, the witness discount achieves the goal of more transactions per block without compromising Bitcoin’s decentralization, a key tenet of the network’s design philosophy.
Frequently Asked Questions (FAQs)
Why is the witness discount 75%?
The 75% witness discount exists because witness data—which includes digital signatures—does not contribute to the long-term size of the UTXO set that nodes must store permanently. Since this data is only needed for transaction validation and can be discarded afterward, it has a lower impact on node resources compared to non-witness data.
With the SegWit upgrade, transaction size is measured in weight units (WU) rather than bytes. Non-witness data is assigned a weight of 4 WU per byte, while witness data is assigned 1 WU per byte—a 1:4 ratio. This means witness data is effectively counted as 25% of its original size, resulting in a 75% discount.
The choice of 1:4 weighting was a deliberate balance between incentivizing SegWit adoption, preserving network efficiency, and maintaining security. It allows more transactions per block while ensuring compatibility with pre-SegWit rules, enhancing Bitcoin’s scalability without sacrificing decentralization.
Does the witness discount mean SegWit blocks are bigger?
Yes, in practice, SegWit blocks can be larger than the pre-SegWit 1MB block limit. However, the way the block weight is calculated means that SegWit blocks are more efficient in storing data, so more transactions — that don’t count for as much weight as before — can fit into a block.
What happens if I don’t use SegWit?
Non-SegWit transactions don’t benefit from the witness discount, meaning they take up more space in a block and typically incur higher fees. However, they are still fully valid and can be processed by the network.
Is the witness discount here to stay?
As of now, there are no plans to remove the witness discount. It remains a critical part of Bitcoin’s scalability strategy and is widely considered a success in improving the network’s efficiency without compromising decentralization or security.
This post The Witness Discount first appeared on Bitcoin Magazine and is written by Conor.
Laisser un commentaire