Skip to main content

UintNote

Fields

FieldType
ownerAztecAddress
randomnessField
valueu128

Methods

new

UintNote::new(value, owner);

Parameters

NameType
valueu128
ownerAztecAddress

get_value

UintNote::get_value(self);

Parameters

NameType
self

partial

/ 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 from sender so that they can / discover the note. recipient will typically be the same as owner.

UintNote::partial(owner, storage_slot, context, recipient, sender, completer, );

Parameters

NameType
ownerAztecAddress
storage_slotField
context&mut PrivateContext
recipientAztecAddress
senderAztecAddress
completerAztecAddress

UintPartialNotePrivateContent

Fields

FieldType
ownerAztecAddress
randomnessField

Methods

compute_partial_commitment

UintPartialNotePrivateContent::compute_partial_commitment(self, storage_slot);

Parameters

NameType
self
storage_slotField

PrivateUintPartialNotePrivateLogContent

Fields

FieldType
public_log_tagField
ownerAztecAddress
randomnessField

PartialUintNote

Fields

FieldType
commitmentField

Methods

complete

/ Completes the partial note, creating a new note that can be used like any other UintNote.

PartialUintNote::complete(self, context, completer, value);

Parameters

NameType
self
context&mut PublicContext
completerAztecAddress
valueu128

compute_validity_commitment

/ Computes a validity commitment for this partial note. The commitment cryptographically binds the note's private / data with the designated completer address. When the note is later completed in public execution, we can load / this commitment from the nullifier tree and verify that both the partial note (e.g. that the storage slot / corresponds to the correct owner, and that we're using the correct state variable) and completer are / legitimate.

PartialUintNote::compute_validity_commitment(self, completer);

Parameters

NameType
self
completerAztecAddress

compute_note_completion_log

PartialUintNote::compute_note_completion_log(self, value);

Parameters

NameType
self
valueu128

compute_complete_note_hash

PartialUintNote::compute_complete_note_hash(self, value);

Parameters

NameType
self
valueu128

Standalone Functions

compute_note_hash

compute_note_hash(self, storage_slot);

Parameters

NameType
self
storage_slotField

compute_nullifier

compute_nullifier(self, context, note_hash_for_nullify, );

#[note] macro.

Parameters

NameType
self
context&mut PrivateContext
note_hash_for_nullifyField

compute_nullifier_unconstrained

compute_nullifier_unconstrained(self, note_hash_for_nullify);

Parameters

NameType
self
note_hash_for_nullifyField

get_id

get_id();

Takes no parameters.

note_hash_matches_completed_partial_note_hash

note_hash_matches_completed_partial_note_hash();

Takes no parameters.

unpack_from_partial_note_encoding

unpack_from_partial_note_encoding();

Takes no parameters.