-
Notifications
You must be signed in to change notification settings - Fork 18
/
slip10.d.ts
38 lines (38 loc) · 1.17 KB
/
slip10.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { Uint32 } from "@iov/encoding";
export interface Slip10Result {
readonly chainCode: Uint8Array;
readonly privkey: Uint8Array;
}
/**
* Raw values must match the curve string in SLIP-0010 master key generation
*
* @see https://github.com/satoshilabs/slips/blob/master/slip-0010.md#master-key-generation
*/
export declare enum Slip10Curve {
Secp256k1 = "Bitcoin seed",
Ed25519 = "ed25519 seed",
}
/**
* Reverse mapping of Slip10Curve
*/
export declare function slip10CurveFromString(curveString: string): Slip10Curve;
export declare class Slip10RawIndex extends Uint32 {
static hardened(hardenedIndex: number): Slip10RawIndex;
static normal(normalIndex: number): Slip10RawIndex;
isHardened(): boolean;
}
export declare class Slip10 {
static derivePath(curve: Slip10Curve, seed: Uint8Array, path: readonly Slip10RawIndex[]): Slip10Result;
private static master;
private static child;
/**
* Implementation of ser_P(point(k_par)) from BIP-0032
*
* @see https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
*/
private static serializedPoint;
private static childImpl;
private static isZero;
private static isGteN;
private static n;
}