@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
new NullifierMemo(P, nk): NullifierMemo;Defined in: @lelantos-org/sdk/dist/wallet/notes/sync-ops.d.ts:64
Parameters
| Parameter | Type |
|---|---|
P | Poseidon |
nk | bigint |
Returns
NullifierMemo
Accessors
size
Get Signature
get size(): number;Defined in: @lelantos-org/sdk/dist/wallet/notes/sync-ops.d.ts:68
Entries currently held.
Returns
number
Methods
has()
has(id): boolean;Defined in: @lelantos-org/sdk/dist/wallet/notes/sync-ops.d.ts:70
Whether id's nullifier is currently memoised.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
boolean
of()
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
| Parameter | Type |
|---|---|
n | StoredNote |
Returns
bigint
retain()
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
| Parameter | Type |
|---|---|
keep | ReadonlySet<string> |
drop | ReadonlySet<string> |
Returns
void