TYPE 0x0633 · PLC FAMILY
COUNTER_UP
Up counter with event signer. SATISFIED while the current count is below the target (still counting). Requires a valid public key or commitment to authorize count increments. No Tapscript equivalent exists.
PLC Non-InvertibleLadder Diagram
Fields
| Field | Data Type | Size | Side | Description |
|---|---|---|---|---|
| current | NUMERIC | 1-4 B | Conditions | Current counter value (NUMERIC[0]) |
| target | NUMERIC | 1-4 B | Conditions | Target count value (NUMERIC[1]) |
| event_pubkey | PUBKEY | 32-33 B | Witness | Event 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.
Both NUMERIC fields are required.
Wire Format Breakdown
0x0633
0
2
NUMERIC · 3B
NUMERIC · 3B
Conditions ≈ 14 bytes
0x0633
0
1
PUBKEY · 35B
Witness ≈ 39 bytes
Total
≈ 53 bytes
Evaluation Logic
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. Fewer than 2 → ERROR. ReadNumeric the first as
current and the second as target; either undecodable → ERROR3.If
current < 0 or target < 0 → ERROR4.If
current < target → SATISFIED (still counting; pair with RECURSE_MODIFIED to increment in the output); else → UNSATISFIED (count complete)Return Values
| Condition | Result |
|---|---|
| No PUBKEY in the merged block | ERROR |
| Fewer than 2 NUMERIC fields, or either undecodable | ERROR |
current < 0 or target < 0 | ERROR |
current ≥ target | UNSATISFIED |
current < target | SATISFIED |
JSON Wire Format
Conditions (signer commit, current=3, target=10)
{
"type": "COUNTER_UP",
"inverted": false,
"fields": [
{ "type": "NUMERIC", "value": 3 },
{ "type": "NUMERIC", "value": 10 }
]
}This creates a signed up counter that remains SATISFIED until 10 authorized events have been recorded. The event signer's pubkey must match the commitment.
Worked Example
event_signer=committed, current=3, target=10
current=0, target=10: pubkey valid, 0 < 10 → SATISFIED
current=9, target=10: pubkey valid, 9 < 10 → SATISFIED (boundary)
current=10, target=10: 10 ≥ 10 → UNSATISFIED (done)
No pubkey field: → ERROR
Use Cases
Signature-Gated Counters
Only an authorized signer can increment the counter. Each increment requires a valid signature from the event signer, preventing unauthorized count manipulation in covenant chains.
Multi-Event Tracking
Track a series of signed events (e.g., oracle attestations, delivery confirmations) up to a target. The covenant remains active while events are being collected and transitions when complete.
Progressive Authorization
Require N signed approvals before unlocking funds. Each approval increments the counter. Combined with other blocks, creates multi-step authorization workflows with cryptographic accountability.