What changed, and why it matters
This commit removes an unused experimental Taproot/MuSig2 code path from the rust-lightning project. It deletes the optional `musig2` dependency, removes the `taproot` build flag, and strips out all conditional Taproot-related message fields and serialization logic. There is no indication this fixes a security vulnerability; it is a cleanup change because Taproot support is not currently planned and the external `musig2` crate is now owned by a third party.
No security action required. Treat as ordinary maintenance. If you rely on the experimental `taproot` cfg build, note that it is removed and you should migrate away from it.
Security signals we found
No security-relevant signals present in commit message or diff
Removal of third-party git dependency (musig2) reduces future supply-chain/dependency risk, but is framed by the vendor as feature cleanup, not a security fix
No memory-safety, cryptographic, or consensus changes to active code paths
Evidence from the diff
The change is a feature-removal/cleanup patch. It removes the cfg(taproot) gated code: the musig2 git dependency in lightning/Cargo.toml, the taproot cfg entries in workspace check-cfg lists, the CI test run with RUSTFLAGS="--cfg=taproot", and all #[cfg(taproot)] fields such as partial_signature_with_nonce and next_local_nonce from Lightning message structs (AcceptChannel, FundingCreated, FundingSigned, CommitmentSigned, RevokeAndACK). It also removes serialization implementations for musig2::types::PublicNonce and PartialSignatureWithNonce, plus related imports and test fixtures. The production code path remains ECDSA-based Lightning channels, which are unaffected.
Changed components
Cargo.toml workspace manifestlightning/Cargo.tomlci/ci-tests-cfg-flags.shlightning/src/ln/msgs.rslightning/src/ln/channel.rslightning/src/util/ser.rslightning/src/sign/mod.rslightning/src/util/test_channel_signer.rslightning-tests/Cargo.tomllightning-tests/src/lib.rsfuzz/Cargo.tomlInspect captured patch +5 / −187
diff --git a/Cargo.toml b/Cargo.toml
index 1eb7b57..7978d9d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -63,7 +63,6 @@ check-cfg = [
"cfg(c_bindings)",
"cfg(ldk_bench)",
"cfg(ldk_test_vectors)",
- "cfg(taproot)",
"cfg(require_route_graph_test)",
"cfg(simple_close)",
"cfg(peer_storage)",
diff --git a/ci/ci-tests-cfg-flags.sh b/ci/ci-tests-cfg-flags.sh
index 5380c98..e6a22a8 100755
--- a/ci/ci-tests-cfg-flags.sh
+++ b/ci/ci-tests-cfg-flags.sh
@@ -5,8 +5,6 @@ set -eox pipefail
source "$(dirname "$0")/ci-tests-common.sh"
echo -e "\n\nTest cfg-flag builds"
-RUSTFLAGS="--cfg=taproot" cargo test --quiet --color always -p lightning
-[ "$CI_MINIMIZE_DISK_USAGE" != "" ] && cargo clean
RUSTFLAGS="--cfg=simple_close" cargo test --quiet --color always -p lightning
[ "$CI_MINIMIZE_DISK_USAGE" != "" ] && cargo clean
RUSTFLAGS="--cfg=lsps1_service" cargo test --quiet --color always -p lightning-liquidity
diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml
index 5bf899f..5a2e397 100644
--- a/fuzz/Cargo.toml
+++ b/fuzz/Cargo.toml
@@ -62,5 +62,4 @@ check-cfg = [
"cfg(fuzzing)",
"cfg(secp256k1_fuzz)",
"cfg(hashes_fuzz)",
- "cfg(taproot)",
]
diff --git a/lightning-tests/Cargo.toml b/lightning-tests/Cargo.toml
index 4e8d330..05a5bd5 100644
--- a/lightning-tests/Cargo.toml
+++ b/lightning-tests/Cargo.toml
@@ -29,6 +29,4 @@ level = "forbid"
#
# Note that Cargo automatically declares corresponding cfgs for every feature
# defined in the member-level [features] tables as "expected".
-check-cfg = [
- "cfg(taproot)",
-]
+check-cfg = []
diff --git a/lightning-tests/src/lib.rs b/lightning-tests/src/lib.rs
index c028193..80c9529 100644
--- a/lightning-tests/src/lib.rs
+++ b/lightning-tests/src/lib.rs
@@ -1,5 +1,5 @@
#[cfg_attr(test, macro_use)]
extern crate lightning;
-#[cfg(all(test, not(taproot)))]
+#[cfg(test)]
pub mod upgrade_downgrade_tests;
diff --git a/lightning/Cargo.toml b/lightning/Cargo.toml
index fd6c505..2f2f01b 100644
--- a/lightning/Cargo.toml
+++ b/lightning/Cargo.toml
@@ -65,8 +65,5 @@ features = ["bitcoinconsensus", "secp-recovery"]
[target.'cfg(ldk_bench)'.dependencies]
criterion = { version = "0.4", optional = true, default-features = false }
-[target.'cfg(taproot)'.dependencies]
-musig2 = { git = "https://github.com/arik-so/rust-musig2", rev = "6f95a05718cbb44d8fe3fa6021aea8117aa38d50" }
-
[lints]
workspace = true
diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs
index 1a69f52..b939c3d 100644
--- a/lightning/src/ln/channel.rs
+++ b/lightning/src/ln/channel.rs
@@ -6002,8 +6002,6 @@ impl<SP: SignerProvider> ChannelContext<SP> {
signature.map(|(signature, _)| msgs::FundingSigned {
channel_id: self.channel_id(),
signature,
- #[cfg(taproot)]
- partial_signature_with_nonce: None,
})
}
@@ -6129,8 +6127,6 @@ impl<SP: SignerProvider> ChannelContext<SP> {
htlc_signatures,
signature,
funding_txid: funding.get_funding_txo().map(|funding_txo| funding_txo.txid),
- #[cfg(taproot)]
- partial_signature_with_nonce: None,
})
} else {
log_debug!(
@@ -9463,8 +9459,6 @@ where
channel_id: self.context.channel_id,
per_commitment_secret,
next_per_commitment_point: self.holder_commitment_point.next_point(),
- #[cfg(taproot)]
- next_local_nonce: None,
release_htlc_message_paths,
});
}
@@ -11519,7 +11513,7 @@ where
bitcoin_signature_2: if were_node_one { their_bitcoin_sig } else { our_bitcoin_sig },
contents: announcement,
})
- }
+ },
}
} else {
Err(ChannelError::Ignore("Attempted to sign channel announcement before we'd received announcement_signatures".to_string()))
@@ -12729,8 +12723,6 @@ where
signature,
htlc_signatures,
funding_txid: funding.get_funding_txo().map(|funding_txo| funding_txo.txid),
- #[cfg(taproot)]
- partial_signature_with_nonce: None,
})
}
}
@@ -13310,10 +13302,6 @@ impl<SP: SignerProvider> OutboundV1Channel<SP> {
funding_txid: self.funding.channel_transaction_parameters.funding_outpoint.as_ref().unwrap().txid,
funding_output_index: self.funding.channel_transaction_parameters.funding_outpoint.as_ref().unwrap().index,
signature,
- #[cfg(taproot)]
- partial_signature_with_nonce: None,
- #[cfg(taproot)]
- next_local_nonce: None,
})
}
@@ -13718,8 +13706,6 @@ impl<SP: SignerProvider> InboundV1Channel<SP> {
channel_type: Some(self.funding.get_channel_type().clone()),
},
channel_reserve_satoshis: self.funding.holder_selected_channel_reserve_satoshis,
- #[cfg(taproot)]
- next_local_nonce: None,
})
}
diff --git a/lightning/src/ln/functional_tests.rs b/lightning/src/ln/functional_tests.rs
index 17fbc1f..eb868d2 100644
--- a/lightning/src/ln/functional_tests.rs
+++ b/lightning/src/ln/functional_tests.rs
@@ -6699,8 +6699,6 @@ pub fn test_counterparty_raa_skip_no_crash() {
channel_id,
per_commitment_secret,
next_per_commitment_point,
- #[cfg(taproot)]
- next_local_nonce: None,
release_htlc_message_paths: Vec::new(),
};
nodes[1].node.handle_revoke_and_ack(node_a_id, &raa);
diff --git a/lightning/src/ln/htlc_reserve_unit_tests.rs b/lightning/src/ln/htlc_reserve_unit_tests.rs
index d88b9a2..80b3ebd 100644
--- a/lightning/src/ln/htlc_reserve_unit_tests.rs
+++ b/lightning/src/ln/htlc_reserve_unit_tests.rs
@@ -930,8 +930,6 @@ pub fn do_test_fee_spike_buffer(cfg: Option<UserConfig>, htlc_fails: bool) {
signature: res.0,
htlc_signatures: res.1,
funding_txid: None,
- #[cfg(taproot)]
- partial_signature_with_nonce: None,
};
// Send the commitment_signed message to the nodes[1].
@@ -943,8 +941,6 @@ pub fn do_test_fee_spike_buffer(cfg: Option<UserConfig>, htlc_fails: bool) {
channel_id: chan.2,
per_commitment_secret: local_secret,
next_per_commitment_point: next_local_point,
- #[cfg(taproot)]
- next_local_nonce: None,
release_htlc_message_paths: Vec::new(),
};
nodes[1].node.handle_revoke_and_ack(node_a_id, &raa_msg);
@@ -2388,8 +2384,6 @@ pub fn do_test_dust_limit_fee_accounting(can_afford: bool) {
signature: res.0,
htlc_signatures: res.1,
funding_txid: None,
- #[cfg(taproot)]
- partial_signature_with_nonce: None,
};
// Send the commitment_signed message to the nodes[1].
@@ -2401,8 +2395,6 @@ pub fn do_test_dust_limit_fee_accounting(can_afford: bool) {
channel_id: chan_id,
per_commitment_secret: local_secret,
next_per_commitment_point: next_local_point,
- #[cfg(taproot)]
- next_local_nonce: None,
release_htlc_message_paths: Vec::new(),
};
nodes[1].node.handle_revoke_and_ack(node_a_id, &raa_msg);
diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs
index ac549dd..2908903 100644
--- a/lightning/src/ln/msgs.rs
+++ b/lightning/src/ln/msgs.rs
@@ -69,14 +69,6 @@ use crate::routing::gossip::{NodeAlias, NodeId};
/// 21 million * 10^8 * 1000
pub(crate) const MAX_VALUE_MSAT: u64 = 21_000_000_0000_0000_000;
-#[cfg(taproot)]
-/// A partial signature that also contains the Musig2 nonce its signer used
-#[derive(Clone, Debug, Hash, PartialEq, Eq)]
-pub struct PartialSignatureWithNonce(
- pub musig2::types::PartialSignature,
- pub musig2::types::PublicNonce,
-);
-
/// An error in decoding a message or struct.
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
pub enum DecodeError {
@@ -370,9 +362,6 @@ pub struct AcceptChannel {
pub common_fields: CommonAcceptChannelFields,
/// The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
pub channel_reserve_satoshis: u64,
- #[cfg(taproot)]
- /// Next nonce the channel initiator should use to create a funding output signature against
- pub next_local_nonce: Option<musig2::types::PublicNonce>,
}
/// An [`accept_channel2`] message to be sent by or received from the channel accepter.
@@ -407,12 +396,6 @@ pub struct FundingCreated {
pub funding_output_index: u16,
/// The signature of the channel initiator (funder) on the initial commitment transaction
pub signature: Signature,
- #[cfg(taproot)]
- /// The partial signature of the channel initiator (funder)
- pub partial_signature_with_nonce: Option<PartialSignatureWithNonce>,
- #[cfg(taproot)]
- /// Next nonce the channel acceptor should use to finalize the funding output signature
- pub next_local_nonce: Option<musig2::types::PublicNonce>,
}
/// A [`funding_signed`] message to be sent to or received from a peer.
@@ -426,9 +409,6 @@ pub struct FundingSigned {
pub channel_id: ChannelId,
/// The signature of the channel acceptor (fundee) on the initial commitment transaction
pub signature: Signature,
- #[cfg(taproot)]
- /// The partial signature of the channel acceptor (fundee)
- pub partial_signature_with_nonce: Option<PartialSignatureWithNonce>,
}
/// A [`channel_ready`] message to be sent to or received from a peer.
@@ -906,9 +886,6 @@ pub struct CommitmentSigned {
pub htlc_signatures: Vec<Signature>,
/// The funding transaction, to discriminate among multiple pending funding transactions (e.g. in case of splicing)
pub funding_txid: Option<Txid>,
- #[cfg(taproot)]
- /// The partial Taproot signature on the commitment transaction
- pub partial_signature_with_nonce: Option<PartialSignatureWithNonce>,
}
/// A [`revoke_and_ack`] message to be sent to or received from a peer.
@@ -922,9 +899,6 @@ pub struct RevokeAndACK {
pub per_commitment_secret: [u8; 32],
/// The next sender-broadcast commitment transaction's per-commitment point
pub next_per_commitment_point: PublicKey,
- #[cfg(taproot)]
- /// Musig nonce the recipient should use in their next commitment signature message
- pub next_local_nonce: Option<musig2::types::PublicNonce>,
/// A list of `(htlc_id, blinded_path)`. The receiver of this message will use the blinded paths
/// as reply paths to [`HeldHtlcAvailable`] onion messages that they send to the often-offline
/// receiver of this HTLC. The `htlc_id` is used by the receiver of this message to identify which
@@ -2909,17 +2883,10 @@ impl Writeable for AcceptChannel {
self.common_fields.delayed_payment_basepoint.write(w)?;
self.common_fields.htlc_basepoint.write(w)?;
self.common_fields.first_per_commitment_point.write(w)?;
- #[cfg(not(taproot))]
encode_tlv_stream!(w, {
(0, self.common_fields.shutdown_scriptpubkey.as_ref().map(|s| WithoutLength(s)), option), // Don't encode length twice.
(1, self.common_fields.channel_type, option),
});
- #[cfg(taproot)]
- encode_tlv_stream!(w, {
- (0, self.common_fields.shutdown_scriptpubkey.as_ref().map(|s| WithoutLength(s)), option), // Don't encode length twice.
- (1, self.common_fields.channel_type, option),
- (4, self.next_local_nonce, option),
- });
Ok(())
}
}
@@ -2943,18 +2910,9 @@ impl LengthReadable for AcceptChannel {
let mut shutdown_scriptpubkey: Option<ScriptBuf> = None;
let mut channel_type: Option<ChannelTypeFeatures> = None;
- #[cfg(not(taproot))]
- decode_tlv_stream!(r, {
- (0, shutdown_scriptpubkey, (option, encoding: (ScriptBuf, WithoutLength))),
- (1, channel_type, option),
- });
- #[cfg(taproot)]
- let mut next_local_nonce: Option<musig2::types::PublicNonce> = None;
- #[cfg(taproot)]
decode_tlv_stream!(r, {
(0, shutdown_scriptpubkey, (option, encoding: (ScriptBuf, WithoutLength))),
(1, channel_type, option),
- (4, next_local_nonce, option),
});
Ok(AcceptChannel {
@@ -2976,8 +2934,6 @@ impl LengthReadable for AcceptChannel {
channel_type,
},
channel_reserve_satoshis,
- #[cfg(taproot)]
- next_local_nonce,
})
}
}
@@ -3245,7 +3201,6 @@ impl_writeable!(ClosingSignedFeeRange, {
max_fee_satoshis
});
-#[cfg(not(taproot))]
impl_writeable_msg!(CommitmentSigned, {
channel_id,
signature,
@@ -3254,54 +3209,24 @@ impl_writeable_msg!(CommitmentSigned, {
(1, funding_txid, option),
});
-#[cfg(taproot)]
-impl_writeable_msg!(CommitmentSigned, {
- channel_id,
- signature,
- htlc_signatures
-}, {
- (1, funding_txid, option),
- (2, partial_signature_with_nonce, option),
-});
-
impl_writeable!(DecodedOnionErrorPacket, {
hmac,
failuremsg,
pad
});
-#[cfg(not(taproot))]
impl_writeable_msg!(FundingCreated, {
temporary_channel_id,
funding_txid,
funding_output_index,
signature
}, {});
-#[cfg(taproot)]
-impl_writeable_msg!(FundingCreated, {
- temporary_channel_id,
- funding_txid,
- funding_output_index,
- signature
-}, {
- (2, partial_signature_with_nonce, option),
- (4, next_local_nonce, option)
-});
-#[cfg(not(taproot))]
impl_writeable_msg!(FundingSigned, {
channel_id,
signature
}, {});
-#[cfg(taproot)]
-impl_writeable_msg!(FundingSigned, {
- channel_id,
- signature
-}, {
- (2, partial_signature_with_nonce, option)
-});
-
impl_writeable_msg!(ChannelReady, {
channel_id,
next_per_commitment_point,
@@ -3529,7 +3454,6 @@ impl LengthReadable for OpenChannelV2 {
}
}
-#[cfg(not(taproot))]
impl_writeable_msg!(RevokeAndACK, {
channel_id,
per_commitment_secret,
@@ -3538,16 +3462,6 @@ impl_writeable_msg!(RevokeAndACK, {
(75537, release_htlc_message_paths, optional_vec)
});
-#[cfg(taproot)]
-impl_writeable_msg!(RevokeAndACK, {
- channel_id,
- per_commitment_secret,
- next_per_commitment_point
-}, {
- (4, next_local_nonce, option),
- (75537, release_htlc_message_paths, optional_vec)
-});
-
impl_writeable_msg!(Shutdown, {
channel_id,
scriptpubkey
@@ -5504,8 +5418,6 @@ mod tests {
channel_type: None,
},
channel_reserve_satoshis: 3608586615801332854,
- #[cfg(taproot)]
- next_local_nonce: None,
};
let encoded_value = accept_channel.encode();
let mut target_value = <Vec<u8>>::from_hex("020202020202020202020202020202020202020202020202020202020202020212345678901234562334032891223698321446687011447600083a840000034d000c89d4c0bcc0bc031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f024d4b6cd1361032ca9bd2aeb9d900aa4d45d9ead80ac9423374c451a7254d076602531fe6068134503d2723133227c867ac8fa6c83c537e9a44c3c5bdbdcb1fe33703462779ad4aad39514614751a71085f2f10e1c7a593e4e030efb5b8721ce55b0b0362c0a046dacce86ddd0343c6d3c7c79c2208ba0d9c9cf24a6d046d21d21f90f703f006a18d5653c4edf5391ff23a61f03ff83d237e880ee61187fa9f379a028e0a").unwrap();
@@ -5671,10 +5583,6 @@ mod tests {
.unwrap(),
funding_output_index: 255,
signature: sig_1,
- #[cfg(taproot)]
- partial_signature_with_nonce: None,
- #[cfg(taproot)]
- next_local_nonce: None,
};
let encoded_value = funding_created.encode();
let target_value = <Vec<u8>>::from_hex("02020202020202020202020202020202020202020202020202020202020202026e96fe9f8b0ddcd729ba03cfafa5a27b050b39d354dd980814268dfa9a44d4c200ffd977cb9b53d93a6ff64bb5f1e158b4094b66e798fb12911168a3ccdf80a83096340a6a95da0ae8d9f776528eecdbb747eb6b545495a4319ed5378e35b21e073a").unwrap();
@@ -5690,12 +5598,8 @@ mod tests {
);
let sig_1 =
get_sig_on!(privkey_1, secp_ctx, String::from("01010101010101010101010101010101"));
- let funding_signed = msgs::FundingSigned {
- channel_id: ChannelId::from_bytes([2; 32]),
- signature: sig_1,
- #[cfg(taproot)]
- partial_signature_with_nonce: None,
- };
+ let funding_signed =
+ msgs::FundingSigned { channel_id: ChannelId::from_bytes([2; 32]), signature: sig_1 };
let encoded_value = funding_signed.encode();
let target_value = <Vec<u8>>::from_hex("0202020202020202020202020202020202020202020202020202020202020202d977cb9b53d93a6ff64bb5f1e158b4094b66e798fb12911168a3ccdf80a83096340a6a95da0ae8d9f776528eecdbb747eb6b545495a4319ed5378e35b21e073a").unwrap();
assert_eq!(encoded_value, target_value);
@@ -6234,8 +6138,6 @@ mod tests {
Txid::from_str("c2d4449afa8d26140898dd54d3390b057ba2a5afcf03ba29d7dc0d8b9ffe966e")
.unwrap(),
),
- #[cfg(taproot)]
- partial_signature_with_nonce: None,
};
let encoded_value = commitment_signed.encode();
let mut target_value = "0202020202020202020202020202020202020202020202020202020202020202d977cb9b53d93a6ff64bb5f1e158b4094b66e798fb12911168a3ccdf80a83096340a6a95da0ae8d9f776528eecdbb747eb6b545495a4319ed5378e35b21e073a".to_string();
@@ -6270,8 +6172,6 @@ mod tests {
1, 1, 1, 1,
],
next_per_commitment_point: pubkey_1,
- #[cfg(taproot)]
- next_local_nonce: None,
release_htlc_message_paths: Vec::new(),
};
let encoded_value = raa.encode();
diff --git a/lightning/src/ln/update_fee_tests.rs b/lightning/src/ln/update_fee_tests.rs
index ac56639..77a4c32 100644
--- a/lightning/src/ln/update_fee_tests.rs
+++ b/lightning/src/ln/update_fee_tests.rs
@@ -508,8 +508,6 @@ pub fn do_test_update_fee_that_funder_cannot_afford(channel_type_features: Chann
signature: res.0,
htlc_signatures: res.1,
funding_txid: None,
- #[cfg(taproot)]
- partial_signature_with_nonce: None,
};
let update_fee = msgs::UpdateFee { channel_id: chan.2, feerate_per_kw: non_buffer_feerate + 4 };
@@ -608,8 +606,6 @@ pub fn test_update_fee_that_saturates_subs() {
signature: res.0,
htlc_signatures: res.1,
funding_txid: None,
- #[cfg(taproot)]
- partial_signature_with_nonce: None,
};
let update_fee = msgs::UpdateFee { channel_id: chan_id, feerate_per_kw: FEERATE };
diff --git a/lightning/src/sign/mod.rs b/lightning/src/sign/mod.rs
index 91e4a67..adab372 100644
--- a/lightning/src/sign/mod.rs
+++ b/lightning/src/sign/mod.rs
@@ -51,8 +51,6 @@ use crate::ln::channel_keys::{
RevocationBasepoint, RevocationKey,
};
use crate::ln::inbound_payment::ExpandedKey;
-#[cfg(taproot)]
-use crate::ln::msgs::PartialSignatureWithNonce;
use crate::ln::msgs::{UnsignedChannelAnnouncement, UnsignedGossipMessage};
use crate::ln::script::ShutdownScript;
use crate::offers::invoice::UnsignedBolt12Invoice;
@@ -71,8 +69,6 @@ use core::convert::TryInto;
use core::future::Future;
use core::ops::Deref;
use core::sync::atomic::{AtomicUsize, Ordering};
-#[cfg(taproot)]
-use musig2::types::{PartialSignature, PublicNonce};
pub(crate) mod type_resolver;
diff --git a/lightning/src/util/ser.rs b/lightning/src/util/ser.rs
index b226332..ec5d9a0 100644
--- a/lightning/src/util/ser.rs
+++ b/lightning/src/util/ser.rs
@@ -47,8 +47,6 @@ use bitcoin::{consensus, Sequence, TxIn, Weight, Witness};
use dnssec_prover::rr::Name;
use crate::chain::ClaimId;
-#[cfg(taproot)]
-use crate::ln::msgs::PartialSignatureWithNonce;
use crate::ln::msgs::{DecodeError, SerialId};
use crate::types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
use crate::types::string::UntrustedString;
@@ -734,7 +732,6 @@ impl_array!(16, u8); // for IPv6
impl_array!(32, u8); // for channel id & hmac
impl_array!(PUBLIC_KEY_SIZE, u8); // for PublicKey
impl_array!(64, u8); // for ecdsa::Signature and schnorr::Signature
-impl_array!(66, u8); // for MuSig2 nonces
impl_array!(1300, u8); // for OnionPacket.hop_data
impl_array!(8, u16);
@@ -1204,40 +1201,6 @@ impl Readable for SecretKey {
}
}
-#[cfg(taproot)]
-impl Writeable for musig2::types::PublicNonce {
- fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
- self.serialize().write(w)
- }
-}
-
-#[cfg(taproot)]
-impl Readable for musig2::types::PublicNonce {
- fn read<R: Read>(r: &mut R) -> Result<Self, DecodeError> {
- let buf: [u8; PUBLIC_KEY_SIZE * 2] = Readable::read(r)?;
- musig2::types::PublicNonce::from_slice(&buf).map_err(|_| DecodeError::InvalidValue)
- }
-}
-
-#[cfg(taproot)]
-impl Writeable for PartialSignatureWithNonce {
- fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
- self.0.serialize().write(w)?;
- self.1.write(w)
- }
-}
-
-#[cfg(taproot)]
-impl Readable for PartialSignatureWithNonce {
- fn read<R: Read>(r: &mut R) -> Result<Self, DecodeError> {
- let partial_signature_buf: [u8; SECRET_KEY_SIZE] = Readable::read(r)?;
- let partial_signature = musig2::types::PartialSignature::from_slice(&partial_signature_buf)
- .map_err(|_| DecodeError::InvalidValue)?;
- let public_nonce: musig2::types::PublicNonce = Readable::read(r)?;
- Ok(PartialSignatureWithNonce(partial_signature, public_nonce))
- }
-}
-
impl Writeable for Hmac<Sha256> {
fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
w.write_all(&self[..])
diff --git a/lightning/src/util/test_channel_signer.rs b/lightning/src/util/test_channel_signer.rs
index b1912bd..8435e7f 100644
--- a/lightning/src/util/test_channel_signer.rs
+++ b/lightning/src/util/test_channel_signer.rs
@@ -34,15 +34,11 @@ use bitcoin::sighash::EcdsaSighashType;
use bitcoin::transaction::Transaction;
use bitcoin::Txid;
-#[cfg(taproot)]
-use crate::ln::msgs::PartialSignatureWithNonce;
use crate::sign::HTLCDescriptor;
use crate::util::dyn_signer::DynSigner;
use bitcoin::secp256k1;
use bitcoin::secp256k1::{ecdsa::Signature, Secp256k1};
use bitcoin::secp256k1::{PublicKey, SecretKey};
-#[cfg(taproot)]
-use musig2::types::{PartialSignature, PublicNonce};
/// Initial value for revoked commitment downward counter
pub const INITIAL_REVOKED_COMMITMENT_NUMBER: u64 = 1 << 48;
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.