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

Safer BTC -> Smart chain swaps #6

Open
adambor opened this issue Dec 14, 2024 · 0 comments
Open

Safer BTC -> Smart chain swaps #6

adambor opened this issue Dec 14, 2024 · 0 comments

Comments

@adambor
Copy link
Member

adambor commented Dec 14, 2024

Why do we need this?

We are running into issues when people don't send correct amounts to the swap address, or send a transaction with low fee which doesn't get confirmed in time - because of this we need to process those swaps manually & could lead to loss of funds for the user. This solution fixes those issues.

Expected complexity

Medium

Comments

We will keep using the direct payment when people use browser wallet, as we have full control of the amount being sent and fee being paid.

For swaps from external wallets we will use ephemeral bitcoin address, which will receive the transaction first, when received, the front-end checks the amount & fee, if valid sends the funds to the swap address, if invalid prompts the user to refund (here the user can also have an option to create a new swap and use the funds directly, or just deposit the rest in a separate transaction), this also allows multi-LP swaps.

The ephemeral needs to be produced from a signature over a known message by the Smart chain wallet - this requires the wallet to use determinstic nonce (this works for Solana wallets), this way the user can recover his bitcoin funds (if they ever become stranded) from any browser, if he uses the same Smart chain wallet.

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

No branches or pull requests

1 participant