RoboSats / robosats

A simple and private bitcoin exchange
https://learn.robosats.com
GNU Affero General Public License v3.0
726 stars 142 forks source link

Buyer payouts on-chain with on-the-fly reverse submarine swaps. #128

Closed Reckless-Satoshi closed 2 years ago

Reckless-Satoshi commented 2 years ago

Observation: New users on lightning seem to be confused about how they can move the Sats to an on-chain address or cold wallet. Usually, after buying sats in LN using RoboSats, they resort to some thrid party service (CoinOS, FxedFloat, Muun...) that charges a relatively large fee.

The swap service, however, might be easy to implement in RoboSats. A user could select to receive the Sats on-chain for an extra fee, and RoboSats will on-the-fly swap the LN Sats received from the seller. The user experience will greatly improve from the seamless swap, while RoboSats service becomes more vertically integrated and can generate revenue from the swaps improving the service sustainability.

Feature requested: Add the option to submit an on-chain address instead of an invoice for buyer payouts.

Some challenges Will have to be faced regarding liquidity management. When RoboSats works 100% in Lightning, there is no need to close/open channels often. However, if users start to withdraw liquidity on-chain, the platform node will become a net sink. That will increase the cost of operating the node. There has to be a clear incentive for users to stay in lightning. therefore this feature will at first have a larger fee (~1-2%) to de incentivize its use.

This will be a large feature that will need active maintainance. Many checks will have to be implemented (is this a valid on-chain address? Is there enough on-chain balance to allow this user the new option? Is this order large enough to be offered the option for seamless swap?) Also a new model "OnChainPayment" will be needed and a full fork of the Send Payment to Buyer pipeline both in backend and frontend.

Reckless-Satoshi commented 2 years ago

Implemented and live https://github.com/Reckless-Satoshi/robosats/pull/160