Witness in Bitcoin transaction refers to contents of signature scripts which prove the authenticity of a transaction. Blocks commit to witness data via putting the witness commitment into an output of the coinbase transaction.
-
Witness commitment = combined hash of witness root hash and witness reserved value.
-
Witness root hash = merkle root of witness txids (wtxids) of all transactions in the block.
-
wtxid = hash of transaction including the witness if exists.
Aditional Questions:
Why was it decided to use this kind of arrangement?
This was chosen because as the coinbase transaction does not consume any UTXO as an input, there is an extra space that could be used for this purpose and doing this way avoids any kind of hard fork. Otherwise the header structure of the block would need to be modified and doing this change would be only possible through a hard fork.