Skip to content

@lelantos-org/sdk / internal / NullifierMemo

Class: NullifierMemo ​

Defined in: @lelantos-org/sdk/dist/wallet/notes/sync-ops.d.ts:60

Note id → nullifier, derived once per note rather than once per sync, so a reconcile pass costs one Poseidon hash per newly seen note.

Built from nk, so a full-viewing-key holder can construct one: nf = Poseidon(TAG_NF, nk, rho, cm) requires no spend authority.

In memory only. Nullifiers are the on-chain spend identifiers, and the notes file carries no nsk: a leaked or backed-up file links its holder to their commitments but not to their spends, which persisting nullifiers would expose.

Keyed by id rather than note object because cache.refresh() may rehydrate new objects, while ids are persisted and stable.

Constructors ​

Constructor ​

ts
new NullifierMemo(P, nk): NullifierMemo;

Defined in: @lelantos-org/sdk/dist/wallet/notes/sync-ops.d.ts:64

Parameters ​

ParameterType
PPoseidon
nkbigint

Returns ​

NullifierMemo

Accessors ​

size ​

Get Signature ​

ts
get size(): number;

Defined in: @lelantos-org/sdk/dist/wallet/notes/sync-ops.d.ts:68

Entries currently held.

Returns ​

number

Methods ​

has() ​

ts
has(id): boolean;

Defined in: @lelantos-org/sdk/dist/wallet/notes/sync-ops.d.ts:70

Whether id's nullifier is currently memoised.

Parameters ​

ParameterType
idstring

Returns ​

boolean


of() ​

ts
of(n): bigint;

Defined in: @lelantos-org/sdk/dist/wallet/notes/sync-ops.d.ts:66

This note's nullifier, derived on first request.

Parameters ​

ParameterType
nStoredNote

Returns ​

bigint


retain() ​

ts
retain(keep, drop): void;

Defined in: @lelantos-org/sdk/dist/wallet/notes/sync-ops.d.ts:77

Drop every entry outside keep, plus everything in drop.

Each reconcile pass calls it with keep as the unspent notes and drop as those the pass found spent, which bounds the memo by the unspent-note count.

Parameters ​

ParameterType
keepReadonlySet<string>
dropReadonlySet<string>

Returns ​

void