Output

Struct Output 

Source
pub struct Output {
Show 20 fields pub redeem_script: Option<Script>, pub witness_script: Option<Script>, pub bip32_derivation: BTreeMap<PublicKey, KeySource>, pub tap_internal_key: Option<XOnlyPublicKey>, pub tap_tree: Option<TapTree>, pub tap_key_origins: BTreeMap<XOnlyPublicKey, (Vec<TapLeafHash>, KeySource)>, pub amount: Option<u64>, pub amount_comm: Option<PedersenCommitment>, pub script_pubkey: Script, pub asset: Option<AssetId>, pub asset_comm: Option<Generator>, pub value_rangeproof: Option<Box<RangeProof>>, pub asset_surjection_proof: Option<Box<SurjectionProof>>, pub blinding_key: Option<PublicKey>, pub ecdh_pubkey: Option<PublicKey>, pub blinder_index: Option<u32>, pub blind_value_proof: Option<Box<RangeProof>>, pub blind_asset_proof: Option<Box<SurjectionProof>>, pub proprietary: BTreeMap<ProprietaryKey, Vec<u8>>, pub unknown: BTreeMap<Key, Vec<u8>>,
}
Expand description

A key-value map for an output of the corresponding index in the unsigned transaction.

Fields§

§redeem_script: Option<Script>

The redeem script for this output.

§witness_script: Option<Script>

The witness script for this output.

§bip32_derivation: BTreeMap<PublicKey, KeySource>

A map from public keys needed to spend this output to their corresponding master key fingerprints and derivation paths.

§tap_internal_key: Option<XOnlyPublicKey>

The internal pubkey

§tap_tree: Option<TapTree>

Taproot Output tree

§tap_key_origins: BTreeMap<XOnlyPublicKey, (Vec<TapLeafHash>, KeySource)>

Map of tap root x only keys to origin info and leaf hashes contained in it

§amount: Option<u64>

(PSET) The explicit amount of the output

§amount_comm: Option<PedersenCommitment>

(PSET) The out amount commitment

§script_pubkey: Script

(PSET) The script pubkey of the output

§asset: Option<AssetId>

The output explicit asset

§asset_comm: Option<Generator>

The output explicit asset

§value_rangeproof: Option<Box<RangeProof>>

Output value rangeproof

§asset_surjection_proof: Option<Box<SurjectionProof>>

Output Asset surjection proof

§blinding_key: Option<PublicKey>

Blinding pubkey which is used in receiving address

§ecdh_pubkey: Option<PublicKey>

The ephermal pk sampled by sender

§blinder_index: Option<u32>

The index of the input whose owner should blind this output

§blind_value_proof: Option<Box<RangeProof>>

The blind value rangeproof

§blind_asset_proof: Option<Box<SurjectionProof>>

The blind asset surjection proof

§proprietary: BTreeMap<ProprietaryKey, Vec<u8>>

Pset Other fields

§unknown: BTreeMap<Key, Vec<u8>>

Unknown key-value pairs for this output.

Implementations§

Source§

impl Output

Source

pub fn new_explicit( script: Script, amount: u64, asset: AssetId, blinding_key: Option<PublicKey>, ) -> Self

Create a new explicit pset output

Source

pub fn from_txout(txout: TxOut) -> Self

Create a output from txout If the txout it TxOut::is_partially_blinded, then nonce of the txout is treated as ecdh pubkey, otherwise the nonce of the txout is assumed to be receiver blinding key. This is to be used when the txout is not blinded. This sets the blinding key from the txout nonce

Source

pub fn to_txout(&self) -> TxOut

Create a txout from self

Source

pub fn is_marked_for_blinding(&self) -> bool

IsBlinded from elements core This indicates whether the output is marked for blinding

Source

pub fn is_partially_blinded(&self) -> bool

IsPartiallyBlinded from elements core

Source

pub fn is_fully_blinded(&self) -> bool

IsFullyBlinded from elements core

Source§

impl Output

ELIP0102 LiquiDEX extensions

Source

pub fn set_abf(&mut self, abf: AssetBlindingFactor)

Set Asset Blinding Factor

Source

pub fn get_abf(&self) -> Option<Result<AssetBlindingFactor, Error>>

Get Asset Blinding Factor

Trait Implementations§

Source§

impl Clone for Output

Source§

fn clone(&self) -> Output

Returns a duplicate 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 Output

Source§

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

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

impl Decodable for Output

Source§

fn consensus_decode<D: Read>(d: D) -> Result<Self, Error>

Decode an object with a well-defined format
Source§

impl Default for Output

Source§

fn default() -> Output

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

impl Encodable for Output

Source§

fn consensus_encode<S: Write>(&self, s: S) -> Result<usize, Error>

Encode an object with a well-defined format, should only ever error if the underlying Write errors. Returns the number of bytes written on success
Source§

impl PartialEq for Output

Source§

fn eq(&self, other: &Output) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Output

Auto Trait Implementations§

§

impl Freeze for Output

§

impl RefUnwindSafe for Output

§

impl Send for Output

§

impl Sync for Output

§

impl Unpin for Output

§

impl UnwindSafe for Output

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.
Source§

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

Source§

fn vzip(self) -> V