From 5d2fdc809e793dd5c144b584a8915329232f0551 Mon Sep 17 00:00:00 2001 From: conduition Date: Thu, 29 Feb 2024 05:23:18 +0000 Subject: [PATCH] funding script pubkey doesn't need to commit to an empty taproot --- src/spend_info/funding.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/spend_info/funding.rs b/src/spend_info/funding.rs index 30f4033..0cc67f6 100644 --- a/src/spend_info/funding.rs +++ b/src/spend_info/funding.rs @@ -44,11 +44,11 @@ impl FundingSpendInfo { /// Returns the TX locking script for funding the ticketed DLC multisig. pub(crate) fn script_pubkey(&self) -> ScriptBuf { - ScriptBuf::new_p2tr( - secp256k1::SECP256K1, - self.key_agg_ctx.aggregated_pubkey(), - None, - ) + // This is safe because the musig key aggregation formula prevents + // participants from hiding tapscript commitments in the aggregated key. + let (xonly, _) = self.key_agg_ctx.aggregated_pubkey(); + let tweaked = bitcoin::key::TweakedPublicKey::dangerous_assume_tweaked(xonly); + ScriptBuf::new_p2tr_tweaked(tweaked) } /// Compute the signature hash for a given outcome transaction.