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

[feature]: Automatic asset/btc sloshing to battle premature channel exchaustion #935

Open
GeorgeTsagk opened this issue Jun 7, 2024 · 0 comments
Labels
enhancement New feature or request premature-exhaustion Related to btc exhaustion of an asset channel tap-channels

Comments

@GeorgeTsagk
Copy link
Member

GeorgeTsagk commented Jun 7, 2024

Problem

A tap channel may reach a state where assets are available on the balances of both peers, but the btc balance on one side is depleted. This will prevent the depleted side from sending assets over the channel.

Solution

To avoid this, we can consider adding an automatic asset-to-btc sloshing. This is basically an automated asset-sell procedure which aims to "burn" some of the asset balance in the channel to gain some btc balance, which will allow asset payments to go through.

Since our btc channel size is relatively small, we can consider a default target of 10%, which is the percentage of the btc capacity that we'll try to automatically acquire on our side by selling assets. This should also be configurable.

Example

Alice and Bob have a beefbux channel
Beefbux capacity: 5000 units
Btc capacity: 100k sats

Let's assume 1 beefbux = 1000 sats

The asset balances are Alice: 2500 units / Bob: 2500 units
The btc balances are Alice: 0sats / Bob: 100k sats (Alice can make 0 payments)

Alice will automatically sell some assets to acquire (default: 10%) 10k sats in order to continue being able to make payments. Alice negotiates a quote with Bob, then sends 5 beefbux over the channel in exchange for 10k sats.

Result:
The asset balances are: Alice: 2495 units / Bob: 2505 units
The btc balances are: Alice: 10k sats / Bob: 90k sats (Alice can make ~30 payments)

@GeorgeTsagk GeorgeTsagk added enhancement New feature or request tap-channels premature-exhaustion Related to btc exhaustion of an asset channel labels Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request premature-exhaustion Related to btc exhaustion of an asset channel tap-channels
Projects
None yet
Development

No branches or pull requests

1 participant