Output

Struct Output 

Source
pub struct Output {
    pub redeem_script: Option<ScriptBuf>,
    pub witness_script: Option<ScriptBuf>,
    pub bip32_derivation: BTreeMap<PublicKey, (Fingerprint, DerivationPath)>,
    pub tap_internal_key: Option<XOnlyPublicKey>,
    pub tap_tree: Option<TapTree>,
    pub tap_key_origins: BTreeMap<XOnlyPublicKey, (Vec<TapLeafHash>, (Fingerprint, DerivationPath))>,
    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<ScriptBuf>

The redeem script for this output.

§witness_script: Option<ScriptBuf>

The witness script for this output.

§bip32_derivation: BTreeMap<PublicKey, (Fingerprint, DerivationPath)>

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>, (Fingerprint, DerivationPath))>

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

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

Proprietary key-value pairs for this output.

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

Unknown key-value pairs for this output.

Implementations§

Source§

impl Output

Source

pub fn combine(&mut self, other: Output)

Combines this Output with other Output (as described by BIP 174).

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<(), Error>

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

impl Default for Output

Source§

fn default() -> Output

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

impl<'de> Deserialize<'de> for Output

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Output, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for Output

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
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 PsbtOutputExt for Output

Source§

fn update_with_descriptor_unchecked( &mut self, descriptor: &Descriptor<DefiniteDescriptorKey>, ) -> Result<Descriptor<PublicKey>, ConversionError>

Given the descriptor of a PSBT output populate the relevant metadata Read more
Source§

impl RgbOutExt<ProprietaryKey> for Output

Source§

fn get_internal_pk(&self) -> Option<XOnlyPublicKey>

Source§

fn is_tap_tree_empty(&self) -> bool

Source§

fn set_tap_tree(&mut self, script_commitment: &ScriptBuf)

Source§

fn bip32_derivation_terminals(&self) -> Vec<Terminal>

Source§

fn tap_bip32_derivation_terminals(&self) -> Vec<Terminal>

Source§

fn proprietary_mpc_messages<'a>( &'a self, ) -> impl Iterator<Item = (&'a [u8], &'a [u8])> + 'a

Source§

fn proprietary_insert(&mut self, key: ProprietaryKey, value: Vec<u8>)

Source§

fn proprietary_contains_key(&self, key: &ProprietaryKey) -> bool

Source§

fn proprietary_get_value(&self, key: &ProprietaryKey) -> Option<&[u8]>

Source§

fn proprietary_remove(&mut self, key: &ProprietaryKey)

Source§

fn is_opret_host(&self) -> bool

Source§

fn is_tapret_host(&self) -> bool

Source§

fn set_opret_host(&mut self) -> bool

Source§

fn set_tapret_host(&mut self) -> bool

Source§

fn tapret_commitment(&self) -> Result<TapretCommitment, TapretKeyError>

Returns valid tapret commitment from the PSBT_OUT_TAPRET_COMMITMENT key, if present. If the commitment is absent or invalid, returns TapretKeyError::NoCommitment.
Source§

fn opret_commit(&mut self, commitment: Commitment) -> Result<(), OpretKeyError>

Assigns value of the opreturn commitment to this PSBT output, by adding PSBT_OUT_OPRET_COMMITMENT proprietary key containing the 32-byte commitment as its value. Also modifies the output script and removes PSBT_OUT_OPRET_HOST key. Read more
Source§

fn tapret_commit( &mut self, commitment: Commitment, ) -> Result<TapretProof, TapretKeyError>

Assigns value of the tapreturn commitment to this PSBT output, by adding PSBT_OUT_TAPRET_COMMITMENT and PSBT_OUT_TAPRET_PROOF proprietary keys containing the 32-byte commitment as its proof. Read more
Source§

fn terminal_derivation(&self) -> Option<Terminal>

Source§

fn mpc_message_map( &self, ) -> Result<Confined<BTreeMap<ProtocolId, Message>, amplify::::collection::confinement::MediumOrdMap::{constant#0}, amplify::::collection::confinement::MediumOrdMap::{constant#1}>, MpcPsbtError>

Returns mpc::MessageMap constructed from the proprietary key data.
Source§

fn mpc_entropy(&self) -> Option<u64>

Returns a valid LNPBP-4 entropy value, if present. Read more
Source§

fn mpc_min_tree_depth(&self) -> Option<u8>

Source§

fn set_mpc_entropy(&mut self, entropy: u64) -> Result<bool, MpcPsbtError>

Sets MPC entropy value. Read more
Source§

fn set_mpc_message( &mut self, protocol_id: ProtocolId, message: Message, ) -> Result<bool, MpcPsbtError>

Sets MPC Message for the given ProtocolId. Read more
Source§

fn mpc_commit(&mut self) -> Result<(Commitment, MerkleBlock), MpcPsbtError>

Source§

fn proprietary_push( &mut self, key: P, value: Vec<u8>, ) -> Result<(), MpcPsbtError>

Source§

fn proprietary_contains(&self, key: &P) -> bool

Source§

fn proprietary_get(&self, key: &P) -> Option<&[u8]>

Source§

impl RgbPsbtExt<ProprietaryKey, Output> for Psbt

Source§

fn get_txid(&self) -> Txid

Source§

fn modifiable_outputs(&self) -> bool

Source§

fn set_as_unmodifiable(&mut self)

Source§

fn unsigned_tx(&self) -> Transaction

Source§

fn set_opret_host(&mut self) -> bool

Source§

fn dbc_output<D>(&self) -> Option<&Output>
where D: DbcPsbtProof,

Source§

fn dbc_output_mut<D>(&mut self) -> Option<(usize, &mut Output)>
where D: DbcPsbtProof,

Source§

fn set_opret_commitment(&mut self, idx: usize)

Source§

fn set_tapret_commitment(&mut self, idx: usize)

Source§

fn proprietary_rgb_contract_consumer_keys<'a>( &'a self, ) -> impl Iterator<Item = &'a [u8]> + 'a

Source§

fn outputs_iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Output>
where Output: 'a,

Source§

fn proprietary_insert(&mut self, key: ProprietaryKey, value: Vec<u8>)

Source§

fn proprietary_contains_key(&self, key: &ProprietaryKey) -> bool

Source§

fn proprietary_get_value(&self, key: &ProprietaryKey) -> Option<&[u8]>

Source§

fn dbc_commit<D>(&mut self) -> Result<(MerkleBlock, D), DbcPsbtError>
where D: DbcPsbtProof, Self: Sized,

Source§

fn rgb_embed(&mut self, batch: Batch) -> Result<(), EmbedError>

Source§

fn rgb_commit(&mut self) -> Result<Fascia, CommitError>
where Self: Sized,

Source§

fn rgb_contract_ids(&self) -> Result<BTreeSet<ContractId>, FromSliceError>

Source§

fn rgb_contract_consumers( &self, contract_id: ContractId, ) -> Result<BTreeMap<Opout, OpId>, RgbPsbtError>

Source§

fn rgb_transition(&self, opid: OpId) -> Result<Option<Transition>, RgbPsbtError>

Source§

fn rgb_close_method(&self) -> Result<Option<Method>, RgbPsbtError>

Source§

fn rgb_tapret_host_on_change(&self) -> bool

Source§

fn set_rgb_close_method(&mut self, close_method: Method)

Source§

fn set_rgb_tapret_host_on_change(&mut self)

Source§

fn set_rgb_contract_consumer( &mut self, contract_id: ContractId, opout: Opout, opid: OpId, ) -> Result<bool, RgbPsbtError>

Adds information about an RGB input allocation and the ID of the state transition spending it. Read more
Source§

fn push_rgb_transition( &mut self, transition: Transition, ) -> Result<bool, RgbPsbtError>

Source§

fn rgb_bundles( &self, ) -> Result<BTreeMap<ContractId, TransitionBundle>, RgbPsbtError>

Source§

fn rgb_bundles_to_mpc( &mut self, ) -> Result<Confined<BTreeMap<ContractId, TransitionBundle>, 1, psrgbt::::RgbPsbtExt::rgb_bundles_to_mpc::{constant#0}>, RgbPsbtError>

Source§

fn proprietary_push( &mut self, key: P, value: Vec<u8>, ) -> Result<(), MpcPsbtError>

Source§

fn proprietary_contains(&self, key: &P) -> bool

Source§

fn proprietary_get(&self, key: &P) -> Option<&[u8]>

Source§

impl Serialize for Output

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Output

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> Same for T

Source§

type Output = T

Should always be Self
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

Source§

impl<T> VerifyEq for T
where T: Eq,

Source§

fn verify_eq(&self, other: &T) -> bool

Verifies commit-equivalence of two instances of the same type.
Source§

impl<T> VerifyEq for T
where T: Eq,

Source§

fn verify_eq(&self, other: &T) -> bool

Verifies commit-equivalence of two instances of the same type.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,