Block Reference
LATCH_SET
PLC Family
TYPE 0x0621 · PLC FAMILY

LATCH_SET

Latch set contact. Activates when state is 0 (unset), allowing the latch to be set. Paired with RECURSE_MODIFIED to flip the state from 0 to 1. Once set, subsequent evaluations return UNSATISFIED until reset by a LATCH_RESET block.

PLC Invertible
LATCH_SET state = 0 state = 1 SATISFIED UNSATISFIED RECURSE_MODIFIED flips 0 → 1
FieldData TypeSizeSideDescription
stateNUMERIC1-4 BConditionsCurrent latch state: 0 = unset, 1 = set

Public key folded into Merkle leaf via merkle_pub_key (PubkeyCountForBlock = 1). No key field in conditions.

0x0621 0 2 NUMERIC · 1B Conditions = 9 bytes
0x0621 0 2 PUBKEY · 32B SIG · 64B Witness = 104 bytes
Total 145 bytes
1.Verify witness PUBKEY against Merkle leaf (merkle_pub_key). If missing or mismatch → ERROR
2.Read state from NUMERIC fields. If no NUMERIC field → SATISFIED (structural-only backward compat)
3.If state == 0 → SATISFIED (latch can be set)
4.If state != 0 → UNSATISFIED (already set)
ConditionResult
Merkle leaf pubkey count mismatchERROR
No NUMERIC field (structural-only mode)SATISFIED
state != 0 (already set)UNSATISFIED
state == 0 (unset, can set)SATISFIED
Conditions (latch unset, ready to activate)
{
  "type": "LATCH_SET",
  "inverted": false,
  "fields": [
    { "type": "PUBKEY", "hex": "02abc1...33 bytes" },
    { "type": "NUMERIC", "value": 0 }
  ]
}

This latch is in the unset state (0). A spend authorized by the setter key with RECURSE_MODIFIED will flip state to 1, after which the block becomes UNSATISFIED until a LATCH_RESET flips it back.

One-Time Authorization Toggles
A latch that can be set exactly once to authorize a spending path. Once set, the authorization is permanent within the covenant chain — it cannot be set again without a corresponding LATCH_RESET.
Feature Activation
Enable a covenant feature by setting the latch. Other blocks on the same or subsequent rungs can check the latch state to gate behavior on whether the feature has been activated.
Irreversible State Transitions
Without a paired LATCH_RESET, the set operation is irreversible. This models one-way state transitions like contract finalization or irrevocable approvals.
← TIMER_OFF_DELAY LATCH_RESET →