RECURSE_MODIFIED
Covenant with controlled mutations. Output must match input conditions except for specified numeric parameter changes. Each mutation applies an additive delta to a targeted parameter at a specific (rung, block, param) position. No Tapscript equivalent.
Recursion Invertible| Field | Data Type | Size | Side | Description |
|---|---|---|---|---|
| max_depth | NUMERIC | 1-4 B | Conditions | Recursion termination guard. Consensus only checks max_depth > 0 (positivity); not compared against a counter. |
| block_idx | NUMERIC | 1-4 B | Conditions | Target block index within rung 0 (legacy) or per-mutation target (new format). Per feedback_recurse_covenants, param_idx counts post-fold condition fields (after PUBKEYs are stripped into the Merkle leaf). |
| param_idx | NUMERIC | 1-4 B | Conditions | Target parameter index within the block (post-fold counting). The targeted field must be NUMERIC; non-NUMERIC targets fail. |
| delta | NUMERIC | 1-4 B | Conditions | Additive delta applied to the target parameter. Two's-complement signed; positive or negative. |
Legacy format: 4 or 5 NUMERICs — max_depth, block_idx, param_idx, delta; single mutation targeting rung_idx = 0. The 5-NUMERIC case is also recognised (the extra trailing NUMERIC is ignored).
New format: max_depth, num_mutations, then 4 NUMERICs per mutation (rung_idx, block_idx, param_idx, delta) for a total of 2 + 4×N. ParseMutationSpecs rejects num_mutations < 1 or > 64.
num_mutations outside [1, 64], or insufficient trailing NUMERICs for the declared mutation count).max_depth ≤ 0 → UNSATISFIEDctx.input_conditions and ctx.spending_output; missing → ERRORrung_idx against verified_leaves.total_rungs (or input_conditions.rungs in fallback). Out of range → UNSATISFIED. Cross-rung mutations require the spender to have supplied the target rung in revealed_mutation_targets; the evaluator verifies ComputeTxMLSCLeaf(target.rung) matches what the conditions_root committed to (audit 8b F1).param_idx-th condition field (post-fold; PUBKEYs already stripped). Must be NUMERIC. Mutate value ← value + delta. Mutating a non-NUMERIC slot → UNSATISFIED; missing slot → UNSATISFIEDDecrementing a counter: rung 0, block 1, param 0, delta = -1
Input has param[0][1][0] = 5. Expected output param = 5 + (-1) = 4.
Output tries delta = -2 instead of -1:
{
"type": "RECURSE_MODIFIED",
"fields": [
{ "type": "NUMERIC", "value": 10 },
{ "type": "NUMERIC", "value": 1 },
{ "type": "NUMERIC", "value": 0 },
{ "type": "NUMERIC", "value": -1 }
]
}Legacy format shown: max_depth=10, target rung 0 (implicit) block 1 param 0, delta=-1 (decrement by 1 each spend).