bdk_wallet

Struct SignOptions

Source
pub struct SignOptions {
    pub trust_witness_utxo: bool,
    pub assume_height: Option<u32>,
    pub allow_all_sighashes: bool,
    pub try_finalize: bool,
    pub tap_leaves_options: TapLeavesOptions,
    pub sign_with_tap_internal_key: bool,
    pub allow_grinding: bool,
}
Expand description

Options for a software signer

Adjust the behavior of our software signers and the way a transaction is finalized

Fields§

§trust_witness_utxo: bool

Whether the signer should trust the witness_utxo, if the non_witness_utxo hasn’t been provided

Defaults to false to mitigate the “SegWit bug” which could trick the wallet into paying a fee larger than expected.

Some wallets, especially if relatively old, might not provide the non_witness_utxo for SegWit transactions in the PSBT they generate: in those cases setting this to true should correctly produce a signature, at the expense of an increased trust in the creator of the PSBT.

For more details see: https://blog.trezor.io/details-of-firmware-updates-for-trezor-one-version-1-9-1-and-trezor-model-t-version-2-3-1-1eba8f60f2dd

§assume_height: Option<u32>

Whether the wallet should assume a specific height has been reached when trying to finalize a transaction

The wallet will only “use” a timelock to satisfy the spending policy of an input if the timelock height has already been reached. This option allows overriding the “current height” to let the wallet use timelocks in the future to spend a coin.

§allow_all_sighashes: bool

Whether the signer should use the sighash_type set in the PSBT when signing, no matter what its value is

Defaults to false which will only allow signing using SIGHASH_ALL.

§try_finalize: bool

Whether to try finalizing the PSBT after the inputs are signed.

Defaults to true which will try finalizing PSBT after inputs are signed.

§tap_leaves_options: TapLeavesOptions

Specifies which Taproot script-spend leaves we should sign for. This option is ignored if we’re signing a non-taproot PSBT.

Defaults to All, i.e., the wallet will sign all the leaves it has a key for.

§sign_with_tap_internal_key: bool

Whether we should try to sign a taproot transaction with the taproot internal key or not. This option is ignored if we’re signing a non-taproot PSBT.

Defaults to true, i.e., we always try to sign with the taproot internal key.

§allow_grinding: bool

Whether we should grind ECDSA signature to ensure signing with low r or not. Defaults to true, i.e., we always grind ECDSA signature to sign with low r.

Trait Implementations§

Source§

impl Clone for SignOptions

Source§

fn clone(&self) -> SignOptions

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SignOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SignOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V