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

Display swap-in grace period & timeouts #444

Merged
merged 3 commits into from
Oct 16, 2023
Merged

Display swap-in grace period & timeouts #444

merged 3 commits into from
Oct 16, 2023

Conversation

dpad85
Copy link
Member

@dpad85 dpad85 commented Oct 13, 2023

Phoenix uses the swap-in potentiam scheme to trustlessly swap on-chain deposits to Lightning with 0 confirmations channels.

This scheme introduces a duration of 4 months during which swaps can be attempted. After this four months have passed, deposits that have not been swapped time out and enter a grace period of two months. After this two months period has passed, these deposits can be unilaterally spent by the user's wallet to any address.

Getting the closest timeout

PeerManager exposes a new swapInNextTimeout flow that contains a Pair of Utxo -> Block to timeout.

Swap-in screen

This PR improves the swap-in screen by discriminating funds according to their status (confirming, swappable, timed-out, and cancelled), based on their confirmation count.

Note that in the screenshot below, the timeout was set to 1 month for a test, but production value is 4 months.

Screenshot_20231013_165303

This elements are not clickable. The UI does not display the details of each UTXO with their remaining block count before timeout. I've tried doing this and it made things overwhelmingly complex while bringing no real utility to the user.

Notice in home

An important notice is also added to the home screen, if a swap is going to time out soon (< 1 month). Also the icon changes to /!\ if the timeout is less than a day (not the case on the screenshot below).

Screenshot_20231013_165833

System notification

The notifications for pending deposits will mention the timeout if it is available at the time of the notification.

Screenshot_20231013_165557

Phoenix uses the swap-in potentiam scheme to trustlessly swap
on-chain deposits to Lightning with 0 confirmations channels.

This scheme introduces a duration of 4 months during which swaps
can be attempted. After this 4 months have passed, deposits that
have not been swapped time out and enter a grace period of two
months. After this two months period has passed, these deposits
can be unilaterally spent by the user's wallet to any address.

This commit improves the swap-in screen by discrimating funds
according to their status (confirming, swappable, timed-out,
and cancelled), based on their confirmation count.

An important notice is also added to the home screen, if a swap
is going to time out soon (< 1 month).

Also, the notifications for pending deposits will mention the
timeout if it is available at the time of the notification.
Pending on-chain deposits can be spammy if many fail in a row
with the same amount but with different fees. In that case, they
should be grouped to make the notifications screen more readable.
@dpad85 dpad85 requested a review from robbiehanson October 13, 2023 15:13
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

Successfully merging this pull request may close these issues.

1 participant