Skip to main content
Use this page to point coding agents at the right Cloak docs before they write code.

Canonical AI files

  1. /llms.txt
  2. /llms-full.txt
  3. /sdk/llms.txt
  4. /sdk/quickstart
  5. /sdk/request-authentication
  6. /sdk/utxo-transactions

User-facing copy

When generating UI text about fees, custody, recovery, or privacy claims, use the “User Guide” section of /llms.txt (routes under /guide/ and /learn/); those pages are authoritative for user-facing wording. Do not invent fee numbers or custody claims.

One-shot prompt: simple SOL send flow

Use this as your first message in Claude Code, Cursor, or Windsurf.
Implement a minimal Cloak integration for a simple SOL send flow using @cloak.dev/sdk.Read these docs first and follow them exactly:
  • /llms.txt
  • /llms-full.txt
  • /sdk/llms.txt
  • /sdk/quickstart
  • /sdk/request-authentication
  • /sdk/utxo-transactions
  • /sdk/wallet-integration
Build requirements:
  1. Use the UTXO API (not legacy note APIs) and keep transaction amounts as bigint.
  2. Implement deposit then full withdraw (send) flow:
    • deposit with transact(...)
    • send with fullWithdraw(...)
  3. Include one integration path using keypair bytes and one using wallet-adapter where relevant. Follow /sdk/request-authentication for the wallet-adapter path.
  4. Add progress and error states suitable for production UX.
  5. Never log secrets (private keys, viewing keys (nk), raw note payloads, seed material). Transaction signatures are public and may be logged for support/debugging.
  6. Rely on SDK default stale-root handling for standard flows; do not add custom retry loops unless explicitly requested.
  7. Use SDK defaults for program and circuits, and do not ask end users to configure them. The relay has no SDK default: pass relayUrl explicitly on every transact / fullWithdraw call. The SDK reads no environment variable for it, so if you want the value configurable, read CLOAK_RELAY_URL in your own code and pass it as relayUrl. Omitting relayUrl throws Viewing key registration is mandatory: relayUrl is required. before any network call, deposits included.
  8. Never pass relayUrl: "" to “skip the relay”. With the default enforceViewingKeyRegistration it throws the same error as omitting it, and it only signals caller-signed direct submission when enforceViewingKeyRegistration: false is set as well. That combination submits a send or withdrawal under the user’s own key and publicly links it, so do not generate it.
  9. In browser code, authenticate the sender with signMessage + walletPublicKey in the transact options. Never emit depositorKeypair in browser send or withdraw code.
  10. 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.
  11. Never tell the user they must use a particular RPC provider. SOLANA_RPC_URL is the app owner’s choice.
  12. For script-only tasks, default to keypair path + lamports CLI (<recipientPubkey> <lamports>).
  13. For script-only tasks, parse recipient/amount from CLI args (not env) and exit explicitly (process.exit(0|1)).
Return format:
  • capability matrix (used / not used) for: note API, UTXO API, scanner/compliance, viewing keys/metadata encryption, relay/proof/Merkle helpers, utility modules
  • file-by-file patches
  • commands run
  • verification summary

Success checklist

  • UTXO flow is the primary execution path.
  • Sign-of-external-amount semantics are correct (positive = deposit, negative = withdraw/swap, zero = transfer).
  • No secret leakage in logs or telemetry.
  • Docs references are included in the implementation notes.
  • No custom retry wrappers (the SDK handles stale-root + blockhash + transient transport).
  • The authenticated sender is the end user’s own wallet key, never an ephemeral or service key.
  • The RPC endpoint is presented as the app owner’s choice, not as a required provider.
  • All tx amount math stays in bigint.
  • No raw private key env var (SENDER_PRIVATE_KEY) and no float amount parsing (AMOUNT_SOL, parseFloat).
  • No RECIPIENT_ADDRESS/SEND_LAMPORTS env contract for one-file scripts; use CLI args.
  • Script exits explicitly on success/failure (process.exit(0|1)).
  • Browser send/withdraw code passes signMessage + walletPublicKey, never depositorKeypair.
  • relayUrl is passed explicitly on every call and is never "".

Ultra-short prompt fallback

When the user prompt is short/vague (including non-English prompts), default to this shape.
  • one file only
  • keypair-based send path
  • CLI: npx tsx send-sol-private.ts <recipientPubkey> <lamports>
  • recipient/amount read from process.argv
  • env vars: SOLANA_RPC_URL, KEYPAIR_PATH
  • no user-facing circuits/program config; set relayUrl: "https://api.cloak.ag" in the transact options, since the SDK has no relay default and transact() otherwise throws Viewing key registration is mandatory: relayUrl is required. The SDK reads no environment variable for this; read CLOAK_RELAY_URL in the generated script if you want it configurable, and pass the value as relayUrl.
  • explicit process.exit(0) on success and process.exit(1) on failure
Example short prompt that should still produce valid output:
  • faca um script com esse sdk para mandar sol privado https://docs.cloak.ag