-
Notifications
You must be signed in to change notification settings - Fork 23
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 #563
Commits on Feb 8, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 24ed675 - Browse repository at this point
Copy the full SHA 24ed675View commit details -
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)
Configuration menu - View commit details
-
Copy full SHA for 7054f5f - Browse repository at this point
Copy the full SHA 7054f5fView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for e6c9038 - Browse repository at this point
Copy the full SHA e6c9038View commit details -
Configuration menu - View commit details
-
Copy full SHA for d097480 - Browse repository at this point
Copy the full SHA d097480View commit details -
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
Configuration menu - View commit details
-
Copy full SHA for af9b0d7 - Browse repository at this point
Copy the full SHA af9b0d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 54988f9 - Browse repository at this point
Copy the full SHA 54988f9View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for bd2690b - Browse repository at this point
Copy the full SHA bd2690bView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 28b69ba - Browse repository at this point
Copy the full SHA 28b69baView commit details -
Revert to using a map to store musig2 secret nonces
The semantics of the secret nonce field added to tx inputs were wrong, these nonces are transient and should be tied to the lifecycle of the interactive tx session, this is much more explicit now.
Configuration menu - View commit details
-
Copy full SHA for 626aeca - Browse repository at this point
Copy the full SHA 626aecaView commit details -
It now provides different types for individual and aggregated musig2 nonces.
Configuration menu - View commit details
-
Copy full SHA for 2f295bb - Browse repository at this point
Copy the full SHA 2f295bbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6909368 - Browse repository at this point
Copy the full SHA 6909368View commit details -
Configuration menu - View commit details
-
Copy full SHA for 89d3956 - Browse repository at this point
Copy the full SHA 89d3956View commit details -
Configuration menu - View commit details
-
Copy full SHA for c485329 - Browse repository at this point
Copy the full SHA c485329View commit details -
Configuration menu - View commit details
-
Copy full SHA for 339cd73 - Browse repository at this point
Copy the full SHA 339cd73View commit details -
- add a pubkey script to the SharedInput() class (we don't need the full TxOut which we can recreate) - remove aggregate nonce check ins FullySignedTx: code already handles transactions that are not properly signed - generate musig2 nonces when we send TxAddInput
Configuration menu - View commit details
-
Copy full SHA for 0c0c7dc - Browse repository at this point
Copy the full SHA 0c0c7dcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7f7f9af - Browse repository at this point
Copy the full SHA 7f7f9afView commit details -
Do not send the previous tx for swap-in inputs
They use taproot v1, providing the tx output and not the entire tx is safe (see #579). Here we add the swap-in input output and txout to the swap-in TLV, so this change does not interface with proposed changes to the LN spec.
Configuration menu - View commit details
-
Copy full SHA for 5bab5d5 - Browse repository at this point
Copy the full SHA 5bab5d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7bfd022 - Browse repository at this point
Copy the full SHA 7bfd022View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ec236d - Browse repository at this point
Copy the full SHA 1ec236dView commit details -
Revert "Do not send the previous tx for swap-in inputs"
This reverts commit c0a6d5a.
Configuration menu - View commit details
-
Copy full SHA for 4b04f5f - Browse repository at this point
Copy the full SHA 4b04f5fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9871f48 - Browse repository at this point
Copy the full SHA 9871f48View commit details -
Use musig2 helpers to simplify swap-in protocol (#592)
We use the musig2 helpers exposed by ACINQ/bitcoin-kmp#114 to simplify the swap-in protocol and hide all of the musig2 internal details (key aggregation cache, control block, internal taproot key, opaque session object, nonce aggregation). The code is simpler to reason about and signing is more similar to signing normal single-sig inputs.
Configuration menu - View commit details
-
Copy full SHA for 2b4ad8d - Browse repository at this point
Copy the full SHA 2b4ad8dView commit details -
They were disabled when we experimented with not sending the full tx.
Configuration menu - View commit details
-
Copy full SHA for 7578574 - Browse repository at this point
Copy the full SHA 7578574View commit details -
Configuration menu - View commit details
-
Copy full SHA for f7c8b07 - Browse repository at this point
Copy the full SHA f7c8b07View commit details -
Configuration menu - View commit details
-
Copy full SHA for c215ad4 - Browse repository at this point
Copy the full SHA c215ad4View commit details -
Configuration menu - View commit details
-
Copy full SHA for f963c21 - Browse repository at this point
Copy the full SHA f963c21View commit details
Commits on Feb 13, 2024
-
The current recovery process needed to be updated to derive the correct master priv key from the seed by specifying our custom BIP32 path (m/52h/0h/2h/0) when we create the wallet. We also export 2 descriptor methods: one to get the private swap-in wallet descriptor, which can be used as-is, and the other to get the public swap-in wallet descriptor, which can be used to create a watch-only wallet to monitor swap-in funds and to recovery funds using our recovery procedure. Both descriptor use the refund master key, and not the master key itself because we use hardened paths to derive the refund key, which means that it is not possible to compute the refund master public key from the master public: importing the descriptor would fail.
Configuration menu - View commit details
-
Copy full SHA for 7d17663 - Browse repository at this point
Copy the full SHA 7d17663View commit details
Commits on Feb 14, 2024
-
Configuration menu - View commit details
-
Copy full SHA for bf2f7b0 - Browse repository at this point
Copy the full SHA bf2f7b0View commit details -
Co-authored-by: Bastien Teinturier <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 335e4c2 - Browse repository at this point
Copy the full SHA 335e4c2View commit details