[][src]Struct grin_core::core::transaction::OutputIdentifier

pub struct OutputIdentifier {
    pub features: OutputFeatures,
    pub commit: Commitment,
}

An output_identifier can be build from either an input or an output and contains everything we need to uniquely identify an output being spent. Needed because it is not sufficient to pass a commitment around.

Fields

features: OutputFeatures

Output features (coinbase vs. regular transaction output) We need to include this when hashing to ensure coinbase maturity can be enforced.

commit: Commitment

Output commitment

Methods

impl OutputIdentifier[src]

pub fn new(features: OutputFeatures, commit: &Commitment) -> OutputIdentifier[src]

Build a new output_identifier.

pub fn commitment(&self) -> Commitment[src]

Our commitment.

pub fn from_output(output: &Output) -> OutputIdentifier[src]

Build an output_identifier from an existing output.

pub fn into_output(self, proof: RangeProof) -> Output[src]

Converts this identifier to a full output, provided a RangeProof

pub fn from_input(input: &Input) -> OutputIdentifier[src]

Build an output_identifier from an existing input.

pub fn to_hex(&self) -> String[src]

convert an output_identifier to hex string format.

Trait Implementations

impl Writeable for OutputIdentifier[src]

impl Readable for OutputIdentifier[src]

impl FixedLength for OutputIdentifier[src]

impl Clone for OutputIdentifier[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq<OutputIdentifier> for OutputIdentifier[src]

impl From<Output> for OutputIdentifier[src]

impl Debug for OutputIdentifier[src]

impl Serialize for OutputIdentifier[src]

impl<'de> Deserialize<'de> for OutputIdentifier[src]

Auto Trait Implementations

Blanket Implementations

impl<W> Hashed for W where
    W: Writeable
[src]

impl<H> ShortIdentifiable for H where
    H: Hashed
[src]

fn short_id(&Self, &Hash, u64) -> ShortId[src]

Generate a short_id via the following -

  • extract k0/k1 from block_hash hashed with the nonce (first two u64 values) * initialize a siphasher24 with k0/k1
    • self.hash() passing in the siphasher24 instance
    • drop the 2 most significant bytes (to return a 6 byte short_id)

impl<T> PMMRIndexHashable for T where
    T: Writeable
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> UnsafeAny for T where
    T: Any

impl<T> Erased for T

impl<T> Same for T

type Output = T

Should always be Self