Author: 798.eth
Lightning Labs co-founder Olaoluwa Osuntokun recently released a new Bitcoin scaling design called LayerTree.
It proposes a rather radical idea: allowing tens of thousands, even millions of users to share a single Bitcoin UTXO, while each user retains independent ownership of their funds and the ability to exit unilaterally.
This sounds somewhat contradictory.
A million people holding Bitcoin separately typically means a million UTXOs are needed on-chain. If funds are pooled at an exchange, indeed only a few UTXOs are needed, internal transfers can be instant, but users must trust the exchange's database.
LayerTree attempts to find a new position between these two.
Only one UTXO is kept on-chain. How much Bitcoin each person owns is recorded in an off-chain Merkle Sum Tree. The operator is responsible for maintaining daily services but cannot arbitrarily modify user balances or prevent existing users from withdrawing their funds back on-chain.
How a Tree Represents Everyone's Balance
In LayerTree, each user owns a leaf node.
A leaf node records the user's balance, owner public key, exit public key, lease term, and state sequence number. Adjacent leaf nodes are continuously merged upward, with each parent node recording the balance sum and hash of its two child nodes, eventually forming a single unique root.
Assume there are four people in the tree:
Alice has 5 BTC, Bob has 3 BTC, Carol and David each have 1 BTC.
The shared UTXO on-chain holds a total of 10 BTC. The tree root commits to how much balance each of the four owns, and that all balances sum exactly to 10 BTC.
If anyone modifies a leaf node, the root changes. If someone tries to inflate a balance out of thin air, the amount verification at the root node will fail.
The Bitcoin chain does not need to store the entire tree, only this root, along with the UTXO corresponding to the total balance in the tree.
This is equivalent to compressing the ownership records of a large number of users into a single cryptographic commitment.
How a User Exits Individually
When Alice wants to exit, she does not need approval from the operator, nor do other users need to be online.
She only needs to submit her leaf node, the Merkle proof from her leaf node to the tree root, and her signature.
The Bitcoin script will verify that Alice is indeed in this tree, confirm she owns the corresponding balance, and then in one transaction accomplish two things:
First, pay Alice's balance to her specified exit address.
Second, delete Alice's leaf node and place the remaining funds into a UTXO that commits to the new tree root.
Whether there are one hundred or one million people in the tree, Alice only needs to broadcast one exit transaction.
What LayerTree calls O(1) exit refers to the number of transactions required for exit always being one. The size of the Merkle proof will still grow with the number of members, approximately O(log N).
This design compresses a large number of users into one UTXO during normal operation, while preserving an on-chain escape route for abnormal situations.
Two Transfer Methods in LayerTree
If every user transfer modified the tree root, all transactions would still need to go on-chain sequentially, offering very limited scaling benefits.
Therefore, LayerTree conducts daily payments off-chain, primarily offering two methods: channel leaf and voucher.
Channel leaf: Putting a Lightning channel into a leaf node
A leaf node can represent a Lightning channel between a user and the operator.
The channel's funding output is not yet present on-chain as a separate UTXO; it is included in the shared output of the entire LayerTree. When users pay each other, they use the operator to forward ordinary Lightning HTLCs.
During the payment process, the LayerTree root does not change, and no on-chain transaction is generated.
Therefore, payments via channel leaf can be nearly as fast as ordinary Lightning, typically completing within seconds. The operator acts as a routing node here, while LayerTree is responsible for compressing the on-chain UTXOs required for channels.
It's similar to a large Lightning hub, occupying only one output on-chain.
Voucher: A digital check that can be cashed on-chain
The more creative part of LayerTree is the voucher.
A voucher can be understood as a digital check issued by a user, with final execution power provided by the Bitcoin script.
Suppose Alice's leaf node has 100,000 sats, and she wants to pay Bob 10,000 sats.
Alice does not need to immediately modify the entire tree. She only needs to sign a message stating which LayerTree this voucher belongs to, which leaf node the funds come from, what new leaf node Bob will receive, the payment amount, and the current state sequence number of Alice's leaf node.
Alice sends the signed voucher to Bob, and the off-chain payment is complete.
This process only involves signatures and network transmission, and can be nearly as fast as exchange internal transfers.
The key difference is that what Bob receives is not just a balance record in the operator's database. He receives a payment instruction that can be executed by the Bitcoin script.
If Alice or the operator stops cooperating, Bob can independently submit the voucher to the chain. The LayerTree contract will deduct the corresponding amount from Alice's leaf node while creating a new leaf node for Bob.
This entire process is called CLAIM.
Alice does not need to sign again, and the operator cannot prevent Bob from cashing it.
Why a Voucher Can Only Be Used Once
Each LayerTree leaf node has a state sequence number, called seq.
Assume Alice's current seq is 7. The voucher she signs will explicitly bind to seq 7.
When a voucher is cashed, Alice's balance decreases, and her seq increases from 7 to 8. All old vouchers bound to seq 7 subsequently become invalid.
This prevents the same check from being cashed repeatedly.
If Alice pays Bob frequently, she also doesn't need to create separate vouchers each time.
For the first payment of 10,000 sats, Alice can sign a voucher for a cumulative amount of 10,000 sats. For the second payment of 20,000 sats, she can re-sign a voucher for a cumulative amount of 30,000 sats.
Bob only needs to keep the latest one.
Hundreds or thousands of small payments can be compressed into a single voucher representing the final cumulative balance. As long as both parties continue to cooperate, there is absolutely no need to write each payment into a Bitcoin block.
Vouchers Cannot Eliminate Credit Risk
Vouchers have real signatures and an on-chain redemption path, but they still carry issuer credit risk until they are cashed.
Suppose Alice's leaf node has only 100,000 sats.
She can sign and issue an 80,000 sat voucher to Bob, and simultaneously sign and issue another 80,000 sat voucher to Carol.
The signatures on both vouchers are genuine, but Alice's balance cannot cover both.
The Bitcoin script can prevent overfunded vouchers from being cashed, but it cannot prevent Alice from signing and issuing multiple vouchers off-chain that exceed her balance. Ultimately, who gets the money may depend on who completes the redemption first.
Alice could also update her leaf node through other legitimate operations, increasing the seq. Vouchers on the old state would then become invalid.
Therefore, an uncashed voucher is much like a traditional check:
The signature can prove who issued it, the holder can attempt to cash it, but the account balance might be insufficient, and multiple checks might compete for the same funds.
The recipient needs to pay attention to the payer's available balance, current seq, uncashed vouchers, leaf node lease term, and the payer's creditworthiness. For strangers or large payments, the recipient might choose to cash immediately. For small, frequent payments between long-term collaborators, they can continue to accumulate off-chain.
LayerTree's website also explicitly states that until a voucher is cashed or settled by other means, the recipient should treat it as credit.
This credit risk is the price paid for the efficiency of vouchers.
Why Design Vouchers in the First Place?
Since credit risk exists, why not just use Lightning channels for everything?
Because the structure of vouchers is simpler and more flexible.
They do not require the payer and payee to establish a separate channel in advance. They can be issued directly by any leaf node owner, can be updated cumulatively multiple times, and can also serve as settlement instruments between LayerTree and Lightning.
LayerTree has designed a credit leaf for receiving payments from Lightning.
After the operator receives a Lightning payment, it can use its own funded leaf node to issue a new cumulative voucher to the recipient. The recipient can continue to hold it or, if necessary, cash it on-chain themselves.
The basic flow has a brief trust window: the operator has received the Lightning payment but has not yet issued the voucher to the recipient. The paper also designs a pending pair, using hash locks, pre-signed vouchers, and a settlement window, allowing the recipient to first obtain an executable voucher before releasing the preimage for the Lightning payment.
In this structure, vouchers become the bridge between Lightning payments and shared UTXO balances.
They are particularly suitable for high-frequency, small-amount payments, salary streams, content payments, long-term service settlements, and scenarios where the operator periodically performs batch settlements. The normal state only requires exchanging signatures, with on-chain redemption reserved for dispute resolution and final settlement.
Which Bitcoin Upgrades Does LayerTree Depend On?
LayerTree cannot currently run on the Bitcoin mainnet.
It requires covenants, which allow a UTXO to impose constraints on how it can be spent in the future. For example, the script must ensure that after a user exits, the remaining funds go back into an output committing to the new tree root, and cannot be taken by any arbitrary address.
The project designs four opcode combinations.
The FULL version relies on BIP 441, BIP 440, OP_TX, BIP 348, and a set of elliptic curve opcodes.
BIP 441 restores some early-disabled script capabilities and supports more flexible data and numerical processing. BIP 440 provides a computational budget for these variable-cost operations.
The MID version relies on OP_CAT from BIP 347, OP_TX, OP_CHECKSIGFROMSTACK from BIP 348, and OP_TWEAKADD from BIP 449.
OP_CAT is used to concatenate data in scripts. OP_TX allows scripts to read and constrain the current transaction. OP_TWEAKADD is used to compute the Taproot public key that commits to the new state.
Among these, BIP 348 is particularly important for vouchers. It allows Bitcoin scripts to verify a signature on arbitrary data. Without this capability, scripts would have difficulty verifying the digital check Alice signed off-chain.
The MIN version relies only on OP_CAT and OP_TWEAKADD but can only implement exit and SPLIT, not vouchers or channel leaves. It's more of an experiment to demonstrate LayerTree's minimum capability boundary.
The CCV version relies on OP_CHECKCONTRACTVERIFY from BIP 443, OP_TX, and BIP 348 for vouchers.
BIP 443 allows UTXOs to carry dynamic state commitments and constrain new outputs to inherit the updated state. It aligns well with on-chain state machines like LayerTree and is also among the versions with the smallest exit volume.
However, none of these BIPs are activated on the Bitcoin mainnet yet.
"Millions Sharing One UTXO" Has an Additional Prerequisite
The version with the most impressive performance in LayerTree's promotion also depends on a dedicated opcode called OP_MERKLESUMUPDATE.
It can verify Merkle Sum proofs and directly compute the new tree root after replacing a leaf node.
With it, a LayerTree with 65,536 members would require about 540 vB for a single-person exit. For every doubling of members, the exit transaction would only increase by about 10 vB.
But OP_MERKLESUMUPDATE is currently just a design and simulated implementation in the project repository, not yet a formal BIP, and has not entered the Bitcoin upgrade process.
If only using existing opcode proposals, the exit cost for a scale of 65,536 people is approximately 908 to 1,473 vB.
So, "a tree carrying millions" is cryptographically sound, but its efficient implementation still depends on Bitcoin script capabilities beyond the current BIPs.
Can It Solve a Mass Withdrawal (Run)?
LayerTree can significantly compress on-chain footprint during normal operation but cannot increase the capacity of the Bitcoin blocks themselves.
All state updates for the same tree must spend and recreate the same shared UTXO, so individual exits need to be executed sequentially.
According to the project's own calculations, if 65,536 users exit from the same tree separately, it would take approximately 2,622 blocks, close to 18 days.
Practical deployment would need to distribute users across many smaller trees, while using batch joins, batch settlements, and batch exits.
This also illustrates LayerTree's design goal: to keep the vast majority of normal activity off-chain, reserving the limited on-chain space for final settlement and abnormal situation handling.
The Significance of LayerTree
LayerTree still has a clear operator.
The operator is responsible for onboarding users, maintaining services, routing payments, and organizing batch updates. It can refuse new users and can also stop providing real-time services. A single LayerTree is therefore not fully decentralized.
It might be more appropriately called a non-custodial shared UTXO system.
The operator controls the service entry, while users control the right to exit funds. The operator might shut down or refuse service, but according to the protocol design, it cannot arbitrarily take the balances from users' leaf nodes.
The most noteworthy part of LayerTree is that, beyond ordinary UTXOs, Lightning channels, and custodial databases, it demonstrates another form of funds:
A digital check that can circulate instantly, accumulate continuously, and ultimately be handed over to the Bitcoin script for forced redemption.
It does not eliminate credit risk, nor does it break through the upper limit of block space.
It confines credit risk to the off-chain payment stage, while preserving a permissionless on-chain execution path for the recipient.
This is a highly creative approach to Bitcoin scaling.





