aztec-nr - uint_note

Struct UintNote

pub struct UintNote {
    pub value: u128,
}

A private note representing a numeric value associated to an account (e.g. a token balance).

Fields

value: u128

The number stored in the note.

Implementations

impl UintNote

pub fn partial( owner: AztecAddress, storage_slot: Field, context: &mut PrivateContext, recipient: AztecAddress, completer: AztecAddress, ) -> PartialUintNote

Creates a partial note that will hide the owner and storage slot but not the value, since the note will be later completed in public. This is a powerful technique for scenarios in which the value cannot be known in private (e.g. because it depends on some public state, such as a DEX).

This function inserts a partial note validity commitment into the nullifier tree to be later on able to verify that the partial note and completer are legitimate. See function docs of compute_validity_commitment for more details.

Each partial note should only be used once, since otherwise multiple notes would be linked together and known to belong to the same owner.

As part of the partial note creation process, a log will be sent to recipient so that they can discover the note. recipient will typically be the same as owner.

Trait implementations

impl Deserialize for UintNote

pub fn deserialize(serialized: [Field; 1]) -> Self

impl Eq for UintNote

pub fn eq(_self: Self, _other: Self) -> bool

impl NoteHash for UintNote

pub fn compute_note_hash( self, owner: AztecAddress, storage_slot: Field, randomness: Field, ) -> Field pub fn compute_nullifier( self, context: &mut PrivateContext, owner: AztecAddress, note_hash_for_nullification: Field, ) -> Field pub unconstrained fn compute_nullifier_unconstrained( self, owner: AztecAddress, note_hash_for_nullification: Field, ) -> Field

impl NoteProperties<UintNoteProperties> for UintNote

pub fn properties() -> UintNoteProperties

impl NoteType for UintNote

pub fn get_id() -> Field

impl Packable for UintNote

pub fn pack(self) -> [Field; 1] pub fn unpack(packed: [Field; 1]) -> Self

impl Serialize for UintNote

pub fn serialize(self) -> [Field; 1]