]> git.codecow.com Git - libnemo.git/commitdiff
Fix key derivation in vault to support curve parameter.
authorChris Duncan <chris@zoso.dev>
Sun, 23 Nov 2025 10:39:45 +0000 (02:39 -0800)
committerChris Duncan <chris@zoso.dev>
Sun, 23 Nov 2025 10:39:45 +0000 (02:39 -0800)
src/lib/vault/vault-worker.ts

index 02776b113b1e59f7dc394a8eed203bdbc65abae4..d5613a162d64444194c943b0f48b14adac423d1a 100644 (file)
@@ -187,9 +187,9 @@ export class VaultWorker {
                        if (typeof index !== 'number') {
                                throw new Error('Invalid wallet account index')
                        }
-                       const derive = this.#type === 'BIP-44'
-                               ? Bip44.ckd(this.#seed, BIP44_COIN_NANO, index)
-                               : Blake2b.ckd(this.#seed, index)
+                       const derive = this.#type === 'BLAKE2b'
+                               ? Blake2b.ckd(this.#seed, index)
+                               : Bip44.ckd(this.#type === 'Exodus' ? 'Bitcoin seed' : 'ed25519 seed', this.#seed, BIP44_COIN_NANO, index)
                        return derive.then(prv => {
                                const pub = NanoNaCl.convert(new Uint8Array(prv))
                                this.#timer = new VaultTimer(() => this.lock(), this.#timeout)