Generate a secret key
Was this helpful?
Was this helpful?
Was this helpful?
import { generateSecretKey } from '@stacks/wallet-sdk';
// Generate a 24-word mnemonic (256 bits of entropy)
const mnemonic24 = generateSecretKey();
// Example: "aunt birth lounge misery utility blind holiday walnut fuel make gift parent gap picnic exact various express sphere family nerve oil drill engage youth"
// Generate a 12-word mnemonic (128 bits of entropy)
const mnemonic12 = generateSecretKey(128);
// Example: "winter crash infant long upset beauty cram tank short remain obtain sauce"