Your mnemonic seed phrase is the master key to all your swap operations. Satora Swaps never has access to your private keys - all cryptographic operations happen locally.Key principles:
Your keys, your coins - Private keys never leave your device
Deterministic derivation - All swap parameters derived from your seed
Recoverable - Restore pending swaps anytime with your mnemonic
Automatic storage - The SDK stores your mnemonic securely via the configured storage provider
Generate New Mnemonic
Generate a new 12-word BIP39 mnemonic using the Signer class:
import { Client, InMemoryWalletStorage } from "@satora/swap";// The SDK generates a mnemonic automatically when none is providedconst client = await Client.builder() .withSignerStorage(new InMemoryWalletStorage()) .build();
Import Existing Mnemonic
To restore from an existing mnemonic, pass it to the client builder:
import { Client, IdbSwapStorage, IdbWalletStorage } from "@satora/swap";const client = await Client.builder() .withSignerStorage(new IdbWalletStorage()) .withSwapStorage(new IdbSwapStorage()) .withMnemonic("your twelve word mnemonic phrase goes here ...") .build();
Get Xpub
Retrieve the user ID xpub from the initialized client. Note: This is an identifier, not a wallet.
// Retrieve the xpub from the client for recovery purposesconst xpub = client.getUserIdXpub();console.log("Xpub:", xpub);
Key Derivation
The SDK uses BIP32/BIP39 standards for deterministic key derivation. Each swap gets unique cryptographic parameters derived from your mnemonic:
Preimage - Random secret for HTLC
Preimage Hash - SHA256 hash used as hash lock
Own Public Key - For VHTLC scripts
User ID - Derived identifier for swap recovery
All derivation happens locally - your mnemonic never leaves your device.
Critical: Your mnemonic is the only way to recover pending swaps. If you lose it, you cannot recover funds locked in HTLCs.
Assistant
Responses are generated using AI and may contain mistakes.