Recovery phrase
BIP-39 mnemonic for account recovery when both passphrase and wrapped key are lost.
Signatures
Section titled “Signatures”generateMnemonic(): stringrecoverWithMnemonic(mnemonic: string, extractable?: boolean): Promise<CryptoKey>Example
Section titled “Example”import { generateMnemonic, recoverWithMnemonic } from '@consealdev/conseal'
// Account setup: generate mnemonic, show it once for the user to write downconst mnemonic = generateMnemonic()// "apple crab moon tide lamp surge ... (24 words)"// Display to user — never store server-side
// Recovery: user enters their 24 wordsconst aek = await recoverWithMnemonic('apple crab moon tide ...')// Same mnemonic always produces the same AEK- The mnemonic is 24 words (256 bits of entropy). Show it once; the user must write it down.
recoverWithMnemonic()is deterministic — same mnemonic always produces the same AEK.- Throws if the phrase fails BIP-39 checksum validation.
- The AEK is derived from the mnemonic (HKDF-SHA-256, with the info label
conseal-mnemonic-aek-v1), not the other way round:initCircle(mnemonic, …)derives a circle’s AEK from it, and only a key derived this way can be recovered from a mnemonic. - Pass
extractable: trueto wrap the recovered key withwrapKey, for example under a new passphrase. - This is a last-resort recovery path. The primary path is
init()with the wrapped key.