Component

Leases and eviction

A lease is a block height after which the operator may remove a leaf, and only by paying its full amount to the owner. Removing a whole expired cohort in one transaction shares one proof among all its leaves, so the cost per leaf falls as the cohort grows.

Leases

Every leaf names an evictor key and a lease height. After the lease height, the holder of the evictor key may remove the leaf, and the covenant requires the removal to pay the leaf's full amount to the leaf's exit key. The lease is a delay on the evictor's right, not a promise that eviction will happen. A member who never wants to be evicted sets the evictor key to a point nobody can sign for, and a member who wants a firm guarantee chooses a lease far in the future. Operators are expected to warn members before evicting, and to offer to renew the lease instead, which is an UPDATE both sides sign.

Leases exist so that the operator can reclaim slots and close down a tree that members have abandoned, without anyone's cooperation and without taking anything. For a channel leaf, eviction is the counterparty's way to force the channel closed, and a channel leaf that forwards payments sets its lease to 0 so that the counterparty can do so at any time.

Evicting one leaf

An eviction uses the exit script with a flag set. Three things change from an owner's exit: the signature must come from the evictor key; the transaction's lock time must be at least the lease height; and the payout must equal the leaf's amount exactly, with the evictor paying the fee. It costs the same as an exit, about 1,020 vB at depth 16.

Sweeping a cohort

A cohort grafted into one aligned subtree with a shared lease can be removed in a single transaction, EVICT_SUBTREE_h. The witness carries the path above the subtree once and then every slot of the subtree, as a leaf or as an empty marker. The script rebuilds the subtree's node from those slots, which both proves them and lets it check each leaf as it goes: the evictor key must be the operator's, the lease must have passed, and the next output must pay that leaf's amount to its exit key. The subtree becomes the empty node, and the path above it is folded once for all of them.

Hashing the subtree's interior once instead of once per leaf is why the cost per leaf falls with the cohort's size:

Cost per leaf removed at depth 16 (from design/cost-comparison.md)
RemovalvB per leaf
One eviction alone1,020
Sweep of a 16-slot subtree, 13 leaves present203
Sweep of a 64-slot subtree, 51 leaves present158
Sweep of a 256-slot subtree, about 200 leaves presentabout 147
Bare spend of a single-owner output, for comparison111

The sweep removes every leaf in its subtree or fails, so one leaf with a later lease or a different evictor blocks it; the operator then removes that leaf by other means or waits. Members with the same lease terms belong in the same cohort. In the MID tier the sweep is also bounded by Bitcoin's limit of 1,000 stack elements, which caps a 64-slot sweep at 54 occupied slots.

Cheap eviction cuts the other way too

At about 160 vB per leaf, an operator can clear expired members cheaply. That keeps small balances removable at high fee rates, and it also makes removing members a cheap way to harass them. Removal always pays in full, so the harm is the member's lost place in the tree, not their money. Members who care choose long leases.

Deeper