Struct lightning::chain::keysinterface::InMemorySigner[][src]

pub struct InMemorySigner {
    pub funding_key: SecretKey,
    pub revocation_base_key: SecretKey,
    pub payment_key: SecretKey,
    pub delayed_payment_base_key: SecretKey,
    pub htlc_base_key: SecretKey,
    pub commitment_seed: [u8; 32],
    // some fields omitted
}

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]

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]

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]

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]

impl Readable for InMemorySigner[src]

impl Sign for InMemorySigner[src]

impl Writeable for InMemorySigner[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.