Block Reference
HASH_GUARDED
Hash Family
TYPE 0x0204 · HASH FAMILY

HASH_GUARDED

Raw SHA-256 preimage verification. SATISFIED when SHA256(preimage) equals the committed hash. Non-invertible and fail-closed.

Hash Non-Invertible
HASH_GUARDED SHA-256(pre) == committed_hash SHA256(preimage) == committed_hash
FieldData TypeSizeSideDescription
committed_hash HASH256 32 B Conditions SHA-256 hash that the preimage must match
preimage PREIMAGE 32 B Witness Data whose SHA-256 must equal committed_hash

Conditions side (in scriptPubKey):

0x3D HASH256 · 32B = 33 bytes (micro-header)

Witness side (in input witness):

0x3D PREIMAGE · 32B = 33 bytes (micro-header)
Total (conditions + witness) ~66 bytes
1. Require 1 HASH256 field + 1 PREIMAGE. Any missing → ERROR
2. Compute SHA256(PREIMAGE)
3. Compare result to committed_hash. If match → SATISFIED
4. Mismatch → UNSATISFIED
ConditionResult
Missing HASH256 fieldERROR
Missing PREIMAGE fieldERROR
SHA256(preimage) does not match committed_hashUNSATISFIED
SHA256(preimage) matches committed_hashSATISFIED
Conditions (scriptPubKey)
{
  "type": "HASH_GUARDED",
  "inverted": false,
  "fields": [
    { "type": "HASH256", "hex": "a1b2c3...32 bytes (committed_hash)" }
  ]
}
Witness (input)
{
  "type": "HASH_GUARDED",
  "inverted": false,
  "fields": [
    { "type": "PREIMAGE", "hex": "deadbeef...exactly 32 bytes" }
  ]
}
Standalone Hash Lock
Standalone hash lock. Provides raw SHA-256 preimage verification without requiring a companion signature block. Non-invertible by design, preventing data embedding through failed verification + inversion.
Commitment Reveal
Commit a hash on-chain, then reveal the preimage later to unlock funds. Useful for oracle-based protocols, escrow release, and data attestation where a signature is not needed.
Cross-Chain Hash Lock
Hash-locked spending conditions for atomic swap protocols where the hash preimage is revealed on another chain. Combine with SIG or COSIGN for additional authorization requirements.

HASH_GUARDED is non-invertible: the inverted flag is rejected at deserialization. This prevents an attacker from creating a block with a garbage hash, providing arbitrary preimage data, and inverting the result to SATISFIED. There is no way to embed arbitrary data through this block type.

← TAGGED_HASH CTV →