Circuits, relayer, stealth (advanced)
Companion to the high-level ZkpClient / ZkpWallet docs.
Typical extra imports (web / Node)
| You use | From | Why |
|---|---|---|
IndexedDBStorage, LocalStorage, IndexedDBStealthStore | @zk-privacy/web | Optional persistence / stealth store |
FileStorage | @zk-privacy/node | Override default file-based storage |
Balances and transfers for normal apps stay on client and wallet. You do not need Grumpkin, ElGamal, or ZkpProver for standard integration.
RelayerClient (RelayerConfig)
Usually set relayerUrl on ZkpClientConfig only. Import RelayerClient when you call the relayer outside ZkpClient (tooling, tests).
| Method | Role |
|---|---|
submitTransferProof | Post concealed-transfer proof |
submitWithdrawToPublicProof | Post withdraw-to-public proof |
submitConcealFromPublic | Public → concealed via relayer |
register | BPK registration (+ optional autoshield) |
setAutoConceal | Toggle auto-incoming |
getStatus / waitForConfirmation | Track submitted txs |
healthCheck | Liveness |
Stealth (full StealthManager API)
Use wallet.stealth from ZkpWallet. In the browser, IndexedDBStealthStore (@zk-privacy/web) can back metadata when you configure stealth storage yourself.
| Method | Description |
|---|---|
create(options?) | New stealth address + on-chain registration as configured |
list() | All stored stealth addresses |
get(index) | By index |
getByEvmAddress / getByBpkHash | Lookup |
update(index, { label? }) | Metadata |
getKeys(index) | Derived keys for index |
getBalance(index) / getBalances() | Concealed balances |
recover(maxIndex?) | Rescan / recovery |
clear() | Wipe local store |
Low-level: deriveStealth* and MemoryStealthStore from @zk-privacy/core are for custom storage or offline tooling — see Packages & exports.
Why core exports Grumpkin, ElGamal, keys, prover, …
Those symbols support custom provers (e.g. native/MoPro), indexers, audits, and shared types across platforms. They are not the recommended surface for typical @zk-privacy/web / @zk-privacy/node UI code. The full list is on Packages & exports.