X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fsign%2Ftaproot.rs;h=230383f4f7d6496bcb1b7d40829b086ea6d39d05;hb=38b78eccb5e579558369f6e152647588acd11b38;hp=0028a0cd12bb4e111aa04da29aa6d36788b3a404;hpb=2659a2375eb819fe050f057b068c3e27f98a30f7;p=rust-lightning diff --git a/lightning/src/sign/taproot.rs b/lightning/src/sign/taproot.rs index 0028a0cd..230383f4 100644 --- a/lightning/src/sign/taproot.rs +++ b/lightning/src/sign/taproot.rs @@ -27,17 +27,19 @@ pub trait TaprootChannelSigner: ChannelSigner { /// Policy checks should be implemented in this function, including checking the amount /// sent to us and checking the HTLCs. /// - /// The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided. - /// A validating signer should ensure that an HTLC output is removed only when the matching - /// preimage is provided, or when the value to holder is restored. + /// 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, preimages: Vec, - secp_ctx: &Secp256k1, + commitment_tx: &CommitmentTransaction, + inbound_htlc_preimages: Vec, + outbound_htlc_preimages: Vec, secp_ctx: &Secp256k1, ) -> Result<(PartialSignatureWithNonce, Vec), ()>; /// Creates a signature for a holder's commitment transaction. @@ -51,8 +53,7 @@ pub trait TaprootChannelSigner: ChannelSigner { /// 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_number: u64, - commitment_tx: &HolderCommitmentTransaction, + fn finalize_holder_commitment(&self, commitment_tx: &HolderCommitmentTransaction, counterparty_partial_signature: PartialSignatureWithNonce, secp_ctx: &Secp256k1 ) -> Result;