Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channels not restored on recovery (Android vs iOS) #231

Closed
prusnak opened this issue Dec 21, 2021 · 13 comments
Closed

Channels not restored on recovery (Android vs iOS) #231

prusnak opened this issue Dec 21, 2021 · 13 comments

Comments

@prusnak
Copy link

prusnak commented Dec 21, 2021

Channels were not restored on recovery when I moved the recovery seed from Android Phoenix to iOS Phoenix.

Steps to reproduce:

  1. initialize Phoenix on Android
  2. open some channels
  3. write down recovery seed
  4. turn off the Android phone
  5. install Phoenix on iOS and recover using the words from step 3
  6. observe there are no recovered channels and NodeID is not the same

Maybe you even don't have to open some channels and just try to figure out why the NodeID is different (I suppose it is meant to be the same after recovery).

@prusnak prusnak changed the title Channels not restored on recovery Channels not restored on recovery (Android -> iOS) Dec 21, 2021
@sstone
Copy link
Member

sstone commented Dec 21, 2021

It's by design: running 2 lightning nodes at the same time with the same keys is not well supported (by the Lightning protocol, it's not specific to us), so to avoid issues with users who have the Android app and want to try it out on iOS we chose to use different derivation paths for the Android and iOS applications.

@prusnak
Copy link
Author

prusnak commented Dec 21, 2021

Unfortunately, this is a very poor choice from a user experience perspective. It defeats the only reason the recovery seeds exist in the first place - to allow recovery to another device.

The fact that this is not documented anywhere (neither in the app nor on the project website) makes things even worse.

Last but not least, the argumentation for this "feature" could also be used against migrating the seed from one Android instance to another or from one iOS instance to another. And the fact this is allowed there but not when switching platforms also violates the principle of least surprise.

@prusnak prusnak changed the title Channels not restored on recovery (Android -> iOS) Channels not restored on recovery (Android vs iOS) Dec 21, 2021
@dpad85
Copy link
Member

dpad85 commented Dec 22, 2021

This issue is temporary and specific to the state of the current Android implementation vs iOS.

As mentioned in the readme, we do not use the same Lightning engine on the Android app and the iOS app (the Android app is older) hence the different derivation path to prevent compatibility issues. Once the Android app has migrated and uses the same new engine as the iOS app, the same seed will generate the same wallet on both environment and channels will be restored as expected.

I'll add an entry in the FAQ in the meantime.

@prusnak
Copy link
Author

prusnak commented Dec 22, 2021

Once the Android app has migrated and uses the same new engine as the iOS app, the same seed will generate the same wallet on both environment and channels will be restored as expected.

Does this mean that the old Android version and the new Android version will have incompatible seeds?

@dpad85
Copy link
Member

dpad85 commented Dec 22, 2021

Yes they are incompatible. However the new Android version will still contain the old engine (as well as the new) in order to be able to restore and use old channels, and at some point close them. That will last for a while. Once most users have migrated to new channels I think the old engine will be removed.

@prusnak
Copy link
Author

prusnak commented Dec 22, 2021

Thanks for your explanation! @dpad85

@Sjors
Copy link

Sjors commented Jan 26, 2023

What's the status of this? I'd like to migrate my iOs wallet to GrapheneOS one day :-)

@dpad85
Copy link
Member

dpad85 commented Jan 26, 2023

We're getting close 😃. It has been delayed a bit because we are not just changing the lightning engine to lightning-kmp).

The new Android version will also be using dual-funding where channels are funded by both parties (your wallet and the ACINQ node). This enables trustless swap-ins: deposits are now sent to an address belonging to Phoenix (path 84'/1'/1') and then automatically fund new channels in cooperation with the peer. Dual-funding also prepares splices, which will be another great feature.

All this is a lot of changes and we'd rather publish it in one update, if possible. And it means that we have to wait for it to be 100% ready before we can release the new Android version.

By the way you can already test the new android app with dual funding here (it's a separate Testnet app).

migrate my iOs wallet to GrapheneOS

Note: it will work but the payments history will be lost. I don't think we'll have time to find a cross-platform data migration solution.

@Sjors
Copy link

Sjors commented Jan 26, 2023

Good stuff, looking forward! Payment history is overrated :-)

@maflcko
Copy link

maflcko commented Oct 15, 2023

Is this still an issue in v2? (For reference, the history feature request seems to be tracked in #141)

@knocte
Copy link

knocte commented Jul 15, 2024

It's by design: running 2 lightning nodes at the same time with the same keys is not well supported

And what happens if you restore from Android to another Android, but then open the old wallet by mistake while the new one is running?

I think this FAQ section covers the question above: https://phoenix.acinq.co/faq#can-i-run-two-phoenix-apps-with-the-same-seed

However, in my opinion, what needs to happen is that this is stated more clearly in the FAQ section called "Restoring a wallet". Right now, this section only has 3 subsections:

  • I lost my phone or accidentally uninstalled Phoenix, how can I get my funds back?
  • Can I restore my Android wallet on an iOS device or vice versa?
  • Can I restore a regular on-chain wallet on Phoenix?

Only the 2nd subsection above links to the initial "Can I run two phoenix aps with the same seed" part. How about adding another subsection here about migration from old to new phone? Is this FAQ in github so that we can propose PRs to it?

@dpad85
Copy link
Member

dpad85 commented Jul 15, 2024

Sorry for the confusion, this issue should have been closed since the 2.0 release which supports cross platform migration.

How about adding another subsection here about migration from old to new phone?

It's already covered by the first entry. The wording in the title could be shorter and more generic though to address more normal use cases, we'll fix that.

@dpad85 dpad85 closed this as completed Jul 15, 2024
@knocte
Copy link

knocte commented Jul 15, 2024

we'll fix that.

Thanks, but take in account that first entry does not link to the "you should NOT run two instances of Phoenix simultaneously with the same seed" sentence that next section includes, don't forget that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants