Trait bdk::wallet::signer::Signer[][src]

pub trait Signer: Debug + Send + Sync {
    fn sign(
        psbt: &mut PartiallySignedTransaction,
        input_index: Option<usize>,
        secp: &Secp256k1<All>
    ) -> Result<(), SignerError>;
fn sign_whole_tx(&self) -> bool;
fn id(&self, secp: &Secp256k1<All>) -> SignerId; fn descriptor_secret_key(&self) -> Option<DescriptorSecretKey> { ... } }
Expand description

Trait for signers

This trait can be implemented to provide customized signers to the wallet. For an example see this module’s documentation.

Required methods

Sign a PSBT

The input_index argument is only provided if the wallet doesn’t declare to sign the whole transaction in one go (see Signer::sign_whole_tx). Otherwise its value is None and can be ignored.

Return whether or not the signer signs the whole transaction in one go instead of every input individually

Return the SignerId for this signer

The SignerId can be used to lookup a signer in the Wallet’s signers map or to compare two signers.

Provided methods

Return the secret key for the signer

This is used internally to reconstruct the original descriptor that may contain secrets. External signers that are meant to keep key isolated should just return None here (which is the default for this method, if not overridden).

Implementations on Foreign Types