Security is paramount when building AI-powered blockchain applications. This guide covers wallet management, security best practices, and how to keep your Radix Agent Kit applications secure.
import { RadixMnemonicWallet } from "radix-agent-kit";// Generate cryptographically secure mnemonicconst wallet = RadixMnemonicWallet.generateRandom({ networkId: RadixNetwork.Stokenet,});console.log("Mnemonic:", wallet.getMnemonic());console.log("Address:", wallet.getAddress());// ⚠️ IMPORTANT: New wallets start with zero balance!// You must fund them manually before use:// 1. Copy the address above// 2. Get testnet XRD from Radix Dashboard or Discord faucets// 3. For mainnet, transfer from existing funded wallet// Validate mnemonic strengthconst isValid = RadixMnemonicWallet.validateMnemonic(mnemonic);const strength = RadixMnemonicWallet.getMnemonicStrength(mnemonic);console.log(`Mnemonic is valid: ${isValid}, Strength: ${strength} bits`);
Generated wallets are empty! Programmatically created wallets have zero XRD balance. Always fund new wallets before attempting transactions: