@leather.io/crypto 1.0.4 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -10,6 +10,7 @@ declare enum DerivationPathDepth {
10
10
  }
11
11
  declare const extractAccountIndexFromPath: (path: string) => number;
12
12
  declare const extractAddressIndexFromPath: (path: string) => number;
13
+ declare function extractFingerprintFromKeyOriginPath(keyOriginPath: string): string;
13
14
  /**
14
15
  * @description
15
16
  * A key origin path refers to the identifier commonly used as part of the key
@@ -19,16 +20,41 @@ declare const extractAddressIndexFromPath: (path: string) => number;
19
20
  * @example `0a3fd8ef/84'/0'/0'`
20
21
  */
21
22
  declare function createKeyOriginPath(fingerprint: string, path: string): string;
23
+ declare function validateKeyOriginPath(keyOriginPath: string): boolean;
24
+ /**
25
+ * @description
26
+ * Creates a descriptor with key origin and xpub
27
+ * @example `[0a3fd8ef/84'/0'/0']xpuba1b…2c3`
28
+ */
29
+ declare function createExtendedPublicKeyDescriptor(keyOriginPath: string, xpub: string): string;
30
+ /**
31
+ * @example `[0a3fd8ef/84'/0'/0']xpuba1b…2c3` -> `0a3fd8ef/84'/0'/0'`
32
+ */
33
+ declare function extractKeyOriginPathFromDescriptor(descriptor: string): string;
34
+ /**
35
+ * @example `[0a3fd8ef/84'/0'/0']xpuba1b…2c3` -> `m/84'/0'/0'`
36
+ */
37
+ declare function extractDerivationPathFromDescriptor(descriptor: string): string;
38
+ /**
39
+ * @example `[0a3fd8ef/84'/0'/0']xpuba1b…2c3` -> `0a3fd8ef`
40
+ */
41
+ declare function extractFingerprintFromDescriptor(descriptor: string): string;
42
+ /**
43
+ * @example `[0a3fd8ef/84'/0'/6']xpuba1b…2c3` -> `6`
44
+ */
45
+ declare function extractAccountIndexFromDescriptor(descriptor: string): number;
22
46
 
23
47
  declare function generateMnemonic(): string;
24
- declare function deriveBip39SeedFromMnemonic(mnemonic: string): Promise<Uint8Array>;
48
+ declare function deriveBip39SeedFromMnemonic(mnemonic: string, passphrase?: string): Promise<Uint8Array>;
25
49
  /** @deprecated Inaccurately named fn, use `deriveBip39SeedFromMnemonic` */
26
50
  declare const deriveBip39MnemonicFromSeed: typeof deriveBip39SeedFromMnemonic;
27
51
  declare function deriveRootBip32Keychain(seed: Uint8Array): HDKey;
52
+ declare function deriveKeychainFromXpub(xpub: string): HDKey;
28
53
  /**
29
54
  * Gets keychain fingerprint directly from mnemonic. This is useful for
30
55
  * referencing a mnemonic safely by an identifier.
31
56
  */
32
57
  declare function getMnemonicRootKeyFingerprint(mnemonic: string): Promise<string>;
58
+ declare function deriveKeychainDescriptor(rootKeychain: HDKey, path: string): string;
33
59
 
34
- export { DerivationPathDepth, createKeyOriginPath, deriveBip39MnemonicFromSeed, deriveBip39SeedFromMnemonic, deriveRootBip32Keychain, extractAccountIndexFromPath, extractAddressIndexFromPath, generateMnemonic, getMnemonicRootKeyFingerprint };
60
+ export { DerivationPathDepth, createExtendedPublicKeyDescriptor, createKeyOriginPath, deriveBip39MnemonicFromSeed, deriveBip39SeedFromMnemonic, deriveKeychainDescriptor, deriveKeychainFromXpub, deriveRootBip32Keychain, extractAccountIndexFromDescriptor, extractAccountIndexFromPath, extractAddressIndexFromPath, extractDerivationPathFromDescriptor, extractFingerprintFromDescriptor, extractFingerprintFromKeyOriginPath, extractKeyOriginPathFromDescriptor, generateMnemonic, getMnemonicRootKeyFingerprint, validateKeyOriginPath };
package/dist/index.mjs CHANGED
@@ -1,9 +1,5 @@
1
- // src/index.ts
2
- import { HDKey } from "@scure/bip32";
3
- import { mnemonicToSeed, generateMnemonic as scureGenerateMnemonic } from "@scure/bip39";
4
- import { wordlist } from "@scure/bip39/wordlists/english";
5
-
6
1
  // src/derivation-path-utils.ts
2
+ import { isHexString } from "@leather.io/utils";
7
3
  var DerivationPathDepth = /* @__PURE__ */ ((DerivationPathDepth2) => {
8
4
  DerivationPathDepth2[DerivationPathDepth2["Root"] = 0] = "Root";
9
5
  DerivationPathDepth2[DerivationPathDepth2["Purpose"] = 1] = "Purpose";
@@ -27,34 +23,94 @@ var extractAccountIndexFromPath = extractSectionFromDerivationPath(
27
23
  var extractAddressIndexFromPath = extractSectionFromDerivationPath(
28
24
  5 /* AddressIndex */
29
25
  );
26
+ function extractFingerprintFromKeyOriginPath(keyOriginPath) {
27
+ const fingerprint = keyOriginPath.split("/")[0];
28
+ if (!isHexString(fingerprint)) throw new Error("Fingerprint must be a hexadecimal string");
29
+ return fingerprint;
30
+ }
30
31
  function createKeyOriginPath(fingerprint, path) {
32
+ if (!isHexString(fingerprint)) throw new Error("Fingerprint must be a hexadecimal string");
31
33
  return `${fingerprint}/${path.replace("m/", "")}`;
32
34
  }
35
+ function validateKeyOriginPath(keyOriginPath) {
36
+ if (keyOriginPath.includes("[") || keyOriginPath.includes("]"))
37
+ throw new Error("Key origin path should not contain square brackets");
38
+ if (!keyOriginPath.includes("/"))
39
+ throw new Error("Key origin path must contain a fingerprint and derivation path");
40
+ if (!isHexString(extractFingerprintFromKeyOriginPath(keyOriginPath)))
41
+ throw new Error("Fingerprint must be a hexadecimal string");
42
+ if (keyOriginPath.split("/").length < 4)
43
+ throw new Error("Key origin path is too short. Should describe at least to the account level");
44
+ return true;
45
+ }
46
+ function createExtendedPublicKeyDescriptor(keyOriginPath, xpub) {
47
+ validateKeyOriginPath(keyOriginPath);
48
+ return `[${keyOriginPath}]${xpub}`;
49
+ }
50
+ function extractKeyOriginPathFromDescriptor(descriptor) {
51
+ const keyOriginPath = descriptor.split("]")[0].replace("[", "");
52
+ validateKeyOriginPath(keyOriginPath);
53
+ return keyOriginPath;
54
+ }
55
+ function extractDerivationPathFromDescriptor(descriptor) {
56
+ const keyOriginPath = extractKeyOriginPathFromDescriptor(descriptor);
57
+ return "m/" + keyOriginPath.split("/").slice(1).join("/");
58
+ }
59
+ function extractFingerprintFromDescriptor(descriptor) {
60
+ return extractFingerprintFromKeyOriginPath(extractKeyOriginPathFromDescriptor(descriptor));
61
+ }
62
+ function extractAccountIndexFromDescriptor(descriptor) {
63
+ return extractAccountIndexFromPath(extractKeyOriginPathFromDescriptor(descriptor));
64
+ }
33
65
 
34
- // src/index.ts
66
+ // src/keychain.ts
67
+ import { HDKey } from "@scure/bip32";
68
+ import { mnemonicToSeed, generateMnemonic as scureGenerateMnemonic } from "@scure/bip39";
69
+ import { wordlist } from "@scure/bip39/wordlists/english";
70
+ import { toHexString } from "@leather.io/utils";
35
71
  function generateMnemonic() {
36
72
  return scureGenerateMnemonic(wordlist, 256);
37
73
  }
38
- async function deriveBip39SeedFromMnemonic(mnemonic) {
39
- return mnemonicToSeed(mnemonic);
74
+ async function deriveBip39SeedFromMnemonic(mnemonic, passphrase) {
75
+ return mnemonicToSeed(mnemonic, passphrase);
40
76
  }
41
77
  var deriveBip39MnemonicFromSeed = deriveBip39SeedFromMnemonic;
42
78
  function deriveRootBip32Keychain(seed) {
43
79
  return HDKey.fromMasterSeed(seed);
44
80
  }
81
+ function deriveKeychainFromXpub(xpub) {
82
+ return HDKey.fromExtendedKey(xpub);
83
+ }
45
84
  async function getMnemonicRootKeyFingerprint(mnemonic) {
46
85
  const keychain = deriveRootBip32Keychain(await deriveBip39SeedFromMnemonic(mnemonic));
47
- return keychain.fingerprint.toString(16);
86
+ return toHexString(keychain.fingerprint);
87
+ }
88
+ function deriveKeychainDescriptor(rootKeychain, path) {
89
+ const masterFingerprint = toHexString(rootKeychain.fingerprint);
90
+ const keyOriginPath = createKeyOriginPath(masterFingerprint, path);
91
+ if (rootKeychain.depth !== 0 /* Root */)
92
+ throw new Error("Cannot derive account keychain from non-root keychain");
93
+ const accountKeychain = rootKeychain.derive(path);
94
+ return createExtendedPublicKeyDescriptor(keyOriginPath, accountKeychain.publicExtendedKey);
48
95
  }
49
96
  export {
50
97
  DerivationPathDepth,
98
+ createExtendedPublicKeyDescriptor,
51
99
  createKeyOriginPath,
52
100
  deriveBip39MnemonicFromSeed,
53
101
  deriveBip39SeedFromMnemonic,
102
+ deriveKeychainDescriptor,
103
+ deriveKeychainFromXpub,
54
104
  deriveRootBip32Keychain,
105
+ extractAccountIndexFromDescriptor,
55
106
  extractAccountIndexFromPath,
56
107
  extractAddressIndexFromPath,
108
+ extractDerivationPathFromDescriptor,
109
+ extractFingerprintFromDescriptor,
110
+ extractFingerprintFromKeyOriginPath,
111
+ extractKeyOriginPathFromDescriptor,
57
112
  generateMnemonic,
58
- getMnemonicRootKeyFingerprint
113
+ getMnemonicRootKeyFingerprint,
114
+ validateKeyOriginPath
59
115
  };
60
116
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/derivation-path-utils.ts"],"sourcesContent":["import { HDKey } from '@scure/bip32';\nimport { mnemonicToSeed, generateMnemonic as scureGenerateMnemonic } from '@scure/bip39';\nimport { wordlist } from '@scure/bip39/wordlists/english';\n\nexport * from './derivation-path-utils';\n\nexport function generateMnemonic() {\n return scureGenerateMnemonic(wordlist, 256);\n}\n\nexport async function deriveBip39SeedFromMnemonic(mnemonic: string) {\n return mnemonicToSeed(mnemonic);\n}\n/** @deprecated Inaccurately named fn, use `deriveBip39SeedFromMnemonic` */\nexport const deriveBip39MnemonicFromSeed = deriveBip39SeedFromMnemonic;\n\nexport function deriveRootBip32Keychain(seed: Uint8Array) {\n return HDKey.fromMasterSeed(seed);\n}\n\n/**\n * Gets keychain fingerprint directly from mnemonic. This is useful for\n * referencing a mnemonic safely by an identifier.\n */\nexport async function getMnemonicRootKeyFingerprint(mnemonic: string) {\n const keychain = deriveRootBip32Keychain(await deriveBip39SeedFromMnemonic(mnemonic));\n return keychain.fingerprint.toString(16);\n}\n","export enum DerivationPathDepth {\n Root = 0,\n Purpose = 1,\n CoinType = 2,\n Account = 3,\n ChangeReceive = 4,\n AddressIndex = 5,\n}\n\nfunction extractSectionFromDerivationPath(depth: DerivationPathDepth) {\n return (path: string) => {\n const segments = path.split('/');\n const accountNum = parseInt(segments[depth].replaceAll(\"'\", ''), 10);\n if (isNaN(accountNum)) throw new Error(`Cannot parse ${DerivationPathDepth[depth]} from path`);\n return accountNum;\n };\n}\n\nexport const extractAccountIndexFromPath = extractSectionFromDerivationPath(\n DerivationPathDepth.Account\n);\n\nexport const extractAddressIndexFromPath = extractSectionFromDerivationPath(\n DerivationPathDepth.AddressIndex\n);\n\n/**\n * @description\n * A key origin path refers to the identifier commonly used as part of the key\n * information provided as part of a Output Descriptor described in BIP-380. It\n * replaces the `m/` part of a derivation path with the master key fingerprint to which the\n * key it describes belongs.\n * @example `0a3fd8ef/84'/0'/0'`\n */\nexport function createKeyOriginPath(fingerprint: string, path: string) {\n return `${fingerprint}/${path.replace('m/', '')}`;\n}\n"],"mappings":";AAAA,SAAS,aAAa;AACtB,SAAS,gBAAgB,oBAAoB,6BAA6B;AAC1E,SAAS,gBAAgB;;;ACFlB,IAAK,sBAAL,kBAAKA,yBAAL;AACL,EAAAA,0CAAA,UAAO,KAAP;AACA,EAAAA,0CAAA,aAAU,KAAV;AACA,EAAAA,0CAAA,cAAW,KAAX;AACA,EAAAA,0CAAA,aAAU,KAAV;AACA,EAAAA,0CAAA,mBAAgB,KAAhB;AACA,EAAAA,0CAAA,kBAAe,KAAf;AANU,SAAAA;AAAA,GAAA;AASZ,SAAS,iCAAiC,OAA4B;AACpE,SAAO,CAAC,SAAiB;AACvB,UAAM,WAAW,KAAK,MAAM,GAAG;AAC/B,UAAM,aAAa,SAAS,SAAS,KAAK,EAAE,WAAW,KAAK,EAAE,GAAG,EAAE;AACnE,QAAI,MAAM,UAAU,EAAG,OAAM,IAAI,MAAM,gBAAgB,oBAAoB,KAAK,CAAC,YAAY;AAC7F,WAAO;AAAA,EACT;AACF;AAEO,IAAM,8BAA8B;AAAA,EACzC;AACF;AAEO,IAAM,8BAA8B;AAAA,EACzC;AACF;AAUO,SAAS,oBAAoB,aAAqB,MAAc;AACrE,SAAO,GAAG,WAAW,IAAI,KAAK,QAAQ,MAAM,EAAE,CAAC;AACjD;;;AD9BO,SAAS,mBAAmB;AACjC,SAAO,sBAAsB,UAAU,GAAG;AAC5C;AAEA,eAAsB,4BAA4B,UAAkB;AAClE,SAAO,eAAe,QAAQ;AAChC;AAEO,IAAM,8BAA8B;AAEpC,SAAS,wBAAwB,MAAkB;AACxD,SAAO,MAAM,eAAe,IAAI;AAClC;AAMA,eAAsB,8BAA8B,UAAkB;AACpE,QAAM,WAAW,wBAAwB,MAAM,4BAA4B,QAAQ,CAAC;AACpF,SAAO,SAAS,YAAY,SAAS,EAAE;AACzC;","names":["DerivationPathDepth"]}
1
+ {"version":3,"sources":["../src/derivation-path-utils.ts","../src/keychain.ts"],"sourcesContent":["import { isHexString } from '@leather.io/utils';\n\nexport enum DerivationPathDepth {\n Root = 0,\n Purpose = 1,\n CoinType = 2,\n Account = 3,\n ChangeReceive = 4,\n AddressIndex = 5,\n}\n\nfunction extractSectionFromDerivationPath(depth: DerivationPathDepth) {\n return (path: string) => {\n const segments = path.split('/');\n const accountNum = parseInt(segments[depth].replaceAll(\"'\", ''), 10);\n if (isNaN(accountNum)) throw new Error(`Cannot parse ${DerivationPathDepth[depth]} from path`);\n return accountNum;\n };\n}\n\nexport const extractAccountIndexFromPath = extractSectionFromDerivationPath(\n DerivationPathDepth.Account\n);\n\nexport const extractAddressIndexFromPath = extractSectionFromDerivationPath(\n DerivationPathDepth.AddressIndex\n);\n\nexport function extractFingerprintFromKeyOriginPath(keyOriginPath: string) {\n const fingerprint = keyOriginPath.split('/')[0];\n if (!isHexString(fingerprint)) throw new Error('Fingerprint must be a hexadecimal string');\n return fingerprint;\n}\n\n/**\n * @description\n * A key origin path refers to the identifier commonly used as part of the key\n * information provided as part of a Output Descriptor described in BIP-380. It\n * replaces the `m/` part of a derivation path with the master key fingerprint to which the\n * key it describes belongs.\n * @example `0a3fd8ef/84'/0'/0'`\n */\nexport function createKeyOriginPath(fingerprint: string, path: string) {\n if (!isHexString(fingerprint)) throw new Error('Fingerprint must be a hexadecimal string');\n return `${fingerprint}/${path.replace('m/', '')}`;\n}\n\nexport function validateKeyOriginPath(keyOriginPath: string) {\n if (keyOriginPath.includes('[') || keyOriginPath.includes(']'))\n throw new Error('Key origin path should not contain square brackets');\n\n if (!keyOriginPath.includes('/'))\n throw new Error('Key origin path must contain a fingerprint and derivation path');\n\n if (!isHexString(extractFingerprintFromKeyOriginPath(keyOriginPath)))\n throw new Error('Fingerprint must be a hexadecimal string');\n\n if (keyOriginPath.split('/').length < 4)\n throw new Error('Key origin path is too short. Should describe at least to the account level');\n\n return true;\n}\n\n/**\n * @description\n * Creates a descriptor with key origin and xpub\n * @example `[0a3fd8ef/84'/0'/0']xpuba1b…2c3`\n */\nexport function createExtendedPublicKeyDescriptor(keyOriginPath: string, xpub: string) {\n validateKeyOriginPath(keyOriginPath);\n return `[${keyOriginPath}]${xpub}`;\n}\n\n/**\n * @example `[0a3fd8ef/84'/0'/0']xpuba1b…2c3` -> `0a3fd8ef/84'/0'/0'`\n */\nexport function extractKeyOriginPathFromDescriptor(descriptor: string) {\n const keyOriginPath = descriptor.split(']')[0].replace('[', '');\n validateKeyOriginPath(keyOriginPath);\n return keyOriginPath;\n}\n\n/**\n * @example `[0a3fd8ef/84'/0'/0']xpuba1b…2c3` -> `m/84'/0'/0'`\n */\nexport function extractDerivationPathFromDescriptor(descriptor: string) {\n const keyOriginPath = extractKeyOriginPathFromDescriptor(descriptor);\n return 'm/' + keyOriginPath.split('/').slice(1).join('/');\n}\n\n/**\n * @example `[0a3fd8ef/84'/0'/0']xpuba1b…2c3` -> `0a3fd8ef`\n */\nexport function extractFingerprintFromDescriptor(descriptor: string) {\n return extractFingerprintFromKeyOriginPath(extractKeyOriginPathFromDescriptor(descriptor));\n}\n\n/**\n * @example `[0a3fd8ef/84'/0'/6']xpuba1b…2c3` -> `6`\n */\nexport function extractAccountIndexFromDescriptor(descriptor: string) {\n return extractAccountIndexFromPath(extractKeyOriginPathFromDescriptor(descriptor));\n}\n","import { HDKey } from '@scure/bip32';\nimport { mnemonicToSeed, generateMnemonic as scureGenerateMnemonic } from '@scure/bip39';\nimport { wordlist } from '@scure/bip39/wordlists/english';\n\nimport { toHexString } from '@leather.io/utils';\n\nimport {\n DerivationPathDepth,\n createExtendedPublicKeyDescriptor,\n createKeyOriginPath,\n} from './derivation-path-utils';\n\nexport function generateMnemonic() {\n return scureGenerateMnemonic(wordlist, 256);\n}\n\nexport async function deriveBip39SeedFromMnemonic(mnemonic: string, passphrase?: string) {\n return mnemonicToSeed(mnemonic, passphrase);\n}\n/** @deprecated Inaccurately named fn, use `deriveBip39SeedFromMnemonic` */\nexport const deriveBip39MnemonicFromSeed = deriveBip39SeedFromMnemonic;\n\nexport function deriveRootBip32Keychain(seed: Uint8Array) {\n return HDKey.fromMasterSeed(seed);\n}\n\nexport function deriveKeychainFromXpub(xpub: string) {\n return HDKey.fromExtendedKey(xpub);\n}\n\n/**\n * Gets keychain fingerprint directly from mnemonic. This is useful for\n * referencing a mnemonic safely by an identifier.\n */\nexport async function getMnemonicRootKeyFingerprint(mnemonic: string) {\n const keychain = deriveRootBip32Keychain(await deriveBip39SeedFromMnemonic(mnemonic));\n return toHexString(keychain.fingerprint);\n}\n\nexport function deriveKeychainDescriptor(rootKeychain: HDKey, path: string) {\n const masterFingerprint = toHexString(rootKeychain.fingerprint);\n const keyOriginPath = createKeyOriginPath(masterFingerprint, path);\n\n if (rootKeychain.depth !== DerivationPathDepth.Root)\n throw new Error('Cannot derive account keychain from non-root keychain');\n\n const accountKeychain = rootKeychain.derive(path);\n return createExtendedPublicKeyDescriptor(keyOriginPath, accountKeychain.publicExtendedKey);\n}\n"],"mappings":"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","names":["DerivationPathDepth"]}
package/package.json CHANGED
@@ -2,17 +2,19 @@
2
2
  "name": "@leather.io/crypto",
3
3
  "author": "leather.io",
4
4
  "description": "Generic crypto utils package for Leather",
5
- "version": "1.0.4",
5
+ "version": "1.1.0",
6
6
  "license": "MIT",
7
7
  "exports": {
8
8
  ".": "./dist/index.mjs"
9
9
  },
10
10
  "dependencies": {
11
11
  "@scure/bip32": "1.4.0",
12
- "@scure/bip39": "1.3.0"
12
+ "@scure/bip39": "1.3.0",
13
+ "@leather.io/utils": "0.11.0"
13
14
  },
14
15
  "devDependencies": {
15
16
  "@vitest/coverage-istanbul": "0.34.6",
17
+ "@vitest/coverage-v8": "2.0.4",
16
18
  "tsup": "8.1.0",
17
19
  "vitest": "2.0.3"
18
20
  },