Legacy P2WSH (pay-to-witness-script-hash) wrapped as a typed Ladder Script block. SHA256 of inner conditions must match. Same pattern as P2SH but with SHA256.
Legacy Invertible| Field | Data Type | Size | Side | Description |
|---|---|---|---|---|
| hash256 | HASH256 | 32 B | Conditions | SHA256 commitment to the inner script. Node-computed — the user provides PREIMAGE (serialised Ladder Script conditions) and the node computes this field automatically. Raw hash input is rejected. |
| preimage | PREIMAGE | var | Witness | Serialised Ladder Script conditions (the inner script) — provided by the user. The node derives HASH256 from this data at creation time. |
| [inner witness] | var | var | Witness | Witness fields required to satisfy the inner conditions |
Conditions side (in scriptPubKey):
Witness side (in input witness):
Witness size depends on the inner Ladder Script conditions and their witness fields.
| Condition | Result |
|---|---|
| Missing HASH256 or PREIMAGE | ERROR |
| HASH256 wrong size (not 32B) | ERROR |
| SHA256(PREIMAGE) != committed hash | UNSATISFIED |
| PREIMAGE fails to deserialize as Ladder conditions | ERROR |
| Inner conditions evaluation fails | UNSATISFIED |
| Recursion depth > 2 | ERROR |
| Inner conditions satisfied | SATISFIED |
{
"type": "P2WSH_LEGACY",
"inverted": false,
"fields": [
{ "type": "HASH256", "hex": "e3b0c4...32 bytes" }
]
}{
"type": "P2WSH_LEGACY",
"inverted": false,
"fields": [
{ "type": "PREIMAGE", "hex": "01020304...serialised Ladder conditions" },
{ "type": "PUBKEY", "hex": "02abc1...33 bytes" },
{ "type": "SIGNATURE", "hex": "e5f6a7...64 bytes" }
]
}