7 namespace org { namespace ldk { namespace structs {
11 /** An implementation of EcdsaChannelSigner */
12 public interface EcdsaChannelSignerInterface {
13 /**Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
15 * Note that if signing fails or is rejected, the channel will be force-closed.
17 * Policy checks should be implemented in this function, including checking the amount
18 * sent to us and checking the HTLCs.
20 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
21 * A validating signer should ensure that an HTLC output is removed only when the matching
22 * preimage is provided, or when the value to holder is restored.
24 * Note that all the relevant preimages will be provided, but there may also be additional
25 * irrelevant or duplicate preimages.
27 Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx, byte[][] preimages);
28 /**Validate the counterparty's revocation.
30 * This is required in order for the signer to make sure that the state has moved
31 * forward and it is safe to sign the next counterparty commitment.
33 Result_NoneNoneZ validate_counterparty_revocation(long idx, byte[] secret);
34 /**Creates a signature for a holder's commitment transaction.
37 * - with a non-revoked `commitment_tx`.
38 * - with the latest `commitment_tx` when we initiate a force-close.
40 * This may be called multiple times for the same transaction.
42 * An external signer implementation should check that the commitment has not been revoked.
44 Result_ECDSASignatureNoneZ sign_holder_commitment(HolderCommitmentTransaction commitment_tx);
45 /**Create a signature for the given input in a transaction spending an HTLC transaction output
46 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
48 * A justice transaction may claim multiple outputs at the same time if timelocks are
49 * similar, but only a signature for the input at index `input` should be signed for here.
50 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
51 * to an upcoming timelock expiration.
53 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
55 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
56 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
57 * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
60 Result_ECDSASignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key);
61 /**Create a signature for the given input in a transaction spending a commitment transaction
62 * HTLC output when our counterparty broadcasts an old state.
64 * A justice transaction may claim multiple outputs at the same time if timelocks are
65 * similar, but only a signature for the input at index `input` should be signed for here.
66 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
67 * to an upcoming timelock expiration.
69 * `amount` is the value of the output spent by this input, committed to in the BIP 143
72 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
73 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
74 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
77 * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
78 * (which is committed to in the BIP 143 signatures).
80 Result_ECDSASignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc);
81 /**Computes the signature for a commitment transaction's HTLC output used as an input within
82 * `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
83 * must be be computed using [`EcdsaSighashType::All`].
85 * Note that this may be called for HTLCs in the penultimate commitment transaction if a
86 * [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
87 * broadcasts it before receiving the update for the latest commitment transaction.
89 * [`EcdsaSighashType::All`]: bitcoin::blockdata::transaction::EcdsaSighashType::All
90 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
92 Result_ECDSASignatureNoneZ sign_holder_htlc_transaction(byte[] htlc_tx, long input, HTLCDescriptor htlc_descriptor);
93 /**Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
94 * transaction, either offered or received.
96 * Such a transaction may claim multiples offered outputs at same time if we know the
97 * preimage for each when we create it, but only the input at index `input` should be
98 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
99 * needed with regards to an upcoming timelock expiration.
101 * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
104 * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
106 * `per_commitment_point` is the dynamic point corresponding to the channel state
107 * detected onchain. It has been generated by our counterparty and is used to derive
108 * channel state keys, which are then included in the witness script and committed to in the
111 Result_ECDSASignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc);
112 /**Create a signature for a (proposed) closing transaction.
114 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
115 * chosen to forgo their output as dust.
117 Result_ECDSASignatureNoneZ sign_closing_transaction(ClosingTransaction closing_tx);
118 /**Computes the signature for a commitment transaction's anchor output used as an
119 * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
121 Result_ECDSASignatureNoneZ sign_holder_anchor_input(byte[] anchor_tx, long input);
122 /**Signs a channel announcement message with our funding key proving it comes from one of the
123 * channel participants.
125 * Channel announcements also require a signature from each node's network key. Our node
126 * signature is computed through [`NodeSigner::sign_gossip_message`].
128 * Note that if this fails or is rejected, the channel will not be publicly announced and
129 * our counterparty may (though likely will not) close the channel on us for violating the
132 Result_ECDSASignatureNoneZ sign_channel_announcement_with_funding_key(UnsignedChannelAnnouncement msg);
136 * A trait to sign Lightning channel transactions as described in
137 * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
139 * Signing services could be implemented on a hardware wallet and should implement signing
140 * policies in order to be secure. Please refer to the [VLS Policy
141 * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
142 * for an example of such policies.
144 public class EcdsaChannelSigner : CommonBase {
145 internal bindings.LDKEcdsaChannelSigner bindings_instance;
146 internal long instance_idx;
148 internal EcdsaChannelSigner(object _dummy, long ptr) : base(ptr) { bindings_instance = null; }
149 ~EcdsaChannelSigner() {
150 if (ptr != 0) { bindings.EcdsaChannelSigner_free(ptr); }
153 private class LDKEcdsaChannelSignerHolder { internal EcdsaChannelSigner held; }
154 private class LDKEcdsaChannelSignerImpl : bindings.LDKEcdsaChannelSigner {
155 internal LDKEcdsaChannelSignerImpl(EcdsaChannelSignerInterface arg, LDKEcdsaChannelSignerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; }
156 private EcdsaChannelSignerInterface arg;
157 private LDKEcdsaChannelSignerHolder impl_holder;
158 public long sign_counterparty_commitment(long _commitment_tx, long _preimages) {
159 org.ldk.structs.CommitmentTransaction _commitment_tx_hu_conv = null; if (_commitment_tx < 0 || _commitment_tx > 4096) { _commitment_tx_hu_conv = new org.ldk.structs.CommitmentTransaction(null, _commitment_tx); }
160 int _preimages_conv_8_len = InternalUtils.getArrayLength(_preimages);
161 byte[][] _preimages_conv_8_arr = new byte[_preimages_conv_8_len][];
162 for (int i = 0; i < _preimages_conv_8_len; i++) {
163 long _preimages_conv_8 = InternalUtils.getU64ArrayElem(_preimages, i);
164 byte[] _preimages_conv_8_conv = InternalUtils.decodeUint8Array(_preimages_conv_8);
165 _preimages_conv_8_arr[i] = _preimages_conv_8_conv;
167 bindings.free_buffer(_preimages);
168 Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ ret = arg.sign_counterparty_commitment(_commitment_tx_hu_conv, _preimages_conv_8_arr);
170 long result = ret == null ? 0 : ret.clone_ptr();
173 public long validate_counterparty_revocation(long _idx, long _secret) {
174 byte[] _secret_conv = InternalUtils.decodeUint8Array(_secret);
175 Result_NoneNoneZ ret = arg.validate_counterparty_revocation(_idx, _secret_conv);
177 long result = ret == null ? 0 : ret.clone_ptr();
180 public long sign_holder_commitment(long _commitment_tx) {
181 org.ldk.structs.HolderCommitmentTransaction _commitment_tx_hu_conv = null; if (_commitment_tx < 0 || _commitment_tx > 4096) { _commitment_tx_hu_conv = new org.ldk.structs.HolderCommitmentTransaction(null, _commitment_tx); }
182 Result_ECDSASignatureNoneZ ret = arg.sign_holder_commitment(_commitment_tx_hu_conv);
184 long result = ret == null ? 0 : ret.clone_ptr();
187 public long sign_justice_revoked_output(long _justice_tx, long _input, long _amount, long _per_commitment_key) {
188 byte[] _justice_tx_conv = InternalUtils.decodeUint8Array(_justice_tx);
189 byte[] _per_commitment_key_conv = InternalUtils.decodeUint8Array(_per_commitment_key);
190 Result_ECDSASignatureNoneZ ret = arg.sign_justice_revoked_output(_justice_tx_conv, _input, _amount, _per_commitment_key_conv);
192 long result = ret == null ? 0 : ret.clone_ptr();
195 public long sign_justice_revoked_htlc(long _justice_tx, long _input, long _amount, long _per_commitment_key, long _htlc) {
196 byte[] _justice_tx_conv = InternalUtils.decodeUint8Array(_justice_tx);
197 byte[] _per_commitment_key_conv = InternalUtils.decodeUint8Array(_per_commitment_key);
198 org.ldk.structs.HTLCOutputInCommitment _htlc_hu_conv = null; if (_htlc < 0 || _htlc > 4096) { _htlc_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, _htlc); }
199 Result_ECDSASignatureNoneZ ret = arg.sign_justice_revoked_htlc(_justice_tx_conv, _input, _amount, _per_commitment_key_conv, _htlc_hu_conv);
201 long result = ret == null ? 0 : ret.clone_ptr();
204 public long sign_holder_htlc_transaction(long _htlc_tx, long _input, long _htlc_descriptor) {
205 byte[] _htlc_tx_conv = InternalUtils.decodeUint8Array(_htlc_tx);
206 org.ldk.structs.HTLCDescriptor _htlc_descriptor_hu_conv = null; if (_htlc_descriptor < 0 || _htlc_descriptor > 4096) { _htlc_descriptor_hu_conv = new org.ldk.structs.HTLCDescriptor(null, _htlc_descriptor); }
207 Result_ECDSASignatureNoneZ ret = arg.sign_holder_htlc_transaction(_htlc_tx_conv, _input, _htlc_descriptor_hu_conv);
209 long result = ret == null ? 0 : ret.clone_ptr();
212 public long sign_counterparty_htlc_transaction(long _htlc_tx, long _input, long _amount, long _per_commitment_point, long _htlc) {
213 byte[] _htlc_tx_conv = InternalUtils.decodeUint8Array(_htlc_tx);
214 byte[] _per_commitment_point_conv = InternalUtils.decodeUint8Array(_per_commitment_point);
215 org.ldk.structs.HTLCOutputInCommitment _htlc_hu_conv = null; if (_htlc < 0 || _htlc > 4096) { _htlc_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, _htlc); }
216 Result_ECDSASignatureNoneZ ret = arg.sign_counterparty_htlc_transaction(_htlc_tx_conv, _input, _amount, _per_commitment_point_conv, _htlc_hu_conv);
218 long result = ret == null ? 0 : ret.clone_ptr();
221 public long sign_closing_transaction(long _closing_tx) {
222 org.ldk.structs.ClosingTransaction _closing_tx_hu_conv = null; if (_closing_tx < 0 || _closing_tx > 4096) { _closing_tx_hu_conv = new org.ldk.structs.ClosingTransaction(null, _closing_tx); }
223 Result_ECDSASignatureNoneZ ret = arg.sign_closing_transaction(_closing_tx_hu_conv);
225 long result = ret == null ? 0 : ret.clone_ptr();
228 public long sign_holder_anchor_input(long _anchor_tx, long _input) {
229 byte[] _anchor_tx_conv = InternalUtils.decodeUint8Array(_anchor_tx);
230 Result_ECDSASignatureNoneZ ret = arg.sign_holder_anchor_input(_anchor_tx_conv, _input);
232 long result = ret == null ? 0 : ret.clone_ptr();
235 public long sign_channel_announcement_with_funding_key(long _msg) {
236 org.ldk.structs.UnsignedChannelAnnouncement _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(null, _msg); }
237 Result_ECDSASignatureNoneZ ret = arg.sign_channel_announcement_with_funding_key(_msg_hu_conv);
239 long result = ret == null ? 0 : ret.clone_ptr();
244 /** Creates a new instance of EcdsaChannelSigner from a given implementation */
245 public static EcdsaChannelSigner new_impl(EcdsaChannelSignerInterface arg, ChannelSignerInterface channelSigner_impl, ChannelPublicKeys pubkeys) {
246 LDKEcdsaChannelSignerHolder impl_holder = new LDKEcdsaChannelSignerHolder();
247 LDKEcdsaChannelSignerImpl impl = new LDKEcdsaChannelSignerImpl(arg, impl_holder);
248 ChannelSigner channelSigner = ChannelSigner.new_impl(channelSigner_impl, pubkeys);
249 long[] ptr_idx = bindings.LDKEcdsaChannelSigner_new(impl, channelSigner.instance_idx, pubkeys == null ? 0 : pubkeys.clone_ptr());
251 impl_holder.held = new EcdsaChannelSigner(null, ptr_idx[0]);
252 impl_holder.held.instance_idx = ptr_idx[1];
253 impl_holder.held.bindings_instance = impl;
254 impl_holder.held.ptrs_to.AddLast(channelSigner);
255 return impl_holder.held;
259 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
261 * Note that if signing fails or is rejected, the channel will be force-closed.
263 * Policy checks should be implemented in this function, including checking the amount
264 * sent to us and checking the HTLCs.
266 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
267 * A validating signer should ensure that an HTLC output is removed only when the matching
268 * preimage is provided, or when the value to holder is restored.
270 * Note that all the relevant preimages will be provided, but there may also be additional
271 * irrelevant or duplicate preimages.
273 public Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ sign_counterparty_commitment(org.ldk.structs.CommitmentTransaction commitment_tx, byte[][] preimages) {
274 long ret = bindings.EcdsaChannelSigner_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(preimages, preimages_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(preimages_conv_8, 32)))));
276 GC.KeepAlive(commitment_tx);
277 GC.KeepAlive(preimages);
278 if (ret >= 0 && ret <= 4096) { return null; }
279 Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ ret_hu_conv = Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.constr_from_ptr(ret);
280 if (this != null) { this.ptrs_to.AddLast(commitment_tx); };
285 * Validate the counterparty's revocation.
287 * This is required in order for the signer to make sure that the state has moved
288 * forward and it is safe to sign the next counterparty commitment.
290 public Result_NoneNoneZ validate_counterparty_revocation(long idx, byte[] secret) {
291 long ret = bindings.EcdsaChannelSigner_validate_counterparty_revocation(this.ptr, idx, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(secret, 32)));
294 GC.KeepAlive(secret);
295 if (ret >= 0 && ret <= 4096) { return null; }
296 Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
301 * Creates a signature for a holder's commitment transaction.
303 * This will be called
304 * - with a non-revoked `commitment_tx`.
305 * - with the latest `commitment_tx` when we initiate a force-close.
307 * This may be called multiple times for the same transaction.
309 * An external signer implementation should check that the commitment has not been revoked.
311 public Result_ECDSASignatureNoneZ sign_holder_commitment(org.ldk.structs.HolderCommitmentTransaction commitment_tx) {
312 long ret = bindings.EcdsaChannelSigner_sign_holder_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr);
314 GC.KeepAlive(commitment_tx);
315 if (ret >= 0 && ret <= 4096) { return null; }
316 Result_ECDSASignatureNoneZ ret_hu_conv = Result_ECDSASignatureNoneZ.constr_from_ptr(ret);
317 if (this != null) { this.ptrs_to.AddLast(commitment_tx); };
322 * Create a signature for the given input in a transaction spending an HTLC transaction output
323 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
325 * A justice transaction may claim multiple outputs at the same time if timelocks are
326 * similar, but only a signature for the input at index `input` should be signed for here.
327 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
328 * to an upcoming timelock expiration.
330 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
332 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
333 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
334 * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
337 public Result_ECDSASignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key) {
338 long ret = bindings.EcdsaChannelSigner_sign_justice_revoked_output(this.ptr, InternalUtils.encodeUint8Array(justice_tx), input, amount, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_key, 32)));
340 GC.KeepAlive(justice_tx);
342 GC.KeepAlive(amount);
343 GC.KeepAlive(per_commitment_key);
344 if (ret >= 0 && ret <= 4096) { return null; }
345 Result_ECDSASignatureNoneZ ret_hu_conv = Result_ECDSASignatureNoneZ.constr_from_ptr(ret);
350 * Create a signature for the given input in a transaction spending a commitment transaction
351 * HTLC output when our counterparty broadcasts an old state.
353 * A justice transaction may claim multiple outputs at the same time if timelocks are
354 * similar, but only a signature for the input at index `input` should be signed for here.
355 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
356 * to an upcoming timelock expiration.
358 * `amount` is the value of the output spent by this input, committed to in the BIP 143
361 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
362 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
363 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
366 * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
367 * (which is committed to in the BIP 143 signatures).
369 public Result_ECDSASignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, org.ldk.structs.HTLCOutputInCommitment htlc) {
370 long ret = bindings.EcdsaChannelSigner_sign_justice_revoked_htlc(this.ptr, InternalUtils.encodeUint8Array(justice_tx), input, amount, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_key, 32)), htlc == null ? 0 : htlc.ptr);
372 GC.KeepAlive(justice_tx);
374 GC.KeepAlive(amount);
375 GC.KeepAlive(per_commitment_key);
377 if (ret >= 0 && ret <= 4096) { return null; }
378 Result_ECDSASignatureNoneZ ret_hu_conv = Result_ECDSASignatureNoneZ.constr_from_ptr(ret);
379 if (this != null) { this.ptrs_to.AddLast(htlc); };
384 * Computes the signature for a commitment transaction's HTLC output used as an input within
385 * `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
386 * must be be computed using [`EcdsaSighashType::All`].
388 * Note that this may be called for HTLCs in the penultimate commitment transaction if a
389 * [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
390 * broadcasts it before receiving the update for the latest commitment transaction.
392 * [`EcdsaSighashType::All`]: bitcoin::blockdata::transaction::EcdsaSighashType::All
393 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
395 public Result_ECDSASignatureNoneZ sign_holder_htlc_transaction(byte[] htlc_tx, long input, org.ldk.structs.HTLCDescriptor htlc_descriptor) {
396 long ret = bindings.EcdsaChannelSigner_sign_holder_htlc_transaction(this.ptr, InternalUtils.encodeUint8Array(htlc_tx), input, htlc_descriptor == null ? 0 : htlc_descriptor.ptr);
398 GC.KeepAlive(htlc_tx);
400 GC.KeepAlive(htlc_descriptor);
401 if (ret >= 0 && ret <= 4096) { return null; }
402 Result_ECDSASignatureNoneZ ret_hu_conv = Result_ECDSASignatureNoneZ.constr_from_ptr(ret);
403 if (this != null) { this.ptrs_to.AddLast(htlc_descriptor); };
408 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
409 * transaction, either offered or received.
411 * Such a transaction may claim multiples offered outputs at same time if we know the
412 * preimage for each when we create it, but only the input at index `input` should be
413 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
414 * needed with regards to an upcoming timelock expiration.
416 * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
419 * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
421 * `per_commitment_point` is the dynamic point corresponding to the channel state
422 * detected onchain. It has been generated by our counterparty and is used to derive
423 * channel state keys, which are then included in the witness script and committed to in the
426 public Result_ECDSASignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, org.ldk.structs.HTLCOutputInCommitment htlc) {
427 long ret = bindings.EcdsaChannelSigner_sign_counterparty_htlc_transaction(this.ptr, InternalUtils.encodeUint8Array(htlc_tx), input, amount, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33)), htlc == null ? 0 : htlc.ptr);
429 GC.KeepAlive(htlc_tx);
431 GC.KeepAlive(amount);
432 GC.KeepAlive(per_commitment_point);
434 if (ret >= 0 && ret <= 4096) { return null; }
435 Result_ECDSASignatureNoneZ ret_hu_conv = Result_ECDSASignatureNoneZ.constr_from_ptr(ret);
436 if (this != null) { this.ptrs_to.AddLast(htlc); };
441 * Create a signature for a (proposed) closing transaction.
443 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
444 * chosen to forgo their output as dust.
446 public Result_ECDSASignatureNoneZ sign_closing_transaction(org.ldk.structs.ClosingTransaction closing_tx) {
447 long ret = bindings.EcdsaChannelSigner_sign_closing_transaction(this.ptr, closing_tx == null ? 0 : closing_tx.ptr);
449 GC.KeepAlive(closing_tx);
450 if (ret >= 0 && ret <= 4096) { return null; }
451 Result_ECDSASignatureNoneZ ret_hu_conv = Result_ECDSASignatureNoneZ.constr_from_ptr(ret);
452 if (this != null) { this.ptrs_to.AddLast(closing_tx); };
457 * Computes the signature for a commitment transaction's anchor output used as an
458 * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
460 public Result_ECDSASignatureNoneZ sign_holder_anchor_input(byte[] anchor_tx, long input) {
461 long ret = bindings.EcdsaChannelSigner_sign_holder_anchor_input(this.ptr, InternalUtils.encodeUint8Array(anchor_tx), input);
463 GC.KeepAlive(anchor_tx);
465 if (ret >= 0 && ret <= 4096) { return null; }
466 Result_ECDSASignatureNoneZ ret_hu_conv = Result_ECDSASignatureNoneZ.constr_from_ptr(ret);
471 * Signs a channel announcement message with our funding key proving it comes from one of the
472 * channel participants.
474 * Channel announcements also require a signature from each node's network key. Our node
475 * signature is computed through [`NodeSigner::sign_gossip_message`].
477 * Note that if this fails or is rejected, the channel will not be publicly announced and
478 * our counterparty may (though likely will not) close the channel on us for violating the
481 public Result_ECDSASignatureNoneZ sign_channel_announcement_with_funding_key(org.ldk.structs.UnsignedChannelAnnouncement msg) {
482 long ret = bindings.EcdsaChannelSigner_sign_channel_announcement_with_funding_key(this.ptr, msg == null ? 0 : msg.ptr);
485 if (ret >= 0 && ret <= 4096) { return null; }
486 Result_ECDSASignatureNoneZ ret_hu_conv = Result_ECDSASignatureNoneZ.constr_from_ptr(ret);
487 if (this != null) { this.ptrs_to.AddLast(msg); };