TYPE 0x0902 · LEGACY FAMILY
P2PKH_LEGACY
Legacy P2PKH (pay-to-pubkey-hash) wrapped as a typed Ladder Script block. Verifies HASH160(pubkey) matches committed hash, then checks signature.
Legacy Non-InvertibleLadder Diagram
Fields
| Field | Data Type | Size | Side | Description |
|---|---|---|---|---|
| hash160 | HASH160 | 20 B | Conditions | RIPEMD160(SHA256(pubkey)) commitment. Node-computed — the user provides PUBKEY and the node computes this field automatically. Raw hash input is rejected. |
| pubkey | PUBKEY | 32-33 B | Witness | Public key — provided by the user. The node derives HASH160 from this key at creation time. Revealed at spend time. |
| signature | SIGNATURE | 64-65 B | Witness | Signature over the transaction sighash |
Wire Format Breakdown
Conditions side (committed in the rung leaf):
0x0902
0
1
HASH160 · 20B
= 26 bytes
Witness side (in input witness):
0x0902
0
2
PUBKEY · 33B
SIGNATURE · 64B
= 105 bytes
Total (conditions + witness)
131 bytes
With rung overhead included. Compressed pubkey (33B) case.
Evaluation Logic
1.
Locate HASH160, PUBKEY, and SIGNATURE. Any missing → ERROR. HASH160 not exactly 20 B → ERROR
2.
Compute CHash160(PUBKEY) = RIPEMD160(SHA256(PUBKEY)).
memcmp against the committed HASH160; mismatch → UNSATISFIED
3.
Read the optional conditions SCHEME (default Schnorr). Dispatch VerifySigWithScheme(pubkey, sig, scheme, ...) through the Ladder
LadderSigChecker — not Core's BaseSignatureChecker, which would crash on a Schnorr sig outside Taproot context (regression fix `83f3a99a25`).
4.
The
VerifySigWithScheme result is the block result.
Return Values
| Condition | Result |
|---|---|
| Missing HASH160, PUBKEY, or SIGNATURE | ERROR |
| HASH160 wrong size (not 20B) | ERROR |
| HASH160(PUBKEY) != committed hash | UNSATISFIED |
| Signature fails | UNSATISFIED |
| Signature valid | SATISFIED |
JSON Wire Format
Conditions (committed in the rung leaf)
{
"type": "P2PKH_LEGACY",
"inverted": false,
"fields": [
{ "type": "HASH160", "hex": "89abcd...20 bytes" }
]
}Witness (input)
{
"type": "P2PKH_LEGACY",
"inverted": false,
"fields": [
{ "type": "PUBKEY", "hex": "02abc1...33 bytes" },
{ "type": "SIGNATURE", "hex": "e5f6a7...64 bytes" }
]
}Notes
- Uses RIPEMD160(SHA256(pubkey)) like Bitcoin P2PKH.
- The HASH160 field is node-computed: the user supplies PUBKEY and the node derives the hash commitment automatically. Submitting a raw HASH160 value directly is rejected.
- Supports all signature schemes via optional SCHEME field.
- The most common legacy Bitcoin output type, now wrapped with typed Ladder Script semantics.
Use Cases
Legacy P2PKH Migration
The most common Bitcoin output type. Wrap existing P2PKH in typed blocks.
Hash-Based Key Binding
HASH160 commitment hides the pubkey until spend time, same as original Bitcoin P2PKH.