spesmilo / electrum

Electrum Bitcoin Wallet
https://electrum.org
MIT License
7.39k stars 3.08k forks source link

[REQ] Ability to backup your ENTIRE Android wallet externally #8851

Open brianddk opened 8 months ago

brianddk commented 8 months ago

The Android security model prevents users from manually backing up their Android Electrum wallet, but it would be nice to allow this option from inside Electrum on Android. Similar to how the "Save Backup" option in the file menu on desktop works.

Although label backups and static channel backups can be offloaded, this still leaves a lot missing. Perhaps the ability should be disabled by default, and obviously require the wallet password to proceed, but I still think it would be a good option to have.

For LN enabled wallets, this would likely require a warning that only one copy of this wallet should ever connect to the internet so as to avoid throwing channels into a toxic state.

Likewise, I think an "Import from Backup" would be useful, though the best case I could make for that is far less compelling.

accumulator commented 8 months ago

Likewise, I think an "Import from Backup" would be useful, though the best case I could make for that is far less compelling.

Moving to a new phone without having to close your channels is quite compelling :)

SomberNight commented 8 months ago

We used to have this in kivy a long time ago, but it broke around Android 10 when the OS tightened access to the file system. see e.g. https://github.com/spesmilo/electrum/issues/6774 and https://github.com/spesmilo/electrum/pull/7300

For LN enabled wallets, this would likely require a warning that only one copy of this wallet should ever connect to the internet so as to avoid throwing channels into a toxic state.

It is quite difficult to explain this to users as even your explanation is ambiguous. It can be misread as: "it is ok to use either phone1 or phone2 whenever, just make sure they are not online at the same time", but the correct reading is "after you go online with the copy, you must not go online with the original. and if you go online with the original after you made the copy, you cannot then ever go online with the copy"

Similar to how the "Save Backup" option in the file menu on desktop works.

That option converts channels to channel backups. Hence it is much more footgun-safe than a manual filesystem-copy.

"Import from Backup" would be useful

Moving to a new phone without having to close your channels is quite compelling :)

Well, yes. It is currently only possible to do that if you use debug builds and manually move files around using adb. :P Importing is orthogonal to the above lightning state issue, that's more to do with exporting. But re exporting: it would be nice to have a "Save Backup" option like on desktop, however a "Save Copy" option (with live channels) would have to be sort of hidden and sprinkled with a lot of UI warnings.

Or, re "Save Copy option (with live channels)", we could treat is as a "migrate" option, and convert the channels in the current wallet to backups and export a file that has the live channels --- although even this would not be too safe, as the user should still be told to only import the backup once.