Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Staged SCB Integration #1111

Open
Open
@Roasbeef

Description

@Roasbeef

As of lnd version 0.6, it's now possible to export static channel backups which allow a user to restore the settled channel funds given their seed and a single static file. Since the current version of the app uses 0.6, the files are already stored and maintained on disk. However, this isn't yet exposed in the UI at all, so a user would need to manually locate the files on disk to backup themselves. This isn't too involved on the desktop, but on platforms like iOS and Android, it requires a bit more work to dig into the internals of their filesystem storage. Therefore we should make steps to gradually expose this functionality to the end user.

There're a few levels of possible integration we can potentially pursue. The ordering of the tasks below is meant to roughly rank them in order of perceived difficulty from my PoV.

  • During the initial set up wizard, we should prompt users with the option to specify a custom location to store their back up file.As part of 0.6, lnd gained a new command line flag: --backupfilepath=. This allows the user to set the location on disk that the backup file will be created and maintained at. One attractive target would be cloud storage systems with FUSE like integration on the file system level. This would let users specify the path to their dropbox/keybase/box/gdrive folder on disk, which would auto update the file in the cloud each time it's changed.

    • For iOS, we can automatically target iCloud storage (I guess on MacOS we can do this as well?), and for Android we can target Google Drive storage.
  • Next, upon seed restoration, we should prompt the user for the location of their SCB file. We can check the default location first, but then should fall back to the user specified file path (if provided). We currently use the InitWallet call to pass in their users seed so we can start the rescan process. After 0.6, it gained a new field channel_backups, where a serialized SCB (the raw bytes read from the file) can be specified. If present, then we'll also recover the channel funds once we finish the on-chain rescan.

  • We should also allow the users (in the dark mode settings) to be able to obtain an up-to-date download of the current SCB state. This would be for more advanced users that may wish to handle their own backups. The ExportChannelBackup is the API target for this.

  • Another relevant feature for more advanced users would be to be able to specify SCBs to restore from after the wallet has already been created. The RestoreChannelBackups would be the target API call for this. Again this would likely be hidden in the more advanced settings, as I'd expect most normal users to restore their SCB during the creation phase. However, it's also possible that the user realizes they had a backup after they'd already gone through the restoration phase.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions