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

Improve swap-in protocol with taproot and musig2 #560

Closed
wants to merge 8 commits into from

Commits on Nov 20, 2023

  1. Configuration menu
    Copy the full SHA
    6c8988e View commit details
    Browse the repository at this point in the history
  2. Add an example of swapin transaction that uses musig2 and taproot

    Add a simple test that uses how to modify the swap-in-potentiam protocol to use musig2 and taproot:
    - taproot key path is used for the mutual user key + server key use case, which sends to a single musig2 aggregated key
    - tapscript path is used for the refund case (user key + delay)
    
    Add another example with taproot but not musig2 that uses 2 differents scripts (mutual case and refund case)
    sstone committed Nov 20, 2023
    Configuration menu
    Copy the full SHA
    b96cb7f View commit details
    Browse the repository at this point in the history
  3. Add a RemoteSwapInV2 message

    This message includes all outputs from the remote tx and not just the one that is included in the swap.
    This is needed for Schnorr signatures.
    sstone committed Nov 20, 2023
    Configuration menu
    Copy the full SHA
    c6687de View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2023

  1. Configuration menu
    Copy the full SHA
    84ca143 View commit details
    Browse the repository at this point in the history
  2. Use different user keys for the common and refund paths

    This allows us to easily rotate swap-in addresses and generate a single generic taproot descriptor (for bitcoin core 26 and newer) that can be used to recover
    swap-in funds once the refund delay has passed, assuming that:
    - user and server keys are static
    - user refund keys follow BIP derivation
    sstone committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    9722067 View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2023

  1. Configuration menu
    Copy the full SHA
    4c044fb View commit details
    Browse the repository at this point in the history
  2. Add a musig2 secret nonce field to local/remote musing2 swap-in classes

    It makes the code cleaner and we get rid of the secret nonces map.
    These nonces are replaced with dummy values whenever this classes are serialized, which is safe since they're never reused for signing txs.
    sstone committed Nov 27, 2023
    Configuration menu
    Copy the full SHA
    ce75299 View commit details
    Browse the repository at this point in the history
  3. Rework TxComplete to use implicit ordering for musig2 nonces

    Instead of sending an explicit serialId -> nonce map, we send a list of public nonces ordered by serial id.
    This matches how signatures are sent in TxSignatures.
    sstone committed Nov 27, 2023
    Configuration menu
    Copy the full SHA
    504c49d View commit details
    Browse the repository at this point in the history