TYPE 0x0622 · PLC FAMILY
LATCH_RESET
Latch reset contact. Activates when state is 1 or greater (set), allowing the latch to be reset. Paired with RECURSE_MODIFIED to flip the state back to 0. Complementary to LATCH_SET for reversible state toggles.
PLC Non-InvertibleLadder Diagram
Fields
| Field | Data Type | Size | Side | Description |
|---|---|---|---|---|
| state | NUMERIC | 1-4 B | Conditions | Current latch state: 0 = unset, ≥ 1 = set |
| delay_blocks | NUMERIC | 1-4 B | Conditions | Delay countdown (block count). Reset only fires when delay has decayed to 0 via the RECURSE_MODIFIED carry-rule chain. Must be ≥ 0. |
| resetter_pubkey | PUBKEY | 32-33 B | Witness | Resetter key (folded out of conditions via merkle_pub_key; revealed at spend time and bound by Merkle proof). Required by HasRequiredPubkeys(block, 1) at consensus. |
Public key folded into Merkle leaf via merkle_pub_key (PubkeyCountForBlock = 1). No key field in conditions.
Two NUMERIC fields (state and delay_blocks) are required.
Wire Format Breakdown
0x0622
0
2
NUMERIC · 3B
NUMERIC · 3B
Conditions ≈ 14 bytes
0x0622
0
1
PUBKEY · 35B
Witness ≈ 39 bytes
Total
≈ 53 bytes
Evaluation Logic
1.HasRequiredPubkeys(block, 1): at least one PUBKEY (the resetter key) must be present in the merged block; else → ERROR. Identity is bound at MLSC-proof level via merkle_pub_key.
2.Collect NUMERICs. Fewer than 2 → ERROR. ReadNumeric the first as
state and the second as delay_blocks; either undecodable → ERROR3.If
delay_blocks < 0 → ERROR4.If
state ≥ 1 and delay_blocks == 0 → SATISFIED (set + matured; the RESET rung is live — pair with RECURSE_MODIFIED to enforce 1→0 and decrement delay_blocks in the output). Otherwise (unset, or set but delay_blocks > 0) → UNSATISFIED. Without the delay_blocks == 0 gate the timed-reset semantics would not be consensus-active — covenants shipped with delay > 0 would otherwise fire immediately.Return Values
| Condition | Result |
|---|---|
| No PUBKEY in the merged block | ERROR |
| Fewer than 2 NUMERIC fields, or either undecodable | ERROR |
delay_blocks < 0 | ERROR |
state == 0 (already unset) | UNSATISFIED |
state ≥ 1 but delay_blocks > 0 (still maturing) | UNSATISFIED |
state ≥ 1 and delay_blocks == 0 (set + matured, RESET rung is live) | SATISFIED |
JSON Wire Format
Conditions (latch set, ready to reset, 144-block delay)
{
"type": "LATCH_RESET",
"inverted": false,
"fields": [
{ "type": "NUMERIC", "value": 1 },
{ "type": "NUMERIC", "value": 144 }
]
}This latch is in the set state (1) with a 144-block delay parameter. A spend authorized by the resetter key with RECURSE_MODIFIED will flip state back to 0.
Use Cases
Reset Authorization
A separate key holder can reset a latch that was previously set, returning the covenant to its original state. Useful for multi-party workflows where set and reset are controlled by different parties.
Feature Deactivation
Paired with LATCH_SET, this creates a toggle system. Features activated by setting the latch can be deactivated by resetting it, enabling on/off governance controls within covenant chains.
Reversible State Toggle
LATCH_SET and LATCH_RESET together model a full SR (set-reset) flip-flop in ladder logic. The covenant can cycle between states indefinitely, with different keys controlling each transition.