Skip to main content
The TypeScript SDK is WIP. Today, call the Relayer HTTP API directly: POST /recipient/register, GET /recipient/addresses, POST /recipient/derive-stealth-key. The shapes below mirror those endpoints.
Tachyon doesn’t require usernames, passwords, or accounts. A user is identified by their wallet (for signing intents) and their viewing key (for seeing and claiming inbound intents).

What you (the integrator) manage

ItemWho generates itWhere it lives
Wallet (signing key)Your existing wallet flowThe user’s wallet, you don’t touch the private key
Viewing keyThe SDKYour storage, encrypted at rest, accessible to the SDK
You already manage wallets. The new piece is the viewing key.

Generate a viewing key

const viewingKey = await tachyon.user.createViewingKey();
// Persist this. The user needs it to detect and claim incoming intents.
await secureStorage.put(`tachyonViewingKey:${userId}`, viewingKey);

Load an existing viewing key

const viewingKey = await secureStorage.get(`tachyonViewingKey:${userId}`);
await tachyon.user.importViewingKey(viewingKey);
After import, the SDK can decrypt incoming intents addressed to the user.

Key storage recommendations

A viewing key gives read access to all of a user’s incoming intents. Treat it with the same care as session secrets, encrypt at rest and never log it.
  • Server-side: encrypt with a per-user KMS-derived key
  • Browser: store encrypted in IndexedDB; never localStorage if you can avoid it
  • Mobile: use the platform secure enclave / Keychain

Backup and recovery

Always offer the user an explicit backup flow at viewing-key creation time. If a user loses their viewing key, they lose visibility into past and future intents addressed to them, funds at stealth addresses still belong to them, but they cannot detect them. A reasonable UX:
  1. On viewing-key creation, prompt the user to save a recovery phrase or download an encrypted backup.
  2. Store a copy in your own backend, encrypted with a key the user controls (e.g., wallet-derived).
  3. On a new device, the user authenticates and re-imports.
Recovery-phrase encoding is a planned SDK helper. Today, back up the raw viewing key (hex) returned by POST /recipient/register.

Multiple viewing keys per user

Some integrators may want to support multiple viewing keys per user (for example, one per workspace). The SDK supports importing a different viewing key per session:
await tachyon.user.importViewingKey(workspaceKey);
Switching viewing keys is a session-level operation; intents addressed under one viewing key are not visible under another.

What integrators do not manage

  • Encryption of the intent payload, handled by the SDK
  • Stealth address derivation, handled by the SDK using the recipient’s viewing key
  • Sweep transactions from the stealth address, handled by the SDK using the user’s wallet
You stick to wallet flows and viewing-key persistence; the SDK handles everything else.

Submit an intent

Build, sign, and submit your first intent.