TYPE 0x0804 · GOVERNANCE FAMILY
OUTPUT_COUNT
Bounds on the number of outputs in the spending transaction. Controls fan-out behavior and prevents excessive output creation. No Tapscript equivalent.
Governance InvertibleLadder Diagram
Fields
| Field | Data Type | Size | Side | Description |
|---|---|---|---|---|
| min_outputs | NUMERIC | 1-4 B | Conditions | Minimum number of outputs required (≥ 0) |
| max_outputs | NUMERIC | 1-4 B | Conditions | Maximum number of outputs allowed (≥ min_outputs) |
Wire Format Breakdown
0x0804
0
2
NUMERIC
NUMERIC
Conditions = 14 bytes
0x0804
0
0
Witness = 4 bytes
Total
20 bytes
Evaluation Logic
1.Collect conditions NUMERICs. Fewer than 2 → ERROR. ReadNumeric the first as
min_outputs and the second as max_outputs; either undecodable → ERROR2.Range/order check:
min_outputs < 0, max_outputs < 0, or min_outputs > max_outputs → ERROR3.Require
ctx.tx; missing → ERROR (fail-closed).4.If
min_outputs ≤ ctx.tx->output_count ≤ max_outputs → SATISFIED; else → UNSATISFIEDJSON Wire Format
{
"type": "OUTPUT_COUNT",
"fields": [
{ "type": "NUMERIC", "value": 1 },
{ "type": "NUMERIC", "value": 2 }
]
}Use Cases
Simple Transfer Enforcement
Setting max=2 forces the spend to create at most 2 outputs (payment + change). Prevents the UTXO from being used in batch payouts or CoinJoin-style transactions.
Covenant Output Structure
Combined with RECURSE_SAME, ensures the spending transaction creates exactly the right number of covenant outputs. Setting min=max=1 forces a 1-to-1 covenant chain.
Anti-Fragmentation
Capping output count prevents value fragmentation attacks where an adversary splits a large UTXO into many dust outputs to increase future spending costs.