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

taproot swaps #28

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

taproot swaps #28

wants to merge 18 commits into from

Conversation

JssDWt
Copy link
Collaborator

@JssDWt JssDWt commented Dec 13, 2024

This PR adds taproot swap support.

Changes in a nutshell:

  • the term 'redeem' was renamed to 'claim'
  • the public api has changed
  • swaps are now taproot swaps, with
    • a claim script spend path
    • a refund script spend path
    • a cooperative musig key spend path
  • there's a cooperative refund added
  • lock time is now absolute. The default locktime is 1008 blocks from when the swap address was made.

Note about the musig2 implementation:

There is no musig2 implementation in rust-bitcoin at the moment. There is a PR in rust-secp256k1 though. Combining the version from that PR with the taproot parts of rust-bitcoin goes well, as long as keys are serialized/deserialized to convert the incompatible structs from one package to another.

review notes

Apologies for the huge PR. For review I think the best option is:

  • check the public server interface in swap.proto
  • check the pay and refund logic in public_server.rs
  • check the taproot logic in swap_service.rs

@JssDWt JssDWt marked this pull request as ready for review December 13, 2024 17:17
@JssDWt JssDWt force-pushed the jssdwt-taproot-swaps branch from a3c38b3 to 2ee3174 Compare December 16, 2024 09:53
MusigSessionId was renamed to MusigSecRand.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants