Cloak ships two first-party SDKs targeting the same on-chain protocol. Pick the one that matches your stack:Documentation Index
Fetch the complete documentation index at: https://docs.cloak.ag/llms.txt
Use this file to discover all available pages before exploring further.
TypeScript SDK
@cloak.dev/sdk — browser + Node.js SDK with a high-level CloakSDK class,
wallet-adapter integration, built-in scanner and note storage.
Integrates with @solana/web3.js and @solana/kit.Rust SDK
cloak-sdk — engine-first Rust crate. One transact() entrypoint,
one TransactOptions struct, full protocol pipeline end-to-end.Which one should I use?
| If you’re building… | Use |
|---|---|
| A web frontend or browser wallet | TypeScript |
| A Next.js / Node.js backend | TypeScript |
| A Rust backend, service, or CLI | Rust |
| A Solana program client | Rust |
Shared runtime defaults
| Setting | Value |
|---|---|
| Program ID | zh1eLd6rSphLejbFfJEneUwzHRfMKxgzrgkfwA6qRkW |
| Default relay URL | https://api.cloak.ag |
| Circuits base URL | https://cloak-circuits.s3.us-east-1.amazonaws.com/circuits/0.1.0 |
| Merkle tree height | 32 |
| Circuit arity | 2 inputs / 2 outputs |
| Proof format | 256-byte Groth16 (pinocchio) |
| Public inputs | 264 bytes |
relayUrl if you’re targeting a different deployment (e.g. devnet).
Shared concepts
Before you write code, skim the language-agnostic primer:- Core concepts — commitments, Merkle tree, nullifiers, fees, stale-root retries, viewing keys.
- Transaction flows — how deposit/transfer/withdraw/swap actually hit the chain.
- Viewing keys and compliance — the chain-note compliance rail.
TypeScript SDK
Start here for web3.js and Solana Kit integrations:- Quickstart — minimal end-to-end SOL send.
- Code examples — send, swap, payroll, history.
- API reference — full
CloakSDKclass surface.
Rust SDK
Start here for server-side and CLI integrations:- Introduction — install, minimal setup, and scope.
- Quickstart — first direct-path deposit.
- API reference —
TransactOptions,TransactResult,Relay, and related types.