TeachMeBitcoin

Witness Script vs. Redeem Script

From TeachMeBitcoin, the free encyclopedia Reading time: 2 min

Witness Script vs. Redeem Script

In Nested SegWit Multisig, the terminology can get confusing because there are two different "scripts" involved in a single transaction. Understanding the difference is key to auditing these transactions.

1. The P2SH Redeem Script

The Redeem Script is the 34-byte "Envelope" that sits in the ScriptSig.

2. The P2WSH Witness Script

The Witness Script is the actual logic (e.g., the 2-of-3 multisig).

3. The Relationship

Think of it like a set of nested boxes:

  1. The ScriptPubKey looks for the hash of the Redeem Script.

  2. The Redeem Script looks for the hash of the Witness Script.

  3. The Witness Script looks for the Signatures.

4. Why this matters for fees

Because the large Witness Script (which contains all the public keys) is stored in the Witness area, it gets the 75% discount.

Term Also Known As Content Storage Location
Redeem Script The Wrapper 00 20 [Hash] ScriptSig (Input)
Witness Script The Inner Script OP_M [Keys] OP_N... Witness Stack

In the next section, we will discuss the security implications of SHA256 vs. HASH160.

☕ Help support TeachMeBitcoin

TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation:

Ethereum: 0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin: bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana: 4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J
Address copied to clipboard!