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?

Not today.
Bitcoin has been #blessed by BIP-39 and BIP-32.

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
 

Keep Current with John Cantrell

John Cantrell Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @JohnCantrell97

Jan 26
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
Read 14 tweets
Jan 24
While we all now know what a Bitcoin price halving is 😂, I’m sure you’ve heard about Bitcoin’s other less brutal halving.

What is being cut in half?
How often does it happen?
Why should I care?

I’ve been working with Bitcoin for almost a decade, let me break it down for you 👇
When you hear the word halving you probably wonder what exactly is being cut in half.

Is it the price?
The number of coins?
The number of coins I own?
The mining hash rate?

Luckily it’s none of those things. It’s referring to the rate at which new Bitcoins are produced.
A block is mined roughly every 10 minutes.

Each block that is mined produces a certain amount of Bitcoin.

The amount of Bitcoin per block started at 50 when Bitcoin was first released and it is that amount which halves roughly every 4 years.

What was once 50, is now 6.25
Read 15 tweets
Jan 23
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.
Read 10 tweets
Jan 22
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.
Read 12 tweets
Jan 22
Did you know that both 12 and 24 word mnemonic phrases offer the same level of security in terms of protecting your private keys?

It’s hard to believe, I know. Let me break down why 👇
It depends how you define ‘level of security’.

I am referring to the amount of time or resources required by an attacker to get your keys.

If protocol A takes an attacker 4hrs to get your keys and protocol B takes 24hrs to access your keys then protocol B is more secure.
In Bitcoin the security is largely defined by the cryptography used.

In Bitcoin’s case we use elliptic curve cryptography to define keys and calculate signatures.

There are known algorithms that can compute a private key from a public key in roughly 2^128 operations.
Read 10 tweets
Jan 20
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.
Read 17 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(