Back

What is Transaction Witness Data?

General Wallet Use

15 min

When you send bitcoin, the transaction uses a process that involves public addresses, private keys, and digital signatures. Each of these elements help make sure the transaction is secure and verifiable.


Among these crucial components is the witness data, which includes the digital signatures. Witness data is part of every Bitcoin transaction but often flies under the radar.


Here’s what you need to know about this important piece of Bitcoin transactions.

What is Witness Data?


Witness data exists in every Bitcoin transaction and consists primarily of digital signatures. When you send bitcoin, your transaction needs to be verified by the network. This verification process involves proving you have the right to spend the bitcoins in question, which is done using your private key to create a digital signature. This signature, along with other information like the public address and the transaction amount, forms the witness data.


The term "witness" in this context refers to the data that witnesses the transaction—essentially, it verifies whether a transaction is legitimate. Witness data has components:


  1. Digital Signature: This proves the sender owns the Bitcoin being spent and has authorized the transaction.

  2. Public Key: This is used to verify the digital signature.

  3. Script Witness: This can include various scripts required for transaction verification, like those used in multisig transactions.

Storing and Using Witness Data


In the traditional Bitcoin transaction model, all data — including witness data — was stored together in a single block. This approach worked well initially but started showing limitations as Bitcoin grew. Each block on the Bitcoin blockchain has a size limit of 1 megabyte (MB). This constrained the number of transactions it was possible to process at a time. As a result, transaction speeds slowed, and fees increased.


This is where Segregated Witness, often called “SegWit,” comes into play. Developers introduced the SegWit Bitcoin upgrade in 2017. It is a protocol upgrade designed to solve the transaction and block space issues. 


SegWit separates (or segregates) the witness data from the transaction data. Instead of storing digital signatures and other witness data in the same block as the transaction details, SegWit moves this data to a separate structure attached to the block. This separation effectively frees up space within the original block, allowing more transactions to be included and processed more efficiently.


With the SegWit upgrade, Bitcoin’s block capacity was significantly increased without raising the block size limit —which was an ongoing debate in the Bitcoin community. This change led to faster transaction processing times and lower fees. 

What is SegWit?


One of the important goals of Segregated Witness was to tackle the problem of transaction malleability and limitations imposed by the 1 MB block size.

The Transaction Malleability Problem

Transaction malleability was a bug that allowed a transaction's unique identifier (TXID) to be altered without changing the transaction's content. This alteration could be made before the transaction was confirmed and added to the blockchain. Here's why it was problematic:


  1. Double Spending: Malicious actors could change the TXID and resubmit a transaction, leading to potential double-spending issues.

  2. Confusion and Errors: Transaction malleability caused confusion for wallets and services that relied on the original TXID to track transactions. This led to errors and inefficiencies in transaction management.

  3. Security Concerns: It undermined trust and reliability of the transaction verification process, posing significant security risks.

How SegWit Addresses Transaction Malleability

SegWit effectively solves the transaction malleability problem by separating the digital signatures (witness data) from the transaction data. 


  1. Segregating Witness Data: Bitcoin transactions before SegWit included witness data in the transaction itself. SegWit moves this data to a separate structure attached to the transaction block. This ensures witness data, which can be altered, is no longer included in the TXID calculation.

  2. Fixed TXIDs: With witness data segregated, any changes to the witness data do not affect the transaction ID. This ensures that once a transaction is broadcasted, its TXID remains consistent, eliminating the possibility of malleability.

  3. Enhanced Security and Efficiency: By addressing transaction malleability, SegWit improves the overall security and reliability of Bitcoin transactions. It also reduces the risk of double spending and other related issues, making the Bitcoin network more robust.


SegWit laid the groundwork for further innovations like the Lightning Network, a layer 2 solution that enables faster and cheaper transactions. It also made other protocol upgrades like Taproot possible, enhancing Bitcoin's functionality and scalability.

How Does Witness Data Affect Users?


Witness data plays a crucial role in how Bitcoin transactions are structured and processed, influencing several aspects of user experience and network functionality.

Impact on Transactions

SegWit allows for more efficient use of block space within the Bitcoin network. With witness data in a separate structure, Bitcoin transactions become more compact, enabling more transactions to be included in each block. As a result, users experience faster transaction confirmations and lower transaction fees than before SegWit.

Changes in Address Formats

A new address format known as Bech32 addresses also came with the SegWit upgrade. These addresses start with "bc1" and are more efficient and error-resistant than previous formats (starting with "1" or "3"). Bech32 addresses are designed to support SegWit transactions directly, providing better security and improving user experience by reducing the likelihood of errors in manually entered addresses.

Wallet Compatibility

One of the practical implications of SegWit for users is wallet compatibility. Not all Bitcoin wallets immediately supported SegWit when it was launched in 2017. Wallets needed updates to handle SegWit transactions and Bech32 addresses properly. As a result, users who wanted to take advantage of lower fees and faster transactions had to get a SegWit-compatible wallet. Over time, most major wallets have integrated SegWit support, allowing users to benefit from improved transaction efficiency seamlessly.

Witness Data and Bitcoin Upgrades


Witness data, with the help of SegWit, has not only improved speed, block space, and security issues on the Bitcoin network, but it also paved the way for new protocols and upgrades like Ordinals.

SegWit Made Ordinals Possible

Ordinals were one of the most popular protocols to emerge in crypto in early 2023. This innovative way to make NFT-like tokens natively on the Bitcoin blockchain makes use of SegWit changes by adding information for Ordinal tokens into Bitcoin witness data.


Emulating non-fungible tokens, Ordinals track and number individual satoshis by assigning unique numbers to each one almost like serial numbers. This process is called Ordinal theory. The information for this numbering system is stored in the witness data of Bitcoin transactions, adding use cases without altering the Bitcoin protocol.


Protocols like Ordinals sparked a broader trend that increases Bitcoin's capabilities beyond simple currency transactions. These advancements underscore Bitcoin's evolution from a digital currency to a robust platform for decentralized applications and financial services.

Conclusion


Over the years, improvements to the Bitcoin network have not only solved existing problems but created opportunities for new innovations.


Witness data continues to be instrumental in shaping the future of Bitcoin with innovative upgrades like Ordinals. Its role in enhancing scalability and facilitating new protocols reveals its significance in Bitcoin utility and the potential for expanded use cases.


Connect to web3 applications built on Bitcoin with the Leather browser extension. Install Leather – the only wallet you need to tap into the multilayered Bitcoin economy – today.

This article was updated on 6/24/24

This article was updated on 6/24/24