Skip to main content

SpPsbtExtractor

Struct SpPsbtExtractor 

Source
pub struct SpPsbtExtractor { /* private fields */ }
Expand description

BIP 375 Extractor role: aggregates ECDH shares and computes SP output scripts.

Created via SpPsbtSigner::into_extractor after all required ECDH shares are present. The extract method computes the final SP output scripts and returns the updated PSBT.

Implementations§

Source§

impl SpPsbtExtractor

Source

pub fn extract( self, _secp: &Secp256k1<impl Verification>, ) -> Result<(Psbt, Vec<ExtractedSpOutput>), PsbtError>

Compute SP output scripts from aggregated ECDH shares.

For each unique scan key in SP output info fields:

  1. Aggregates ECDH shares (global share directly, or per-input via combine_keys)
  2. The aggregated share IS the BIP 352 shared secret point
  3. Derives output pubkeys via compute_output_pubkey(spend_key, shared_secret, k)
  4. Builds P2TR scripts from the output pubkeys

Returns the updated PSBT (with computed scriptPubKeys) and extracted output metadata.

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> 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, 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.