Package org.ldk.structs
Class InMemorySigner
- java.lang.Object
-
- org.ldk.structs.InMemorySigner
-
public class InMemorySigner extends Object
A simple implementation of Sign that just keeps the private keys in memory. This implementation performs no policy checks and is insufficient by itself as a secure external signer.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BaseSign
as_BaseSign()
Constructs a new BaseSign which calls the relevant methods on this_arg.Sign
as_Sign()
Constructs a new Sign which calls the relevant methods on this_arg.InMemorySigner
clone()
Creates a copy of the InMemorySignerChannelPublicKeys
counterparty_pubkeys()
Counterparty pubkeys.short
counterparty_selected_contest_delay()
The contest_delay value specified by our counterparty and applied on holder-broadcastable transactions, ie the amount of time that we have to wait to recover our funds if we broadcast a transaction.protected void
finalize()
OutPoint
funding_outpoint()
Funding outpoint Will panic if ready_channel wasn't called.ChannelTransactionParameters
get_channel_parameters()
Obtain a ChannelTransactionParameters for this channel, to be used when verifying or building transactions.byte[]
get_commitment_seed()
Commitment seedbyte[]
get_delayed_payment_base_key()
Holder secret key used in HTLC txbyte[]
get_funding_key()
Private key of anchor txbyte[]
get_htlc_base_key()
Holder htlc secret key used in commitment tx htlc outputsbyte[]
get_payment_key()
Holder secret key used for our balance in counterparty-broadcasted commitment transactionsbyte[]
get_revocation_base_key()
Holder secret key for blinded revocation pubkeyshort
holder_selected_contest_delay()
The contest_delay value specified by us and applied on transactions broadcastable by our counterparty, ie the amount of time that they have to wait to recover their funds if they broadcast a transaction.boolean
is_outbound()
Whether the holder is the initiator Will panic if ready_channel wasn't called.static InMemorySigner
of(byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, byte[] channel_keys_id)
Create a new InMemorySignerstatic Result_InMemorySignerDecodeErrorZ
read(byte[] ser)
Read a InMemorySigner from a byte array, created by InMemorySigner_writevoid
set_commitment_seed(byte[] val)
Commitment seedvoid
set_delayed_payment_base_key(byte[] val)
Holder secret key used in HTLC txvoid
set_funding_key(byte[] val)
Private key of anchor txvoid
set_htlc_base_key(byte[] val)
Holder htlc secret key used in commitment tx htlc outputsvoid
set_payment_key(byte[] val)
Holder secret key used for our balance in counterparty-broadcasted commitment transactionsvoid
set_revocation_base_key(byte[] val)
Holder secret key for blinded revocation pubkeyResult_CVec_CVec_u8ZZNoneZ
sign_counterparty_payment_input(byte[] spend_tx, long input_idx, StaticPaymentOutputDescriptor descriptor)
Sign the single input of spend_tx at index `input_idx` which spends the output described by descriptor, returning the witness stack for the input.Result_CVec_CVec_u8ZZNoneZ
sign_dynamic_p2wsh_input(byte[] spend_tx, long input_idx, DelayedPaymentOutputDescriptor descriptor)
Sign the single input of spend_tx at index `input_idx` which spends the output described by descriptor, returning the witness stack for the input.byte[]
write()
Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
get_funding_key
public byte[] get_funding_key()
Private key of anchor tx
-
set_funding_key
public void set_funding_key(byte[] val)
Private key of anchor tx
-
get_revocation_base_key
public byte[] get_revocation_base_key()
Holder secret key for blinded revocation pubkey
-
set_revocation_base_key
public void set_revocation_base_key(byte[] val)
Holder secret key for blinded revocation pubkey
-
get_payment_key
public byte[] get_payment_key()
Holder secret key used for our balance in counterparty-broadcasted commitment transactions
-
set_payment_key
public void set_payment_key(byte[] val)
Holder secret key used for our balance in counterparty-broadcasted commitment transactions
-
get_delayed_payment_base_key
public byte[] get_delayed_payment_base_key()
Holder secret key used in HTLC tx
-
set_delayed_payment_base_key
public void set_delayed_payment_base_key(byte[] val)
Holder secret key used in HTLC tx
-
get_htlc_base_key
public byte[] get_htlc_base_key()
Holder htlc secret key used in commitment tx htlc outputs
-
set_htlc_base_key
public void set_htlc_base_key(byte[] val)
Holder htlc secret key used in commitment tx htlc outputs
-
get_commitment_seed
public byte[] get_commitment_seed()
Commitment seed
-
set_commitment_seed
public void set_commitment_seed(byte[] val)
Commitment seed
-
clone
public InMemorySigner clone()
Creates a copy of the InMemorySigner
-
of
public static InMemorySigner of(byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, byte[] channel_keys_id)
Create a new InMemorySigner
-
counterparty_pubkeys
public ChannelPublicKeys counterparty_pubkeys()
Counterparty pubkeys. Will panic if ready_channel wasn't called.
-
counterparty_selected_contest_delay
public short counterparty_selected_contest_delay()
The contest_delay value specified by our counterparty and applied on holder-broadcastable transactions, ie the amount of time that we have to wait to recover our funds if we broadcast a transaction. Will panic if ready_channel wasn't called.
-
holder_selected_contest_delay
public short holder_selected_contest_delay()
The contest_delay value specified by us and applied on transactions broadcastable by our counterparty, ie the amount of time that they have to wait to recover their funds if they broadcast a transaction. Will panic if ready_channel wasn't called.
-
is_outbound
public boolean is_outbound()
Whether the holder is the initiator Will panic if ready_channel wasn't called.
-
funding_outpoint
public OutPoint funding_outpoint()
Funding outpoint Will panic if ready_channel wasn't called.
-
get_channel_parameters
public ChannelTransactionParameters get_channel_parameters()
Obtain a ChannelTransactionParameters for this channel, to be used when verifying or building transactions. Will panic if ready_channel wasn't called.
-
sign_counterparty_payment_input
public Result_CVec_CVec_u8ZZNoneZ sign_counterparty_payment_input(byte[] spend_tx, long input_idx, StaticPaymentOutputDescriptor descriptor)
Sign the single input of spend_tx at index `input_idx` which spends the output described by descriptor, returning the witness stack for the input. Returns an Err if the input at input_idx does not exist, has a non-empty script_sig, or is not spending the outpoint described by `descriptor.outpoint`.
-
sign_dynamic_p2wsh_input
public Result_CVec_CVec_u8ZZNoneZ sign_dynamic_p2wsh_input(byte[] spend_tx, long input_idx, DelayedPaymentOutputDescriptor descriptor)
Sign the single input of spend_tx at index `input_idx` which spends the output described by descriptor, returning the witness stack for the input. Returns an Err if the input at input_idx does not exist, has a non-empty script_sig, is not spending the outpoint described by `descriptor.outpoint`, or does not have a sequence set to `descriptor.to_self_delay`.
-
as_BaseSign
public BaseSign as_BaseSign()
Constructs a new BaseSign which calls the relevant methods on this_arg. This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
-
as_Sign
public Sign as_Sign()
Constructs a new Sign which calls the relevant methods on this_arg. This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
-
write
public byte[] write()
Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
-
read
public static Result_InMemorySignerDecodeErrorZ read(byte[] ser)
Read a InMemorySigner from a byte array, created by InMemorySigner_write
-
-