From 639ae3b9cd60dda213f86e2b3a34431c7155b2b6 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sat, 9 Aug 2025 00:30:35 -0700 Subject: [PATCH] Fix BIP-44 ckd using SLIP-0010 which only defines hardened addresses at all levels, deviating from BIP-44. --- src/lib/crypto/bip44.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/crypto/bip44.ts b/src/lib/crypto/bip44.ts index 81c4823..59210ba 100644 --- a/src/lib/crypto/bip44.ts +++ b/src/lib/crypto/bip44.ts @@ -31,9 +31,9 @@ export class Bip44 { const coinKey = await this.CKDpriv(purposeKey, coin + HARDENED_OFFSET) const accountKey = await this.CKDpriv(coinKey, account + HARDENED_OFFSET) if (chain == null) return accountKey.privateKey - const chainKey = await this.CKDpriv(accountKey, chain) + const chainKey = await this.CKDpriv(accountKey, chain + HARDENED_OFFSET) if (address == null) return chainKey.privateKey - const addressKey = await this.CKDpriv(chainKey, address) + const addressKey = await this.CKDpriv(chainKey, address + HARDENED_OFFSET) return addressKey.privateKey } -- 2.47.3