From d9cc1833c9a2292169447697ed00cb2f03f1b347 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sun, 10 Nov 2024 13:25:59 -0800 Subject: [PATCH] Fix BLAKE2b ckd using 16-bit index instead of 32-bit. --- src/lib/wallet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/wallet.ts b/src/lib/wallet.ts index 08bb55a..08ada18 100644 --- a/src/lib/wallet.ts +++ b/src/lib/wallet.ts @@ -546,7 +546,7 @@ export class Blake2bWallet extends Wallet { * @returns {Promise} */ async ckd (index: number): Promise { - const hash = await Tools.blake2b([this.seed, dec.toHex(index, 4)]) + const hash = await Tools.blake2b([this.seed, dec.toHex(index, 8)]) const key = bytes.toHex(hash) return await Account.fromPrivateKey(key, index) // return await ckdPool.work({ type: 'blake2b', seed: this.seed, index }) -- 2.34.1