Components
| Component | Responsibility |
|---|---|
| Frontend | Connects the user’s external Solana wallet, shows balances and forms, and calls backend APIs |
| Product backend | Owns sessions, generated private keys, proof signatures, UTXO cache, history, and SDK calls |
| Database | Persists wallet rows, scan progress, decoded UTXOs, encrypted outputs, and operation history |
| Privacy Layer SDK | Builds Arcane instructions, scans UTXOs, creates proofs, and submits through a relayer |
| Arcane API | Provides indexer and relayer APIs |
| Solana RPC | Reads public SOL balances and confirms transactions |
Runtime configuration
Recommended backend environment:User-side state
Keep user-side state minimal.| User-side field | Purpose |
|---|---|
owner_wallet_public_key | External Solana wallet identity used to find the backend wallet row |
| Session cookie or auth token | Authenticates future backend requests; prefer an HttpOnly cookie for browser apps |
- Backend-generated private keys.
- Proof signatures.
- Stealth deposit private keys.
- Decoded UTXOs.
- Encrypted output cache.
Database state
The SDK does not enforce a database schema. A backend-managed integration needs equivalent storage for these records.| Store | Purpose |
|---|---|
wallets | One row per external owner wallet |
arcane_utxo_scan_state | Tracks how far the backend has scanned the Arcane indexer for one owner wallet |
arcane_utxos | Stores decoded private UTXOs owned by the managed wallet |
arcane_utxo_encrypted_outputs | Stores encrypted outputs cached from the indexer |
arcane_utxo_history | Stores scan events and user-visible operation history |
Login or session restore
- The frontend connects the user’s Solana wallet and sends
owner_wallet_public_keyto the backend. - The backend looks up
wallets.owner_wallet_public_key. - If no row exists, the backend generates a Solana keypair and stores the managed signing reference.
- The backend creates
proof_signature_base58once from the managed signer. - The backend derives the active stealth deposit address using
proof_signature_base58andstealth_deposit_index. - The backend initializes scan state.
- The backend returns public context only.
start_at_current=true.
Balance scan
Call this when the wallet screen opens, after shield, after spend, after withdrawal, and on user refresh.- Load the wallet row and scan state.
- Query the current Arcane API index.
- Call SDK UTXO scanning with server-side storage scoped by
owner_wallet_public_key. - Persist encrypted outputs, decoded UTXOs, and scan progress.
- Return private balances, scan state, and user-visible history.
Stealth deposit and shield
- The frontend displays the current stealth SOL deposit address.
- The user sends public SOL to that address.
- The frontend calls your backend to check the deposit balance.
- The backend reads public SOL balance from Solana RPC.
- If SOL is available, the backend calls
depositWithRelayer. - The SDK creates private output UTXOs, generates the proof, builds the Arcane transaction, and submits through the relayer.
- The backend records
shield_deposit_submitted.
wallets.stealth_deposit_index and derive the next stealth address. Keep historical deposit addresses if your product needs reconciliation.
Private spend
Use private spend when value should move inside the privacy layer.- Scan or refresh cached UTXOs.
- Choose the amount.
- Derive the recipient’s Arcane UTXO public key and X25519 public key.
- Call
transactTransfer. - Record
spend_submittedwith the signature and timing metadata.
Withdraw to Solana
Use withdrawals when the user enters a public Solana recipient and amount.- Validate the recipient public key and amount.
- Scan or refresh cached UTXOs.
- Call
withdrawWithRelayer. - Record
withdraw_submitted. - Refresh private balance and history.
Production notes
- Authenticate sessions before using
owner_wallet_public_keyas the wallet scope. - Do not restore a “latest wallet” in multi-user production.
- Add rate limits for deposit checks, spend, withdrawal, and relayer endpoints.
- Store enough history metadata to explain failures and reconcile signatures.
- Treat Arcane API, Solana RPC, proof generation, and relayer submission as independent failure points.
Related pages
Solana SDK reference
See SDK package status, exports, configuration, and examples.
Private card funding
Apply this pattern to a card funding flow.