]> git.codecow.com Git - libnemo.git/commitdiff
Fix BIP-44 ckd using SLIP-0010 which only defines hardened addresses at all levels...
authorChris Duncan <chris@zoso.dev>
Sat, 9 Aug 2025 07:30:35 +0000 (00:30 -0700)
committerChris Duncan <chris@zoso.dev>
Sat, 9 Aug 2025 07:30:35 +0000 (00:30 -0700)
src/lib/crypto/bip44.ts

index 81c482375d66bb8b841dc9c5c41666d97b0d9fc6..59210ba4d994a251a8115b5c10cbcd74276b5d3c 100644 (file)
@@ -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
        }