Skip to main content

Circuits, relayer, stealth (advanced)

Companion to the high-level ZkpClient / ZkpWallet docs.

Typical extra imports (web / Node)

You useFromWhy
IndexedDBStorage, LocalStorage, IndexedDBStealthStore@zk-privacy/webOptional persistence / stealth store
FileStorage@zk-privacy/nodeOverride 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).

MethodRole
submitTransferProofPost concealed-transfer proof
submitWithdrawToPublicProofPost withdraw-to-public proof
submitConcealFromPublicPublic → concealed via relayer
registerBPK registration (+ optional autoshield)
setAutoConcealToggle auto-incoming
getStatus / waitForConfirmationTrack submitted txs
healthCheckLiveness

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.

MethodDescription
create(options?)New stealth address + on-chain registration as configured
list()All stored stealth addresses
get(index)By index
getByEvmAddress / getByBpkHashLookup
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.