Trait lwk_common::Signer

source ·
pub trait Signer {
    type Error: Debug;

    // Required methods
    fn sign(
        &self,
        pset: &mut PartiallySignedTransaction
    ) -> Result<u32, Self::Error>;
    fn derive_xpub(&self, path: &DerivationPath) -> Result<Xpub, Self::Error>;
    fn slip77_master_blinding_key(
        &self
    ) -> Result<MasterBlindingKey, Self::Error>;

    // Provided methods
    fn xpub(&self) -> Result<Xpub, Self::Error> { ... }
    fn identifier(&self) -> Result<XKeyIdentifier, Self::Error> { ... }
    fn fingerprint(&self) -> Result<Fingerprint, Self::Error> { ... }
    fn keyorigin_xpub(
        &self,
        bip: Bip,
        is_mainnet: bool
    ) -> Result<String, Self::Error> { ... }
    fn is_mainnet(&self) -> Result<bool, Self::Error> { ... }
}
Expand description

A trait defining methods of signers, providing blanket implementations for some methods.

Required Associated Types§

Required Methods§

source

fn sign( &self, pset: &mut PartiallySignedTransaction ) -> Result<u32, Self::Error>

Try to sign the given pset, mutating it in place. returns how many signatures were added or overwritten

source

fn derive_xpub(&self, path: &DerivationPath) -> Result<Xpub, Self::Error>

Derive an xpub from the master, path can contains hardened derivations

source

fn slip77_master_blinding_key(&self) -> Result<MasterBlindingKey, Self::Error>

Return the slip77 master blinding key

Provided Methods§

source

fn xpub(&self) -> Result<Xpub, Self::Error>

Return the master xpub of the signer

source

fn identifier(&self) -> Result<XKeyIdentifier, Self::Error>

Return the full identifier of the signer

source

fn fingerprint(&self) -> Result<Fingerprint, Self::Error>

Return the fingerprint of the signer (4 bytes)

source

fn keyorigin_xpub( &self, bip: Bip, is_mainnet: bool ) -> Result<String, Self::Error>

Return keyorigin and xpub, like “[73c5da0a/84h/1h/0h]tpub…”

source

fn is_mainnet(&self) -> Result<bool, Self::Error>

Implementors§