You’ve done your homework on Bitcoin and are learning about Lightning or just set up a node. You aren’t sure how it works and are nervous about losing funds
What’s involved in backing up a lightning node?
I’ve been using lightning for years, let me break it down for you 👇
Your Bitcoin is in cold storage. You stamped your mnemonic into a piece of solid steel.
It won’t be destroyed in a flood, fire, or acid bath.
You can finally sleep at night knowing your Bitcoin are safe.
With Bitcoin covered, you are excited to experiment with Lightning.
You fully expect a similar security model when booting up your lightning node for the first time.
I’ll get a seed phrase and stamp it into another piece of steel.
Unfortunately, it won’t quite be as simple.
What makes lightning more difficult to backup and secure?
In Bitcoin things are simpler.
You have your set of UTXOs and a seed phrase that can be used to generate all the keys needed to unlock those UTXOs as well as all the UTXOs you might create in the future.
Everything you need to recover funds can be generated from a single seed.
In Lightning there is a lot more state that is needed in order to recover your channels and that state is not deterministically generated from some single piece of information.
Each channel consists of the most recent commitment transaction and a set of revocation secrets.
While the keys used to create and sign each new commitment transaction can be backed up similarly to your on-chain keys, the latest commitment tx and revocation secrets cannot.
They change every time a payment is made or HTLC is forwarded.
This doesn’t mean all hope is lost.
It just means you need to make a backup every time the channel is updated.
Your wallet or node implementation should handle this for you.
They will backup both pieces of state to your hard drive and ideally encrypted in the cloud as well.
With this backup and your keys to sign the commitment tx you will always be able to claim your funds and protect yourself from potential theft by your channel partner.
What about restoring these backups on a different wallet or node implementation?
These are industry standards that define how to generate a seed from your mnemonic and then an entire set of addresses from your seed.
This means you can import your mnemonic into almost any wallet and recover your funds.
There is no equivalent standard in the lightning ecosystem.
Each implementation represents this channel state in slightly different ways internally and on disk.
This structure is not defined in any BOLT spec nor is it required to be the same for payment interoperability.
All hope is not lost.
At the end of the day all backups must contain the same minimum set of information needed to recover.
In theory a brave engineer could implement software that knows how to read each implementation's backup structure and write it out in any of the formats.
Such a tool could allow for cross implementation channel recovery.
This tool would likely come with a large maintenance burden as there’s nothing preventing each implementation from continuing to iterate on their internal structures.
Anyone out there working on this?
I hope this helped you understand why backing up and restoring state on lightning is more complicated than it is with on-chain bitcoin.
I hope it didn’t scare you off lightning as nodes and wallets really make it pretty simple to safely backup this state.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
Did you know that Bitcoin maintains a 10 min avg time between blocks regardless of the amount of hash power that on the network?
It’s possible because of a mechanism called the difficulty adjustment and it’s incredibly important to understand.
Let me break it down for you 👇
The difficulty refers to how hard it is for a miner to find a hash that would be considered a valid block on the network.
A higher difficulty translates to more hashes needing to be calculated on average whereas a lower difficulty means less hashes are needed on average.
If we recall from my previous thread on how mining works we know that a miner is hashing random values in search of an output that is less than some target.
When they find an input that produces an output below this target they are able to produce a block and claim the reward
My thread about the security of 12 vs 24 word mnemonic phrases surfaced some good discussion and some confusion. To clarify it further it’s important to understand the answers to:
What is a seed?
How’s it different from a private key?
Let me further break it down for you 👇
A seed is a set of random data that is used as the starting point for wallets to generate an endless supply of public and private keys for you.
If someone has your seed they can use it to generate the private keys for ALL of the addresses you use and ever will use.
The mnemonic phrase is used as an easy way to remember and/or write down your seed.
So if someone gets your mnemonic phrase they can use it to get your seed and eventually all of your private keys.
Something bitcoiners can forget is that it is challenging for the avg person to realize modern, govt issued currencies are a social construct and not a force of nature.
The illusion of fiat is completely pervasive and is reinforced constantly from our very first allowance 👇
A helpful discussion to wake others up to the injustice of fiat comes from the “The bitcoin standard” by @saifedean.
By simply asking the question:
“what makes for a good form of money?”
the perception of our local fiat currency as inherent and necessary can be broken.
Ammous' discussion of hard vs easy money illustrates that currencies that have an unlimited supply become worthless in the long run but there is also the possibility to strategically and nefariously siphon off a society's value through intentional manipulation of currency supply.
You’ve heard Bitcoin is a decentralized p2p system for transferring value anywhere on earth. That sounds awesome but you might be wondering:
How changes are made?
What is the process?
Who decides?
I’ve been working on Bitcoin for almost a decade, I'll break it down for you 👇
Bitcoin is free and open source software meaning that anyone can view. download, review, and run the source code.
Just like any open source project it also means anyone is welcome to propose changes as long as they follow the guidelines that the project's community defines.
Because of the scale and impact of Bitcoin, these guidelines are more formalized than most other projects you might have been involved with.
Bitcoin defines something called a Bitcoin Improvement Proposal (BIP)
The first of which is used to define the proposal process itself.