A fashioned chant from many on this location this expose day in step with any discussion of modifications to the Bitcoin protocol is “Don’t mess with Layer 1! You might perhaps perhaps well appropriate develop it on Layer 2!” This sounds like a extraordinarily logical thing to accomplish, appropriate? Why threat the security and balance of L1 within the event that you can appropriate develop on top of it? The stammer is this fundamentally fails to effect the relationship between Layer 1 and Layer 2.
An L2 protocol is an extension of the L1. The entire lot that an L2 is designed to accomplish must within the rupture decrease the entire vogue down to what the L1 is in a position to. The blanket allege of “appropriate accomplish it on L2!” obfuscates tons of implicit realities of what can or can’t be finished on an L2 given the most contemporary sing of the horrid layer. To illustrate, imagine making an strive to develop the Lightning Network without the existence of multisignature scripts. You couldn’t. It wouldn’t be you might perhaps mediate to share retain watch over between greater than one individual, and your entire thought of a charge channel wouldn’t be you might perhaps mediate.
The Evolution of Price Channels
The total cause that charge channels can exist within the main sing is which capacity of the fact that L1 of Bitcoin helps the flexibility for multiple folks to share retain watch over of a UTXO with a multisig script. What is feasible on a L2 is inherently constrained by what’s feasible on L1; sure, unnecessary to claim it’s you might perhaps mediate to accomplish things on L2 that aren’t you might perhaps mediate on L1, however the within the rupture limiting component of what that you can accomplish off-chain is what’s feasible on-chain. Sooner charge affirmation in a charge channel is handiest you might perhaps mediate because on-chain custody might perhaps perhaps well presumably be shared between multiple folks.
Even that isn’t ample for a safe charge channel even supposing. The distinctive charge channel had a pre-signed transaction using an nLocktime timelock that offers the funder their money wait on after so many blocks, and handiest supported charge channels in one direction. Transaction malleability made these fashioned charge channels unsafe to make expend of. If the funding transaction was once malleated by any person sooner than confirming, then the refund transaction would become invalidated and the funder would have not any arrangement to affirm their money wait on. The quite a bit of occasion within the channel might perhaps perhaps well successfully retain their money hostage.
CHECKLOCKTIMEVERIFY, the absolute timelock opcode, was once the resolution. CLTV capacity that you can develop a coin unspendable till a recount blockheight or time in due direction. This, together with the flexibility to develop scripts that can perhaps well well also presumably be spent in multiple systems, allowed the multisig UTXO to beget a script direction the effect the funder might perhaps perhaps well deliver the entire funds themselves after a timelock. This guaranteed the funder might perhaps perhaps well be in a arrangement to affirm the money wait on in a worst case scenario even when the funding transaction was once malleated. The channel might perhaps perhaps well peaceable handiest facilitate one-contrivance funds even supposing.
In remark to facilitate two-contrivance funds, a merely resolution to transaction malleability was once foremost. This was once a noteworthy motivator for Segregated Gaze. A timelock is all that was once foremost for a one contrivance channel for the explanation that money handiest increased in one direction. The handiest threat to the sender was once that the completely different occasion would never claim what they’ve already been despatched on-chain, leaving the comfort of the sender’s money trapped. The timelock refund every gave the receiver the incentive to affirm funds on-chain sooner than the timelock, when they’d lose the entire funds they’d already been despatched, and the sender a worst-case recourse in case one thing occurred to permanently knock the receiver offline. Script does no longer toughen enforcing particular quantities to particular future scripts, so a pre-signed transaction is the handiest viable preliminary refund mechanism if funds are to float in every directions. This reopened the threat of funds being held hostage.
With the toughen to Segwit, this stammer was once solved. Rather then the timelock refund incentivizing appropriate behavior, the penalty key was once launched. Since the funds in a two-contrivance channel can float in every direction there’ll inevitably be a case the effect all sides had extra money in a prior sing of the channel than the most contemporary one. By organising a branch in every channel sing’s pre-signed transaction using a penalty key, customers can exchange these after signing the new sing and know if the completely different occasion tries to make expend of an used transaction they’ll claim 100% of the funds within the channel. Timelocks are liable to guarantee the fashioned spending direction the effect customers take their respective balances isn’t accurate for a time to present channel events the probability to make expend of the penalty key if foremost. There’s a stammer with this even supposing, using CLTV manner that in some unspecified time in the future in due direction the channel has to conclude or else the timelock will expire and you no longer beget that safety duration to penalize the dishonest occasion.
Bi-directional charge channels also wished CHECKSEQUENCEVERIFY, or relative timelocks, in remark to resolve this disaster. No longer like CLTV, which specifies a recount time or blockheight in due direction, CSV specifies a relative length of time or preference of blocks from the time or block that the UTXO using CSV within the script is confirmed within the blockchain. This allowed the safety duration to operate for penalty key expend without requiring channels having to conclude on-chain at a pre-made up our minds time.
Even this does no longer give us the Lightning Network even supposing. There might perhaps be peaceable no arrangement to in actual fact route a charge all thru multiple charge channels. They’ll behavior funds in every directions, however handiest between the two folks occupied with the channel. In remark to route funds all thru multiple channels you wish, you guessed it, completely different functionality from the L1. Hash Time Locked Contracts are how that is finished, they generally require every CLTV as smartly as hashlocks. Hashlocks require providing the preimage to a hash in remark to deliver the coins. It’s like a signature, other than you absolutely appropriate stammer the “interior most key” rather then signing with it. This permits the receiver in a Lightning charge to produce a hashlock, and each intermediate channel between sender and receiver construct a script that enables spending exact now with the hash preimage, or refunding the money backwards after a timelock. If the receiver displays the hashlock, every person can claim the money for forwarding the charge, if no longer, then the money might perhaps perhaps well presumably be claimed backwards and reversed without finalizing it.
So the Lightning Network as it exists at the new time depends fully on 5 functionalities being you might perhaps mediate on the horrid layer of Bitcoin. Multisignature scripts, absolute timelocks, relative timelocks, Segregated Gaze, and hashlocks. Without any regarded as such a parts reward on L1, Lightning as we perceive it at the new time would no longer be a you might perhaps mediate L2 we might perhaps perhaps well construct. Its existence as an L2 is fully dependent on L1’s functionality to accomplish particular things. So if one were to, in a world with a Bitcoin that did no longer toughen hashlocks, timelocks in script, and no malleability fix, merely proceed “Appropriate develop a bidirectional multi-hop charge channel system on Layer 2! We shouldn’t be messing round with Layer 1” it would be a truly incoherent allege.
The Win
That talked about, strictly technically speaking, it peaceable would were you might perhaps mediate to develop that bidirectional multi-hop charge channel system in that world without those three parts on L1. At a huge price in the case of introducing belief in completely different folks to no longer rob you money when they’re in a position to doing so. A federated sidechain. Each person might perhaps perhaps well beget appropriate location up a federated chain like Liquid or Rootstock and added those parts to the sidechain, constructing the Lightning Network there rather then on the mainchain. The stammer with that’s, it’s no longer the same thing. On a technical diploma the network would purpose the very same, however no one using it might perhaps actually perhaps well even beget the same diploma of retain watch over over their coins.
When they closed out a Lightning channel it might perhaps actually perhaps well identify a sidechain backed by a federation, i.e. it might perhaps actually perhaps well appropriate be an accounting entry on top of any person else’s multisig wallet the effect you have not any ability to manipulate those coins on L1. You appropriate must belief the allotted community operating the federation to no longer rug every person. Even drivechains (which satirically itself requires new L1 functionality to be finished) is acceptable one other form of federation at the rupture of the day, with some extra restrictions added to the withdrawal direction of. The federation is acceptable miners rather then folks holding interior most keys.
Right here is the implicit actuality, whether or not they effect it or no longer, underlying the reaction “appropriate develop it on L2!” each time any person is discussing improvements to L1. There might perhaps be the scope of what’s already you might perhaps mediate to develop on L2, which in all fairness shrimp and restricted by its have scaling obstacles, after which there’s the scope of what’s no longer already you might perhaps mediate. The entire lot falling into the latter class is inconceivable to develop without interjecting some depended on entity or community of entities that within the rupture is up to the mark of customers’ funds for them.
What’s the Level?
“Layer 2” is no longer a magic incantation. You might perhaps perhaps well’t appropriate wave a magic wand and chant the phrases, and the relaxation and the entire lot turns into magically you might perhaps mediate. There are strict inescapable obstacles of what an L2 can construct, and those obstacles are what the L1 can construct. Right here is acceptable an inherent truth of engineering actuality when taking a thought at a system like Bitcoin. You might perhaps perhaps well’t receive away it in anyway other than by degrading the belief assumptions increasingly the extra versatile of an L2 you develop beyond the capabilities of L1.
So when discussions round these points happen, equivalent to what improvements might perhaps perhaps well presumably be made to L1, two things are of maximum importance. First, those improvements to L1 are almost fully centered round enabling the constructing of extra versatile and scalable L2s. Secondly, L2s can no longer magically allow the entire lot. L2s beget their have obstacles based fully on those of the L1, and to beget a discussion regarding modifications to L1 without acknowledging the handiest contrivance round those obstacles is to introduce depended on entities is no longer an acceptable dialog.
It’s time to initiate acknowledging actuality if we are going to debate what to accomplish with Bitcoin going forward, otherwise nothing is occurring however denial of actuality and gaslighting. And that’s no longer productive.