monero_rpc

Trait DecoyRpc

Source
pub trait DecoyRpc:
    Sync
    + Clone
    + Debug {
    // Required methods
    fn get_output_distribution_end_height<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<usize, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_output_distribution<'life0, 'async_trait>(
        &'life0 self,
        range: impl 'async_trait + Send + RangeBounds<usize>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u64>, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_outs<'life0, 'life1, 'async_trait>(
        &'life0 self,
        indexes: &'life1 [u64],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<OutputInformation>, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_unlocked_outputs<'life0, 'life1, 'async_trait>(
        &'life0 self,
        indexes: &'life1 [u64],
        height: usize,
        fingerprintable_deterministic: bool,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<[EdwardsPoint; 2]>>, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A trait for any object which can be used to select RingCT decoys.

An implementation is provided for any satisfier of Rpc. It is not recommended to use an Rpc object to satisfy this. This should be satisfied by a local store of the output distribution, both for performance and to prevent potential attacks a remote node can perform.

Required Methods§

Source

fn get_output_distribution_end_height<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<usize, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the height the output distribution ends at.

This is equivalent to the hight of the blockchain it’s for. This is intended to be cheaper than fetching the entire output distribution.

Source

fn get_output_distribution<'life0, 'async_trait>( &'life0 self, range: impl 'async_trait + Send + RangeBounds<usize>, ) -> Pin<Box<dyn Future<Output = Result<Vec<u64>, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the RingCT (zero-amount) output distribution.

range is in terms of block numbers. The result may be smaller than the requested range if the range starts before RingCT outputs were created on-chain.

Source

fn get_outs<'life0, 'life1, 'async_trait>( &'life0 self, indexes: &'life1 [u64], ) -> Pin<Box<dyn Future<Output = Result<Vec<OutputInformation>, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the specified outputs from the RingCT (zero-amount) pool.

Source

fn get_unlocked_outputs<'life0, 'life1, 'async_trait>( &'life0 self, indexes: &'life1 [u64], height: usize, fingerprintable_deterministic: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<[EdwardsPoint; 2]>>, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the specified outputs from the RingCT (zero-amount) pool, but only return them if their timelock has been satisfied.

The timelock being satisfied is distinct from being free of the 10-block lock applied to all Monero transactions.

The node is trusted for if the output is unlocked unless fingerprintable_deterministic is set to true. If fingerprintable_deterministic is set to true, the node’s local view isn’t used, yet the transaction’s timelock is checked to be unlocked at the specified height. This offers a deterministic decoy selection, yet is fingerprintable as time-based timelocks aren’t evaluated (and considered locked, preventing their selection).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<R: Rpc> DecoyRpc for R