pub struct TxIn {
pub previous_output: OutPoint,
pub is_pegin: bool,
pub script_sig: Script,
pub sequence: Sequence,
pub asset_issuance: AssetIssuance,
pub witness: TxInWitness,
}
Expand description
A transaction input, which defines old coins to be consumed
Fields§
§previous_output: OutPoint
The reference to the previous output that is being used an an input
is_pegin: bool
Flag indicating that previous_outpoint
refers to something on the main chain
script_sig: Script
The script which pushes values on the stack which will cause the referenced output’s script to accept
sequence: Sequence
The sequence number, which suggests to miners which of two conflicting transactions should be preferred, or 0xFFFFFFFF to ignore this feature. This is generally never used since the miner behaviour cannot be enforced.
asset_issuance: AssetIssuance
Asset issuance data
witness: TxInWitness
Witness data - not deserialized/serialized as part of a TxIn
object
(rather as part of its containing transaction, if any) but is logically
part of the txin.
Implementations§
source§impl TxIn
impl TxIn
sourcepub fn is_coinbase(&self) -> bool
pub fn is_coinbase(&self) -> bool
Whether the input is a coinbase
sourcepub fn pegin_prevout(&self) -> Option<OutPoint>
pub fn pegin_prevout(&self) -> Option<OutPoint>
In case of a pegin input, returns the Bitcoin prevout.
sourcepub fn pegin_data(&self) -> Option<PeginData<'_>>
pub fn pegin_data(&self) -> Option<PeginData<'_>>
Extracts witness data from a pegin. Will return None
if any data
cannot be parsed. The combination of is_pegin()
returning true
and pegin_data()
returning None
indicates an invalid transaction.
sourcepub fn has_issuance(&self) -> bool
pub fn has_issuance(&self) -> bool
Helper to determine whether an input has an asset issuance attached
sourcepub fn outpoint_flag(&self) -> u8
pub fn outpoint_flag(&self) -> u8
Obtain the outpoint flag corresponding to this input
sourcepub fn issuance_ids(&self) -> (AssetId, AssetId)
pub fn issuance_ids(&self) -> (AssetId, AssetId)
Compute the issuance asset ids from this TxIn
. This function does not check
whether there is an issuance in this input. Returns (asset_id, token_id)
source§impl TxIn
impl TxIn
sourcepub fn blind_issuances_with_bfs<C: Signing>(
&mut self,
secp: &Secp256k1<C>,
issue_vbf: ValueBlindingFactor,
token_vbf: ValueBlindingFactor,
issue_sk: SecretKey,
token_sk: SecretKey
) -> Result<(), BlindError>
pub fn blind_issuances_with_bfs<C: Signing>( &mut self, secp: &Secp256k1<C>, issue_vbf: ValueBlindingFactor, token_vbf: ValueBlindingFactor, issue_sk: SecretKey, token_sk: SecretKey ) -> Result<(), BlindError>
Blind issuances for this TxIn
. Asset amount and token amount must be
set in AssetIssuance
field for this input
sourcepub fn blind_issuances<C: Signing, R: RngCore + CryptoRng>(
&mut self,
secp: &Secp256k1<C>,
rng: &mut R
) -> Result<(ValueBlindingFactor, SecretKey, ValueBlindingFactor, SecretKey), BlindError>
pub fn blind_issuances<C: Signing, R: RngCore + CryptoRng>( &mut self, secp: &Secp256k1<C>, rng: &mut R ) -> Result<(ValueBlindingFactor, SecretKey, ValueBlindingFactor, SecretKey), BlindError>
Blind issuances for this TxIn
. Asset amount and token amount must be
set in AssetIssuance
field for this input
Returns (issuance_blinding_factor, issue_blind_sec_key, token_blinding_factor, token_blind_sec_key)
Trait Implementations§
source§impl Ord for TxIn
impl Ord for TxIn
source§impl PartialEq for TxIn
impl PartialEq for TxIn
source§impl PartialOrd for TxIn
impl PartialOrd for TxIn
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more