hypercore-one / syrius

MIT License
0 stars 0 forks source link

Add deposit recovery feature #40

Closed vilkris4 closed 1 year ago

vilkris4 commented 1 year ago

This PR adds the option to recover (=reclaim) any HTLC deposit that the user has created.

The motivation behind this feature is that in a situation where the user has lost access to the machine on which they have ongoing swaps on, there has to be a way for the user to recover the funds on a separate machine. There is no mechanism built in that can restore swap items on a separate machine/instance of Syrius.

The user needs their deposit's ID to recover the funds. If the user does not have the deposit ID, the user is instructed to see the swap tutorial for instructions on how to find the deposit ID via an explorer.

The deposit recovery feature is intentionally kept minimalistic, since it should be a relatively rare edge case where the user completely loses access to their machine while they have ongoing swaps.

Screenshot of the deposit recovery modal that is opened from the P2P Swap Options card's menu: image

vilkris4 commented 1 year ago
  1. I believe this feature will be needed very rarely, so I don't want to bloat the UI by making this feature more prominent. If someone loses access to their computer in the middle of a swap, they can always ask for help in our community chats and be guided to this feature. This feature is also covered in the tutorial.
  2. Considering the maximum time window that a swap can be conducted in is around 2 hours, I don't believe that recovering an active swap is a necessary feature - and it would be fairly complicated to implement. The P2P swap experience is primarily based on the assumption that both parties are online for the duration of the swap.