Block Reference
RECURSE_SAME
Recursion Family
TYPE 0x0401 · RECURSION FAMILY

RECURSE_SAME

Covenant self-replication. Verifies the spending output carries identical rung conditions as the input. Creates perpetual covenant chains where each spend must re-encumber the output with the same conditions. No Tapscript equivalent.

Recursion Invertible
RECURSE_SAME output_conditions == input_conditions FullConditionsEqual comparison — perpetual covenant max_depth bounded Self-replicating covenant — identical conditions on every spend
FieldData TypeSizeSideDescription
max_depthNUMERIC1-4 BConditionsMaximum recursion depth (> 0). Bounds the number of recursive spends allowed.
0x0401 0 1 NUMERIC · max_depth Conditions = 9 bytes
0x0401 0 0 Witness = 4 bytes
Total 15 bytes
1.Read max_depth from NUMERIC field
2.If max_depth ≤ 0 → UNSATISFIED
3.Retrieve input_conditions and spending_output from evaluation context
4.Deserialize output conditions from spending output
5.Compare using FullConditionsEqual — must match exactly
6.If conditions match → SATISFIED
7.Otherwise → UNSATISFIED

Perpetual vault with max_depth = 100

Input has RECURSE_SAME(100) + SIG(pubkey_A). Output must carry identical conditions.

max_depth = 100 > 0 → proceed
Output conditions: RECURSE_SAME(100) + SIG(pubkey_A)
FullConditionsEqual → SATISFIED

Output tries to remove the SIG block:

Output conditions: RECURSE_SAME(100) only
FullConditionsEqual fails → UNSATISFIED
{
  "type": "RECURSE_SAME",
  "fields": [
    { "type": "NUMERIC", "value": 100 }
  ]
}

The max_depth field bounds recursion depth. Typical values: 10–1000 depending on expected covenant lifetime.

Perpetual Vaults
A UTXO that can only ever be spent into an output with identical conditions. Combined with SIG or MULTISIG, creates a vault where the signing key can move funds but never remove the covenant restrictions.
Self-Enforcing Contracts
Contracts that guarantee their own perpetuation. Every spend must re-encumber the output with the same rules, ensuring the contract terms survive indefinitely across the UTXO chain.
State Machines
Combined with other blocks, creates state machines where the base covenant structure persists while external state (amounts, timelocks) may change through other block evaluations.
← AMOUNT_LOCK RECURSE_MODIFIED →