> ## Documentation Index
> Fetch the complete documentation index at: https://sdk.umbraprivacy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install @umbra-privacy/sdk@5.x. The SDK ships everything in one package — operations are imported from named subpaths (/registration, /deposit, /burn, /query, …); the ZK prover lives at /zk-prover.

## Package

The SDK is a single package — `@umbra-privacy/sdk`. The ZK prover, indexer client, relayer client, store adapters, and Solana primitives are all subpaths of the same package. **There is no separate `@umbra-privacy/web-zk-prover`** — it is folded into `@umbra-privacy/sdk/zk-prover`.

<CodeGroup>
  ```bash pnpm theme={null}
  pnpm add @umbra-privacy/sdk@5.0.0-rc.6 snarkjs
  ```

  ```bash npm theme={null}
  npm install @umbra-privacy/sdk@5.0.0-rc.6 snarkjs
  ```

  ```bash yarn theme={null}
  yarn add @umbra-privacy/sdk@5.0.0-rc.6 snarkjs
  ```
</CodeGroup>

<Note>
  `snarkjs` is a **required peer dependency** — the SDK imports it for Groth16 proving. Install it alongside the SDK (as shown above) or the first prover import throws `ERR_MODULE_NOT_FOUND`.
</Note>

<Warning>
  Pin the SDK to an exact version (no `^`, no `~`). The ZK assets are versioned in lockstep with the package; a floating version can resolve a manifest that points at a different circuit hash than the one your wallet's master seed was set up for.
</Warning>

## TypeScript

The SDK is written in TypeScript and ships full type declarations. No additional `@types` packages are needed.

Minimum TypeScript version: **5.0**.

For Node.js:

```json theme={null}
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "strict": true
  }
}
```

## Subpath imports

The main `@umbra-privacy/sdk` barrel only re-exports:

* `getUmbraClient`, the four signer factories (`createInMemorySigner`, `createSignerFromPrivateKeyBytes`, `createSignerFromKeyPair`, `createSignerFromWalletAccount`).
* The full error hierarchy and the `Result<T, E>` helpers.
* Everything from `infrastructure/{arcium, indexer, relayer, solana, zk-prover}` — including `getUmbraRelayer`, `getUmbraIndexer`, RPC providers, transaction forwarders.

**Every operation factory lives behind a named subpath.** This keeps the main barrel small and helps bundlers tree-shake aggressively. The subpath map:

* `@umbra-privacy/sdk/client` — `IUmbraClient`, `IUmbraSigner` interfaces.
* `@umbra-privacy/sdk/shared` — protocol-wide constants. **`UMBRA_MESSAGE_TO_SIGN` lives here**, not on the main barrel.
* `@umbra-privacy/sdk/registration` — `getUserRegistrationFunction` + executors.
* `@umbra-privacy/sdk/deposit` — direct depositor + the four Stealth Pool Note creators.
* `@umbra-privacy/sdk/withdrawal` — ETA → ATA withdrawer.
* `@umbra-privacy/sdk/burn` — note scanner + three burner factories + `enrichWithMerkleProof`.
* `@umbra-privacy/sdk/query` — encrypted-balance + user-account queriers.
* `@umbra-privacy/sdk/conversion` — MXE-only → Shared converter.
* `@umbra-privacy/sdk/compliance` — grant issue / revoke / re-encrypt / query.
* `@umbra-privacy/sdk/account` — staged-token recoverers, key rotation, maintenance.
* `@umbra-privacy/sdk/zk-prover` — Groth16 provers (one factory per circuit) + `getCdnZkAssetProvider`.
* `@umbra-privacy/sdk/zk-prover/cdn` — direct access to the CDN asset provider.
* `@umbra-privacy/sdk/store-adapters` — `createBrowserStorageBackend`, `createShardedUtxoDataStore`, `createShardedNullifierStore`.
* `@umbra-privacy/sdk/store` — base store interfaces (for custom storage backends).
* `@umbra-privacy/sdk/indexer`, `@umbra-privacy/sdk/indexer/utxo`, `@umbra-privacy/sdk/indexer/nullifier` — typed indexer clients.
* `@umbra-privacy/sdk/relayer` — typed relayer client (re-exported from main barrel).
* `@umbra-privacy/sdk/solana`, `@umbra-privacy/sdk/pda`, `@umbra-privacy/sdk/token` — Solana primitives.
* `@umbra-privacy/sdk/arcium` — Arcium MPC types + helpers.
* `@umbra-privacy/sdk/constants` — `BPS_DIVISOR`, mint lists, etc.
* `@umbra-privacy/sdk/types` — branded primitives (`U64`, `Address`, …).
* `@umbra-privacy/sdk/crypto`, `…/crypto/poseidon`, `…/crypto/rescue`, `…/crypto/aes`, `…/crypto/key-derivation`, `…/crypto/challenges`, `…/crypto/commitment` — cryptographic primitives.
* `@umbra-privacy/sdk/errors` — error classes + `is*` type guards.
* `@umbra-privacy/sdk/converters`, `@umbra-privacy/sdk/temporal`, `@umbra-privacy/sdk/validation`, `@umbra-privacy/sdk/hooks`, `@umbra-privacy/sdk/pipeline`, `@umbra-privacy/sdk/fee-provider`, `@umbra-privacy/sdk/math` — utilities.

A typical app import block:

```typescript theme={null}
// Main barrel — client + signer + infrastructure
import {
  getUmbraClient,
  createSignerFromWalletAccount,
  getUmbraRelayer,
} from "@umbra-privacy/sdk";

// Operation subpaths
import { getUserRegistrationFunction } from "@umbra-privacy/sdk/registration";
import { getATAIntoETADirectDepositorFunction } from "@umbra-privacy/sdk/deposit";
import { getETAIntoATAWithdrawerFunction } from "@umbra-privacy/sdk/withdrawal";
import {
  getBurnableStealthPoolNoteScannerFunction,
  getReceiverBurnableStealthPoolNoteIntoETABurnerFunction,
} from "@umbra-privacy/sdk/burn";

// ZK prover (same package, named subpath)
import {
  getATAIntoStealthPoolNoteCreatorProver,
  getClaimReceiverClaimableUtxoIntoEncryptedBalanceProver,
} from "@umbra-privacy/sdk/zk-prover";

// Browser store adapters (recommended for any scanning workload)
import {
  createBrowserStorageBackend,
  createShardedUtxoDataStore,
  createShardedNullifierStore,
} from "@umbra-privacy/sdk/store-adapters";

// Error classification
import { isEncryptedDepositError } from "@umbra-privacy/sdk/errors";
```

<Note>
  The **burner** ZK prover factories are spelled `getClaim…ClaimableUtxo…`. The **creator** prover factories are `getETAIntoStealthPoolNoteCreatorProver` (ETA-source) and `getATAIntoStealthPoolNoteCreatorProver` (ATA-source).
</Note>

## Runtime Requirements

The SDK works in both Node.js (18+) and modern browser environments. It has no native dependencies — all cryptography is pure TypeScript / WebAssembly.

<Note>
  If you are using a bundler (Vite, webpack, Next.js), no special configuration is needed for the SDK itself. For Next.js, add `@umbra-privacy/sdk` to `transpilePackages` in `next.config.ts` if you hit ESM/CJS interop issues.
</Note>
