Struct monero::blockdata::transaction::OwnedTxOut [−][src]
pub struct OwnedTxOut<'a> { /* fields omitted */ }
Expand description
Transaction ouput that can be redeemed by a private key pair at a given index and are returned
by the check_outputs
method.
use monero::blockdata::transaction::Transaction; use monero::consensus::encode::deserialize; use monero::util::key::{KeyPair, PrivateKey, PublicKey, ViewPair}; // Keypair used to recover the ephemeral spend key of an output let keypair = KeyPair { view: secret_view, spend: secret_spend, }; // Viewpair used to scan a transaction to retreive owned outputs let view_pair = ViewPair { view: secret_view, spend }; // Get all owned output for sub-addresses in range of 0-1 major index and 0-2 minor index let owned_outputs = tx.check_outputs(&view_pair, 0..2, 0..3).unwrap(); for out in owned_outputs { // Recover the ephemeral private spend key let private_key = out.recover_key(&keypair); }
Implementations
impl<'a> OwnedTxOut<'a>
[src]
impl<'a> OwnedTxOut<'a>
[src]pub fn sub_index(&self) -> Index
[src]
pub fn sub_index(&self) -> Index
[src]Returns the index of the key pair to use, can be 0/0
for main address.
pub fn amount(&self) -> Option<u64>
[src]
pub fn amount(&self) -> Option<u64>
[src]Returns the unblinded amount of this output.
None if we didn’t have enough information to unblind the output.
pub fn blinding_factor(&self) -> Option<Scalar>
[src]
pub fn blinding_factor(&self) -> Option<Scalar>
[src]Returns the original blinding factor of this output.
None if we didn’t have enough information to unblind the output.
pub fn commitment(&self) -> Option<EdwardsPoint>
[src]
pub fn commitment(&self) -> Option<EdwardsPoint>
[src]Returns the original commitment of this output.
None if we didn’t have enough information to unblind the output.
pub fn recover_key(&self, keys: &KeyPair) -> PrivateKey
[src]
pub fn recover_key(&self, keys: &KeyPair) -> PrivateKey
[src]Recover the ephemeral private key for spending the output, this requires access to the private spend key.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for OwnedTxOut<'a>
impl<'a> Send for OwnedTxOut<'a>
impl<'a> Sync for OwnedTxOut<'a>
impl<'a> Unpin for OwnedTxOut<'a>
impl<'a> UnwindSafe for OwnedTxOut<'a>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self