Comparison

Scaling and comparison

A member leaves a LayerTree in one transaction whose size grows by about 10 vB each time the membership doubles: about 540 vB at 65,536 members, 580 at a million and 700 at four billion. Leaving a transaction tree costs a whole extra transaction per doubling, and leaving a Lightning channel costs three transactions and a wait of about a day. LayerTree loses to a bare output on every solo exit, and to everything else when a whole tree tries to leave at once without cooperating.

What "LayerTree" means on this page. The tiers page builds the same tree four times against opcodes that have been proposed. This page assumes the most succinct form: the CCV tier (OP_CHECKCONTRACTVERIFY and OP_TX) plus one opcode that verifies a Merkle-sum path and returns the updated root, OP_MERKLESUMUPDATE. With it the script is 252 bytes at any depth and the proof carries one 40-byte sibling per occupied level, so the tree can be key-addressed at depth 64 and grow far past 216. Every LayerTree figure on this page uses that model (541 vB at 65,536 members); the spec and the cost comparison quote about 520 vB for the simulator's dense depth-16 tree. The opcode is specified and measured in the repository's simulator (133 checks); nobody has proposed it for Bitcoin yet. The FULL tier, built only from existing proposals, is drawn dashed for reference. The tiers page has every tier.

Pick a size

65,536 members (2¹⁶)
One member leaving alone, with nobody's help.
DesignExit, vBTransactionsBlocks until spendable (time)Fee, satSolo exits per block
LayerTree, CCV + Merkle-sum opcode54111 (~10 min)5,4101,848
LayerTree, FULL tier1,02011 (~10 min)10,200980
Transaction tree (Ark model)2,5111716 (~2.7 h) + leaf timelock25,110398
Lightning force close5303about 145 (~1 day)5,3001,886
Bare output11111 (~10 min)1,1109,009

Leaving alone: 10 vB per doubling

A LayerTree exit carries the leaving member's leaf, a signature and the proof: one sibling node for each level of the tree where another member sits. With N members that is about log2 N siblings of 40 bytes, or 10 vB each. Everything else in the transaction is fixed, so the exit is about 381 + 10 log2 N vB, and doubling the tree adds 10 vB to everyone's exit.

A transaction tree, the structure behind Ark and CTV-based designs, pays a whole transaction per level instead: a member unrolls the branch from the root to their leaf one transaction at a time, about 150 vB each, and then claims. The FULL tier sits in between, because without a native opcode the script unrolls the fold once per level, about 32 vB each, and the tree's depth is fixed when it is created.

Size of one solo exit against the number of members At 2^32 members: transaction tree 4,911 vB, FULL tier 1,536, LayerTree with the Merkle-sum opcode 701, a Lightning force close 530 and a bare spend 111. LayerTree grows by 10 vB per doubling of members, the transaction tree by 150.
One member leaving alone, vbytes against tree size, both axes logarithmic. The vertical rule marks 216, where most of the repository's measurements are taken. Past it, LayerTree's line barely moves while the transaction tree's keeps climbing.
Solo exit in vB as the tree grows past 216.
MembersLayerTreeFULL tierTransaction treeTree / LayerTree
256 (28)4617621,3112.8×
65,536 (216)5411,0202,5114.6×
1,048,576 (220)5811,1493,1115.4×
16.8 million (224)6211,2783,7116.0×
4.3 billion (232)7011,5364,9117.0×

Two things change past 216. The ratio against a transaction tree keeps widening, from 4.6 times at 65,536 members to 7 times at four billion. And the tree no longer has to be sized in advance: a key-addressed tree of depth 64 has room for any realistic population, and a member's exit depends on how many members there are, not on how many slots there could be. Without the opcode, a FULL-tier tree of that depth would pay its script for all 64 levels, about 2,870 vB per exit.

One transaction is the safety property

The byte count understates the difference. A LayerTree exit is a single transaction that spends the shared output, pays the member and recreates the output for everyone else. It needs no counterparty, no presigned transaction and no timelock, and once it confirms the money is the member's. There is nothing to watch afterwards.

Transactions one member must get confirmed to leave LayerTree needs one transaction at every size. A Lightning force close needs three. A transaction-tree exit needs one per level plus a claim: 5 at 16 members, 17 at 65,536 and 33 at four billion.
Transactions a member must get confirmed to leave alone. Each one is a separate fee to pay at whatever rate the market sets that day, and a separate place where a low-fee ancestor or a conflicting spend can hold it up.

A transaction-tree exit is log2 N transactions plus a claim: 5 for a tree of 16, 17 for 65,536. They must confirm in order, each paying its own fee, and the whole branch has to land before the round expires or the operator can take the funds back. A Lightning force close is three transactions, a commitment, a child that pays its fee and a sweep after a relative timelock, and the channel needs a watchtower until the sweep. A member who leaves under fee pressure, during a mass exit or while the operator is hostile is safer with one transaction to get confirmed than with seventeen.

Time and liveness for one solo exit at 65,536 members.
LayerTreeLightning force closeTransaction tree
Transactions1317, each needing its own fee
Blocks until spendable1 (~10 min)about 145 (~1 day)16 (~2.7 h), plus the leaf timelock
Timelock on the exitnoneon the broadcaster's outputat the leaf
Who must be onlinenobodya watchtower, for stale statesthe member, before the round expires
What expiresnothing; leases are optionalnothingthe round; funds must be refreshed

Per member, over a lifetime

Most members should never pay for a solo exit. They join in a cohort that the operator grafts in one transaction, move value off-chain in channel leaves or with vouchers, and leave in a cohort exit or a sweep that shares the proof among many leaves. The table adds up entry and exit for one member at 65,536 members.

On-chain vB per member, entering in a batch. LayerTree's batch exit is the measured cohort sweep and exit of the FULL and CCV tiers, 158 to 165 vB a leaf; the Merkle-sum opcode is not yet measured for cohorts, so these rows are conservative.
DesignNever leaves aloneLeaves in a batchLeaves alone
LayerTree, CCV + Merkle-sum opcode3161544
LayerTree, FULL tier31611,023
Lightning channel197197573
Transaction tree (Ark model)86862,554
Bare output154154154

The UTXO set tells the same story at a larger scale. A tree of any size is one output on-chain. The same members on Lightning are one output per channel, and as bare outputs one each.

Where it loses

Blocks until every member has left, nobody cooperating, at 1 MvB of block space per block and 25 exits per tree per block. A sharded deployment splits the members into trees of 1,024; a cohort exit removes 64 members in one transaction.
MembersLayerTree, one treeLayerTree, shardedLayerTree, sharded, cohort exitsTransaction treeLightning
1,02441411111
65,5362,62241111835
1,048,57641,944610173274556

A single tree of 65,536 members drained one stranger at a time takes about 2,600 blocks, around 18 days. That is why the specification tells operators to size each tree by exit throughput and to shard a large deployment, and why DETACH_h can split a cohort into its own output on demand. Sharded into trees of 1,024, the same members are out in 41 blocks. If the members of those shards leave in cohorts of 64 per transaction, at about 165 vB a leaf, they are out in 11 blocks, fewer than any other design in the table. At a million members every design is limited by block space, and the cheaper per-member exit wins.

How the numbers are made

All rows use the specification's fee model: a transaction is its script, witness and control block plus a 946 weight-unit skeleton with a fee input, change, the tree output and one payout, which runs about 1% under the serialised transaction. LayerTree with the Merkle-sum opcode is the measured exit of tools/test_msu.py, 252 bytes of script and a witness of 197 bytes plus 40 per occupied level at depth 64, which gives 381 + 10k vB for 2k members; the occupied levels of a key-addressed tree are about log2 N. The FULL tier is dense at depth k, 762, 1,020 and 1,149 vB measured at depths 8, 16 and 20 and extrapolated at 32.25 vB per level beyond that. The transaction tree is the specification's Ark or CTV model, k transactions of 150 vB and a 111 vB claim, and its mass exit counts its N − 1 interior transactions once. Lightning is a simple taproot channel: a 154 vB cooperative close and a 530 vB force close made of a 240 vB commitment, a 152 vB anchor child and a 138 vB sweep after a 144-block delay. Cohort exits are the measured REWRITE_6 with every position leaving. None of the models includes fee pinning.

Deeper