TYPE 0x0651 · PLC FAMILY

SEQUENCER

Step sequencer. Tracks the current step and total number of steps. SATISFIED while more steps remain (current < total). Becomes UNSATISFIED when the sequence is complete or invalid. No Tapscript equivalent exists.

PLC Invertible
SEQUENCER 1 2 3 4 5 done current remaining current_step < total_steps → SATISFIED (more steps remain)
FieldData TypeSizeSideDescription
current_stepNUMERIC1-4 BConditionsCurrent step index (NUMERIC[0])
total_stepsNUMERIC1-4 BConditionsTotal number of steps in the sequence (NUMERIC[1], must be > 0)

No witness fields required — evaluation uses only the two NUMERIC condition fields.

0x0651 0 2 NUMERIC · 3B NUMERIC · 3B Conditions = 14 bytes
0x0651 0 0 Witness = 4 bytes (empty block)
Total 18 bytes
1.Collect conditions NUMERIC fields. Fewer than 2 → ERROR. ReadNumeric the first as current_step and the second as total_steps; either undecodable → ERROR
2.Combined range check: current_step < 0, total_steps ≤ 0, or current_step ≥ total_stepsUNSATISFIED (one branch covers all "step out of range" + "sequence complete" cases).
3.Otherwise → SATISFIED (a valid step remains in the sequence). RECURSE_MODIFIED on the same rung increments current_step in the recursed output.
ConditionResult
Fewer than 2 NUMERIC fields, or either undecodableERROR
current_step < 0, total_steps ≤ 0, or current_step ≥ total_stepsUNSATISFIED
0 ≤ current_step < total_stepsSATISFIED
Conditions (step 2 of 5)
{
  "type": "SEQUENCER",
  "inverted": false,
  "fields": [
    { "type": "NUMERIC", "value": 2 },
    { "type": "NUMERIC", "value": 5 }
  ]
}

This creates a 5-step sequence currently at step 2. Three more steps remain before the sequencer becomes UNSATISFIED.

total_steps=5

current_step=0, total=5: 0 < 5 → SATISFIED (step 1 of 5)
current_step=2, total=5: 2 < 5 → SATISFIED (step 3 of 5)
current_step=4, total=5: 4 < 5 → SATISFIED (last step)
current_step=5, total=5: 5 ≥ 5 → UNSATISFIED (sequence complete)
current_step=0, total=0: total ≤ 0 → UNSATISFIED (invalid)
Multi-Step Protocols
Enforce that a multi-phase protocol progresses through each step in order. Each UTXO in the covenant chain carries the current step, ensuring no steps are skipped and the protocol completes fully.
Ordered State Transitions
Model finite state machines on-chain. The sequencer tracks which state the covenant is in, and combined with other blocks, enforces valid transitions between states in a predetermined order.
Workflow Enforcement
Business workflows requiring sequential approval steps (e.g., proposal → review → approval → execution). The sequencer ensures each step is completed before the next can begin.