What changed, and why it matters
This commit removes an unfinished Taproot-specific signer type from the Lightning Dev Kit codebase. The removed code was behind a special compile-time flag ('taproot') and consisted almost entirely of placeholder 'todo!()' stubs that did not actually sign anything. The change is a cleanup/refactoring step toward having one unified channel signer type, not a security fix.
No security action required. Treat as a normal API-cleanup commit. Downstream users building with the non-default 'taproot' feature should expect compile-time breakage and should migrate to the unified EcdsaSigner/InMemorySigner channel signer interface.
Security signals we found
No security-relevant code paths are altered: all removed Taproot branches were todo!() stubs unreachable in normal builds.
No bug fixes, bounds checks, input validation, or cryptographic hardening are present in the diff.
The commit message frames the change as architectural simplification, not a vulnerability remediation.
Evidence from the diff
The commit deletes the TaprootChannelSigner trait and its implementations, removes the TaprootSigner associated type from SignerProvider, and strips out all #[cfg(taproot)] match arms that previously panicked or stubbed Taproot paths with todo!(). The diff is large (-451 lines) but mechanical: it eliminates dead/placeholder code rather than changing live ECDSA signing logic. No cryptographic operations, validation checks, or network behaviors are modified in a way that affects runtime security.
Changed components
lightning/src/sign/taproot.rs (deleted)lightning/src/sign/mod.rslightning/src/sign/type_resolver.rslightning/src/util/dyn_signer.rslightning/src/util/test_channel_signer.rslightning/src/util/test_utils.rslightning/src/ln/channel.rslightning-background-processor/src/lib.rsfuzz targetsInspect captured patch +5 / −451
diff --git a/fuzz/src/chanmon_consistency.rs b/fuzz/src/chanmon_consistency.rs
index 2200689..a6288e1 100644
--- a/fuzz/src/chanmon_consistency.rs
+++ b/fuzz/src/chanmon_consistency.rs
@@ -447,8 +447,6 @@ impl NodeSigner for KeyProvider {
impl SignerProvider for KeyProvider {
type EcdsaSigner = TestChannelSigner;
- #[cfg(taproot)]
- type TaprootSigner = TestChannelSigner;
fn generate_channel_keys_id(&self, _inbound: bool, _user_channel_id: u128) -> [u8; 32] {
let id = self.rand_bytes_id.fetch_add(1, atomic::Ordering::Relaxed) as u8;
diff --git a/fuzz/src/full_stack.rs b/fuzz/src/full_stack.rs
index 5dfa510..35b1632 100644
--- a/fuzz/src/full_stack.rs
+++ b/fuzz/src/full_stack.rs
@@ -457,8 +457,6 @@ impl NodeSigner for KeyProvider {
impl SignerProvider for KeyProvider {
type EcdsaSigner = TestChannelSigner;
- #[cfg(taproot)]
- type TaprootSigner = TestChannelSigner;
fn generate_channel_keys_id(&self, inbound: bool, _user_channel_id: u128) -> [u8; 32] {
let ctr = self.counter.fetch_add(1, Ordering::Relaxed) as u8;
diff --git a/fuzz/src/onion_message.rs b/fuzz/src/onion_message.rs
index 70dfb07..4859f73 100644
--- a/fuzz/src/onion_message.rs
+++ b/fuzz/src/onion_message.rs
@@ -296,8 +296,6 @@ impl NodeSigner for KeyProvider {
impl SignerProvider for KeyProvider {
type EcdsaSigner = TestChannelSigner;
- #[cfg(taproot)]
- type TaprootSigner = TestChannelSigner;
fn generate_channel_keys_id(&self, _inbound: bool, _user_channel_id: u128) -> [u8; 32] {
unreachable!()
diff --git a/lightning-background-processor/src/lib.rs b/lightning-background-processor/src/lib.rs
index da415c7..be0d7ee 100644
--- a/lightning-background-processor/src/lib.rs
+++ b/lightning-background-processor/src/lib.rs
@@ -378,18 +378,11 @@ type DynMessageRouter = lightning::onion_message::messenger::DefaultMessageRoute
&'static (dyn EntropySource + Send + Sync),
>;
-#[cfg(all(not(c_bindings), not(taproot)))]
+#[cfg(not(c_bindings))]
type DynSignerProvider = dyn lightning::sign::SignerProvider<EcdsaSigner = lightning::sign::InMemorySigner>
+ Send
+ Sync;
-#[cfg(all(not(c_bindings), taproot))]
-type DynSignerProvider = (dyn lightning::sign::SignerProvider<
- EcdsaSigner = lightning::sign::InMemorySigner,
- TaprootSigner = lightning::sign::InMemorySigner,
-> + Send
- + Sync);
-
#[cfg(not(c_bindings))]
type DynChannelManager = lightning::ln::channelmanager::ChannelManager<
&'static (dyn chain::Watch<lightning::sign::InMemorySigner> + Send + Sync),
diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs
index 9361cd3..1a69f52 100644
--- a/lightning/src/ln/channel.rs
+++ b/lightning/src/ln/channel.rs
@@ -2229,8 +2229,6 @@ where
splice_input_index as usize,
&context.secp_ctx,
),
- #[cfg(taproot)]
- ChannelSignerType::Taproot(_) => todo!(),
};
Some(sig)
} else {
@@ -5988,13 +5986,9 @@ impl<SP: SignerProvider> ChannelContext<SP> {
// We sign "counterparty" commitment transaction, allowing them to broadcast the tx if they wish.
let signature = match &self.holder_signer {
- // TODO (arik): move match into calling method for Taproot
ChannelSignerType::Ecdsa(ecdsa) => ecdsa.sign_counterparty_commitment(
channel_parameters, &counterparty_initial_commitment_tx, Vec::new(), Vec::new(), &self.secp_ctx
).ok(),
- // TODO (taproot|arik)
- #[cfg(taproot)]
- _ => todo!()
};
if signature.is_some() && self.signer_pending_funding {
@@ -6104,7 +6098,6 @@ impl<SP: SignerProvider> ChannelContext<SP> {
);
let counterparty_initial_commitment_tx = commitment_data.tx;
match self.holder_signer {
- // TODO (taproot|arik): move match into calling method for Taproot
ChannelSignerType::Ecdsa(ref ecdsa) => {
let channel_parameters = &funding.channel_transaction_parameters;
ecdsa
@@ -6117,9 +6110,6 @@ impl<SP: SignerProvider> ChannelContext<SP> {
)
.ok()
},
- // TODO (taproot|arik)
- #[cfg(taproot)]
- _ => todo!(),
}
}
@@ -8427,9 +8417,6 @@ where
ChannelError::close("Failed to validate revocation from peer".to_owned())
})?;
},
- // TODO (taproot|arik)
- #[cfg(taproot)]
- _ => todo!(),
};
self.context
@@ -10384,9 +10371,6 @@ where
&self.context.secp_ctx,
)
.ok(),
- // TODO (taproot|arik)
- #[cfg(taproot)]
- _ => todo!(),
};
if sig.is_none() {
log_trace!(logger, "Closing transaction signature unavailable, waiting on signer");
@@ -11505,10 +11489,7 @@ where
node_signature: our_node_sig,
bitcoin_signature: our_bitcoin_sig,
})
- },
- // TODO (taproot|arik)
- #[cfg(taproot)]
- _ => todo!()
+ }
}
}
@@ -11538,10 +11519,7 @@ where
bitcoin_signature_2: if were_node_one { their_bitcoin_sig } else { our_bitcoin_sig },
contents: announcement,
})
- },
- // TODO (taproot|arik)
- #[cfg(taproot)]
- _ => todo!()
+ }
}
} else {
Err(ChannelError::Ignore("Attempted to sign channel announcement before we'd received announcement_signatures".to_string()))
@@ -11883,8 +11861,6 @@ where
(Some(prev_funding_txid), ChannelSignerType::Ecdsa(ecdsa)) => {
ecdsa.new_funding_pubkey(prev_funding_txid, &self.context.secp_ctx)
},
- #[cfg(taproot)]
- _ => todo!(),
};
let funding_feerate_per_kw = context.funding_feerate_sat_per_1000_weight;
@@ -11989,8 +11965,6 @@ where
(Some(prev_funding_txid), ChannelSignerType::Ecdsa(ecdsa)) => {
ecdsa.new_funding_pubkey(prev_funding_txid, &self.context.secp_ctx)
},
- #[cfg(taproot)]
- _ => todo!(),
};
let mut new_keys = self.funding.get_holder_pubkeys().clone();
new_keys.funding_pubkey = funding_pubkey;
@@ -12758,11 +12732,8 @@ where
#[cfg(taproot)]
partial_signature_with_nonce: None,
})
- },
- // TODO (taproot|arik)
- #[cfg(taproot)]
- _ => todo!()
- }
+ }
+ }
}
/// Adds a pending outbound HTLC to this channel, and builds a new remote commitment
@@ -13319,15 +13290,11 @@ impl<SP: SignerProvider> OutboundV1Channel<SP> {
&self.context.counterparty_next_commitment_point.unwrap(), false, false, logger);
let counterparty_initial_commitment_tx = commitment_data.tx;
let signature = match &self.context.holder_signer {
- // TODO (taproot|arik): move match into calling method for Taproot
ChannelSignerType::Ecdsa(ecdsa) => {
let channel_parameters = &self.funding.channel_transaction_parameters;
ecdsa.sign_counterparty_commitment(channel_parameters, &counterparty_initial_commitment_tx, Vec::new(), Vec::new(), &self.context.secp_ctx)
.map(|(sig, _)| sig).ok()
},
- // TODO (taproot|arik)
- #[cfg(taproot)]
- _ => todo!()
};
if signature.is_some() && self.context.signer_pending_funding {
@@ -15775,8 +15742,6 @@ mod tests {
#[cfg(ldk_test_vectors)]
impl SignerProvider for Keys {
type EcdsaSigner = InMemorySigner;
- #[cfg(taproot)]
- type TaprootSigner = InMemorySigner;
fn generate_channel_keys_id(&self, _inbound: bool, _user_channel_id: u128) -> [u8; 32] {
self.signer.channel_keys_id()
diff --git a/lightning/src/sign/mod.rs b/lightning/src/sign/mod.rs
index 84bfbb9..91e4a67 100644
--- a/lightning/src/sign/mod.rs
+++ b/lightning/src/sign/mod.rs
@@ -65,8 +65,6 @@ use crate::util::transaction_utils;
use crate::crypto::chacha20::ChaCha20;
use crate::prelude::*;
use crate::sign::ecdsa::EcdsaChannelSigner;
-#[cfg(taproot)]
-use crate::sign::taproot::TaprootChannelSigner;
use crate::util::atomic_counter::AtomicCounter;
use core::convert::TryInto;
@@ -79,8 +77,6 @@ use musig2::types::{PartialSignature, PublicNonce};
pub(crate) mod type_resolver;
pub mod ecdsa;
-#[cfg(taproot)]
-pub mod taproot;
pub mod tx_builder;
pub(crate) const COMPRESSED_PUBLIC_KEY_SIZE: usize = bitcoin::secp256k1::constants::PUBLIC_KEY_SIZE;
@@ -1084,18 +1080,7 @@ impl<T: OutputSpender + ?Sized, O: Deref<Target = T>> OutputSpender for O {
/// A dynamic [`SignerProvider`] temporarily needed for doc tests.
///
/// This is not exported to bindings users as it is not intended for public consumption.
-#[cfg(taproot)]
#[doc(hidden)]
-#[deprecated(note = "Remove once taproot cfg is removed")]
-pub type DynSignerProvider =
- dyn SignerProvider<EcdsaSigner = InMemorySigner, TaprootSigner = InMemorySigner>;
-
-/// A dynamic [`SignerProvider`] temporarily needed for doc tests.
-///
-/// This is not exported to bindings users as it is not intended for public consumption.
-#[cfg(not(taproot))]
-#[doc(hidden)]
-#[deprecated(note = "Remove once taproot cfg is removed")]
pub type DynSignerProvider = dyn SignerProvider<EcdsaSigner = InMemorySigner>;
/// A trait that can return signer instances for individual channels.
@@ -1109,9 +1094,6 @@ pub type DynSignerProvider = dyn SignerProvider<EcdsaSigner = InMemorySigner>;
pub trait SignerProvider {
/// A type which implements [`EcdsaChannelSigner`] which will be returned by [`Self::derive_channel_signer`].
type EcdsaSigner: EcdsaChannelSigner;
- #[cfg(taproot)]
- /// A type which implements [`TaprootChannelSigner`]
- type TaprootSigner: TaprootChannelSigner;
/// Generates a unique `channel_keys_id` that can be used to obtain a [`Self::EcdsaSigner`] through
/// [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
@@ -1151,8 +1133,6 @@ pub trait SignerProvider {
impl<T: SignerProvider + ?Sized, SP: Deref<Target = T>> SignerProvider for SP {
type EcdsaSigner = T::EcdsaSigner;
- #[cfg(taproot)]
- type TaprootSigner = T::TaprootSigner;
fn generate_channel_keys_id(&self, inbound: bool, user_channel_id: u128) -> [u8; 32] {
self.deref().generate_channel_keys_id(inbound, user_channel_id)
@@ -1983,65 +1963,6 @@ impl EcdsaChannelSigner for InMemorySigner {
}
}
-#[cfg(taproot)]
-#[allow(unused)]
-impl TaprootChannelSigner for InMemorySigner {
- fn generate_local_nonce_pair(
- &self, commitment_number: u64, secp_ctx: &Secp256k1<All>,
- ) -> PublicNonce {
- todo!()
- }
-
- fn partially_sign_counterparty_commitment(
- &self, counterparty_nonce: PublicNonce, commitment_tx: &CommitmentTransaction,
- inbound_htlc_preimages: Vec<PaymentPreimage>,
- outbound_htlc_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<All>,
- ) -> Result<(PartialSignatureWithNonce, Vec<schnorr::Signature>), ()> {
- todo!()
- }
-
- fn finalize_holder_commitment(
- &self, commitment_tx: &HolderCommitmentTransaction,
- counterparty_partial_signature: PartialSignatureWithNonce, secp_ctx: &Secp256k1<All>,
- ) -> Result<PartialSignature, ()> {
- todo!()
- }
-
- fn sign_justice_revoked_output(
- &self, justice_tx: &Transaction, input: usize, amount: u64, per_commitment_key: &SecretKey,
- secp_ctx: &Secp256k1<All>,
- ) -> Result<schnorr::Signature, ()> {
- todo!()
- }
-
- fn sign_justice_revoked_htlc(
- &self, justice_tx: &Transaction, input: usize, amount: u64, per_commitment_key: &SecretKey,
- htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<All>,
- ) -> Result<schnorr::Signature, ()> {
- todo!()
- }
-
- fn sign_holder_htlc_transaction(
- &self, htlc_tx: &Transaction, input: usize, htlc_descriptor: &HTLCDescriptor,
- secp_ctx: &Secp256k1<All>,
- ) -> Result<schnorr::Signature, ()> {
- todo!()
- }
-
- fn sign_counterparty_htlc_transaction(
- &self, htlc_tx: &Transaction, input: usize, amount: u64, per_commitment_point: &PublicKey,
- htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<All>,
- ) -> Result<schnorr::Signature, ()> {
- todo!()
- }
-
- fn partially_sign_closing_transaction(
- &self, closing_tx: &ClosingTransaction, secp_ctx: &Secp256k1<All>,
- ) -> Result<PartialSignature, ()> {
- todo!()
- }
-}
-
/// Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
/// 32-byte seed for use as a BIP 32 extended key and derives keys from that.
///
@@ -2548,8 +2469,6 @@ impl OutputSpender for KeysManager {
impl SignerProvider for KeysManager {
type EcdsaSigner = InMemorySigner;
- #[cfg(taproot)]
- type TaprootSigner = InMemorySigner;
fn generate_channel_keys_id(&self, _inbound: bool, user_channel_id: u128) -> [u8; 32] {
let child_idx = self.channel_child_index.fetch_add(1, Ordering::AcqRel);
@@ -2697,8 +2616,6 @@ impl OutputSpender for PhantomKeysManager {
impl SignerProvider for PhantomKeysManager {
type EcdsaSigner = InMemorySigner;
- #[cfg(taproot)]
- type TaprootSigner = InMemorySigner;
fn generate_channel_keys_id(&self, inbound: bool, user_channel_id: u128) -> [u8; 32] {
self.inner.generate_channel_keys_id(inbound, user_channel_id)
diff --git a/lightning/src/sign/taproot.rs b/lightning/src/sign/taproot.rs
deleted file mode 100644
index 22470f4..0000000
--- a/lightning/src/sign/taproot.rs
+++ /dev/null
@@ -1,155 +0,0 @@
-//! Defines a Taproot-specific signer type.
-
-use alloc::vec::Vec;
-use bitcoin::secp256k1;
-use bitcoin::secp256k1::{schnorr::Signature, PublicKey, Secp256k1, SecretKey};
-use bitcoin::transaction::Transaction;
-
-use musig2::types::{PartialSignature, PublicNonce};
-
-use crate::ln::chan_utils::{
- ClosingTransaction, CommitmentTransaction, HTLCOutputInCommitment, HolderCommitmentTransaction,
-};
-use crate::ln::msgs::PartialSignatureWithNonce;
-use crate::sign::{ChannelSigner, HTLCDescriptor};
-use crate::types::payment::PaymentPreimage;
-
-/// A Taproot-specific signer type that defines signing-related methods that are either unique to
-/// Taproot or have argument or return types that differ from the ones an ECDSA signer would be
-/// expected to have.
-pub trait TaprootChannelSigner: ChannelSigner {
- /// Generate a local nonce pair, which requires committing to ahead of time.
- /// The counterparty needs the public nonce generated herein to compute a partial signature.
- fn generate_local_nonce_pair(
- &self, commitment_number: u64, secp_ctx: &Secp256k1<secp256k1::All>,
- ) -> PublicNonce;
-
- /// Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
- ///
- /// Note that if signing fails or is rejected, the channel will be force-closed.
- ///
- /// Policy checks should be implemented in this function, including checking the amount
- /// sent to us and checking the HTLCs.
- ///
- /// The preimages of outbound and inbound HTLCs that were fulfilled since the last commitment
- /// are provided. A validating signer should ensure that an outbound HTLC output is removed
- /// only when the matching preimage is provided and after the corresponding inbound HTLC has
- /// been removed for forwarded payments.
- ///
- /// Note that all the relevant preimages will be provided, but there may also be additional
- /// irrelevant or duplicate preimages.
- //
- // TODO: Document the things someone using this interface should enforce before signing.
- fn partially_sign_counterparty_commitment(
- &self, counterparty_nonce: PublicNonce, commitment_tx: &CommitmentTransaction,
- inbound_htlc_preimages: Vec<PaymentPreimage>,
- outbound_htlc_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<secp256k1::All>,
- ) -> Result<(PartialSignatureWithNonce, Vec<Signature>), ()>;
-
- /// Creates a signature for a holder's commitment transaction.
- ///
- /// This will be called
- /// - with a non-revoked `commitment_tx`.
- /// - with the latest `commitment_tx` when we initiate a force-close.
- ///
- /// This may be called multiple times for the same transaction.
- ///
- /// An external signer implementation should check that the commitment has not been revoked.
- ///
- // TODO: Document the things someone using this interface should enforce before signing.
- fn finalize_holder_commitment(
- &self, commitment_tx: &HolderCommitmentTransaction,
- counterparty_partial_signature: PartialSignatureWithNonce,
- secp_ctx: &Secp256k1<secp256k1::All>,
- ) -> Result<PartialSignature, ()>;
-
- /// Create a signature for the given input in a transaction spending an HTLC transaction output
- /// or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
- ///
- /// A justice transaction may claim multiple outputs at the same time if timelocks are
- /// similar, but only a signature for the input at index `input` should be signed for here.
- /// It may be called multiple times for same output(s) if a fee-bump is needed with regards
- /// to an upcoming timelock expiration.
- ///
- /// Amount is value of the output spent by this input, committed to in the BIP 341 signature.
- ///
- /// `per_commitment_key` is revocation secret which was provided by our counterparty when they
- /// revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
- /// not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
- /// so).
- fn sign_justice_revoked_output(
- &self, justice_tx: &Transaction, input: usize, amount: u64, per_commitment_key: &SecretKey,
- secp_ctx: &Secp256k1<secp256k1::All>,
- ) -> Result<Signature, ()>;
-
- /// Create a signature for the given input in a transaction spending a commitment transaction
- /// HTLC output when our counterparty broadcasts an old state.
- ///
- /// A justice transaction may claim multiple outputs at the same time if timelocks are
- /// similar, but only a signature for the input at index `input` should be signed for here.
- /// It may be called multiple times for same output(s) if a fee-bump is needed with regards
- /// to an upcoming timelock expiration.
- ///
- /// `amount` is the value of the output spent by this input, committed to in the BIP 341
- /// signature.
- ///
- /// `per_commitment_key` is revocation secret which was provided by our counterparty when they
- /// revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
- /// not allow the spending of any funds by itself (you need our holder revocation_secret to do
- /// so).
- ///
- /// `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
- /// (which is committed to in the BIP 341 signatures).
- fn sign_justice_revoked_htlc(
- &self, justice_tx: &Transaction, input: usize, amount: u64, per_commitment_key: &SecretKey,
- htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<secp256k1::All>,
- ) -> Result<Signature, ()>;
-
- /// Computes the signature for a commitment transaction's HTLC output used as an input within
- /// `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
- /// must be be computed using [`TapSighashType::Default`].
- ///
- /// Note that this may be called for HTLCs in the penultimate commitment transaction if a
- /// [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
- /// broadcasts it before receiving the update for the latest commitment transaction.
- ///
- ///
- /// [`TapSighashType::Default`]: bitcoin::sighash::TapSighashType::Default
- /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
- fn sign_holder_htlc_transaction(
- &self, htlc_tx: &Transaction, input: usize, htlc_descriptor: &HTLCDescriptor,
- secp_ctx: &Secp256k1<secp256k1::All>,
- ) -> Result<Signature, ()>;
-
- /// Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
- /// transaction, either offered or received.
- ///
- /// Such a transaction may claim multiples offered outputs at same time if we know the
- /// preimage for each when we create it, but only the input at index `input` should be
- /// signed for here. It may be called multiple times for same output(s) if a fee-bump is
- /// needed with regards to an upcoming timelock expiration.
- ///
- /// `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
- /// outputs.
- ///
- /// `amount` is value of the output spent by this input, committed to in the BIP 341 signature.
- ///
- /// `per_commitment_point` is the dynamic point corresponding to the channel state
- /// detected onchain. It has been generated by our counterparty and is used to derive
- /// channel state keys, which are then included in the witness script and committed to in the
- /// BIP 341 signature.
- fn sign_counterparty_htlc_transaction(
- &self, htlc_tx: &Transaction, input: usize, amount: u64, per_commitment_point: &PublicKey,
- htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<secp256k1::All>,
- ) -> Result<Signature, ()>;
-
- /// Create a signature for a (proposed) closing transaction.
- ///
- /// Note that, due to rounding, there may be one "missing" satoshi, and either party may have
- /// chosen to forgo their output as dust.
- fn partially_sign_closing_transaction(
- &self, closing_tx: &ClosingTransaction, secp_ctx: &Secp256k1<secp256k1::All>,
- ) -> Result<PartialSignature, ()>;
-
- // TODO: sign channel announcement
-}
diff --git a/lightning/src/sign/type_resolver.rs b/lightning/src/sign/type_resolver.rs
index 405e346..3e78489 100644
--- a/lightning/src/sign/type_resolver.rs
+++ b/lightning/src/sign/type_resolver.rs
@@ -3,9 +3,6 @@ use crate::sign::{ChannelSigner, SignerProvider};
pub(crate) enum ChannelSignerType<SP: SignerProvider> {
// in practice, this will only ever be an EcdsaChannelSigner (specifically, Writeable)
Ecdsa(SP::EcdsaSigner),
- #[cfg(taproot)]
- #[allow(unused)]
- Taproot(SP::TaprootSigner),
}
#[cfg(test)]
@@ -19,9 +16,6 @@ impl<SP: SignerProvider> ChannelSignerType<SP> {
pub(crate) fn as_ref(&self) -> &dyn ChannelSigner {
match self {
ChannelSignerType::Ecdsa(ecs) => ecs,
- #[cfg(taproot)]
- #[allow(unused)]
- ChannelSignerType::Taproot(tcs) => tcs,
}
}
diff --git a/lightning/src/util/dyn_signer.rs b/lightning/src/util/dyn_signer.rs
index cf1cac3..436eaab 100644
--- a/lightning/src/util/dyn_signer.rs
+++ b/lightning/src/util/dyn_signer.rs
@@ -12,8 +12,6 @@ use crate::ln::inbound_payment::ExpandedKey;
use crate::ln::msgs::{UnsignedChannelAnnouncement, UnsignedGossipMessage};
use crate::ln::script::ShutdownScript;
use crate::sign::ecdsa::EcdsaChannelSigner;
-#[cfg(taproot)]
-use crate::sign::taproot::TaprootChannelSigner;
use crate::sign::InMemorySigner;
use crate::sign::{ChannelSigner, ReceiveAuthKey};
use crate::sign::{EntropySource, HTLCDescriptor, OutputSpender, PhantomKeysManager};
@@ -25,20 +23,13 @@ use bitcoin::absolute::LockTime;
use bitcoin::secp256k1::All;
use bitcoin::{secp256k1, ScriptBuf, Transaction, TxOut, Txid};
use lightning_invoice::RawBolt11Invoice;
-#[cfg(taproot)]
-use musig2::types::{PartialSignature, PublicNonce};
use secp256k1::ecdsa::RecoverableSignature;
use secp256k1::{ecdh::SharedSecret, ecdsa::Signature, PublicKey, Scalar, Secp256k1, SecretKey};
use types::payment::PaymentPreimage;
-#[cfg(not(taproot))]
/// A super-trait for all the traits that a dyn signer backing implements
pub trait DynSignerTrait: EcdsaChannelSigner + Send + Sync {}
-#[cfg(taproot)]
-/// A super-trait for all the traits that a dyn signer backing implements
-pub trait DynSignerTrait: EcdsaChannelSigner + TaprootChannelSigner + Send + Sync {}
-
/// Helper to allow DynSigner to clone itself
pub trait InnerSign: DynSignerTrait {
/// Clone into a Box
@@ -60,67 +51,6 @@ impl DynSigner {
}
}
-#[cfg(taproot)]
-#[allow(unused_variables)]
-impl TaprootChannelSigner for DynSigner {
- fn generate_local_nonce_pair(
- &self, commitment_number: u64, secp_ctx: &Secp256k1<All>,
- ) -> PublicNonce {
- todo!()
- }
-
- fn partially_sign_counterparty_commitment(
- &self, counterparty_nonce: PublicNonce, commitment_tx: &CommitmentTransaction,
- inbound_htlc_preimages: Vec<PaymentPreimage>,
- outbound_htlc_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<All>,
- ) -> Result<(crate::ln::msgs::PartialSignatureWithNonce, Vec<secp256k1::schnorr::Signature>), ()>
- {
- todo!();
- }
-
- fn finalize_holder_commitment(
- &self, commitment_tx: &HolderCommitmentTransaction,
- counterparty_partial_signature: crate::ln::msgs::PartialSignatureWithNonce,
- secp_ctx: &Secp256k1<All>,
- ) -> Result<PartialSignature, ()> {
- todo!();
- }
-
- fn sign_justice_revoked_output(
- &self, justice_tx: &Transaction, input: usize, amount: u64, per_commitment_key: &SecretKey,
- secp_ctx: &Secp256k1<All>,
- ) -> Result<secp256k1::schnorr::Signature, ()> {
- todo!();
- }
-
- fn sign_justice_revoked_htlc(
- &self, justice_tx: &Transaction, input: usize, amount: u64, per_commitment_key: &SecretKey,
- htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<All>,
- ) -> Result<secp256k1::schnorr::Signature, ()> {
- todo!();
- }
-
- fn sign_holder_htlc_transaction(
- &self, htlc_tx: &Transaction, input: usize, htlc_descriptor: &HTLCDescriptor,
- secp_ctx: &Secp256k1<All>,
- ) -> Result<secp256k1::schnorr::Signature, ()> {
- todo!();
- }
-
- fn sign_counterparty_htlc_transaction(
- &self, htlc_tx: &Transaction, input: usize, amount: u64, per_commitment_point: &PublicKey,
- htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<All>,
- ) -> Result<secp256k1::schnorr::Signature, ()> {
- todo!();
- }
-
- fn partially_sign_closing_transaction(
- &self, closing_tx: &ClosingTransaction, secp_ctx: &Secp256k1<All>,
- ) -> Result<PartialSignature, ()> {
- todo!();
- }
-}
-
impl Clone for DynSigner {
fn clone(&self) -> Self {
DynSigner { inner: self.inner.box_clone() }
@@ -231,8 +161,6 @@ delegate!(DynKeysInterface, SignerProvider,
fn generate_channel_keys_id(, _inbound: bool, _user_channel_id: u128) -> [u8; 32],
fn derive_channel_signer(, _channel_keys_id: [u8; 32]) -> Self::EcdsaSigner;
type EcdsaSigner = DynSigner,
- #[cfg(taproot)]
- type TaprootSigner = DynSigner
);
delegate!(DynKeysInterface, EntropySource, inner,
@@ -246,25 +174,12 @@ delegate!(DynKeysInterface, OutputSpender, inner,
locktime: Option<LockTime>, secp_ctx: &Secp256k1<All>
) -> Result<Transaction, ()>
);
-#[cfg(not(taproot))]
/// A supertrait for all the traits that a keys interface implements
pub trait DynKeysInterfaceTrait:
NodeSigner + OutputSpender + SignerProvider<EcdsaSigner = DynSigner> + EntropySource + Send + Sync
{
}
-#[cfg(taproot)]
-/// A supertrait for all the traits that a keys interface implements
-pub trait DynKeysInterfaceTrait:
- NodeSigner
- + OutputSpender
- + SignerProvider<EcdsaSigner = DynSigner, TaprootSigner = DynSigner>
- + EntropySource
- + Send
- + Sync
-{
-}
-
/// A dyn wrapper for PhantomKeysManager
pub struct DynPhantomKeysInterface {
inner: Box<PhantomKeysManager>,
@@ -293,8 +208,6 @@ delegate!(DynPhantomKeysInterface, NodeSigner,
impl SignerProvider for DynPhantomKeysInterface {
type EcdsaSigner = DynSigner;
- #[cfg(taproot)]
- type TaprootSigner = DynSigner;
fn get_destination_script(&self, channel_keys_id: [u8; 32]) -> Result<ScriptBuf, ()> {
self.inner.get_destination_script(channel_keys_id)
diff --git a/lightning/src/util/test_channel_signer.rs b/lightning/src/util/test_channel_signer.rs
index 70eb322..b1912bd 100644
--- a/lightning/src/util/test_channel_signer.rs
+++ b/lightning/src/util/test_channel_signer.rs
@@ -36,13 +36,9 @@ use bitcoin::Txid;
#[cfg(taproot)]
use crate::ln::msgs::PartialSignatureWithNonce;
-#[cfg(taproot)]
-use crate::sign::taproot::TaprootChannelSigner;
use crate::sign::HTLCDescriptor;
use crate::util::dyn_signer::DynSigner;
use bitcoin::secp256k1;
-#[cfg(taproot)]
-use bitcoin::secp256k1::All;
use bitcoin::secp256k1::{ecdsa::Signature, Secp256k1};
use bitcoin::secp256k1::{PublicKey, SecretKey};
#[cfg(taproot)]
@@ -520,65 +516,6 @@ impl EcdsaChannelSigner for TestChannelSigner {
}
}
-#[cfg(taproot)]
-#[allow(unused)]
-impl TaprootChannelSigner for TestChannelSigner {
- fn generate_local_nonce_pair(
- &self, commitment_number: u64, secp_ctx: &Secp256k1<All>,
- ) -> PublicNonce {
- todo!()
- }
-
- fn partially_sign_counterparty_commitment(
- &self, counterparty_nonce: PublicNonce, commitment_tx: &CommitmentTransaction,
- inbound_htlc_preimages: Vec<PaymentPreimage>,
- outbound_htlc_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<All>,
- ) -> Result<(PartialSignatureWithNonce, Vec<secp256k1::schnorr::Signature>), ()> {
- todo!()
- }
-
- fn finalize_holder_commitment(
- &self, commitment_tx: &HolderCommitmentTransaction,
- counterparty_partial_signature: PartialSignatureWithNonce, secp_ctx: &Secp256k1<All>,
- ) -> Result<PartialSignature, ()> {
- todo!()
- }
-
- fn sign_justice_revoked_output(
- &self, justice_tx: &Transaction, input: usize, amount: u64, per_commitment_key: &SecretKey,
- secp_ctx: &Secp256k1<All>,
- ) -> Result<secp256k1::schnorr::Signature, ()> {
- todo!()
- }
-
- fn sign_justice_revoked_htlc(
- &self, justice_tx: &Transaction, input: usize, amount: u64, per_commitment_key: &SecretKey,
- htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<All>,
- ) -> Result<secp256k1::schnorr::Signature, ()> {
- todo!()
- }
-
- fn sign_holder_htlc_transaction(
- &self, htlc_tx: &Transaction, input: usize, htlc_descriptor: &HTLCDescriptor,
- secp_ctx: &Secp256k1<All>,
- ) -> Result<secp256k1::schnorr::Signature, ()> {
- todo!()
- }
-
- fn sign_counterparty_htlc_transaction(
- &self, htlc_tx: &Transaction, input: usize, amount: u64, per_commitment_point: &PublicKey,
- htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<All>,
- ) -> Result<secp256k1::schnorr::Signature, ()> {
- todo!()
- }
-
- fn partially_sign_closing_transaction(
- &self, closing_tx: &ClosingTransaction, secp_ctx: &Secp256k1<All>,
- ) -> Result<PartialSignature, ()> {
- todo!()
- }
-}
-
impl TestChannelSigner {
fn verify_counterparty_commitment_tx<'a, T: secp256k1::Signing + secp256k1::Verification>(
&self, channel_parameters: &ChannelTransactionParameters,
diff --git a/lightning/src/util/test_utils.rs b/lightning/src/util/test_utils.rs
index 22be436..47f40ed 100644
--- a/lightning/src/util/test_utils.rs
+++ b/lightning/src/util/test_utils.rs
@@ -457,8 +457,6 @@ impl EntropySource for OnlyReadsKeysInterface {
impl SignerProvider for OnlyReadsKeysInterface {
type EcdsaSigner = TestChannelSigner;
- #[cfg(taproot)]
- type TaprootSigner = TestChannelSigner;
fn generate_channel_keys_id(&self, _inbound: bool, _user_channel_id: u128) -> [u8; 32] {
unreachable!();
@@ -1926,8 +1924,6 @@ impl NodeSigner for TestKeysInterface {
impl SignerProvider for TestKeysInterface {
type EcdsaSigner = TestChannelSigner;
- #[cfg(taproot)]
- type TaprootSigner = TestChannelSigner;
fn generate_channel_keys_id(&self, inbound: bool, user_channel_id: u128) -> [u8; 32] {
let mut override_keys = self.override_next_keys_id.lock().unwrap();
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.