Skip to main content

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.

Cloak ships two first-party SDKs targeting the same on-chain protocol. Pick the one that matches your stack:

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 walletTypeScript
A Next.js / Node.js backendTypeScript
A Rust backend, service, or CLIRust
A Solana program clientRust
Both SDKs speak the same protocol and produce the same 264-byte public inputs. Migrating between them is straightforward once you understand the shared primitives.

Shared runtime defaults

SettingValue
Program IDzh1eLd6rSphLejbFfJEneUwzHRfMKxgzrgkfwA6qRkW
Default relay URLhttps://api.cloak.ag
Circuits base URLhttps://cloak-circuits.s3.us-east-1.amazonaws.com/circuits/0.1.0
Merkle tree height32
Circuit arity2 inputs / 2 outputs
Proof format256-byte Groth16 (pinocchio)
Public inputs264 bytes
The relay URL points at Cloak’s hosted submission endpoint that the SDK uses to land transactions on-chain. The default is correct for mainnet — only override relayUrl if you’re targeting a different deployment (e.g. devnet).

Shared concepts

Before you write code, skim the language-agnostic primer:

TypeScript SDK

Start here for web3.js and Solana Kit integrations: Install:
npm install @cloak.dev/sdk @solana/web3.js

Rust SDK

Start here for server-side and CLI integrations: Install:
[dependencies]
cloak-sdk = { git = "https://github.com/cloak-ag/rustsdk" }