SegWit architecture
Terms used in this lesson
- SegWit
- Segregated Witness: a Bitcoin upgrade that separates authorization data from the transaction identifier and introduces versioned witness programs.
- Witness
- Signatures, scripts, or other data supplied to satisfy a Bitcoin output’s spending condition.
- Signature malleability
- The possibility that related signature representations can authorize the same message unless a scheme and its rules enforce a canonical form.
- Transaction ID
- The identifier produced by hashing a Bitcoin transaction’s non-witness serialization.
- Witness transaction ID
- An identifier that commits to a transaction including its witness data.
- Coinbase transaction
- The special first transaction in a Bitcoin block, which claims permitted subsidy and fees and has no ordinary prior-output input.
- P2WPKH
- Pay to Witness Public Key Hash: a native SegWit output for one public-key hash.
- P2WSH
- Pay to Witness Script Hash: a native SegWit output that commits to a witness script.
SegWit separates witness data, fixes third-party malleability, changes weight accounting, and enables safer second-layer commitments.
Loading lesson visuals...
Learn the idea
Segregated Witness, or SegWit, moved input authorization data into a separate witness structure, introduced versioned witness programs, changed block resource accounting, and committed witness data through the block's coinbase. It fixed third-party txid malleability for SegWit inputs because their witness bytes are excluded from txid while remaining committed by wtxid and the block.
Commit a witness program
An output script contains a version and program. Version 0 defines P2WPKH and P2WSH semantics from program length.
Inspect every idea above to open it.
Witness signatures are transmitted, validated, stored subject to node configuration, and committed in blocks. They are separated from legacy txid calculation, not removed from consensus.
The questions unlock after every required learning activity
Inspect every guided idea, open the worked example, rebuild its mechanism, and complete the deterministic lesson tool. Your progress is saved automatically.