+/**
+ * Base key used in conjunction with a `per_commitment_point` to generate a [`DelayedPaymentKey`].
+ *
+ * The delayed payment key is used to pay the commitment state broadcaster their
+ * non-HTLC-encumbered funds after a delay to give their counterparty a chance to punish if the
+ * state broadcasted was previously revoked.
+ */
+typedef struct MUST_USE_STRUCT LDKDelayedPaymentBasepoint {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeDelayedPaymentBasepoint *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKDelayedPaymentBasepoint;
+
+/**
+ * The contents of CResult_DelayedPaymentBasepointDecodeErrorZ
+ */
+typedef union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKDelayedPaymentBasepoint *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr;
+
+/**
+ * A CResult_DelayedPaymentBasepointDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::DelayedPaymentBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ {
+ /**
+ * The contents of this CResult_DelayedPaymentBasepointDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_DelayedPaymentBasepointDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_DelayedPaymentBasepointDecodeErrorZ;
+
+
+
+/**
+ * A derived key built from a [`DelayedPaymentBasepoint`] and `per_commitment_point`.
+ *
+ * The delayed payment key is used to pay the commitment state broadcaster their
+ * non-HTLC-encumbered funds after a delay. This delay gives their counterparty a chance to
+ * punish and claim all the channel funds if the state broadcasted was previously revoked.
+ *
+ * [See the BOLT specs]
+ * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
+ * for more information on key derivation details.
+ */
+typedef struct MUST_USE_STRUCT LDKDelayedPaymentKey {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeDelayedPaymentKey *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKDelayedPaymentKey;
+
+/**
+ * The contents of CResult_DelayedPaymentKeyDecodeErrorZ
+ */
+typedef union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKDelayedPaymentKey *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_DelayedPaymentKeyDecodeErrorZPtr;
+
+/**
+ * A CResult_DelayedPaymentKeyDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::DelayedPaymentKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_DelayedPaymentKeyDecodeErrorZ {
+ /**
+ * The contents of this CResult_DelayedPaymentKeyDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_DelayedPaymentKeyDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_DelayedPaymentKeyDecodeErrorZ;
+
+
+
+/**
+ * Base key used in conjunction with a `per_commitment_point` to generate an [`HtlcKey`].
+ *
+ * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
+ * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
+ * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
+ */
+typedef struct MUST_USE_STRUCT LDKHtlcBasepoint {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeHtlcBasepoint *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKHtlcBasepoint;
+
+/**
+ * The contents of CResult_HtlcBasepointDecodeErrorZ
+ */
+typedef union LDKCResult_HtlcBasepointDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKHtlcBasepoint *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_HtlcBasepointDecodeErrorZPtr;
+
+/**
+ * A CResult_HtlcBasepointDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::HtlcBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_HtlcBasepointDecodeErrorZ {
+ /**
+ * The contents of this CResult_HtlcBasepointDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_HtlcBasepointDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_HtlcBasepointDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_HtlcBasepointDecodeErrorZ;
+
+
+
+/**
+ * A derived key built from a [`HtlcBasepoint`] and `per_commitment_point`.
+ *
+ * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
+ * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
+ * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
+ *
+ * [See the BOLT specs]
+ * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
+ * for more information on key derivation details.
+ */
+typedef struct MUST_USE_STRUCT LDKHtlcKey {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeHtlcKey *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKHtlcKey;
+
+/**
+ * The contents of CResult_HtlcKeyDecodeErrorZ
+ */
+typedef union LDKCResult_HtlcKeyDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKHtlcKey *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_HtlcKeyDecodeErrorZPtr;
+
+/**
+ * A CResult_HtlcKeyDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::HtlcKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_HtlcKeyDecodeErrorZ {
+ /**
+ * The contents of this CResult_HtlcKeyDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_HtlcKeyDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_HtlcKeyDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_HtlcKeyDecodeErrorZ;
+
+
+
+/**
+ * Master key used in conjunction with per_commitment_point to generate [htlcpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#key-derivation) for the latest state of a channel.
+ * A watcher can be given a [RevocationBasepoint] to generate per commitment [RevocationKey] to create justice transactions.
+ */
+typedef struct MUST_USE_STRUCT LDKRevocationBasepoint {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeRevocationBasepoint *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKRevocationBasepoint;
+
+/**
+ * The contents of CResult_RevocationBasepointDecodeErrorZ
+ */
+typedef union LDKCResult_RevocationBasepointDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKRevocationBasepoint *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_RevocationBasepointDecodeErrorZPtr;
+
+/**
+ * A CResult_RevocationBasepointDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::RevocationBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_RevocationBasepointDecodeErrorZ {
+ /**
+ * The contents of this CResult_RevocationBasepointDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_RevocationBasepointDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_RevocationBasepointDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_RevocationBasepointDecodeErrorZ;
+
+
+
+/**
+ * The revocation key is used to allow a channel party to revoke their state - giving their
+ * counterparty the required material to claim all of their funds if they broadcast that state.
+ *
+ * Each commitment transaction has a revocation key based on the basepoint and
+ * per_commitment_point which is used in both commitment and HTLC transactions.
+ *
+ * See [the BOLT spec for derivation details]
+ * (https://github.com/lightning/bolts/blob/master/03-transactions.md#revocationpubkey-derivation)
+ */
+typedef struct MUST_USE_STRUCT LDKRevocationKey {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeRevocationKey *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKRevocationKey;
+
+/**
+ * The contents of CResult_RevocationKeyDecodeErrorZ
+ */
+typedef union LDKCResult_RevocationKeyDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKRevocationKey *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_RevocationKeyDecodeErrorZPtr;
+
+/**
+ * A CResult_RevocationKeyDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::RevocationKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_RevocationKeyDecodeErrorZ {
+ /**
+ * The contents of this CResult_RevocationKeyDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_RevocationKeyDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_RevocationKeyDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_RevocationKeyDecodeErrorZ;
+
+
+