← Back to Glossary

Script Witness

The script witness is the segregated portion of a bitcoin transaction that carries signatures and other unlocking data for SegWit inputs, held in a structure separate from the transaction fields that determine its identifier. Introduced with SegWit in August 2017, witness bytes are discounted in fee accounting, counting as 1 weight unit each against 4 for ordinary bytes.

Why it matters

Moving signatures out of the transaction identifier fixed transaction malleability, a flaw that had let third parties alter a transaction's ID without invalidating it, breaking any protocol that needed to reference unconfirmed transactions. Solving it made the Lightning Network safe to build. The witness discount also expanded effective block capacity to a theoretical 4 million weight units, roughly doubling typical throughput without a hard fork, and repriced block space to favor moving spending-proof data off the most expensive bytes.

How it works

Each SegWit input has a witness stack containing the items its script requires, such as a signature and public key for a simple payment or the script itself plus arguments for script-path spends. The transaction ID is computed without witness data, while a separate witness transaction ID commits to everything, and blocks anchor the witness set through a commitment in the coinbase transaction. Old nodes, which never see the witness, still accept the blocks, which is what allowed SegWit to deploy as a backward-compatible soft fork. Taproot later extended the same witness structure with its own version.

Ready to convert your gold to Bitcoin?

Get Your Free Kit →