pub struct Input {Show 21 fields
pub non_witness_utxo: Option<Transaction>,
pub witness_utxo: Option<TxOut>,
pub partial_sigs: BTreeMap<PublicKey, Signature, Global>,
pub sighash_type: Option<PsbtSighashType>,
pub redeem_script: Option<ScriptBuf>,
pub witness_script: Option<ScriptBuf>,
pub bip32_derivation: BTreeMap<PublicKey, (Fingerprint, DerivationPath), Global>,
pub final_script_sig: Option<ScriptBuf>,
pub final_script_witness: Option<Witness>,
pub ripemd160_preimages: BTreeMap<Hash, Vec<u8, Global>, Global>,
pub sha256_preimages: BTreeMap<Hash, Vec<u8, Global>, Global>,
pub hash160_preimages: BTreeMap<Hash, Vec<u8, Global>, Global>,
pub hash256_preimages: BTreeMap<Hash, Vec<u8, Global>, Global>,
pub tap_key_sig: Option<Signature>,
pub tap_script_sigs: BTreeMap<(XOnlyPublicKey, TapLeafHash), Signature, Global>,
pub tap_scripts: BTreeMap<ControlBlock, (ScriptBuf, LeafVersion), Global>,
pub tap_key_origins: BTreeMap<XOnlyPublicKey, (Vec<TapLeafHash, Global>, (Fingerprint, DerivationPath)), Global>,
pub tap_internal_key: Option<XOnlyPublicKey>,
pub tap_merkle_root: Option<TapNodeHash>,
pub proprietary: BTreeMap<ProprietaryKey<u8>, Vec<u8, Global>, Global>,
pub unknown: BTreeMap<Key, Vec<u8, Global>, Global>,
}
Expand description
A key-value map for an input of the corresponding index in the unsigned transaction.
Fields§
§non_witness_utxo: Option<Transaction>
The non-witness transaction this input spends from. Should only be std::option::Option::Some for inputs which spend non-segwit outputs or if it is unknown whether an input spends a segwit output.
witness_utxo: Option<TxOut>
The transaction output this input spends from. Should only be std::option::Option::Some for inputs which spend segwit outputs, including P2SH embedded ones.
partial_sigs: BTreeMap<PublicKey, Signature, Global>
A map from public keys to their corresponding signature as would be pushed to the stack from a scriptSig or witness for a non-taproot inputs.
sighash_type: Option<PsbtSighashType>
The sighash type to be used for this input. Signatures for this input must use the sighash type.
redeem_script: Option<ScriptBuf>
The redeem script for this input.
witness_script: Option<ScriptBuf>
The witness script for this input.
bip32_derivation: BTreeMap<PublicKey, (Fingerprint, DerivationPath), Global>
A map from public keys needed to sign this input to their corresponding master key fingerprints and derivation paths.
final_script_sig: Option<ScriptBuf>
The finalized, fully-constructed scriptSig with signatures and any other scripts necessary for this input to pass validation.
final_script_witness: Option<Witness>
The finalized, fully-constructed scriptWitness with signatures and any other scripts necessary for this input to pass validation.
ripemd160_preimages: BTreeMap<Hash, Vec<u8, Global>, Global>
TODO: Proof of reserves commitment RIPEMD160 hash to preimage map.
sha256_preimages: BTreeMap<Hash, Vec<u8, Global>, Global>
SHA256 hash to preimage map.
hash160_preimages: BTreeMap<Hash, Vec<u8, Global>, Global>
HSAH160 hash to preimage map.
hash256_preimages: BTreeMap<Hash, Vec<u8, Global>, Global>
HAS256 hash to preimage map.
tap_key_sig: Option<Signature>
Serialized taproot signature with sighash type for key spend.
tap_script_sigs: BTreeMap<(XOnlyPublicKey, TapLeafHash), Signature, Global>
Map of <xonlypubkey>|<leafhash>
with signature.
tap_scripts: BTreeMap<ControlBlock, (ScriptBuf, LeafVersion), Global>
Map of Control blocks to Script version pair.
tap_key_origins: BTreeMap<XOnlyPublicKey, (Vec<TapLeafHash, Global>, (Fingerprint, DerivationPath)), Global>
Map of tap root x only keys to origin info and leaf hashes contained in it.
tap_internal_key: Option<XOnlyPublicKey>
Taproot Internal key.
tap_merkle_root: Option<TapNodeHash>
Taproot Merkle root.
proprietary: BTreeMap<ProprietaryKey<u8>, Vec<u8, Global>, Global>
Proprietary key-value pairs for this input.
unknown: BTreeMap<Key, Vec<u8, Global>, Global>
Unknown key-value pairs for this input.
Implementations§
§impl Input
impl Input
pub fn ecdsa_hash_ty(&self) -> Result<EcdsaSighashType, NonStandardSighashType>
pub fn ecdsa_hash_ty(&self) -> Result<EcdsaSighashType, NonStandardSighashType>
Obtains the [EcdsaSighashType
] for this input if one is specified. If no sighash type is
specified, returns [EcdsaSighashType::All
].
Errors
If the sighash_type
field is set to a non-standard ECDSA sighash value.
pub fn taproot_hash_ty(&self) -> Result<TapSighashType, Error>
pub fn taproot_hash_ty(&self) -> Result<TapSighashType, Error>
Obtains the [TapSighashType
] for this input if one is specified. If no sighash type is
specified, returns [TapSighashType::Default
].
Errors
If the sighash_type
field is set to a invalid Taproot sighash value.
Trait Implementations§
§impl<'de> Deserialize<'de> for Input
impl<'de> Deserialize<'de> for Input
§fn deserialize<__D>(
__deserializer: __D
) -> Result<Input, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Input, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
§impl Serialize for Input
impl Serialize for Input
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
impl Eq for Input
impl StructuralEq for Input
impl StructuralPartialEq for Input
Auto Trait Implementations§
impl RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnwindSafe for Input
Blanket Implementations§
§impl<T> Conv for T
impl<T> Conv for T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where &'a Self: for<'a> IntoIterator,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere Self: Borrow<B>, B: 'a + ?Sized, R: 'a,
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> Rwhere Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere Self: AsRef<U>, U: 'a + ?Sized, R: 'a,
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere Self: AsMut<U>, U: 'a + ?Sized, R: 'a,
self
, then passes self.as_mut()
into the pipe
function.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere Self: Deref<Target = T>, T: ?Sized,
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere Self: DerefMut<Target = T> + Deref, T: ?Sized,
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§impl<T> TryConv for T
impl<T> TryConv for T
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.