@cloak.dev/sdk).
Quick launch
Use in Cursor
Open the Cursor starter prompt.
Use in Claude Code
Open the Claude starter prompt.
Use in Windsurf
Open the Windsurf starter prompt.
1) Rules file
Create.cursor/rules.md:
View .cursor/rules.md template
View .cursor/rules.md template
Cursor Rules for SDK
This project integrates@cloak.dev/sdk.Fixed integration constants
- Program ID:
zh1eLd6rSphLejbFfJEneUwzHRfMKxgzrgkfwA6qRkW - Circuit base URL:
https://storage.googleapis.com/cloak-circuits/circuits/0.2.0(ceremony bundle, and the SDK default). Never hand-write the string: use the exportedDEFAULT_CIRCUITS_URLconstant, orresolveCircuitsBase()when a base may be overridden. Never use0.1.0: the program no longer accepts those artifacts.
SDK capability coverage (must evaluate all)
- Note API free functions (
generateNoteFromWallet,parseNote,serializeNote,exportNote) - UTXO primitives + transaction API
- scanner/compliance API
- viewing-key + metadata encryption API
- relay/proof/Merkle helpers
- fees/errors/network/wallet/storage utilities
Required behavior
- UTXO path is primary for new integrations.
- Amounts are
bigintin tx logic. - Viewing-key registration is enforced inside the SDK transaction flows (
transact,transfer,partialWithdraw,fullWithdraw,swapWithChange); do not add an app-level registration step and do not disable it. Call the exportedregisterViewingKeyonly for standalone compliance or history scanning. - Keep history cache-first with explicit rescan.
Safety
- Never log private keys, viewing keys (
nk), seed material, or raw note payloads. - Transaction signatures are public and can be logged for support/debugging.
- Use SDK defaults for program and circuits. Do not expose those as user-facing config. The relay has no SDK default: pass
relayUrlexplicitly on every call. The SDK reads no environment variable for it; if the value should be configurable, readCLOAK_RELAY_URLin your own code and pass it asrelayUrl. OmittingrelayUrlthrowsViewing key registration is mandatory: relayUrl is required.before any network call, deposits included. - Never pass
relayUrl: ""to “skip the relay”. Under the defaultenforceViewingKeyRegistrationit throws the same error as omitting it, and it only signals caller-signed direct submission whenenforceViewingKeyRegistration: falseis set as well, which submits a send or withdrawal under the user’s own key and publicly links it. - In browser code, authenticate the sender with
signMessage+walletPublicKeyin the transact options. Never emitdepositorKeypairin browser send or withdraw code. - Never substitute the authenticated sender with an ephemeral or service key. That key is the one screened, so it must be the end user’s own wallet key.
- Never tell the user they must use a particular RPC provider. The RPC endpoint is the app owner’s choice.
- Rely on SDK stale-root retries by default; add extra app-level retry/backoff only when explicitly required.
Reference docs
/llms.txt/llms-full.txt/sdk/llms.txt/sdk/api-reference/sdk/request-authentication/sdk/utxo-transactions/sdk/wallet-integration
2) Starter prompt
Copy starter prompt
Copy starter prompt
Implement this feature with
@cloak.dev/sdk.First, output a matrix for these capability groups:- Note API
- UTXO API
- Scanner/compliance
- Viewing keys + metadata encryption
- Relay/proof/Merkle helpers
- Utility modules
used or not used + reason.Then:- produce file-by-file patches
- keep bigint-safe logic
- include wallet-adapter and keypair-bytes examples where applicable, following
/sdk/request-authenticationfor the wallet-adapter path - run checks and summarize verification output
3) High-value prompts
Generate complete SDK integration scaffold
Generate complete SDK integration scaffold
Create hooks/services for deposit/send/withdraw/swap + compliance history + CSV export.
Fix contract mismatches
Fix contract mismatches
Audit and patch all mismatches against current SDK API and runtime behavior.
Production hardening pass
Production hardening pass
Improve retries, error mapping, progress UX, and secret-safe logging for all transaction flows.