]> git.codecow.com Git - libnemo.git/commitdiff
Document plaintext availability of secrets on new wallets.
authorChris Duncan <chris@codecow.com>
Mon, 10 Aug 2026 04:58:55 +0000 (21:58 -0700)
committerChris Duncan <chris@codecow.com>
Mon, 10 Aug 2026 04:58:55 +0000 (21:58 -0700)
src/lib/wallet/index.ts

index 37cd471f27a28edf552692fb90fa86a334a2e30e..e0e909ca75d5f84c61bab56628c66ddb07ec345b 100644 (file)
@@ -84,10 +84,17 @@ export class Wallet {
        * Creates a new HD wallet by using an entropy value generated using a\r
        * cryptographically strong pseudorandom number generator.\r
        *\r
+       * **NOTE: Until the mnemonic and/or seed are accessed at least once, they are\r
+       * available to untrusted code without the password.**\r
+       *\r
+       * The user must be able to view the mnemonic and/or seed in order to createa a\r
+       * backup, so they are available in plaintext until first read at which point\r
+       * they self-destruct.\r
+       *\r
        * @param {string} type - Algorithm used to generate wallet and child accounts\r
        * @param {string} password - Encrypts the wallet to lock and unlock it\r
        * @param {string} [salt=''] - Used when generating the final seed\r
-       * @returns {Wallet} A newly instantiated Wallet\r
+       * @returns {Wallet} A newly instantiated Wallet with unencrypted mnemonic/seed\r
        */\r
        static async create (type: 'BIP-44' | 'BLAKE2b', password: string, mnemonicSalt?: string): Promise<Wallet>\r
        static async create (type: WalletType, password?: string, mnemonicSalt?: string): Promise<Wallet> {\r