Enabling automated backup on Eclair Wallet

TL; DR: Latest release of Eclair Wallet Testnet includes automated encrypted backups using Google Drive. Will be rolled out to mainnet ASAP.

A bit #Reckless until now

Until now, upon installing Eclair Wallet for Android, a huge scary disclaimer warned users that funds allocated to Lightning channels weren’t being backed up. In other words, funds stored in channels would be lost if the user uninstalled the app, or even deleted application data, or simply lost their phone with open channels (of course, on-chain funds are always protected by the seed and can be recovered).

Backing up Lightning channels is difficult

The reason for this is that backing up Lightning channels is far more complex than backing up on-chain funds. On-chain is easy: everyone is used to writing down a list of words once and for all. But there are two problems with the backup of Lightning funds. First the backup needs to be updated every time the state of the channel changes (which happens several times during a single payment!). The second problem is even worse: if you restore channels from a backup that you think is up to date, but is actually an old stale state, then your counterparty could believe you are attempting to cheat on them, and take all your money as a punishment.

How it works

We decided to use Google Drive to store channel backup data. It is updated every time a channel’s state changes. Note that only the channel data is saved, not the routing table which can be fetched from the network. To be more precise, the data we store is encrypted using a key derived from the main seed, and its name is also derived from this same seed. This allows users to seamlessly restore their Eclair Wallet app, using only the 12 words they are used to; it also supports having an unlimited number of different wallets simultaneously, and restore one or the other.

We are building an implementation of Lightning, a scalable instant payment network built on top of the Bitcoin blockchain.

We are building an implementation of Lightning, a scalable instant payment network built on top of the Bitcoin blockchain.