Block Reference
COUNTER_DOWN
PLC Family
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 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)

Public key folded into Merkle leaf via merkle_pub_key (PubkeyCountForBlock = 1). No key field in conditions.

0x0631 0 2 NUMERIC · 3B Conditions = 11 bytes
0x0631 0 2 PUBKEY · 32B SIG · 64B Witness = 104 bytes
Total 147 bytes
1.Verify witness PUBKEY against Merkle leaf (merkle_pub_key). If missing or mismatch → ERROR
2.Read count from NUMERIC field. If no NUMERIC field → ERROR
3.If count < 0 → ERROR
4.If count > 0 → SATISFIED (counter active, can decrement)
5.If count == 0 → UNSATISFIED (countdown complete)
ConditionResult
Merkle leaf pubkey count mismatchERROR
No NUMERIC fieldERROR
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": "PUBKEY", "hex": "02abc1...33 bytes" },
    { "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.
← LATCH_RESET COUNTER_PRESET →