[
A typical mantra from many within the area nowadays in response to any dialogue of adjustments to the Bitcoin protocol is “Don't mess with Layer 1!” You’ll be able to solely make it on layer 2!” Looks as if a really logical factor to do, doesn't it? Why danger the safety and stability of L1 when you’ll be able to construct on prime of it? The issue is that it essentially fails to know the connection between Layer 1 and Layer 2.
L2 protocol is an extension of L1. Regardless of the L2 is designed to do should in the end be restricted to the aptitude of the L1. “Simply do it on L2!” The blanket assertion of what can or can’t be carried out on L2, given the present state of the bottom layer, obscures lots of the underlying realities. For instance, think about making an attempt to construct a Lightning Community with out the existence of multisignature scripts. You couldn't. It will not be potential to share management between a couple of particular person, and the complete idea of a fee channel wouldn’t be potential.
Improvement of fee channels
All the cause the fee channel exists within the first place is because of the truth that Bitcoin's L1 helps the power for a number of individuals to share management of UTXOs with multisig scripts. What is feasible on the L2 is of course constrained by what is feasible on the L1; Sure, in fact it's potential to do issues on L2 that aren't potential on L1, however the in the end limiting issue of what you are able to do off-chain is what's potential on-chain. Sooner fee affirmation within the fee channel is barely potential as a result of on-chain custody will be shared amongst many individuals.
Nonetheless even this isn’t sufficient for a safe fee channel. The unique fee channel had pre-signed transactions utilizing nLocktime timelocks that give the funder their a refund after so many blocks, and solely supported the fee channel in a single course. The pliability of transactions has made these native fee channels unsafe to make use of. If somebody had tampered with the funding transaction earlier than affirmation, the refund transaction will probably be invalidated and the funder may have no solution to declare their a refund. The opposite occasion within the channel can successfully maintain their cash hostage.
CHECKLOCKTIMEVERIFY, the complete timelock opcode, was the answer. CLTV lets you make a coin unspendable till a sure blockheight or time sooner or later. This, together with the power to create scripts that may be spent in a number of methods, permits MultiSig UTXOs to have a script path the place the funder can spend all of the funds themselves after a timelock. This ensures that the funder will be capable to declare the cash again even within the worst case situation, even when the funding transaction goes fallacious. Nonetheless, the channel can nonetheless solely facilitate one-way funds.
To facilitate two-way funds, a correct answer to transaction flexibility was required. This was an enormous motivator for the remoted witness. A timelock is all that was wanted for a one-way channel as a result of cash Solely grew in a single course. The one danger to the sender was that the opposite occasion would by no means declare that they’d already been despatched on chain, leaving the sender with the remainder of the cash caught. Timelock refunds each give the receiver an incentive to assert on-chain funds earlier than the timelock, after they would lose all of the funds already despatched, and provides the sender recourse within the worst case if one thing occurs, giving the receiver a everlasting refund. Will likely be taken offline fully. , The script doesn’t help making use of sure quantities to some future script, so if funds are to circulate in each instructions then pre-signed transactions are the one viable preliminary refund mechanism. This reopened the danger of cash changing into hostage.
With the improve to SegWit, this drawback was solved. Rather than timelocked refunds, which inspired trustworthy behaviour, the penalty key was launched. As a result of funds can circulate backwards and forwards in every course in a two-way channel, there’ll inevitably be a case the place each events had more cash within the prior state of the channel than within the current one. By organising a department in every channel state's pre-signed transactions utilizing the penalty key, customers can trade these after signing the brand new state and know what is going to occur if the opposite occasion tries to make use of the outdated transaction. If that’s the case then they’ll declare 100% of the funds within the channel. Timelocks are used to ensure the conventional spend path the place customers don’t preserve their respective balances legitimate for a time period, to permit channel events the chance to make use of penalty keys if mandatory. Nonetheless there’s a drawback, utilizing CLTV signifies that sooner or later sooner or later the channel Is Shut in any other case the time restrict will expire and you’ll not have that safety interval to punish the dishonest occasion.
Bi-directional fee channels additionally required CHECKSEQUENCEVERIFY, or relative timelock, to unravel this drawback. Not like CLTV, which specifies a particular time or blockheight sooner or later, CSV specifies a size of time or variety of blocks relative to the time or block that the UTXO that makes use of CSV within the script is confirmed within the blockchain. This allowed the safety interval for using penalty keys to operate with out requiring channels to be shut down on-chain at a pre-determined time.
Nonetheless, even this doesn’t give us the Lightning Community. There’s nonetheless no solution to truly route funds by way of a number of fee channels. They’ll make funds in each instructions, however solely between two individuals concerned within the channel. You guessed you'll want different L1 performance to route funds throughout a number of channels. Hash time locked contracts are how that is achieved, they usually require each a CLTV and a hashlock. Hashlock requires offering a pre-image of the hash to be able to spend cash. It's like a signature, besides you merely reveal the “non-public key” as an alternative of really signing with it. This permits the receiver in Lightning funds to offer a hashlock, and every intermediate channel between the sender and the receiver creates a script that permits spending the cash instantly with the hash preimage or returning the cash after a timelock. If the recipient discloses the hashlock, everybody can declare the cash for forwarding the fee, if not, the cash will be claimed again with out finalizing it.
Subsequently the Lightning Community that exists at this time relies upon fully on 5 The performance is being made potential on the bottom layer of Bitcoin. Multisignature scripts, absolute timelock, relative timelock, a number of witnesses and hashlock. With out even one in every of these options current on L1, Lightning as we all know it at this time wouldn’t be a possible L2 that we might construct. Its existence as an L2 is totally depending on the power of the L1 to do sure issues. So if one is in a world the place Bitcoin helps hashlocks, timelocks in scripts, and no resiliency fixes, then simply say “construct a bidirectional multi-hop fee channel system at Layer 2!” “We shouldn’t be messing with Layer 1” could be a very inconsistent assertion.
Hunt
That stated, strictly technically talking, it will nonetheless have been potential to construct that bidirectional multi-hop fee channel system in a world with out these three options at L1. on a On Massive scale Price by way of establishing belief in different individuals, in order that they’ll't steal your cash, even when they’re able to accomplish that. A federated sidechain. Everybody might arrange a federated chain like Liquid or Rootstock and add these options to the sidechain, making a Lightning Community as an alternative of the principle chain. The issue with that is that it's not the identical factor. On a technical stage the community will work precisely the identical, however anybody utilizing it won’t even have the identical stage of management over their cash.
Once they shut down the Lightning Channel will probably be settled on a federation backed sidechain, i.e. will probably be an accounting entry on prime of another person's multisig pockets the place you’ll have no capacity to manage these cash on L1. . You simply should belief the distributed group working the federation in order to not disturb everybody. Even Drivechain (which requires the brand new L1 performance) is simply one other type of federation on the finish of the day, with some extra restrictions added to the withdrawal course of. The federation is simply the miners reasonably than the individuals who maintain the non-public keys.
That is the underlying actuality, whether or not they perceive it or not, that the response is “Simply make it on L2!” Each time somebody is discussing bettering L1. There’s the scope of what’s already potential to construct on L2, which is kind of restricted and restricted by its personal scaling limitations, after which there’s the scope of what’s not already potential. The creation of every thing that falls into the latter class is inconceivable with out involving a trusted entity or group of entities that’s in the end accountable for customers' funds for them.
What’s the matter?
“Layer 2” just isn’t a magic mantra. You’ll be able to't simply wave a magic wand and chant phrases, and something and every thing magically turns into potential. There are laborious unavoidable limits to what the L2 can obtain, and people are limits to what the L1 can accomplish. That is an inherent reality of engineering actuality when a system like Bitcoin. You can not keep away from this in any means, besides that you simply additional weaken the assumptions of confidence because of the larger flexibility of the L2 in-built past the capabilities of the L1.
So when these points are mentioned, similar to what enhancements will be made in L1, two issues are extraordinarily necessary. First, these enhancements to L1 are virtually fully centered on enabling the creation of a extra versatile and scalable L2. Second, L2s can't magically allow every thing. L2 has its personal limitations primarily based on L1, and the one solution to overcome these limitations is to introduce trusted entities, discussing adjustments in L1 with out acknowledging this isn’t an trustworthy dialog.
If we’re going to focus on what to do subsequent with Bitcoin, it’s time to begin accepting actuality, in any other case nothing however denial of actuality and gaslighting is occurring. And that’s not productive.