Struct lightning::chain::keysinterface::InMemorySigner [−][src]
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.
Fields
funding_key: SecretKey
Private key of anchor tx
revocation_base_key: SecretKey
Holder secret key for blinded revocation pubkey
payment_key: SecretKey
Holder secret key used for our balance in counterparty-broadcasted commitment transactions
delayed_payment_base_key: SecretKey
Holder secret key used in HTLC tx
htlc_base_key: SecretKey
Holder htlc secret key used in commitment tx htlc outputs
commitment_seed: [u8; 32]
Commitment seed
Implementations
impl InMemorySigner
[src]
pub fn new<C: Signing>(
secp_ctx: &Secp256k1<C>,
funding_key: SecretKey,
revocation_base_key: SecretKey,
payment_key: SecretKey,
delayed_payment_base_key: SecretKey,
htlc_base_key: SecretKey,
commitment_seed: [u8; 32],
channel_value_satoshis: u64,
channel_keys_id: [u8; 32]
) -> InMemorySigner
[src]
secp_ctx: &Secp256k1<C>,
funding_key: SecretKey,
revocation_base_key: SecretKey,
payment_key: SecretKey,
delayed_payment_base_key: SecretKey,
htlc_base_key: SecretKey,
commitment_seed: [u8; 32],
channel_value_satoshis: u64,
channel_keys_id: [u8; 32]
) -> InMemorySigner
Create a new InMemorySigner
pub fn counterparty_pubkeys(&self) -> &ChannelPublicKeys
[src]
Counterparty pubkeys. Will panic if ready_channel wasn’t called.
pub fn counterparty_selected_contest_delay(&self) -> u16
[src]
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.
pub fn holder_selected_contest_delay(&self) -> u16
[src]
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.
pub fn is_outbound(&self) -> bool
[src]
Whether the holder is the initiator Will panic if ready_channel wasn’t called.
pub fn funding_outpoint(&self) -> &OutPoint
[src]
Funding outpoint Will panic if ready_channel wasn’t called.
pub fn get_channel_parameters(&self) -> &ChannelTransactionParameters
[src]
Obtain a ChannelTransactionParameters for this channel, to be used when verifying or building transactions.
Will panic if ready_channel wasn’t called.
pub fn sign_counterparty_payment_input<C: Signing>(
&self,
spend_tx: &Transaction,
input_idx: usize,
descriptor: &StaticPaymentOutputDescriptor,
secp_ctx: &Secp256k1<C>
) -> Result<Vec<Vec<u8>>, ()>
[src]
&self,
spend_tx: &Transaction,
input_idx: usize,
descriptor: &StaticPaymentOutputDescriptor,
secp_ctx: &Secp256k1<C>
) -> Result<Vec<Vec<u8>>, ()>
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
.
pub fn sign_dynamic_p2wsh_input<C: Signing>(
&self,
spend_tx: &Transaction,
input_idx: usize,
descriptor: &DelayedPaymentOutputDescriptor,
secp_ctx: &Secp256k1<C>
) -> Result<Vec<Vec<u8>>, ()>
[src]
&self,
spend_tx: &Transaction,
input_idx: usize,
descriptor: &DelayedPaymentOutputDescriptor,
secp_ctx: &Secp256k1<C>
) -> Result<Vec<Vec<u8>>, ()>
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
.
Trait Implementations
impl Clone for InMemorySigner
[src]
fn clone(&self) -> InMemorySigner
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Readable for InMemorySigner
[src]
impl Sign for InMemorySigner
[src]
fn get_per_commitment_point<T: Signing + Verification>(
&self,
idx: u64,
secp_ctx: &Secp256k1<T>
) -> PublicKey
[src]
&self,
idx: u64,
secp_ctx: &Secp256k1<T>
) -> PublicKey
fn release_commitment_secret(&self, idx: u64) -> [u8; 32]
[src]
fn pubkeys(&self) -> &ChannelPublicKeys
[src]
fn channel_keys_id(&self) -> [u8; 32]
[src]
fn sign_counterparty_commitment<T: Signing + Verification>(
&self,
commitment_tx: &CommitmentTransaction,
secp_ctx: &Secp256k1<T>
) -> Result<(Signature, Vec<Signature>), ()>
[src]
&self,
commitment_tx: &CommitmentTransaction,
secp_ctx: &Secp256k1<T>
) -> Result<(Signature, Vec<Signature>), ()>
fn sign_holder_commitment_and_htlcs<T: Signing + Verification>(
&self,
commitment_tx: &HolderCommitmentTransaction,
secp_ctx: &Secp256k1<T>
) -> Result<(Signature, Vec<Signature>), ()>
[src]
&self,
commitment_tx: &HolderCommitmentTransaction,
secp_ctx: &Secp256k1<T>
) -> Result<(Signature, Vec<Signature>), ()>
fn sign_justice_transaction<T: Signing + Verification>(
&self,
justice_tx: &Transaction,
input: usize,
amount: u64,
per_commitment_key: &SecretKey,
htlc: &Option<HTLCOutputInCommitment>,
secp_ctx: &Secp256k1<T>
) -> Result<Signature, ()>
[src]
&self,
justice_tx: &Transaction,
input: usize,
amount: u64,
per_commitment_key: &SecretKey,
htlc: &Option<HTLCOutputInCommitment>,
secp_ctx: &Secp256k1<T>
) -> Result<Signature, ()>
fn sign_counterparty_htlc_transaction<T: Signing + Verification>(
&self,
htlc_tx: &Transaction,
input: usize,
amount: u64,
per_commitment_point: &PublicKey,
htlc: &HTLCOutputInCommitment,
secp_ctx: &Secp256k1<T>
) -> Result<Signature, ()>
[src]
&self,
htlc_tx: &Transaction,
input: usize,
amount: u64,
per_commitment_point: &PublicKey,
htlc: &HTLCOutputInCommitment,
secp_ctx: &Secp256k1<T>
) -> Result<Signature, ()>
fn sign_closing_transaction<T: Signing>(
&self,
closing_tx: &Transaction,
secp_ctx: &Secp256k1<T>
) -> Result<Signature, ()>
[src]
&self,
closing_tx: &Transaction,
secp_ctx: &Secp256k1<T>
) -> Result<Signature, ()>
fn sign_channel_announcement<T: Signing>(
&self,
msg: &UnsignedChannelAnnouncement,
secp_ctx: &Secp256k1<T>
) -> Result<Signature, ()>
[src]
&self,
msg: &UnsignedChannelAnnouncement,
secp_ctx: &Secp256k1<T>
) -> Result<Signature, ()>
fn ready_channel(&mut self, channel_parameters: &ChannelTransactionParameters)
[src]
impl Writeable for InMemorySigner
[src]
Auto Trait Implementations
impl RefUnwindSafe for InMemorySigner
impl Send for InMemorySigner
impl Sync for InMemorySigner
impl Unpin for InMemorySigner
impl UnwindSafe for InMemorySigner
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,