6 namespace org { namespace ldk { namespace structs {
9 * A trait to sign Lightning channel transactions as described in
10 * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
12 * Signing services could be implemented on a hardware wallet and should implement signing
13 * policies in order to be secure. Please refer to the [VLS Policy
14 * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
15 * for an example of such policies.
17 public class EcdsaChannelSigner : CommonBase {
18 internal readonly bindings.LDKEcdsaChannelSigner bindings_instance;
19 internal EcdsaChannelSigner(object _dummy, long ptr) : base(ptr) { bindings_instance = null; }
20 private EcdsaChannelSigner(bindings.LDKEcdsaChannelSigner arg, bindings.LDKChannelSigner ChannelSigner, ChannelPublicKeys pubkeys) : base(bindings.LDKEcdsaChannelSigner_new(arg, ChannelSigner, pubkeys == null ? 0 : pubkeys.clone_ptr())) {
21 this.ptrs_to.AddLast(arg);
22 this.ptrs_to.AddLast(ChannelSigner);
23 this.bindings_instance = arg;
25 ~EcdsaChannelSigner() {
26 if (ptr != 0) { bindings.EcdsaChannelSigner_free(ptr); }
29 public interface EcdsaChannelSignerInterface {
31 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
33 * Note that if signing fails or is rejected, the channel will be force-closed.
35 * Policy checks should be implemented in this function, including checking the amount
36 * sent to us and checking the HTLCs.
38 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
39 * A validating signer should ensure that an HTLC output is removed only when the matching
40 * preimage is provided, or when the value to holder is restored.
42 * Note that all the relevant preimages will be provided, but there may also be additional
43 * irrelevant or duplicate preimages.
45 Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction _commitment_tx, byte[][] _preimages);
47 * Validate the counterparty's revocation.
49 * This is required in order for the signer to make sure that the state has moved
50 * forward and it is safe to sign the next counterparty commitment.
52 Result_NoneNoneZ validate_counterparty_revocation(long _idx, byte[] _secret);
54 * Creates a signature for a holder's commitment transaction and its claiming HTLC transactions.
57 * - with a non-revoked `commitment_tx`.
58 * - with the latest `commitment_tx` when we initiate a force-close.
59 * - with the previous `commitment_tx`, just to get claiming HTLC
60 * signatures, if we are reacting to a [`ChannelMonitor`]
61 * [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
62 * that decided to broadcast before it had been updated to the latest `commitment_tx`.
64 * This may be called multiple times for the same transaction.
66 * An external signer implementation should check that the commitment has not been revoked.
68 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
70 Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction _commitment_tx);
72 * Create a signature for the given input in a transaction spending an HTLC transaction output
73 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
75 * A justice transaction may claim multiple outputs at the same time if timelocks are
76 * similar, but only a signature for the input at index `input` should be signed for here.
77 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
78 * to an upcoming timelock expiration.
80 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
82 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
83 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
84 * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
87 Result_SignatureNoneZ sign_justice_revoked_output(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key);
89 * Create a signature for the given input in a transaction spending a commitment transaction
90 * HTLC output when our counterparty broadcasts an old state.
92 * A justice transaction may claim multiple outputs at the same time if timelocks are
93 * similar, but only a signature for the input at index `input` should be signed for here.
94 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
95 * to an upcoming timelock expiration.
97 * `amount` is the value of the output spent by this input, committed to in the BIP 143
100 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
101 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
102 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
105 * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
106 * (which is committed to in the BIP 143 signatures).
108 Result_SignatureNoneZ sign_justice_revoked_htlc(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key, HTLCOutputInCommitment _htlc);
110 * Computes the signature for a commitment transaction's HTLC output used as an input within
111 * `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
112 * must be be computed using [`EcdsaSighashType::All`]. Note that this should only be used to
113 * sign HTLC transactions from channels supporting anchor outputs after all additional
114 * inputs/outputs have been added to the transaction.
116 * [`EcdsaSighashType::All`]: bitcoin::blockdata::transaction::EcdsaSighashType::All
118 Result_SignatureNoneZ sign_holder_htlc_transaction(byte[] _htlc_tx, long _input, HTLCDescriptor _htlc_descriptor);
120 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
121 * transaction, either offered or received.
123 * Such a transaction may claim multiples offered outputs at same time if we know the
124 * preimage for each when we create it, but only the input at index `input` should be
125 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
126 * needed with regards to an upcoming timelock expiration.
128 * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
131 * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
133 * `per_commitment_point` is the dynamic point corresponding to the channel state
134 * detected onchain. It has been generated by our counterparty and is used to derive
135 * channel state keys, which are then included in the witness script and committed to in the
138 Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] _htlc_tx, long _input, long _amount, byte[] _per_commitment_point, HTLCOutputInCommitment _htlc);
140 * Create a signature for a (proposed) closing transaction.
142 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
143 * chosen to forgo their output as dust.
145 Result_SignatureNoneZ sign_closing_transaction(ClosingTransaction _closing_tx);
147 * Computes the signature for a commitment transaction's anchor output used as an
148 * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
150 Result_SignatureNoneZ sign_holder_anchor_input(byte[] _anchor_tx, long _input);
152 * Signs a channel announcement message with our funding key proving it comes from one of the
153 * channel participants.
155 * Channel announcements also require a signature from each node's network key. Our node
156 * signature is computed through [`NodeSigner::sign_gossip_message`].
158 * Note that if this fails or is rejected, the channel will not be publicly announced and
159 * our counterparty may (though likely will not) close the channel on us for violating the
162 Result_SignatureNoneZ sign_channel_announcement_with_funding_key(UnsignedChannelAnnouncement _msg);
164 private class LDKEcdsaChannelSignerHolder { internal EcdsaChannelSigner held; }
165 private class LDKEcdsaChannelSignerImpl : bindings.LDKEcdsaChannelSigner {
166 internal LDKEcdsaChannelSignerImpl(EcdsaChannelSignerInterface arg, LDKEcdsaChannelSignerHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; }
167 private EcdsaChannelSignerInterface arg;
168 private LDKEcdsaChannelSignerHolder impl_holder;
169 public long sign_counterparty_commitment(long _commitment_tx, byte[][] _preimages) {
170 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); }
171 Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_counterparty_commitment(_commitment_tx_hu_conv, _preimages);
173 long result = ret == null ? 0 : ret.clone_ptr();
176 public long validate_counterparty_revocation(long _idx, byte[] _secret) {
177 Result_NoneNoneZ ret = arg.validate_counterparty_revocation(_idx, _secret);
179 long result = ret == null ? 0 : ret.clone_ptr();
182 public long sign_holder_commitment_and_htlcs(long _commitment_tx) {
183 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); }
184 Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_holder_commitment_and_htlcs(_commitment_tx_hu_conv);
186 long result = ret == null ? 0 : ret.clone_ptr();
189 public long sign_justice_revoked_output(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key) {
190 Result_SignatureNoneZ ret = arg.sign_justice_revoked_output(_justice_tx, _input, _amount, _per_commitment_key);
192 long result = ret == null ? 0 : ret.clone_ptr();
195 public long sign_justice_revoked_htlc(byte[] _justice_tx, long _input, long _amount, byte[] _per_commitment_key, long _htlc) {
196 org.ldk.structs.HTLCOutputInCommitment _htlc_hu_conv = null; if (_htlc < 0 || _htlc > 4096) { _htlc_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, _htlc); }
197 Result_SignatureNoneZ ret = arg.sign_justice_revoked_htlc(_justice_tx, _input, _amount, _per_commitment_key, _htlc_hu_conv);
199 long result = ret == null ? 0 : ret.clone_ptr();
202 public long sign_holder_htlc_transaction(byte[] _htlc_tx, long _input, long _htlc_descriptor) {
203 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); }
204 Result_SignatureNoneZ ret = arg.sign_holder_htlc_transaction(_htlc_tx, _input, _htlc_descriptor_hu_conv);
206 long result = ret == null ? 0 : ret.clone_ptr();
209 public long sign_counterparty_htlc_transaction(byte[] _htlc_tx, long _input, long _amount, byte[] _per_commitment_point, long _htlc) {
210 org.ldk.structs.HTLCOutputInCommitment _htlc_hu_conv = null; if (_htlc < 0 || _htlc > 4096) { _htlc_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, _htlc); }
211 Result_SignatureNoneZ ret = arg.sign_counterparty_htlc_transaction(_htlc_tx, _input, _amount, _per_commitment_point, _htlc_hu_conv);
213 long result = ret == null ? 0 : ret.clone_ptr();
216 public long sign_closing_transaction(long _closing_tx) {
217 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); }
218 Result_SignatureNoneZ ret = arg.sign_closing_transaction(_closing_tx_hu_conv);
220 long result = ret == null ? 0 : ret.clone_ptr();
223 public long sign_holder_anchor_input(byte[] _anchor_tx, long _input) {
224 Result_SignatureNoneZ ret = arg.sign_holder_anchor_input(_anchor_tx, _input);
226 long result = ret == null ? 0 : ret.clone_ptr();
229 public long sign_channel_announcement_with_funding_key(long _msg) {
230 org.ldk.structs.UnsignedChannelAnnouncement _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(null, _msg); }
231 Result_SignatureNoneZ ret = arg.sign_channel_announcement_with_funding_key(_msg_hu_conv);
233 long result = ret == null ? 0 : ret.clone_ptr();
237 public static EcdsaChannelSigner new_impl(EcdsaChannelSignerInterface arg, ChannelSigner.ChannelSignerInterface ChannelSigner_impl, ChannelPublicKeys pubkeys) {
238 LDKEcdsaChannelSignerHolder impl_holder = new LDKEcdsaChannelSignerHolder();
239 impl_holder.held = new EcdsaChannelSigner(new LDKEcdsaChannelSignerImpl(arg, impl_holder), ChannelSigner.new_impl(ChannelSigner_impl, pubkeys).bindings_instance, pubkeys);
240 return impl_holder.held;
244 * Gets the underlying ChannelSigner.
246 public ChannelSigner get_channel_signer() {
247 ChannelSigner res = new ChannelSigner(null, bindings.LDKEcdsaChannelSigner_get_ChannelSigner(this.ptr));
248 this.ptrs_to.AddLast(res);
253 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
255 * Note that if signing fails or is rejected, the channel will be force-closed.
257 * Policy checks should be implemented in this function, including checking the amount
258 * sent to us and checking the HTLCs.
260 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
261 * A validating signer should ensure that an HTLC output is removed only when the matching
262 * preimage is provided, or when the value to holder is restored.
264 * Note that all the relevant preimages will be provided, but there may also be additional
265 * irrelevant or duplicate preimages.
267 public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(org.ldk.structs.CommitmentTransaction commitment_tx, byte[][] preimages) {
268 long ret = bindings.EcdsaChannelSigner_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr, preimages != null ? InternalUtils.mapArray(preimages, preimages_conv_8 => InternalUtils.check_arr_len(preimages_conv_8, 32)) : null);
270 GC.KeepAlive(commitment_tx);
271 GC.KeepAlive(preimages);
272 if (ret >= 0 && ret <= 4096) { return null; }
273 Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
274 if (this != null) { this.ptrs_to.AddLast(commitment_tx); };
279 * Validate the counterparty's revocation.
281 * This is required in order for the signer to make sure that the state has moved
282 * forward and it is safe to sign the next counterparty commitment.
284 public Result_NoneNoneZ validate_counterparty_revocation(long idx, byte[] secret) {
285 long ret = bindings.EcdsaChannelSigner_validate_counterparty_revocation(this.ptr, idx, InternalUtils.check_arr_len(secret, 32));
288 GC.KeepAlive(secret);
289 if (ret >= 0 && ret <= 4096) { return null; }
290 Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
295 * Creates a signature for a holder's commitment transaction and its claiming HTLC transactions.
297 * This will be called
298 * - with a non-revoked `commitment_tx`.
299 * - with the latest `commitment_tx` when we initiate a force-close.
300 * - with the previous `commitment_tx`, just to get claiming HTLC
301 * signatures, if we are reacting to a [`ChannelMonitor`]
302 * [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
303 * that decided to broadcast before it had been updated to the latest `commitment_tx`.
305 * This may be called multiple times for the same transaction.
307 * An external signer implementation should check that the commitment has not been revoked.
309 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
311 public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(org.ldk.structs.HolderCommitmentTransaction commitment_tx) {
312 long ret = bindings.EcdsaChannelSigner_sign_holder_commitment_and_htlcs(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr);
314 GC.KeepAlive(commitment_tx);
315 if (ret >= 0 && ret <= 4096) { return null; }
316 Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.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_SignatureNoneZ 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, justice_tx, input, amount, 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_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.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_SignatureNoneZ 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, justice_tx, input, amount, 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_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.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`]. Note that this should only be used to
387 * sign HTLC transactions from channels supporting anchor outputs after all additional
388 * inputs/outputs have been added to the transaction.
390 * [`EcdsaSighashType::All`]: bitcoin::blockdata::transaction::EcdsaSighashType::All
392 public Result_SignatureNoneZ sign_holder_htlc_transaction(byte[] htlc_tx, long input, org.ldk.structs.HTLCDescriptor htlc_descriptor) {
393 long ret = bindings.EcdsaChannelSigner_sign_holder_htlc_transaction(this.ptr, htlc_tx, input, htlc_descriptor == null ? 0 : htlc_descriptor.ptr);
395 GC.KeepAlive(htlc_tx);
397 GC.KeepAlive(htlc_descriptor);
398 if (ret >= 0 && ret <= 4096) { return null; }
399 Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
400 if (this != null) { this.ptrs_to.AddLast(htlc_descriptor); };
405 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
406 * transaction, either offered or received.
408 * Such a transaction may claim multiples offered outputs at same time if we know the
409 * preimage for each when we create it, but only the input at index `input` should be
410 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
411 * needed with regards to an upcoming timelock expiration.
413 * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
416 * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
418 * `per_commitment_point` is the dynamic point corresponding to the channel state
419 * detected onchain. It has been generated by our counterparty and is used to derive
420 * channel state keys, which are then included in the witness script and committed to in the
423 public Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, org.ldk.structs.HTLCOutputInCommitment htlc) {
424 long ret = bindings.EcdsaChannelSigner_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, InternalUtils.check_arr_len(per_commitment_point, 33), htlc == null ? 0 : htlc.ptr);
426 GC.KeepAlive(htlc_tx);
428 GC.KeepAlive(amount);
429 GC.KeepAlive(per_commitment_point);
431 if (ret >= 0 && ret <= 4096) { return null; }
432 Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
433 if (this != null) { this.ptrs_to.AddLast(htlc); };
438 * Create a signature for a (proposed) closing transaction.
440 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
441 * chosen to forgo their output as dust.
443 public Result_SignatureNoneZ sign_closing_transaction(org.ldk.structs.ClosingTransaction closing_tx) {
444 long ret = bindings.EcdsaChannelSigner_sign_closing_transaction(this.ptr, closing_tx == null ? 0 : closing_tx.ptr);
446 GC.KeepAlive(closing_tx);
447 if (ret >= 0 && ret <= 4096) { return null; }
448 Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
449 if (this != null) { this.ptrs_to.AddLast(closing_tx); };
454 * Computes the signature for a commitment transaction's anchor output used as an
455 * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
457 public Result_SignatureNoneZ sign_holder_anchor_input(byte[] anchor_tx, long input) {
458 long ret = bindings.EcdsaChannelSigner_sign_holder_anchor_input(this.ptr, anchor_tx, input);
460 GC.KeepAlive(anchor_tx);
462 if (ret >= 0 && ret <= 4096) { return null; }
463 Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
468 * Signs a channel announcement message with our funding key proving it comes from one of the
469 * channel participants.
471 * Channel announcements also require a signature from each node's network key. Our node
472 * signature is computed through [`NodeSigner::sign_gossip_message`].
474 * Note that if this fails or is rejected, the channel will not be publicly announced and
475 * our counterparty may (though likely will not) close the channel on us for violating the
478 public Result_SignatureNoneZ sign_channel_announcement_with_funding_key(org.ldk.structs.UnsignedChannelAnnouncement msg) {
479 long ret = bindings.EcdsaChannelSigner_sign_channel_announcement_with_funding_key(this.ptr, msg == null ? 0 : msg.ptr);
482 if (ret >= 0 && ret <= 4096) { return null; }
483 Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
484 if (this != null) { this.ptrs_to.AddLast(msg); };