Block Reference
SEQUENCER
PLC Family
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.Read current_step (NUMERIC[0]) and total_steps (NUMERIC[1]). If fewer than 2 NUMERIC fields → ERROR
2.Validate: total_steps > 0. If total_steps ≤ 0 → UNSATISFIED
3.If current_step < total_steps → SATISFIED (more steps remain)
4.If current_step ≥ total_steps → UNSATISFIED (sequence complete)
ConditionResult
Fewer than 2 NUMERIC fieldsERROR
total_steps ≤ 0UNSATISFIED
current_step ≥ total_stepsUNSATISFIED
current_step < total_steps AND total_steps > 0SATISFIED
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.
← COMPARE ONE_SHOT →