@midnight-ntwrk/wallet-sdk-hd 1.0.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/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # Midnight SDK HD Wallet
2
+
3
+ This package provides support for Hierarchical Deterministic (HD) Wallet.
4
+
5
+ To allow deterministic derivation of keys for different features, Midnight follows algorithms and structure being a mix of [BIP-32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki), [BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) and [CIP-1852](https://github.com/cardano-foundation/CIPs/blob/master/CIP-1852/README.md). Specifically, derivation follows BIP-32, and following path for a key pair is used:
6
+
7
+ ```
8
+ m / purpose' / coin_type' / account' / role / index
9
+ ```
10
+
11
+ Where:
12
+ - `purpose` is integer `44` (`0x8000002c`) - despite extensions, Night part of the hierarchy follows BIP-44
13
+ - `coin_type` is integer `2400` (`0x80000960`)
14
+ - `account` follows BIP-44 recommendations
15
+ - `role` follows table below
16
+ - `index` follows BIP-44 recommendations
17
+
18
+
19
+ | Role name | Value | Description |
20
+ |----------------------|-------|---------------------------------------------------------|
21
+ | Night External chain | 0 | Night is Midnight's main token of value, Follows BIP-44 |
22
+ | Night Internal chain | 1 | as above |
23
+ | Dust | 2 | Dust is needed to pay fees on Midnight |
24
+ | Zswap | 3 | Zswap is a sub-protocol for shielded native tokens |
25
+ | Metadata | 4 | Keys for signing metadata |
26
+
27
+
28
+ ## How to derive the keys?
29
+ Below you can find an example on how to derive keys from a random seed:
30
+
31
+ ```typescript
32
+ import { generateRandomSeed, HDWallet, Roles } from '@midnight-ntwrk/wallet-sdk-hd';
33
+
34
+ const seed = generateRandomSeed();
35
+ const generatedWallet = HDWallet.fromSeed(seed);
36
+
37
+ if (generatedWallet.type == 'seedOk') {
38
+ const zswapKey = generatedWallet.hdWallet.selectAccount(0).selectRole(Roles.Zswap).deriveKeyAt(0);
39
+ if (zswapKey.type === 'keyDerived') {
40
+ console.log('success', zswapKey.key);
41
+ } else {
42
+ console.error('Error deriving key');
43
+ }
44
+ } else {
45
+ console.error('Error generating HDWallet');
46
+ }
47
+ ```
@@ -0,0 +1,44 @@
1
+ import { HDKey } from '@scure/bip32';
2
+ type ValueOf<T> = T[keyof T];
3
+ export declare const Roles: {
4
+ readonly NightExternal: 0;
5
+ readonly NightInternal: 1;
6
+ readonly Dust: 2;
7
+ readonly Zswap: 3;
8
+ readonly Metadata: 4;
9
+ };
10
+ export type Role = ValueOf<typeof Roles>;
11
+ type DerivationResult = {
12
+ type: 'keyDerived';
13
+ key: Uint8Array;
14
+ } | {
15
+ type: 'keyOutOfBounds';
16
+ };
17
+ type HDWalletResult = {
18
+ type: 'seedOk';
19
+ hdWallet: HDWallet;
20
+ } | {
21
+ type: 'seedError';
22
+ error: unknown;
23
+ };
24
+ export declare class HDWallet {
25
+ private readonly rootKey;
26
+ private constructor();
27
+ static fromSeed(seed: Uint8Array): HDWalletResult;
28
+ selectAccount(account: number): AccountKey;
29
+ }
30
+ export declare class AccountKey {
31
+ private rootKey;
32
+ private account;
33
+ constructor(rootKey: HDKey, account: number);
34
+ selectRole(role: Role): RoleKey;
35
+ }
36
+ export declare class RoleKey {
37
+ private rootKey;
38
+ private account;
39
+ private role;
40
+ constructor(rootKey: HDKey, account: number, role: Role);
41
+ deriveKeyAt(index: number): DerivationResult;
42
+ }
43
+ export {};
44
+ //# sourceMappingURL=HDWallet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HDWallet.d.ts","sourceRoot":"","sources":["../src/HDWallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE7B,eAAO,MAAM,KAAK;;;;;;CAMR,CAAC;AAEX,MAAM,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,KAAK,CAAC,CAAC;AAEzC,KAAK,gBAAgB,GAAG;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,GAAG,EAAE,UAAU,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAC7F,KAAK,cAAc,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAKrG,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAQ;IAEhC,OAAO;IAIP,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,cAAc;IAU1C,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU;CAGlD;AAED,qBAAa,UAAU;IAEnB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;gBADP,OAAO,EAAE,KAAK,EACd,OAAO,EAAE,MAAM;IAIlB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO;CAGvC;AAED,qBAAa,OAAO;IAEhB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,IAAI;gBAFJ,OAAO,EAAE,KAAK,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,IAAI;IAIb,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB;CAKpD"}
@@ -0,0 +1,8 @@
1
+ export declare const mnemonicToWords: (mnemonic: string) => string[];
2
+ /** A wrapper around the bip39 package function, with default strength applied to produce 24 words */
3
+ export declare const generateMnemonicWords: (strength?: number) => string[];
4
+ export declare const joinMnemonicWords: (mnenomic: string[]) => string;
5
+ export declare const generateRandomSeed: (strength?: number) => Uint8Array;
6
+ /** A wrapper around the bip39 package function */
7
+ export declare const validateMnemonic: (mnemonic: string) => boolean;
8
+ //# sourceMappingURL=MnemonicUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MnemonicUtils.d.ts","sourceRoot":"","sources":["../src/MnemonicUtils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,EAA8C,CAAC;AAEzG,qGAAqG;AACrG,eAAO,MAAM,qBAAqB,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,EACL,CAAC;AAE7D,eAAO,MAAM,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,MAAmD,CAAC;AAE5G,eAAO,MAAM,kBAAkB,GAAI,iBAAc,KAAG,UAEnD,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,KAAG,OAAoD,CAAC"}
package/dist/index.cjs ADDED
@@ -0,0 +1,102 @@
1
+ 'use strict';
2
+
3
+ var bip32 = require('@scure/bip32');
4
+ var bip39 = require('@scure/bip39');
5
+ var english = require('@scure/bip39/wordlists/english');
6
+
7
+ function _interopNamespaceDefault(e) {
8
+ var n = Object.create(null);
9
+ if (e) {
10
+ Object.keys(e).forEach(function (k) {
11
+ if (k !== 'default') {
12
+ var d = Object.getOwnPropertyDescriptor(e, k);
13
+ Object.defineProperty(n, k, d.get ? d : {
14
+ enumerable: true,
15
+ get: function () { return e[k]; }
16
+ });
17
+ }
18
+ });
19
+ }
20
+ n.default = e;
21
+ return Object.freeze(n);
22
+ }
23
+
24
+ var bip39__namespace = /*#__PURE__*/_interopNamespaceDefault(bip39);
25
+
26
+ const Roles = {
27
+ NightExternal: 0,
28
+ NightInternal: 1,
29
+ Dust: 2,
30
+ Zswap: 3,
31
+ Metadata: 4,
32
+ };
33
+ const PURPOSE = 44;
34
+ const COIN_TYPE = 2400;
35
+ class HDWallet {
36
+ rootKey;
37
+ constructor(key) {
38
+ this.rootKey = key;
39
+ }
40
+ static fromSeed(seed) {
41
+ try {
42
+ const rootKey = bip32.HDKey.fromMasterSeed(seed);
43
+ return { type: 'seedOk', hdWallet: new HDWallet(rootKey) };
44
+ }
45
+ catch (e) {
46
+ return { type: 'seedError', error: e };
47
+ }
48
+ }
49
+ // Begin by selecting an account.
50
+ selectAccount(account) {
51
+ return new AccountKey(this.rootKey, account);
52
+ }
53
+ }
54
+ class AccountKey {
55
+ rootKey;
56
+ account;
57
+ constructor(rootKey, account) {
58
+ this.rootKey = rootKey;
59
+ this.account = account;
60
+ }
61
+ // After account, select a role.
62
+ selectRole(role) {
63
+ return new RoleKey(this.rootKey, this.account, role);
64
+ }
65
+ }
66
+ class RoleKey {
67
+ rootKey;
68
+ account;
69
+ role;
70
+ constructor(rootKey, account, role) {
71
+ this.rootKey = rootKey;
72
+ this.account = account;
73
+ this.role = role;
74
+ }
75
+ // Finally, derive the key at the given index.
76
+ deriveKeyAt(index) {
77
+ const path = `m/${PURPOSE}'/${COIN_TYPE}'/${this.account}'/${this.role}/${index}`;
78
+ const derivedKey = this.rootKey.derive(path);
79
+ return derivedKey.privateKey ? { type: 'keyDerived', key: derivedKey.privateKey } : { type: 'keyOutOfBounds' };
80
+ }
81
+ }
82
+
83
+ const mnemonicToWords = (mnemonic) => mnemonic.split(' ');
84
+ /** A wrapper around the bip39 package function, with default strength applied to produce 24 words */
85
+ const generateMnemonicWords = (strength = 256) => mnemonicToWords(bip39__namespace.generateMnemonic(english.wordlist, strength));
86
+ const joinMnemonicWords = (mnenomic) => mnenomic.join(' ');
87
+ const generateRandomSeed = (strength = 256) => {
88
+ return crypto.getRandomValues(new Uint8Array(Math.ceil(strength / 8)));
89
+ };
90
+ /** A wrapper around the bip39 package function */
91
+ const validateMnemonic = (mnemonic) => bip39__namespace.validateMnemonic(mnemonic, english.wordlist);
92
+
93
+ exports.AccountKey = AccountKey;
94
+ exports.HDWallet = HDWallet;
95
+ exports.RoleKey = RoleKey;
96
+ exports.Roles = Roles;
97
+ exports.generateMnemonicWords = generateMnemonicWords;
98
+ exports.generateRandomSeed = generateRandomSeed;
99
+ exports.joinMnemonicWords = joinMnemonicWords;
100
+ exports.mnemonicToWords = mnemonicToWords;
101
+ exports.validateMnemonic = validateMnemonic;
102
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../src/HDWallet.ts","../src/MnemonicUtils.ts"],"sourcesContent":[null,null],"names":["HDKey","bip39","english"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIa,MAAA,KAAK,GAAG;AACnB,IAAA,aAAa,EAAE,CAAC;AAChB,IAAA,aAAa,EAAE,CAAC;AAChB,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,QAAQ,EAAE,CAAC;;AAQb,MAAM,OAAO,GAAG,EAAE;AAClB,MAAM,SAAS,GAAG,IAAI;MAET,QAAQ,CAAA;AACF,IAAA,OAAO;AAExB,IAAA,WAAA,CAAoB,GAAU,EAAA;AAC5B,QAAA,IAAI,CAAC,OAAO,GAAG,GAAG;;IAGpB,OAAO,QAAQ,CAAC,IAAgB,EAAA;AAC9B,QAAA,IAAI;YACF,MAAM,OAAO,GAAGA,WAAK,CAAC,cAAc,CAAC,IAAI,CAAC;AAC1C,YAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,QAAQ,CAAC,OAAO,CAAC,EAAE;;QAC1D,OAAO,CAAU,EAAE;YACnB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,EAAE;;;;AAKnC,IAAA,aAAa,CAAC,OAAe,EAAA;QAClC,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;;AAE/C;MAEY,UAAU,CAAA;AAEX,IAAA,OAAA;AACA,IAAA,OAAA;IAFV,WACU,CAAA,OAAc,EACd,OAAe,EAAA;QADf,IAAO,CAAA,OAAA,GAAP,OAAO;QACP,IAAO,CAAA,OAAA,GAAP,OAAO;;;AAIV,IAAA,UAAU,CAAC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C,CAAC;AACxE;AAEA;AACa,MAAA,gBAAgB,GAAG,CAAC,QAAgB,KAAcD,gBAAK,CAAC,gBAAgB,CAAC,QAAQ,EAAEC,gBAAO;;;;;;;;;;;;"}
@@ -0,0 +1,3 @@
1
+ export * from './HDWallet';
2
+ export * from './MnemonicUtils';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}
package/dist/index.mjs ADDED
@@ -0,0 +1,73 @@
1
+ import { HDKey } from '@scure/bip32';
2
+ import * as bip39 from '@scure/bip39';
3
+ import { wordlist } from '@scure/bip39/wordlists/english';
4
+
5
+ const Roles = {
6
+ NightExternal: 0,
7
+ NightInternal: 1,
8
+ Dust: 2,
9
+ Zswap: 3,
10
+ Metadata: 4,
11
+ };
12
+ const PURPOSE = 44;
13
+ const COIN_TYPE = 2400;
14
+ class HDWallet {
15
+ rootKey;
16
+ constructor(key) {
17
+ this.rootKey = key;
18
+ }
19
+ static fromSeed(seed) {
20
+ try {
21
+ const rootKey = HDKey.fromMasterSeed(seed);
22
+ return { type: 'seedOk', hdWallet: new HDWallet(rootKey) };
23
+ }
24
+ catch (e) {
25
+ return { type: 'seedError', error: e };
26
+ }
27
+ }
28
+ // Begin by selecting an account.
29
+ selectAccount(account) {
30
+ return new AccountKey(this.rootKey, account);
31
+ }
32
+ }
33
+ class AccountKey {
34
+ rootKey;
35
+ account;
36
+ constructor(rootKey, account) {
37
+ this.rootKey = rootKey;
38
+ this.account = account;
39
+ }
40
+ // After account, select a role.
41
+ selectRole(role) {
42
+ return new RoleKey(this.rootKey, this.account, role);
43
+ }
44
+ }
45
+ class RoleKey {
46
+ rootKey;
47
+ account;
48
+ role;
49
+ constructor(rootKey, account, role) {
50
+ this.rootKey = rootKey;
51
+ this.account = account;
52
+ this.role = role;
53
+ }
54
+ // Finally, derive the key at the given index.
55
+ deriveKeyAt(index) {
56
+ const path = `m/${PURPOSE}'/${COIN_TYPE}'/${this.account}'/${this.role}/${index}`;
57
+ const derivedKey = this.rootKey.derive(path);
58
+ return derivedKey.privateKey ? { type: 'keyDerived', key: derivedKey.privateKey } : { type: 'keyOutOfBounds' };
59
+ }
60
+ }
61
+
62
+ const mnemonicToWords = (mnemonic) => mnemonic.split(' ');
63
+ /** A wrapper around the bip39 package function, with default strength applied to produce 24 words */
64
+ const generateMnemonicWords = (strength = 256) => mnemonicToWords(bip39.generateMnemonic(wordlist, strength));
65
+ const joinMnemonicWords = (mnenomic) => mnenomic.join(' ');
66
+ const generateRandomSeed = (strength = 256) => {
67
+ return crypto.getRandomValues(new Uint8Array(Math.ceil(strength / 8)));
68
+ };
69
+ /** A wrapper around the bip39 package function */
70
+ const validateMnemonic = (mnemonic) => bip39.validateMnemonic(mnemonic, wordlist);
71
+
72
+ export { AccountKey, HDWallet, RoleKey, Roles, generateMnemonicWords, generateRandomSeed, joinMnemonicWords, mnemonicToWords, validateMnemonic };
73
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../src/HDWallet.ts","../src/MnemonicUtils.ts"],"sourcesContent":[null,null],"names":["english"],"mappings":";;;;AAIa,MAAA,KAAK,GAAG;AACnB,IAAA,aAAa,EAAE,CAAC;AAChB,IAAA,aAAa,EAAE,CAAC;AAChB,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,QAAQ,EAAE,CAAC;;AAQb,MAAM,OAAO,GAAG,EAAE;AAClB,MAAM,SAAS,GAAG,IAAI;MAET,QAAQ,CAAA;AACF,IAAA,OAAO;AAExB,IAAA,WAAA,CAAoB,GAAU,EAAA;AAC5B,QAAA,IAAI,CAAC,OAAO,GAAG,GAAG;;IAGpB,OAAO,QAAQ,CAAC,IAAgB,EAAA;AAC9B,QAAA,IAAI;YACF,MAAM,OAAO,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EAAE,GAAG,EAAE,UAAU,CAAC,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,gBAAgB,EAAE;;AAEjH;;AChEM,MAAM,eAAe,GAAmC,CAAC,QAAgB,KAAK,QAAQ,CAAC,KAAK,CAAC,GAAG;AAEvG;MACa,qBAAqB,GAAoC,CAAC,QAAQ,GAAG,GAAG,KACnF,eAAe,CAAC,KAAK,CAAC,gBAAgB,CAACA,QAAO,EAAE,QAAQ,CAAC;AAEpD,MAAM,iBAAiB,GAAmC,CAAC,QAAkB,KAAK,QAAQ,CAAC,IAAI,CAAC,GAAG;MAE7F,kBAAkB,GAAG,CAAC,QAAQ,GAAG,GAAG,KAAgB;AAC/D,IAAA,OAAO,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC;AACxE;AAEA;AACa,MAAA,gBAAgB,GAAG,CAAC,QAAgB,KAAc,KAAK,CAAC,gBAAgB,CAAC,QAAQ,EAAEA,QAAO;;;;"}
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@midnight-ntwrk/wallet-sdk-hd",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "main": "./dist/index.cjs",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "author": "IOHK",
9
+ "license": "Apache-2.0",
10
+ "publishConfig": {
11
+ "registry": "https://npm.pkg.github.com/"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/midnight-ntwrk/artifacts.git"
16
+ },
17
+ "files": [
18
+ "dist/"
19
+ ],
20
+ "exports": {
21
+ ".": {
22
+ "import": "./dist/index.mjs",
23
+ "require": "./dist/index.cjs",
24
+ "types": "./dist/index.d.ts"
25
+ }
26
+ },
27
+ "dependencies": {
28
+ "@scure/base": "^1.1.9",
29
+ "@scure/bip32": "^1.6.2",
30
+ "@scure/bip39": "^1.5.4"
31
+ },
32
+ "devDependencies": {
33
+ "@ethereumjs/wallet": "^3.0.0-alpha.1",
34
+ "fast-check": "^3.23.2"
35
+ },
36
+ "scripts": {
37
+ "typecheck": "tsc -b ./tsconfig.json --noEmit",
38
+ "test": "NODE_OPTIONS='--experimental-vm-modules' jest",
39
+ "lint": "eslint",
40
+ "dist": "rollup -c ./rollup.config.mjs"
41
+ }
42
+ }