pub struct Input {Show 26 fields
pub previous_outpoint: Outpoint,
pub sequence_number: Option<SeqNo>,
pub required_time_lock: Option<LockTimestamp>,
pub required_height_lock: Option<LockHeight>,
pub non_witness_tx: Option<Tx>,
pub witness_utxo: Option<TxOut>,
pub partial_sigs: IndexMap<LegacyPk, LegacySig>,
pub sighash_type: Option<SighashType>,
pub redeem_script: Option<RedeemScript>,
pub witness_script: Option<WitnessScript>,
pub bip32_derivation: IndexMap<LegacyPk, KeyOrigin>,
pub final_script_sig: Option<SigScript>,
pub final_witness: Option<Witness>,
pub proof_of_reserves: Option<String>,
pub ripemd160: IndexMap<Array<u8, 20>, ByteStr>,
pub sha256: IndexMap<Array<u8, 32>, ByteStr>,
pub hash160: IndexMap<Array<u8, 20>, ByteStr>,
pub hash256: IndexMap<Array<u8, 32>, ByteStr>,
pub tap_key_sig: Option<Bip340Sig>,
pub tap_script_sig: IndexMap<(XOnlyPk, TapLeafHash), Bip340Sig>,
pub tap_leaf_script: IndexMap<ControlBlock, LeafScript>,
pub tap_bip32_derivation: IndexMap<XOnlyPk, TapDerivation>,
pub tap_internal_key: Option<InternalPk>,
pub tap_merkle_root: Option<TapNodeHash>,
pub proprietary: IndexMap<PropKey, ValueData>,
pub unknown: IndexMap<u8, IndexMap<ByteStr, ValueData>>,
/* private fields */
}
Fields§
§previous_outpoint: Outpoint
Previous transaction outpoint to spent.
sequence_number: Option<SeqNo>
Sequence number of this input. If omitted, the sequence number is assumed to be the final sequence number (0xffffffff).
required_time_lock: Option<LockTimestamp>
32 bit unsigned little endian integer greater than or equal to 500000000 representing the minimum Unix timestamp that this input requires to be set as the transaction’s lock time.
required_height_lock: Option<LockHeight>
32 bit unsigned little endian integer less than 500000000 representing the minimum block height that this input requires to be set as the transaction’s lock time.
non_witness_tx: Option<Tx>
The non-witness transaction this input spends from. Should only be
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 Some
for
inputs which spend segwit outputs, including P2SH embedded ones.
partial_sigs: IndexMap<LegacyPk, LegacySig>
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<SighashType>
The sighash type to be used for this input. Signatures for this input must use the sighash type.
redeem_script: Option<RedeemScript>
The redeem script for this input.
witness_script: Option<WitnessScript>
The witness script for this input.
bip32_derivation: IndexMap<LegacyPk, KeyOrigin>
A map from public keys needed to sign this input to their corresponding master key fingerprints and derivation paths.
final_script_sig: Option<SigScript>
The finalized, fully-constructed scriptSig with signatures and any other scripts necessary for this input to pass validation.
final_witness: Option<Witness>
The finalized, fully-constructed scriptWitness with signatures and any other scripts necessary for this input to pass validation.
proof_of_reserves: Option<String>
The UTF-8 encoded commitment message string for the proof-of-reserves. See BIP 127 for more information.
ripemd160: IndexMap<Array<u8, 20>, ByteStr>
The hash preimage, encoded as a byte vector, which must equal the key when run through the RIPEMD160 algorithm.
sha256: IndexMap<Array<u8, 32>, ByteStr>
The hash preimage, encoded as a byte vector, which must equal the key when run through the SHA256 algorithm.
hash160: IndexMap<Array<u8, 20>, ByteStr>
The hash preimage, encoded as a byte vector, which must equal the key when run through the SHA256 algorithm followed by the RIPEMD160 algorithm .
hash256: IndexMap<Array<u8, 32>, ByteStr>
The hash preimage, encoded as a byte vector, which must equal the key when run through the SHA256 algorithm twice.
tap_key_sig: Option<Bip340Sig>
The 64 or 65 byte Schnorr signature for key path spending a Taproot output. Finalizers
should remove this field after PSBT_IN_FINAL_SCRIPTWITNESS
is constructed.
tap_script_sig: IndexMap<(XOnlyPk, TapLeafHash), Bip340Sig>
The 64 or 65 byte Schnorr signature for this pubkey and leaf combination. Finalizers
should remove this field after PSBT_IN_FINAL_SCRIPTWITNESS
is constructed.
tap_leaf_script: IndexMap<ControlBlock, LeafScript>
The script for this leaf as would be provided in the witness stack followed by the single
byte leaf version. Note that the leaves included in this field should be those that the
signers of this input are expected to be able to sign for. Finalizers should remove this
field after PSBT_IN_FINAL_SCRIPTWITNESS
is constructed.
tap_bip32_derivation: IndexMap<XOnlyPk, TapDerivation>
A compact size unsigned integer representing the number of leaf hashes, followed by a list
of leaf hashes, followed by the 4 byte master key fingerprint concatenated with the
derivation path of the public key. The derivation path is represented as 32-bit little
endian unsigned integer indexes concatenated with each other. Public keys are those needed
to spend this output. The leaf hashes are of the leaves which involve this public key. The
internal key does not have leaf hashes, so can be indicated with a hashes len of 0.
Finalizers should remove this field after PSBT_IN_FINAL_SCRIPTWITNESS
is constructed.
tap_internal_key: Option<InternalPk>
The X-only pubkey used as the internal key in this output. Finalizers should remove this
field after PSBT_IN_FINAL_SCRIPTWITNESS
is constructed.
tap_merkle_root: Option<TapNodeHash>
The 32 byte Merkle root hash. Finalizers should remove this field after
PSBT_IN_FINAL_SCRIPTWITNESS
is constructed.
proprietary: IndexMap<PropKey, ValueData>
Proprietary keys
unknown: IndexMap<u8, IndexMap<ByteStr, ValueData>>
Unknown keys
Implementations§
Source§impl Input
impl Input
pub fn new(index: usize) -> Input
pub fn with_txin(txin: impl Into<UnsignedTxIn>, index: usize) -> Input
pub fn from_unsigned_txin(_: (usize, UnsignedTxIn)) -> Input
pub fn to_unsigned_txin(&self) -> UnsignedTxIn
pub fn prev_txout(&self) -> &TxOut
pub fn prevout(&self) -> Prevout
pub fn value(&self) -> Sats
pub fn index(&self) -> usize
Sourcepub fn script_code(&self) -> Option<ScriptCode>
pub fn script_code(&self) -> Option<ScriptCode>
Computes script code, used in SegWit v0 signing algorithm (BIP143).
NB: Does not support processing of OP_CODESEPARATOR
.
§Returns
None
if input spends P2WSH or P2WSH-in-P2SH output, but contains no witness script.
pub fn is_segwit_v0(&self) -> bool
pub fn is_bip340(&self) -> bool
pub fn is_finalized(&self) -> bool
pub fn finalize<D, K, V>(&mut self, descriptor: &D) -> boolwhere
D: Descriptor<K, V>,
Trait Implementations§
Source§impl KeyMap for Input
impl KeyMap for Input
const PROPRIETARY_TYPE: <Input as KeyMap>::Keys = InputKey::Proprietary
type Keys = InputKey
fn retrieve_key_pair<'enc>( &'enc self, _: PsbtVer, key_type: <Input as KeyMap>::Keys, ) -> Vec<KeyPair<<Input as KeyMap>::Keys, Box<dyn Encode + 'enc>, Box<dyn Encode + 'enc>>>
fn insert_singular( &mut self, key_type: <Input as KeyMap>::Keys, value_data: ValueData, ) -> Result<(), PsbtError>
fn insert_plural( &mut self, key_type: <Input as KeyMap>::Keys, key_data: ByteStr, value_data: ValueData, ) -> Result<(), PsbtError>
fn encode_map( &self, version: PsbtVer, writer: &mut dyn Write, ) -> Result<usize, IoError>
fn parse_map( &mut self, version: PsbtVer, map: Map<Self::Keys>, ) -> Result<(), PsbtError>
fn has_proprietary(&self, key: &PropKey) -> bool
fn proprietary(&self, key: &PropKey) -> Option<&ValueData>
fn proprietary_mut(&mut self, key: &PropKey) -> Option<&mut ValueData>
fn push_proprietary( &mut self, key: PropKey, value: impl Into<ValueData>, ) -> Result<(), KeyAlreadyPresent>
fn remove_proprietary(&mut self, key: &PropKey) -> Option<ValueData>
fn insert_proprietary(&mut self, prop_key: PropKey, value_data: ValueData)
fn insert_unknown( &mut self, key_type: u8, key_data: ByteStr, value_data: ValueData, )
Source§impl RgbInExt for Input
impl RgbInExt for Input
Source§fn rgb_consumer(
&self,
contract_id: ContractId,
) -> Result<Option<OpId>, FromSliceError>
fn rgb_consumer( &self, contract_id: ContractId, ) -> Result<Option<OpId>, FromSliceError>
Source§fn set_rgb_consumer(
&mut self,
contract_id: ContractId,
opid: OpId,
) -> Result<bool, KeyAlreadyPresent>
fn set_rgb_consumer( &mut self, contract_id: ContractId, opid: OpId, ) -> Result<bool, KeyAlreadyPresent>
Source§impl Serialize for Input
impl Serialize for Input
Source§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 StructuralPartialEq for Input
Auto Trait Implementations§
impl Freeze for Input
impl RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnwindSafe for Input
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.