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.
PLCInvertible
Ladder Diagram
Fields
Field
Data Type
Size
Side
Description
state
NUMERIC
1-4 B
Conditions
Current latch state: 0 = unset, 1 = set
Public key folded into Merkle leaf via merkle_pub_key (PubkeyCountForBlock = 1). No key field in conditions.
Wire Format Breakdown
0x062102NUMERIC · 1BConditions = 9 bytes
0x062102PUBKEY · 32BSIG · 64BWitness = 104 bytes
Total145 bytes
Evaluation Logic
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)
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.
Use Cases
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.