Canonical AI files
Recommended read order
/llms.txt/llms-full.txt/sdk/llms.txt/sdk/quickstart/sdk/request-authentication/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.Copy one-shot prompt
Copy one-shot prompt
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
- Use the UTXO API (not legacy note APIs) and keep transaction amounts as
bigint. - Implement deposit then full withdraw (send) flow:
- deposit with
transact(...) - send with
fullWithdraw(...)
- deposit with
- Include one integration path using keypair bytes and one using wallet-adapter where relevant. Follow
/sdk/request-authenticationfor the wallet-adapter path. - Add progress and error states suitable for production UX.
- Never log secrets (private keys, viewing keys (
nk), raw note payloads, seed material). Transaction signatures are public and may be logged for support/debugging. - Rely on SDK default stale-root handling for standard flows; do not add custom retry loops unless explicitly requested.
- Use SDK defaults for program and circuits, and do not ask end users to configure them. The relay has no SDK default: pass
relayUrlexplicitly on everytransact/fullWithdrawcall. The SDK reads no environment variable for it, so if you want the value 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”. With the defaultenforceViewingKeyRegistrationit throws the same error as omitting it, and it only signals caller-signed direct submission whenenforceViewingKeyRegistration: falseis 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. - 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.
SOLANA_RPC_URLis the app owner’s choice. - For script-only tasks, default to keypair path + lamports CLI (
<recipientPubkey> <lamports>). - For script-only tasks, parse recipient/amount from CLI args (not env) and exit explicitly (
process.exit(0|1)).
- 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_LAMPORTSenv 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, neverdepositorKeypair. relayUrlis 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 andtransact()otherwise throwsViewing key registration is mandatory: relayUrl is required.The SDK reads no environment variable for this; readCLOAK_RELAY_URLin the generated script if you want it configurable, and pass the value asrelayUrl. - explicit
process.exit(0)on success andprocess.exit(1)on failure
faca um script com esse sdk para mandar sol privado https://docs.cloak.ag