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 InvertibleLadder Diagram
Fields
| Field | Data Type | Size | Side | Description |
|---|---|---|---|---|
| current_step | NUMERIC | 1-4 B | Conditions | Current step index (NUMERIC[0]) |
| total_steps | NUMERIC | 1-4 B | Conditions | Total number of steps in the sequence (NUMERIC[1], must be > 0) |
No witness fields required — evaluation uses only the two NUMERIC condition fields.
Wire Format Breakdown
0x0651
0
2
NUMERIC · 3B
NUMERIC · 3B
Conditions = 14 bytes
0x0651
0
0
Witness = 4 bytes (empty block)
Total
18 bytes
Evaluation Logic
1.Collect conditions NUMERIC fields. Fewer than 2 → ERROR. ReadNumeric the first as
current_step and the second as total_steps; either undecodable → ERROR2.Combined range check:
current_step < 0, total_steps ≤ 0, or current_step ≥ total_steps → UNSATISFIED (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.Return Values
| Condition | Result |
|---|---|
| Fewer than 2 NUMERIC fields, or either undecodable | ERROR |
current_step < 0, total_steps ≤ 0, or current_step ≥ total_steps | UNSATISFIED |
0 ≤ current_step < total_steps | SATISFIED |
JSON Wire Format
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.
Worked Example
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)
Use Cases
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.