Skip to content

Commit 615feef

Browse files
committed
Make sign_holder_htlc_transaction generic over signature type
1 parent aab89b7 commit 615feef

File tree

8 files changed

+109
-131
lines changed

8 files changed

+109
-131
lines changed

lightning/src/chain/onchaintx.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,10 +1227,8 @@ impl<ChannelSigner: EcdsaChannelSigner> OnchainTxHandler<ChannelSigner> {
12271227
preimage: preimage.clone(),
12281228
counterparty_sig: counterparty_htlc_sig.clone(),
12291229
};
1230-
if let Ok(htlc_sig) = self.signer.sign_holder_htlc_transaction(&htlc_tx, 0, &htlc_descriptor, &self.secp_ctx) {
1231-
htlc_tx.input[0].witness = trusted_tx.build_htlc_input_witness(
1232-
htlc_idx, &counterparty_htlc_sig, &htlc_sig, preimage,
1233-
);
1230+
if let Ok(tx) = self.signer.sign_holder_htlc_transaction(&htlc_tx, 0, &htlc_descriptor, &self.secp_ctx) {
1231+
htlc_tx = tx;
12341232
}
12351233
Some(MaybeSignedTransaction(htlc_tx))
12361234
};

lightning/src/events/bump_transaction.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ pub enum BumpTransactionEvent {
189189
/// The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
190190
/// HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
191191
/// through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
192-
/// computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
192+
/// computed with [`ChannelSigner::sign_holder_htlc_transaction`], which can then be
193193
/// provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
194194
/// to spend.
195195
///
@@ -204,7 +204,7 @@ pub enum BumpTransactionEvent {
204204
/// to the HTLC transaction is greater in value than the HTLCs being claimed.
205205
///
206206
/// [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
207-
/// [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_htlc_transaction
207+
/// [`ChannelSigner::sign_holder_htlc_transaction`]: crate::sign::ChannelSigner::sign_holder_htlc_transaction
208208
HTLCResolution {
209209
/// The `channel_id` of the channel which has been closed.
210210
channel_id: ChannelId,
@@ -799,9 +799,7 @@ where
799799
for (idx, htlc_descriptor) in htlc_descriptors.iter().enumerate() {
800800
// Unwrap because we derived the corresponding signers for all htlc descriptors further above
801801
let signer = &signers_and_revokeable_spks.get(&htlc_descriptor.channel_derivation_parameters.keys_id).unwrap().0;
802-
let htlc_sig = signer.sign_holder_htlc_transaction(&htlc_tx, idx, htlc_descriptor, &self.secp)?;
803-
let witness_script = htlc_descriptor.witness_script(&self.secp);
804-
htlc_tx.input[idx].witness = htlc_descriptor.tx_input_witness(&htlc_sig, &witness_script);
802+
htlc_tx = signer.sign_holder_htlc_transaction(&htlc_tx, idx, htlc_descriptor, &self.secp)?;
805803
}
806804

807805
#[cfg(debug_assertions)] {

lightning/src/ln/channel.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10891,7 +10891,7 @@ mod tests {
1089110891
use bitcoin::hash_types::Txid;
1089210892
use bitcoin::hex::DisplayHex;
1089310893
use bitcoin::secp256k1::Message;
10894-
use crate::sign::{ChannelDerivationParameters, HTLCDescriptor, ecdsa::EcdsaChannelSigner};
10894+
use crate::sign::{ChannelDerivationParameters, HTLCDescriptor};
1089510895
use crate::types::payment::PaymentPreimage;
1089610896
use crate::ln::channel::{HTLCOutputInCommitment ,TxCreationKeys};
1089710897
use crate::ln::channel_keys::{DelayedPaymentBasepoint, HtlcBasepoint};
@@ -11047,8 +11047,12 @@ mod tests {
1104711047
assert!(preimage.is_some());
1104811048
}
1104911049

11050+
let num_anchors = if $opt_anchors.supports_anchors_zero_fee_htlc_tx() { 2 } else { 0 };
11051+
assert_eq!(htlc.transaction_output_index, Some($htlc_idx + num_anchors), "output index");
11052+
1105011053
let htlc_counterparty_sig = htlc_counterparty_sig_iter.next().unwrap();
11051-
let htlc_holder_sig = chan.context.holder_signer.as_ecdsa().unwrap().sign_holder_htlc_transaction(&htlc_tx, 0, &HTLCDescriptor {
11054+
11055+
htlc_tx = chan.context.holder_signer.as_ref().sign_holder_htlc_transaction(&htlc_tx, 0, &HTLCDescriptor {
1105211056
channel_derivation_parameters: ChannelDerivationParameters {
1105311057
value_satoshis: chan.context.channel_value_satoshis,
1105411058
keys_id: chan.context.channel_keys_id,
@@ -11062,13 +11066,7 @@ mod tests {
1106211066
preimage: preimage.clone(),
1106311067
counterparty_sig: *htlc_counterparty_sig,
1106411068
}, &secp_ctx).unwrap();
11065-
let num_anchors = if $opt_anchors.supports_anchors_zero_fee_htlc_tx() { 2 } else { 0 };
11066-
assert_eq!(htlc.transaction_output_index, Some($htlc_idx + num_anchors), "output index");
1106711069

11068-
let signature = Signature::from_der(&<Vec<u8>>::from_hex($htlc_sig_hex).unwrap()[..]).unwrap();
11069-
assert_eq!(signature, htlc_holder_sig, "htlc sig");
11070-
let trusted_tx = holder_commitment_tx.trust();
11071-
htlc_tx.input[0].witness = trusted_tx.build_htlc_input_witness($htlc_idx, htlc_counterparty_sig, &htlc_holder_sig, &preimage);
1107211070
log_trace!(logger, "htlc_tx = {}", serialize(&htlc_tx).as_hex());
1107311071
assert_eq!(serialize(&htlc_tx)[..], <Vec<u8>>::from_hex($htlc_tx_hex).unwrap()[..], "htlc tx");
1107411072
})*

lightning/src/ln/monitor_tests.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,9 +2928,7 @@ fn test_anchors_aggregated_revoked_htlc_tx() {
29282928
for (idx, htlc_descriptor) in descriptors.into_iter().enumerate() {
29292929
let htlc_input_idx = idx + 1;
29302930
let signer = htlc_descriptor.derive_channel_signer(&nodes[1].keys_manager);
2931-
let our_sig = signer.sign_holder_htlc_transaction(&htlc_tx, htlc_input_idx, &htlc_descriptor, &secp).unwrap();
2932-
let witness_script = htlc_descriptor.witness_script(&secp);
2933-
htlc_tx.input[htlc_input_idx].witness = htlc_descriptor.tx_input_witness(&our_sig, &witness_script);
2931+
htlc_tx = signer.sign_holder_htlc_transaction(&htlc_tx, htlc_input_idx, &htlc_descriptor, &secp).unwrap();
29342932
}
29352933
let fee_utxo_sig = {
29362934
let witness_script = ScriptBuf::new_p2pkh(&public_key.pubkey_hash());

lightning/src/sign/ecdsa.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -110,27 +110,6 @@ pub trait EcdsaChannelSigner: ChannelSigner {
110110
&self, justice_tx: &Transaction, input: usize, amount: u64, per_commitment_key: &SecretKey,
111111
htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<secp256k1::All>,
112112
) -> Result<Signature, ()>;
113-
/// Computes the signature for a commitment transaction's HTLC output used as an input within
114-
/// `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
115-
/// must be be computed using [`EcdsaSighashType::All`].
116-
///
117-
/// Note that this may be called for HTLCs in the penultimate commitment transaction if a
118-
/// [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
119-
/// broadcasts it before receiving the update for the latest commitment transaction.
120-
///
121-
/// An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
122-
/// signature and should be retried later. Once the signer is ready to provide a signature after
123-
/// previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
124-
/// monitor or [`ChainMonitor::signer_unblocked`] called to attempt unblocking all monitors.
125-
///
126-
/// [`EcdsaSighashType::All`]: bitcoin::sighash::EcdsaSighashType::All
127-
/// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
128-
/// [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
129-
/// [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked
130-
fn sign_holder_htlc_transaction(
131-
&self, htlc_tx: &Transaction, input: usize, htlc_descriptor: &HTLCDescriptor,
132-
secp_ctx: &Secp256k1<secp256k1::All>,
133-
) -> Result<Signature, ()>;
134113
/// Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
135114
/// transaction, either offered or received.
136115
///

lightning/src/sign/mod.rs

Lines changed: 55 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,27 @@ pub trait ChannelSigner {
925925
fn unsafe_sign_holder_commitment(
926926
&self, commitment_tx: &HolderCommitmentTransaction, secp_ctx: &Secp256k1<secp256k1::All>,
927927
) -> Result<Transaction, ()>;
928+
/// Computes the signature for a commitment transaction's HTLC output used as an input within
929+
/// `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
930+
/// must be be computed using [`EcdsaSighashType::All`].
931+
///
932+
/// Note that this may be called for HTLCs in the penultimate commitment transaction if a
933+
/// [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
934+
/// broadcasts it before receiving the update for the latest commitment transaction.
935+
///
936+
/// An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
937+
/// signature and should be retried later. Once the signer is ready to provide a signature after
938+
/// previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
939+
/// monitor or [`ChainMonitor::signer_unblocked`] called to attempt unblocking all monitors.
940+
///
941+
/// [`EcdsaSighashType::All`]: bitcoin::sighash::EcdsaSighashType::All
942+
/// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
943+
/// [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
944+
/// [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked
945+
fn sign_holder_htlc_transaction(
946+
&self, htlc_tx: &Transaction, input: usize, htlc_descriptor: &HTLCDescriptor,
947+
secp_ctx: &Secp256k1<secp256k1::All>,
948+
) -> Result<Transaction, ()>;
928949
}
929950

930951
/// Specifies the recipient of an invoice.
@@ -1713,6 +1734,40 @@ impl ChannelSigner for InMemorySigner {
17131734
);
17141735
Ok(commitment_tx.add_holder_sig(&funding_redeemscript, sig))
17151736
}
1737+
1738+
fn sign_holder_htlc_transaction(
1739+
&self, htlc_tx: &Transaction, input: usize, htlc_descriptor: &HTLCDescriptor,
1740+
secp_ctx: &Secp256k1<secp256k1::All>,
1741+
) -> Result<Transaction, ()> {
1742+
let witness_script = htlc_descriptor.witness_script(secp_ctx);
1743+
let sighash = &sighash::SighashCache::new(&*htlc_tx)
1744+
.p2wsh_signature_hash(
1745+
input,
1746+
&witness_script,
1747+
htlc_descriptor.htlc.to_bitcoin_amount(),
1748+
EcdsaSighashType::All,
1749+
)
1750+
.map_err(|_| ())?;
1751+
let our_htlc_private_key = chan_utils::derive_private_key(
1752+
&secp_ctx,
1753+
&htlc_descriptor.per_commitment_point,
1754+
&self.htlc_base_key,
1755+
);
1756+
let sighash = hash_to_message!(sighash.as_byte_array());
1757+
let sig = sign_with_aux_rand(&secp_ctx, &sighash, &our_htlc_private_key, &self);
1758+
1759+
let features = &self.channel_parameters.as_ref().unwrap().channel_type_features;
1760+
let witness = chan_utils::build_htlc_input_witness(
1761+
&sig,
1762+
&htlc_descriptor.counterparty_sig,
1763+
&htlc_descriptor.preimage,
1764+
&witness_script,
1765+
features,
1766+
);
1767+
let mut signed_tx = htlc_tx.clone();
1768+
signed_tx.input[input].witness = witness;
1769+
Ok(signed_tx)
1770+
}
17161771
}
17171772

17181773
const MISSING_PARAMS_ERR: &'static str =
@@ -1879,28 +1934,6 @@ impl EcdsaChannelSigner for InMemorySigner {
18791934
return Ok(sign_with_aux_rand(secp_ctx, &sighash, &revocation_key, &self));
18801935
}
18811936

1882-
fn sign_holder_htlc_transaction(
1883-
&self, htlc_tx: &Transaction, input: usize, htlc_descriptor: &HTLCDescriptor,
1884-
secp_ctx: &Secp256k1<secp256k1::All>,
1885-
) -> Result<Signature, ()> {
1886-
let witness_script = htlc_descriptor.witness_script(secp_ctx);
1887-
let sighash = &sighash::SighashCache::new(&*htlc_tx)
1888-
.p2wsh_signature_hash(
1889-
input,
1890-
&witness_script,
1891-
htlc_descriptor.htlc.to_bitcoin_amount(),
1892-
EcdsaSighashType::All,
1893-
)
1894-
.map_err(|_| ())?;
1895-
let our_htlc_private_key = chan_utils::derive_private_key(
1896-
&secp_ctx,
1897-
&htlc_descriptor.per_commitment_point,
1898-
&self.htlc_base_key,
1899-
);
1900-
let sighash = hash_to_message!(sighash.as_byte_array());
1901-
Ok(sign_with_aux_rand(&secp_ctx, &sighash, &our_htlc_private_key, &self))
1902-
}
1903-
19041937
fn sign_counterparty_htlc_transaction(
19051938
&self, htlc_tx: &Transaction, input: usize, amount: u64, per_commitment_point: &PublicKey,
19061939
htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<secp256k1::All>,
@@ -2041,13 +2074,6 @@ impl TaprootChannelSigner for InMemorySigner {
20412074
todo!()
20422075
}
20432076

2044-
fn sign_holder_htlc_transaction(
2045-
&self, htlc_tx: &Transaction, input: usize, htlc_descriptor: &HTLCDescriptor,
2046-
secp_ctx: &Secp256k1<All>,
2047-
) -> Result<schnorr::Signature, ()> {
2048-
todo!()
2049-
}
2050-
20512077
fn sign_counterparty_htlc_transaction(
20522078
&self, htlc_tx: &Transaction, input: usize, amount: u64, per_commitment_point: &PublicKey,
20532079
htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<All>,

lightning/src/sign/taproot.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,6 @@ pub trait TaprootChannelSigner: ChannelSigner {
105105
htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<secp256k1::All>,
106106
) -> Result<Signature, ()>;
107107

108-
/// Computes the signature for a commitment transaction's HTLC output used as an input within
109-
/// `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
110-
/// must be be computed using [`TapSighashType::Default`].
111-
///
112-
/// Note that this may be called for HTLCs in the penultimate commitment transaction if a
113-
/// [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
114-
/// broadcasts it before receiving the update for the latest commitment transaction.
115-
///
116-
///
117-
/// [`TapSighashType::Default`]: bitcoin::sighash::TapSighashType::Default
118-
/// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
119-
fn sign_holder_htlc_transaction(
120-
&self, htlc_tx: &Transaction, input: usize, htlc_descriptor: &HTLCDescriptor,
121-
secp_ctx: &Secp256k1<secp256k1::All>,
122-
) -> Result<Signature, ()>;
123-
124108
/// Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
125109
/// transaction, either offered or received.
126110
///

lightning/src/util/test_channel_signer.rs

Lines changed: 42 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,48 @@ impl ChannelSigner for TestChannelSigner {
294294
fn unsafe_sign_holder_commitment(&self, commitment_tx: &HolderCommitmentTransaction, secp_ctx: &Secp256k1<secp256k1::All>) -> Result<Transaction, ()> {
295295
Ok(self.inner.unsafe_sign_holder_commitment(commitment_tx, secp_ctx).unwrap())
296296
}
297+
298+
fn sign_holder_htlc_transaction(
299+
&self, htlc_tx: &Transaction, input: usize, htlc_descriptor: &HTLCDescriptor,
300+
secp_ctx: &Secp256k1<secp256k1::All>
301+
) -> Result<Transaction, ()> {
302+
#[cfg(test)]
303+
if !self.is_signer_available(SignerOp::SignHolderHtlcTransaction) {
304+
return Err(());
305+
}
306+
let state = self.state.lock().unwrap();
307+
if state.last_holder_revoked_commitment - 1 != htlc_descriptor.per_commitment_number &&
308+
state.last_holder_revoked_commitment - 2 != htlc_descriptor.per_commitment_number
309+
{
310+
if !self.disable_revocation_policy_check {
311+
panic!("can only sign the next two unrevoked commitment numbers, revoked={} vs requested={} for {}",
312+
state.last_holder_revoked_commitment, htlc_descriptor.per_commitment_number, self.inner.commitment_seed[0])
313+
}
314+
}
315+
assert_eq!(htlc_tx.input[input], htlc_descriptor.unsigned_tx_input());
316+
let revokeable_spk = self.get_revokeable_spk(true, htlc_descriptor.per_commitment_number, &htlc_descriptor.per_commitment_point, secp_ctx);
317+
assert_eq!(htlc_tx.output[input], htlc_descriptor.tx_output(revokeable_spk));
318+
{
319+
let witness_script = htlc_descriptor.witness_script(secp_ctx);
320+
let sighash_type = if self.channel_type_features().supports_anchors_zero_fee_htlc_tx() {
321+
EcdsaSighashType::SinglePlusAnyoneCanPay
322+
} else {
323+
EcdsaSighashType::All
324+
};
325+
let sighash = &sighash::SighashCache::new(&*htlc_tx).p2wsh_signature_hash(
326+
input, &witness_script, htlc_descriptor.htlc.to_bitcoin_amount(), sighash_type
327+
).unwrap();
328+
let countersignatory_htlc_key = HtlcKey::from_basepoint(
329+
&secp_ctx, &self.inner.counterparty_pubkeys().unwrap().htlc_basepoint, &htlc_descriptor.per_commitment_point,
330+
);
331+
332+
secp_ctx.verify_ecdsa(
333+
&hash_to_message!(sighash.as_byte_array()), &htlc_descriptor.counterparty_sig, &countersignatory_htlc_key.to_public_key()
334+
).unwrap();
335+
}
336+
Ok(self.inner.sign_holder_htlc_transaction(htlc_tx, input, htlc_descriptor, secp_ctx).unwrap())
337+
}
338+
297339
}
298340

299341
impl EcdsaChannelSigner for TestChannelSigner {
@@ -336,47 +378,6 @@ impl EcdsaChannelSigner for TestChannelSigner {
336378
Ok(EcdsaChannelSigner::sign_justice_revoked_htlc(&self.inner, justice_tx, input, amount, per_commitment_key, htlc, secp_ctx).unwrap())
337379
}
338380

339-
fn sign_holder_htlc_transaction(
340-
&self, htlc_tx: &Transaction, input: usize, htlc_descriptor: &HTLCDescriptor,
341-
secp_ctx: &Secp256k1<secp256k1::All>
342-
) -> Result<Signature, ()> {
343-
#[cfg(test)]
344-
if !self.is_signer_available(SignerOp::SignHolderHtlcTransaction) {
345-
return Err(());
346-
}
347-
let state = self.state.lock().unwrap();
348-
if state.last_holder_revoked_commitment - 1 != htlc_descriptor.per_commitment_number &&
349-
state.last_holder_revoked_commitment - 2 != htlc_descriptor.per_commitment_number
350-
{
351-
if !self.disable_revocation_policy_check {
352-
panic!("can only sign the next two unrevoked commitment numbers, revoked={} vs requested={} for {}",
353-
state.last_holder_revoked_commitment, htlc_descriptor.per_commitment_number, self.inner.commitment_seed[0])
354-
}
355-
}
356-
assert_eq!(htlc_tx.input[input], htlc_descriptor.unsigned_tx_input());
357-
let revokeable_spk = self.get_revokeable_spk(true, htlc_descriptor.per_commitment_number, &htlc_descriptor.per_commitment_point, secp_ctx);
358-
assert_eq!(htlc_tx.output[input], htlc_descriptor.tx_output(revokeable_spk));
359-
{
360-
let witness_script = htlc_descriptor.witness_script(secp_ctx);
361-
let sighash_type = if self.channel_type_features().supports_anchors_zero_fee_htlc_tx() {
362-
EcdsaSighashType::SinglePlusAnyoneCanPay
363-
} else {
364-
EcdsaSighashType::All
365-
};
366-
let sighash = &sighash::SighashCache::new(&*htlc_tx).p2wsh_signature_hash(
367-
input, &witness_script, htlc_descriptor.htlc.to_bitcoin_amount(), sighash_type
368-
).unwrap();
369-
let countersignatory_htlc_key = HtlcKey::from_basepoint(
370-
&secp_ctx, &self.inner.counterparty_pubkeys().unwrap().htlc_basepoint, &htlc_descriptor.per_commitment_point,
371-
);
372-
373-
secp_ctx.verify_ecdsa(
374-
&hash_to_message!(sighash.as_byte_array()), &htlc_descriptor.counterparty_sig, &countersignatory_htlc_key.to_public_key()
375-
).unwrap();
376-
}
377-
Ok(EcdsaChannelSigner::sign_holder_htlc_transaction(&self.inner, htlc_tx, input, htlc_descriptor, secp_ctx).unwrap())
378-
}
379-
380381
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, ()> {
381382
#[cfg(test)]
382383
if !self.is_signer_available(SignerOp::SignCounterpartyHtlcTransaction) {
@@ -446,10 +447,6 @@ impl TaprootChannelSigner for TestChannelSigner {
446447
todo!()
447448
}
448449

449-
fn sign_holder_htlc_transaction(&self, htlc_tx: &Transaction, input: usize, htlc_descriptor: &HTLCDescriptor, secp_ctx: &Secp256k1<All>) -> Result<secp256k1::schnorr::Signature, ()> {
450-
todo!()
451-
}
452-
453450
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, ()> {
454451
todo!()
455452
}

0 commit comments

Comments
 (0)