Struct elements::TxOut [−][src]
pub struct TxOut { pub asset: Asset, pub value: Value, pub nonce: Nonce, pub script_pubkey: Script, pub witness: TxOutWitness, }
Expand description
Transaction output
Fields
asset: Asset
Committed asset
value: Value
Committed amount
nonce: Nonce
Nonce (ECDH key passed to recipient)
script_pubkey: Script
Scriptpubkey
witness: TxOutWitness
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
Whether this data represents nulldata (OP_RETURN followed by pushes, not necessarily minimal)
Whether this output is a pegout, which is a subset of nulldata with the following extra rules: (a) there must be at least 2 pushes, the first of which must be 32 bytes and the second of which must be nonempty; (b) all pushes must use a push opcode rather than a numeric or reserved opcode
If this output is a pegout, returns the destination genesis block, the destination script pubkey, and any additional data
Extracts the minimum value from the rangeproof, if there is one, or returns 0.
pub fn new_not_last_confidential<R, C>(
rng: &mut R,
secp: &Secp256k1<C>,
value: u64,
address: Address,
asset: AssetId,
spent_utxo_secrets: &[(Asset, Option<&TxOutSecrets>)]
) -> Result<(Self, AssetBlindingFactor, ValueBlindingFactor), ConfidentialTxOutError> where
R: RngCore + CryptoRng,
C: Signing,
pub fn new_not_last_confidential<R, C>(
rng: &mut R,
secp: &Secp256k1<C>,
value: u64,
address: Address,
asset: AssetId,
spent_utxo_secrets: &[(Asset, Option<&TxOutSecrets>)]
) -> Result<(Self, AssetBlindingFactor, ValueBlindingFactor), ConfidentialTxOutError> where
R: RngCore + CryptoRng,
C: Signing,
Creates a new confidential output that is not the last one in the transaction.
Provide input secret information by creating TxOutSecrets
type.
The inputs secrets must be consistent with the target_asset confidential Asset
It is not necessary to supply [TxOutSecrets]
for explicit assets
pub fn to_non_last_confidential<R, C>(
&mut self,
rng: &mut R,
secp: &Secp256k1<C>,
blinder: PublicKey,
spent_utxo_secrets: &[(Asset, Option<&TxOutSecrets>)]
) -> Result<(AssetBlindingFactor, ValueBlindingFactor), ConfidentialTxOutError> where
R: RngCore + CryptoRng,
C: Signing,
pub fn to_non_last_confidential<R, C>(
&mut self,
rng: &mut R,
secp: &Secp256k1<C>,
blinder: PublicKey,
spent_utxo_secrets: &[(Asset, Option<&TxOutSecrets>)]
) -> Result<(AssetBlindingFactor, ValueBlindingFactor), ConfidentialTxOutError> where
R: RngCore + CryptoRng,
C: Signing,
Convert a explicit TxOut into a Confidential TxOut. The blinding key is provided by the blinder paramter. The initial value of nonce is ignored and is set to the ECDH pubkey sampled by the sender.
pub fn new_last_confidential<R, C>(
rng: &mut R,
secp: &Secp256k1<C>,
value: u64,
address: Address,
asset: AssetId,
spent_utxo_secrets: &[(Asset, &TxOutSecrets)],
output_secrets: &[&TxOutSecrets]
) -> Result<(Self, AssetBlindingFactor, ValueBlindingFactor), ConfidentialTxOutError> where
R: RngCore + CryptoRng,
C: Signing,
pub fn new_last_confidential<R, C>(
rng: &mut R,
secp: &Secp256k1<C>,
value: u64,
address: Address,
asset: AssetId,
spent_utxo_secrets: &[(Asset, &TxOutSecrets)],
output_secrets: &[&TxOutSecrets]
) -> Result<(Self, AssetBlindingFactor, ValueBlindingFactor), ConfidentialTxOutError> where
R: RngCore + CryptoRng,
C: Signing,
Creates a new confidential output that IS the last one in the transaction.
Provide input Asset information by creating [TxInputAsset
] type.
pub fn unblind<C: Verification>(
&self,
secp: &Secp256k1<C>,
blinding_key: SecretKey
) -> Result<TxOutSecrets, UnblindError>
pub fn unblind<C: Verification>(
&self,
secp: &Secp256k1<C>,
blinding_key: SecretKey
) -> Result<TxOutSecrets, UnblindError>
Unblinds a transaction output, if it is confidential.
It returns the secret elements of the value and asset Pedersen commitments.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TxOut
impl UnwindSafe for TxOut
Blanket Implementations
Mutably borrows from an owned value. Read more