
What’s the Lightning Community? It’s usually spoken about in analogies, metaphors or direct explanations of function.
- “It’s the checking account, versus on-chain because the financial savings account.”
- “It’s a sequence of tubes just like the web, with bitcoin flowing by them.”
- “It’s a fast, instant-settlement layer of bitcoin.”
What it truly is is a community of cost channels, the place individuals lock bitcoin right into a multisignature deal with, and replace the state of steadiness distributions off-chain. It’s how we’re going to scale Bitcoin — or a minimum of a part of how we’re going to scale Bitcoin.
Within the quick “Explainer” sequence on this journal, I clarify the mechanics of how Lightning works: how the pre-signed transactions that make up a Lightning channel work, how funds are routed throughout the community, ways in which liquidity is managed, and so on. Learn these, and you need to have a strong understanding of the underlying mechanisms that make the Lightning Community work.
The issue is, in terms of asking what the Lightning Community is, all of these particular person items are modular and replaceable. What if we structured the pre-signed transactions in a different way? Or what if we used a distinct mechanism to route funds throughout the community? What about completely rethinking the way in which we even choose routes for funds within the first place?
What if we changed all of them over time, in order that not one of the particular person items of the protocol or community are the identical? Is that also the Lightning Community? Just like the Ship of Theseus, is the ship nonetheless Theseus’ ship after each plank and screw has been changed?
Is the Lightning Community nonetheless the Lightning Community if we modify how all the person items work?
Channel Designs
Lightning channels are units of pre-signed transactions. The aim of those transactions is to decide to, and provides customers a mechanism to implement, a steadiness distribution of a shared UTXO that neither get together has unilateral management over.
These channels, or transactions, presently take the type of a Poon-Dryja channel. These transactions use the revocation key mechanism invented by Tadge Dryja within the authentic Lightning Community white paper. It is a very particular transaction construction for a cost channel, however it’s certainly not the one one.
Let’s have a look at an idea known as “timeout bushes” to take a look at one thing with minimal variations from the way in which channels presently work.

A timeout tree is likely one of the most elementary doable types of multiparty channels (a channel with greater than two members in it). A Lightning service supplier (LSP) creates a tree of transactions branching out from a single on-chain UTXO, and ending alongside every department with a Lightning channel between the LSP and a few person. Every tree has an expiry time, after which the on-chain UTXO (or any of the middleman ones between it and the Lightning channels) might be spent unilaterally by the LSP. The thought is that customers can merely swap their funds from channels within the expiring tree to a brand new one earlier than that time, and let the LSP reclaim the liquidity it locked up with its customers after expiry.
This was proposed as a use case for CHECKTEMPLATEVERIFY (CTV), an opcode that stops a UTXO from being spent any means aside from the transaction that matches a predefined hash; in precept, it may very well be finished with out it utilizing pre-signed transactions with the trade-off of introducing extra coordination complexity and danger of failure to initialize a tree.
The Lightning channels would primarily work simply the identical as Poon-Dryja channels, but in addition want to incorporate all the additional pre-signed transactions concerned in unfurling the tree, and topic to the expiry time of the tree as a complete.
Is that this Lightning? Or is that this one thing else?
What about LN-Symmetry? That could be a proposal utilizing CTV and CHECKSIGFROMSTACK (CSFS), an opcode that permits you to examine a signature towards arbitrary information in a transaction to utterly change the revocation key and revocation mechanism.
As a substitute of the revocation system, LN-Symmetry creates the idea of a floating signature or floating transaction. The LN-Symmetry script has two methods to spend it, both a CTV department locking the spend to the transaction representing the steadiness distribution for that channel state, or a CTV + CSFS department that lets any transaction matching a CTV template signed by a particular key set within the script spend it. This, together with using totally different timelock values, permits any dedication transaction to spend the output of any prior dedication transaction, i.e., to interchange older states with newer ones.
Slightly than penalizing a celebration who used an outdated transaction, LN-Symmetry “corrects” the outdated transaction to distribute balances based mostly on the present state as a substitute. Is that this nonetheless Lightning? Or is that this too totally different?
Cost Forwarding Protocols
Hash-time lock contracts (HTLCs) are used to route funds throughout the Lightning Community. Every HTLC both finalizes the cost transferring ahead with the revealing of a preimage to a hash, or permits it to be refunded backward if that preimage isn’t revealed in time. That is the mechanism safely implementing that each hop of a cost both strikes ahead to the receiver, or backward to the sender (if it couldn’t be accomplished).
This isn’t the one approach to accomplish that aim.
Level timelock contracts (PTLCs) are one other mechanism that may very well be used instead of HTLCs. PTLCs make use of adapter signatures versus preimages and hashes to offer atomic ensures between all of the hops in a cost. Adapter signatures are cryptographic signatures which have had a knowledge worth added to them — or faraway from them — with a purpose to render them invalid. The signature can now solely be made legitimate once more by including (or eradicating) the “adapter worth” that was used within the first place.
Funds alongside a route are signed with adapter signatures, with the recipient of the cost releasing the data wanted to render them legitimate once more. However this isn’t that radically totally different from an HTLC; it simply makes use of a distinct mechanism for facilitation.
Let’s have a look at one thing wildly totally different: packetized funds. That is an outdated proposal to utterly put off HTLCs with a purpose to ahead funds. The thought is to interrupt up a single cost into quite a few funds of very small worth, say 100 satoshis, after which simply blindly ahead them to a peer with routing directions.
The recipient can inform the sender each time a “cost packet” arrives efficiently, and if one doesn’t arrive, the sender is aware of that one hop alongside the route isn’t truthfully forwarding the cash. They’ll cease utilizing that route and take a look at one other one, solely shedding 100 satoshis within the course of.
Is that this nonetheless Lightning, or one thing utterly totally different? The channel transactions would work the identical means and the routing protocol could be similar, however is it nonetheless Lightning?
Routing Protocols
What if we utterly change the routing protocol? Lightning presently makes use of the gossip protocol with a purpose to be certain that all Lightning nodes on the community have a comparatively good map of the totally different channels throughout the community, how a lot bitcoin is in them, and the charges they cost — all the data vital for every node to completely choose the routing path for its funds by itself.
Ant Routing is a proposal to put off all of that fully: to route funds throughout the community with none gossip protocol, with none map of the community, and with out the sender choosing the trail that their cost takes.
The design to perform that’s constructed round “pheromone trails” and “pheromone seeds,” particular messages which are broadcast out throughout the complete community with a purpose to facilitate funds. Collectively, the sender and receiver generate a big random quantity, and create a partial hash of that (the pheromone seed). Each events then broadcast the seed to all of their speedy friends with a counter that will increase by +1 each time the seed is handed alongside.
Finally, one node within the community will obtain each seeds, and know that they’re the connecting level for an entire path between sender and receiver. At this level, that node will ship a response message again in each instructions, and when the sender and receiver each verify the response they will coordinate the cost.
It will likely be handed again alongside the path to the connection level, and from there to the receiver, all with out anybody alongside the trail, together with the sender and receiver, having to assemble the route themselves or having any concept what the whole route is.
Is that this nonetheless the Lightning Community? Or is that this too radically totally different?
What Is It?!
The Lightning Community is a sequence of pre-signed transactions to implement a steadiness distribution between customers, plus the opposite mechanisms concerned in updating that distribution and synchronizing these updates between customers all throughout the community.
However doesn’t that additionally describe Ark? Or statechains? Sure. That’s my level.
The core concept of Lightning is simply updating agreements about the right way to distribute funds off-chain, whereas guaranteeing that the newest model of that settlement might be enforced on-chain if wanted, with out room for an concerned get together to “cheat the system” and implement a extra favorable previous settlement.
There are various alternative ways to attain that aim. The best way used presently is just the primary concrete means that was specified. There are, and might be, extra and alternative ways to try this. Over time the strategies and instruments for conducting that aim will change.
Perhaps some new means will utterly out of date an older means. Perhaps some new means works higher in a sure situation or scenario. However new methods will certainly come, and that’s okay.
Some issues will utterly change, others will solely be slight variations of what got here earlier than, however Lightning will shapeshift over time. It must with a purpose to proceed scaling in the long run, to unravel its personal issues, to assist bitcoin perform as a cash.
Lightning will evolve.

Don’t miss your probability to personal The Lightning Challenge — that includes an unique interview with Lightning co-creator Tadge Dryja. It dives deep into Bitcoin’s strongest scaling layer. Restricted run. Solely out there whereas provides final.
This piece is an article featured within the newest Print version of Bitcoin Journal, The Lightning Challenge. We’re sharing it right here to indicate the concepts explored all through the total situation.