TYPE 0x0631 · PLC FAMILY

COUNTER_DOWN

Down counter. SATISFIED while the count is greater than zero (can still decrement). Paired with RECURSE_MODIFIED to decrement each covenant spend. Once count reaches zero, the block becomes UNSATISFIED.

PLC Non-Invertible
COUNTER_DOWN 5 4 3 ... 0 count > 0 → SATISFIED | count == 0 → UNSATISFIED
FieldData TypeSizeSideDescription
countNUMERIC1-4 BConditionsCurrent counter value (decremented by RECURSE_MODIFIED each spend). Must be ≥ 0; count == 0 → UNSATISFIED.
event_pubkeyPUBKEY32-33 BWitnessEvent signer 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.

0x0631 0 1 NUMERIC · 3B Conditions ≈ 9 bytes
0x0631 0 1 PUBKEY · 35B Witness ≈ 39 bytes
Total ≈ 48 bytes
1.HasRequiredPubkeys(block, 1): at least one PUBKEY (the event-signer key) must be present in the merged block; else → ERROR. Identity is bound at MLSC-proof level via merkle_pub_key.
2.Collect NUMERICs. None present → ERROR. ReadNumeric the first as count; undecodable → ERROR
3.If count < 0ERROR
4.If count > 0SATISFIED (counter active; pair with RECURSE_MODIFIED to decrement in the output); else (== 0) → UNSATISFIED
ConditionResult
No PUBKEY in the merged blockERROR
No NUMERIC field, or undecodable, or count < 0ERROR
count == 0 (countdown done)UNSATISFIED
count > 0 (counter active)SATISFIED
Conditions (counter at 5, counting down)
{
  "type": "COUNTER_DOWN",
  "inverted": false,
  "fields": [
    { "type": "NUMERIC", "value": 5 }
  ]
}

This counter has 5 remaining uses. Each spend authorized by the event signer with RECURSE_MODIFIED decrements the count. After 5 spends, count reaches 0 and the block becomes UNSATISFIED.

Limited-Use Spending Authorization
A covenant that permits exactly N spends before the authorization expires. Each spend decrements the counter. Once exhausted, the spending path is permanently closed within the covenant chain.
Ticket Systems
Digital tickets represented as counter-gated covenants. Each use (spend + recurse) consumes one ticket. When all tickets are used, the covenant transitions to a terminal state.
Finite Resource Allocation
Allocate a fixed number of operations to a key holder. The counter tracks remaining allocations, ensuring the resource budget cannot be exceeded regardless of how the covenant is spent.