TYPE 0x0632 · PLC FAMILY
COUNTER_PRESET
Preset counter. SATISFIED while the current count is still below the preset target (accumulating). Becomes UNSATISFIED once the current count reaches or exceeds the preset value. No Tapscript equivalent exists.
PLC InvertibleLadder Diagram
Fields
| Field | Data Type | Size | Side | Description |
|---|---|---|---|---|
| current | NUMERIC | 1-4 B | Conditions | Current counter value (NUMERIC[0]) |
| preset | NUMERIC | 1-4 B | Conditions | Target preset value (NUMERIC[1]) |
No witness fields required — evaluation uses only the two NUMERIC condition fields.
Wire Format Breakdown
0x0632
0
2
NUMERIC · 3B
NUMERIC · 3B
Conditions = 14 bytes
0x0632
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 and the second as preset; either undecodable → ERROR2.If
current < 0 or preset < 0 → ERROR3.If
current < preset → SATISFIED (still accumulating); else → UNSATISFIED (target reached)Return Values
| Condition | Result |
|---|---|
| Fewer than 2 NUMERIC fields, or either undecodable | ERROR |
current < 0 or preset < 0 | ERROR |
current ≥ preset | UNSATISFIED |
current < preset | SATISFIED |
JSON Wire Format
Conditions (current=3, preset=10)
{
"type": "COUNTER_PRESET",
"inverted": false,
"fields": [
{ "type": "NUMERIC", "value": 3 },
{ "type": "NUMERIC", "value": 10 }
]
}This creates a counter that remains SATISFIED until 10 events have been accumulated. Once current reaches 10, the block becomes UNSATISFIED.
Worked Example
current=3, preset=10
current=0, preset=10: 0 < 10 → SATISFIED
current=5, preset=10: 5 < 10 → SATISFIED
current=9, preset=10: 9 < 10 → SATISFIED (boundary)
current=10, preset=10: 10 ≥ 10 → UNSATISFIED (target reached)
current=15, preset=10: 15 ≥ 10 → UNSATISFIED (exceeded)
Use Cases
Threshold Triggers
Gate a spending path on reaching a specific event count. The UTXO remains spendable (SATISFIED) while accumulating, and locks (UNSATISFIED) once the threshold is hit — triggering a transition to a different covenant path.
Accumulation Targets
Track deposit counts or confirmation milestones. A treasury UTXO can enforce that at least N contributions have been recorded before releasing funds by combining COUNTER_PRESET with other covenant blocks.
Batch Size Enforcement
Enforce that a batch processing covenant only fires after a preset number of items have been queued, preventing premature batch execution and ensuring efficiency.