From: Chris Duncan Date: Mon, 10 Aug 2026 04:58:55 +0000 (-0700) Subject: Document plaintext availability of secrets on new wallets. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=4c4079484a20bc785c86157a71f35449d73dadd7;p=libnemo.git Document plaintext availability of secrets on new wallets. --- diff --git a/src/lib/wallet/index.ts b/src/lib/wallet/index.ts index 37cd471..e0e909c 100644 --- a/src/lib/wallet/index.ts +++ b/src/lib/wallet/index.ts @@ -84,10 +84,17 @@ export class Wallet { * Creates a new HD wallet by using an entropy value generated using a * cryptographically strong pseudorandom number generator. * + * **NOTE: Until the mnemonic and/or seed are accessed at least once, they are + * available to untrusted code without the password.** + * + * The user must be able to view the mnemonic and/or seed in order to createa a + * backup, so they are available in plaintext until first read at which point + * they self-destruct. + * * @param {string} type - Algorithm used to generate wallet and child accounts * @param {string} password - Encrypts the wallet to lock and unlock it * @param {string} [salt=''] - Used when generating the final seed - * @returns {Wallet} A newly instantiated Wallet + * @returns {Wallet} A newly instantiated Wallet with unencrypted mnemonic/seed */ static async create (type: 'BIP-44' | 'BLAKE2b', password: string, mnemonicSalt?: string): Promise static async create (type: WalletType, password?: string, mnemonicSalt?: string): Promise {