LN-Zap / zap-iOS

Zap Wallet - Native iOS lightning wallet focused on user experience and ease of use ⚡️
http://zaphq.io
MIT License
181 stars 47 forks source link

Could not restore the channel.backup file from iCloud Drive #240

Open xAdamPos opened 4 years ago

xAdamPos commented 4 years ago

I tried to recover the LN wallet with my seed - the history of on-chain funds is not visible but I suppose that is another issue. Anyway, I did not have any on-chain funds, just funded LN channels which are not visible at the moment.

Thought that the channel.backup file is actually backed up both on my phone / iCloud Drive because when I went to Channel Backup before both backups had green dot. By mistake, I have not backed up the channel.backup file anywhere else.

So back to restoring - I input the seed and click the button to select the channel.backup file but it was not anywhere (folder Zap was not either on phone drive nor on iCloud Drive). I suppose the app is not able to access the hidden folder because when I go to Settings -> iCloud -> Manage Storage -> mainnet (it's how the app appears on this list) -> Documents -> there are many channel.backup files (I suppose the original one is actually there but it is not possible to move it to another folder).

Is there a way to recover these LN funds?

Thanks a lot!

xAdamPos commented 4 years ago

Update: I have generated a completely new wallet nad it seems the channel.backup file is not created in a visible folder on iCloud Drive. It is created on the device though.

(unfortunately, the previous wallet did not create channel.backup on the device either so these LN funds are probably lost for me - unless it is possible to access the data in Settings -> iCloud -> Manage Storage -> mainnet -> Documents)

JimmyMow commented 4 years ago

Hey @xAdamPos.

Zap should write the channel backup file on the device and to your iCloud Drive. If you navigate to your Settings -> Channel Backup you can see the status of your SCB file.

There seems to be a bug in the restore process for our recent mainnet release (#230). We're working to fix it.

ottosuess commented 4 years ago

can you see the backup file in the phone's Files app? there should also be an iCloud folder

xAdamPos commented 4 years ago

Unfortunately not.

Only in Settings - iCloud - Manage Storage - mainnet - Documents (and this is not accessible directly from the app).

On 2 Sep 2019, at 15:12, Otto Suess notifications@github.com wrote:

can you see the backup in the phones Files app?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Sjors commented 4 years ago

There seems to be a bug in the restore process for our recent mainnet release

I'm pretty sure these are separate bugs. Mainnet funds are recovered again since the latest release, but there is something wrong with how the channel backup files are stored.

I also see a "mainnet" folder in my iCloud Store settings on my phone. It contains a folder with the same digits as the Zap/... folder on the device. It contains a 0.1 KB channel.backup file, which I can't open or otherwise inspect.

JimmyMow commented 4 years ago

Hey, @xAdamPos @Sjors.

I'm a little confused about the issue (or don't totally understand). If the app is deleted, the local backup will also be deleted. Not much we can do there. Users can periodically email themselves (or text, etc etc) the backup if they'd like. Maybe we don't put a green checkmark next to it in the settings? Was that misleading from a UX point of view?

In regards to the backup stored in iCloud, what is the issue here? The idea is that if your device does get damaged/stolen or you do delete the app, you have your seed and the iCloud backup to restore. Is there something wrong with this idea?

xAdamPos commented 4 years ago

The idea is right, of course, I don’t need the local backup, cloud backup is fine. But the iCloud backup has not been created (or it is not in the on iCloud Drive at least). I guess it is still available in the Application Data in Settings but this is not accessible by the user. That is why the seed is the only thing I have got at the moment and LN funds are probably lost :-(

    1. 2019 v 16:14, JimmyMow notifications@github.com:

Hey, @xAdamPos https://github.com/xAdamPos @Sjors https://github.com/Sjors.

I'm a little confused about the issue (or don't totally understand). If the app is deleted, the local backup will also be deleted. Not much we can do there. Users can periodically email themselves (or text, etc etc) the backup if they'd like. Maybe we don't put a green checkmark next to it in the settings? Was that misleading from a UX point of view?

In regards to the backup stored in iCloud, what is the issue here? The idea is that if your device does get damaged/stolen or you do delete the app, you have your seed and the iCloud backup to restore. Is there something wrong with this idea?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/LN-Zap/zap-iOS/issues/240?email_source=notifications&email_token=ALJBCUPIWHTFTU5NKGJWEIDQHZWNFA5CNFSM4IRWJUB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5YKW6Y#issuecomment-527477627, or mute the thread https://github.com/notifications/unsubscribe-auth/ALJBCUJBAVPYLFS5EIXBFE3QHZWNFANCNFSM4IRWJUBQ.

ottosuess commented 4 years ago

where exactly in the settings do you see the file?

Sjors commented 4 years ago

Maybe we don't put a green checkmark next to it in the settings?

Yes, maybe don't even show it. It's not really a backup if it's tied so strongly to the app. When I delete Instagram it doesn't delete my camera roll, so it's not obvious to users. Instead, encourage users to copy the backup somewhere save. Maybe have a green dot if you know they've saved the backup elsewhere and make it red again when there's a new channel.

the iCloud backup has not been created (or it is not in the on iCloud Drive at least

That indeed appears to be the main issue.

xAdamPos commented 4 years ago

As described above:

Settings -> iCloud -> Manage Storage -> mainnet (it's how the app appears on this list) -> Documents -> there are many channel.backup files

    1. 2019 v 16:25, Otto Suess notifications@github.com:

where exactly in the settings do you see the file?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/LN-Zap/zap-iOS/issues/240?email_source=notifications&email_token=ALJBCUIDCDA67NCTFCCERDLQHZXU3A5CNFSM4IRWJUB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5YL3QY#issuecomment-527482307, or mute the thread https://github.com/notifications/unsubscribe-auth/ALJBCUPEQPWLOZOLL7NQ7ZTQHZXU3ANCNFSM4IRWJUBQ.

JimmyMow commented 4 years ago

Hey, @xAdamPos @Sjors I've had a difficult time reproducing this. What iPhone and iOS version are you running? Attempts at recovering my wallets have been successful. Are you still facing this issue?

Sjors commented 4 years ago

I haven't tried reproducing, but those backup files are definitely not on my iCloud. My best guess is that it didn't make an (iCloud) backup because I closed the app right after broadcasting the opening transaction, and deleted it before the app could find out the channel was confirmed.

I still need to try if I can recover the funds without a backup using desktop Lnd: https://bitcoin.stackexchange.com/questions/90196/how-to-recover-funds-from-a-force-closed-lnd-lightning-channel

xAdamPos commented 4 years ago

The same situation on my side. I have not tried reproducing but the iCloud backup file has not been created on my iCloud therefore I am not able to restore the channel funds. I didn’t close the app right after broadcasting the opening tx - the channels were successfully opened for a while.

I am still curious if the iCloud backup file couldn’t be hidden in Settings -> iCloud -> Manage Storage -> mainnet -> Documents because I see many backup files there (screenshot). I believe that the first channel.backup (size 3.4 kb) is actually the one I have been looking for and was not created in the iCloud Drive. I still believe the file exists and this is the one :) Unfortunately, these files are not accessible.

Snímek obrazovky 2019-09-27 v 10 10 19

I can show the situation to you at LN conf in Berlin :)

lobsterpub commented 4 years ago

So i just ran into this issue today. I think there is some confusion between "icloud backup" and "icloud drive". I think the confusion comes from that they use the same storage, but are separated.

Zap uses the icloud Backup which is something you would use if you want to restore files for an iphone that has been corrupted. Or that were on a old iphone (lost/stolen/bricked) and you have a new iphone. You CAN NOT manually download these files, they are not accessible in the icloud Drive app. The issue is that you will have to RESET the device and then select "Restore from iCloud Backup".

https://support.apple.com/kb/ph12521?locale=en_US

Zap does NOT backup the files to the icloud Drive, which afaict you would have to manually add files to the icloud drive, and then they would be accessible across devices using the icloud drive app or website.

If it is possible to automatically backup the files to the icloud Drive that would be ideal.

Short story is that icloud is a confusing hot mess.

xAdamPos commented 4 years ago

Is there any progress regarding the channel backups in iOS? Is it possible for the channel.backup file to be automatically saved to iCloud Drive (not iCloud Backup as mentioned above) / Google Drive so the user can restore the app without restoring iPhone? Right now I have to manually save the file after each channel update. Thanks for any follow up!

CoinJoinDay commented 4 years ago

i have this problem too, i have a channel Backup on my google drive, and i'm trying to restore on ZAP mobile (ios), but unsuccessful. i have now put on icloud drive but still not recovered

lobsterpub commented 4 years ago

There hasn't been any commits in nearly 6 months.

lobsterpub commented 3 years ago

I'd like an update on this as well. Still no sign of the backup file on the latest version of zap.

I would not recommend this app until this issue is resolved, user funds are at risk.