export class Bip44 {
static get BIP44_PURPOSE (): 44 { return 44 }
static get HARDENED_OFFSET (): 0x80000000 { return 0x80000000 }
- static get SECP256K1_N (): bigint {
- return 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141n
- }
/**
* Derives a private child key for a coin by following the specified BIP-32 and
return ({ privateKey: IL, chainCode: IR })
} else {
const ILparsed = this.parse256(new Uint8Array(IL))
- if (ILparsed >= this.SECP256K1_N) {
+ if (ILparsed >= Secp256k1.N) {
throw new Error('Invalid child key is greater than the order of the curve')
}
const pkParsed = this.parse256(pk)
- const childKey = (ILparsed + pkParsed) % this.SECP256K1_N
+ const childKey = (ILparsed + pkParsed) % Secp256k1.N
if (childKey === 0n) {
throw new Error('Invalid child key is zero')
}