Witness data in a Bitcoin transaction refers to the digital…

dsflaty ·

Witness data in a Bitcoin transaction refers to the digital signatures and scripts (like public keys) that prove ownership and authorize the spending of Bitcoin.
Purpose: It acts as the "proof" or "unlocking key" for a transaction input, equivalent to the ScriptSig in legacy transactions.
SegWit Change: Before SegWit, this data was included within the main transaction body. SegWit moved it to a separate, optional structure at the end of the transaction.
Benefits: By segregating this data:
It is not included in the calculation of the transaction ID (txid), which fixes transaction malleability.
It receives a discount when calculating block weight (1 byte = 1 weight unit vs. 4 for other data), effectively increasing block capacity.