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]
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 BaseSign for InMemorySigner
[src]
impl BaseSign for InMemorySigner
[src]fn get_per_commitment_point(
&self,
idx: u64,
secp_ctx: &Secp256k1<All>
) -> PublicKey
[src]
&self,
idx: u64,
secp_ctx: &Secp256k1<All>
) -> 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(
&self,
commitment_tx: &CommitmentTransaction,
secp_ctx: &Secp256k1<All>
) -> Result<(Signature, Vec<Signature>), ()>
[src]
&self,
commitment_tx: &CommitmentTransaction,
secp_ctx: &Secp256k1<All>
) -> Result<(Signature, Vec<Signature>), ()>
fn sign_holder_commitment_and_htlcs(
&self,
commitment_tx: &HolderCommitmentTransaction,
secp_ctx: &Secp256k1<All>
) -> Result<(Signature, Vec<Signature>), ()>
[src]
&self,
commitment_tx: &HolderCommitmentTransaction,
secp_ctx: &Secp256k1<All>
) -> Result<(Signature, Vec<Signature>), ()>
fn sign_justice_transaction(
&self,
justice_tx: &Transaction,
input: usize,
amount: u64,
per_commitment_key: &SecretKey,
htlc: &Option<HTLCOutputInCommitment>,
secp_ctx: &Secp256k1<All>
) -> Result<Signature, ()>
[src]
&self,
justice_tx: &Transaction,
input: usize,
amount: u64,
per_commitment_key: &SecretKey,
htlc: &Option<HTLCOutputInCommitment>,
secp_ctx: &Secp256k1<All>
) -> Result<Signature, ()>
fn sign_counterparty_htlc_transaction(
&self,
htlc_tx: &Transaction,
input: usize,
amount: u64,
per_commitment_point: &PublicKey,
htlc: &HTLCOutputInCommitment,
secp_ctx: &Secp256k1<All>
) -> Result<Signature, ()>
[src]
&self,
htlc_tx: &Transaction,
input: usize,
amount: u64,
per_commitment_point: &PublicKey,
htlc: &HTLCOutputInCommitment,
secp_ctx: &Secp256k1<All>
) -> Result<Signature, ()>
fn sign_closing_transaction(
&self,
closing_tx: &Transaction,
secp_ctx: &Secp256k1<All>
) -> Result<Signature, ()>
[src]
&self,
closing_tx: &Transaction,
secp_ctx: &Secp256k1<All>
) -> Result<Signature, ()>
fn sign_channel_announcement(
&self,
msg: &UnsignedChannelAnnouncement,
secp_ctx: &Secp256k1<All>
) -> Result<Signature, ()>
[src]
&self,
msg: &UnsignedChannelAnnouncement,
secp_ctx: &Secp256k1<All>
) -> Result<Signature, ()>
fn ready_channel(&mut self, channel_parameters: &ChannelTransactionParameters)
[src]
impl Clone for InMemorySigner
[src]
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 Readable for InMemorySigner
[src]impl Sign for InMemorySigner
[src]
impl Sign for InMemorySigner
[src]Auto Trait Implementations
impl RefUnwindSafe for InMemorySigner
impl RefUnwindSafe for InMemorySigner
impl Send for InMemorySigner
impl Send for InMemorySigner
impl Sync for InMemorySigner
impl Sync for InMemorySigner
impl Unpin for InMemorySigner
impl Unpin for InMemorySigner
impl UnwindSafe for InMemorySigner
impl UnwindSafe for InMemorySigner