A witness is a field of stack items for individual inputs. Its meaning follows the version and condition of the output being spent; it is not automatically a separately executable script.
Each input has its own item list in witness serialization. Signature verification uses a message defined by the relevant script version; the mere presence of data does not prove validity. [BIP 141 — Segregated Witness] [BIP 143 — SegWit signature hashing]
txid is computed from the original serialization without witness. wtxid includes the complete serialization with witness; for a transaction without witness the identifiers are equal. [BIP 141 — Segregated Witness]
A witness program is a versioned condition in the output being spent. Witness is provided by the later spending transaction; it is neither the same field nor a UTXO-set backup. [BIP 141 — Segregated Witness]
Native SegWit version 0 requires an empty scriptSig. In the P2SH-wrapped form, scriptSig pushes the witness program; spending evidence remains in the witness. [BIP 141 — Segregated Witness]
P2WPKH supplies a signature and public key. For P2WSH the last item is witnessScript, whose hash must match the program; earlier items provide the initial stack. [BIP 141 — Segregated Witness] [BIP 143 — SegWit signature hashing]
After removing an annex if present, Taproot distinguishes a single signature item for key-path spending from a script path with script and control block. Version-zero rules cannot be mechanically applied to version 1. [BIP 341 — Taproot]
BIP 141 commits to witness through a wtxid tree and a coinbase commitment. Coinbase uses a zero wtxid for this tree; the commitment combines the root with a 32-byte reserved value. [BIP 141 — Segregated Witness]
Changing witness alone does not change txid. Separation does not guarantee immutability of all other fields or all combinations of inputs; altered evidence must still pass validation. [BIP 141 — Segregated Witness] [Bitcoin Core — Segregated Witness benefits]
Bytes added by witness serialization contribute 1 WU versus 4 WU for a base byte. A Full Node still needs them for applicable validation; this is not free off-chain data. [BIP 141 — Segregated Witness] [Bitcoin Core v29.0 — Script interpreter]
Witness may publicly reveal a signature, public key or the script branch used. It is not encrypted storage, is not intended to store private keys and replaces neither a Seed Phrase nor wallet backups. [BIP 341 — Taproot] [Bitcoin Developer Reference — Transactions]
For the clearest picture, read this entry together with SegWit, Block weight, Bitcoin Script, Taproot. The reverse links also lead from Virtual byte (vbyte), Block weight.