Struct phoenix_core::note::Note[][src]

pub struct Note { /* fields omitted */ }
Expand description

A note that does not encrypt its value

Implementations

Creates a new phoenix output note

Creates a new transparent note

The blinding factor will be constant zero since the value commitment exists only to shield the value. The value is not hidden for transparent notes, so this can be trivially treated as a constant.

Creates a new obfuscated note

The provided blinding factor will be used to calculate the value commitment of the note. The tuple (value, blinding_factor), known by the caller of this function, must be later used to prove the knowledge of the value commitment of this note.

Create a new phoenix output note without inner randomness

Create a unique nullifier for the note

This nullifier is represeted as H(sk_r · G', pos)

Return the internal representation of scalars to be hashed

Return a hash represented by `H(note_type, value_commitment, H(StealthAddress), pos, encrypted_data)

Return the type of the note

Return the position of the note on the tree.

Set the position of the note on the tree. This, naturally, won’t reflect immediatelly on the data storage

Nonce used for the encrypt / decrypt of data for this note

Return the value commitment H(value, blinding_factor)

Returns the cipher of the encrypted data

Attempt to decrypt the note value provided a ViewKey. Always succeeds for transparent notes, might fails or return random values for obfuscated notes if the provided view key is wrong.

Decrypt the blinding factor with the provided ViewKey

If the decrypt fails, a random value is returned

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Returns the associated StealthAddress

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Converts a Note into a byte representation

Attempts to convert a byte representation of a note into a Note, failing if the input is invalid

The type returned in the event of a conversion error.

The size of

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Deserialize a slice of u8 into Self

Deserialize the type reading the bytes from a reader. The bytes read are removed from the reader. Read more

Performs the conversion.

Performs the conversion.

Parse a string slice as bytes hex representation and returns `

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.