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

Ephemeral address to prevent wrong amounts/fees for BTC -> SC swaps #3

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

Comments

@adambor
Copy link
Member

adambor commented Dec 9, 2024

If the user is sending BTC on-chain funds from an external wallet, we should use an ephemeral address to first receive the funds there and then send it to the real swap address only once we verified that it contains valid amount & pays high enough fee, prompting the user to refund the funds if those aren't satisfied, this also prevents user from sending in the funds too late, as in that case the user can just refund. This should also allow us to decrease the timeout time of the escrows significantly.

This approach will not be used when sending the funds from browser based wallet, as there we have full control of the transaction construction, with the fees & amounts.

It is proposed to use smart-chain wallet's signature over a known message to generate a private key for the ephemeral address, this however requires the use of deterministic nonce by the signing wallet (this works for Solana)

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

No branches or pull requests

1 participant