Package org.ldk.structs
Class TrustedCommitmentTransaction
- java.lang.Object
-
- org.ldk.structs.TrustedCommitmentTransaction
-
public class TrustedCommitmentTransaction extends Object
A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin transaction and the transaction creation keys) are trusted. See trust() and verify() functions on CommitmentTransaction. This structure implements Deref.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Result_TransactionNoneZbuild_to_local_justice_tx(long feerate_per_kw, byte[] destination_script)Helper method to build an unsigned justice transaction spending the revokeable `to_local` output to a destination script.BuiltCommitmentTransactionbuilt_transaction()The pre-built Bitcoin commitment transactionChannelTypeFeatureschannel_type_features()Should anchors be used.protected voidfinalize()Result_CVec_ECDSASignatureZNoneZget_htlc_sigs(byte[] htlc_base_key, DirectedChannelTransactionParameters channel_parameters, EntropySource entropy_source)Get a signature for each HTLC which was included in the commitment transaction (ie for which HTLCOutputInCommitment::transaction_output_index.is_some()).TxCreationKeyskeys()The pre-calculated transaction creation public keys.Option_usizeZrevokeable_output_index()Returns the index of the revokeable output, i.e.byte[]txid()The transaction ID of the built Bitcoin transaction
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
txid
public byte[] txid()
The transaction ID of the built Bitcoin transaction
-
built_transaction
public BuiltCommitmentTransaction built_transaction()
The pre-built Bitcoin commitment transaction
-
keys
public TxCreationKeys keys()
The pre-calculated transaction creation public keys.
-
channel_type_features
public ChannelTypeFeatures channel_type_features()
Should anchors be used.
-
get_htlc_sigs
public Result_CVec_ECDSASignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, DirectedChannelTransactionParameters channel_parameters, EntropySource entropy_source)
Get a signature for each HTLC which was included in the commitment transaction (ie for which HTLCOutputInCommitment::transaction_output_index.is_some()). The returned Vec has one entry for each HTLC, and in the same order. This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
-
revokeable_output_index
public Option_usizeZ revokeable_output_index()
Returns the index of the revokeable output, i.e. the `to_local` output sending funds to the broadcaster, in the built transaction, if any exists. There are two cases where this may return `None`: - The balance of the revokeable output is below the dust limit (only found on commitments early in the channel's lifetime, i.e. before the channel reserve is met). - This commitment was created before LDK 0.0.117. In this case, the commitment transaction previously didn't contain enough information to locate the revokeable output.
-
build_to_local_justice_tx
public Result_TransactionNoneZ build_to_local_justice_tx(long feerate_per_kw, byte[] destination_script)
Helper method to build an unsigned justice transaction spending the revokeable `to_local` output to a destination script. Fee estimation accounts for the expected revocation witness data that will be added when signed. This method will error if the given fee rate results in a fee greater than the value of the output being spent, or if there exists no revokeable `to_local` output on this commitment transaction. See [`Self::revokeable_output_index`] for more details. The built transaction will allow fee bumping with RBF, and this method takes `feerate_per_kw` as an input such that multiple copies of a justice transaction at different fee rates may be built.
-
-