@bsv/wallet-toolbox 2.0.0-beta.1 → 2.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/CHANGELOG.md +21 -0
- package/docs/README.md +1 -0
- package/docs/client.md +409 -267
- package/docs/services.md +15 -3
- package/docs/storage.md +48 -88
- package/docs/wab-shamir.md +311 -0
- package/docs/wallet.md +409 -267
- package/out/src/ShamirWalletManager.d.ts +213 -0
- package/out/src/ShamirWalletManager.d.ts.map +1 -0
- package/out/src/ShamirWalletManager.js +363 -0
- package/out/src/ShamirWalletManager.js.map +1 -0
- package/out/src/Wallet.d.ts +1 -1
- package/out/src/Wallet.d.ts.map +1 -1
- package/out/src/Wallet.js +23 -7
- package/out/src/Wallet.js.map +1 -1
- package/out/src/WalletPermissionsManager.d.ts +84 -1
- package/out/src/WalletPermissionsManager.d.ts.map +1 -1
- package/out/src/WalletPermissionsManager.js +1045 -214
- package/out/src/WalletPermissionsManager.js.map +1 -1
- package/out/src/__tests/ShamirWalletManager.test.d.ts +2 -0
- package/out/src/__tests/ShamirWalletManager.test.d.ts.map +1 -0
- package/out/src/__tests/ShamirWalletManager.test.js +298 -0
- package/out/src/__tests/ShamirWalletManager.test.js.map +1 -0
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.js +134 -0
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.js +9 -0
- package/out/src/__tests/WalletPermissionsManager.fixtures.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.flows.test.js +121 -0
- package/out/src/__tests/WalletPermissionsManager.flows.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.pmodules.test.js +111 -0
- package/out/src/__tests/WalletPermissionsManager.pmodules.test.js.map +1 -1
- package/out/src/entropy/EntropyCollector.d.ts +89 -0
- package/out/src/entropy/EntropyCollector.d.ts.map +1 -0
- package/out/src/entropy/EntropyCollector.js +176 -0
- package/out/src/entropy/EntropyCollector.js.map +1 -0
- package/out/src/entropy/__tests/EntropyCollector.test.d.ts +2 -0
- package/out/src/entropy/__tests/EntropyCollector.test.d.ts.map +1 -0
- package/out/src/entropy/__tests/EntropyCollector.test.js +137 -0
- package/out/src/entropy/__tests/EntropyCollector.test.js.map +1 -0
- package/out/src/index.all.d.ts +2 -0
- package/out/src/index.all.d.ts.map +1 -1
- package/out/src/index.all.js +2 -0
- package/out/src/index.all.js.map +1 -1
- package/out/src/sdk/WalletServices.interfaces.d.ts.map +1 -1
- package/out/src/sdk/WalletStorage.interfaces.d.ts +3 -3
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
- package/out/src/services/__tests/getRawTx.test.js +3 -0
- package/out/src/services/__tests/getRawTx.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainCdn.d.ts +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.js +4 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/__tests/Chaintracks.test.js +3 -1
- package/out/src/services/chaintracker/chaintracks/__tests/Chaintracks.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js +1 -2
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/validBulkHeaderFilesByFileHash.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/validBulkHeaderFilesByFileHash.js +12 -0
- package/out/src/services/chaintracker/chaintracks/util/validBulkHeaderFilesByFileHash.js.map +1 -1
- package/out/src/storage/StorageProvider.d.ts +16 -2
- package/out/src/storage/StorageProvider.d.ts.map +1 -1
- package/out/src/storage/StorageProvider.js +33 -4
- package/out/src/storage/StorageProvider.js.map +1 -1
- package/out/src/storage/methods/ListOutputsSpecOp.d.ts +15 -1
- package/out/src/storage/methods/ListOutputsSpecOp.d.ts.map +1 -1
- package/out/src/storage/methods/ListOutputsSpecOp.js +52 -2
- package/out/src/storage/methods/ListOutputsSpecOp.js.map +1 -1
- package/out/src/storage/methods/__test/offsetKey.test.js +266 -100
- package/out/src/storage/methods/__test/offsetKey.test.js.map +1 -1
- package/out/src/storage/methods/getBeefForTransaction.js +1 -1
- package/out/src/storage/methods/getBeefForTransaction.js.map +1 -1
- package/out/src/storage/methods/internalizeAction.d.ts.map +1 -1
- package/out/src/storage/methods/internalizeAction.js +2 -2
- package/out/src/storage/methods/internalizeAction.js.map +1 -1
- package/out/src/storage/methods/listOutputsIdb.d.ts.map +1 -1
- package/out/src/storage/methods/listOutputsIdb.js +10 -17
- package/out/src/storage/methods/listOutputsIdb.js.map +1 -1
- package/out/src/storage/methods/listOutputsKnex.d.ts.map +1 -1
- package/out/src/storage/methods/listOutputsKnex.js +44 -26
- package/out/src/storage/methods/listOutputsKnex.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js +4 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js.map +1 -1
- package/out/src/wab-client/WABClient.d.ts +65 -0
- package/out/src/wab-client/WABClient.d.ts.map +1 -1
- package/out/src/wab-client/WABClient.js +107 -0
- package/out/src/wab-client/WABClient.js.map +1 -1
- package/package.json +8 -4
- package/out/src/sdk/validationHelpers.d.ts +0 -303
- package/out/src/sdk/validationHelpers.d.ts.map +0 -1
- package/out/src/sdk/validationHelpers.js +0 -632
- package/out/src/sdk/validationHelpers.js.map +0 -1
- package/out/src/utility/ReaderUint8Array.d.ts +0 -28
- package/out/src/utility/ReaderUint8Array.d.ts.map +0 -1
- package/out/src/utility/ReaderUint8Array.js +0 -166
- package/out/src/utility/ReaderUint8Array.js.map +0 -1
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ShamirWalletManager
|
|
3
|
+
*
|
|
4
|
+
* A wallet manager that uses Shamir Secret Sharing for key recovery
|
|
5
|
+
* instead of password-derived keys and on-chain UMP tokens.
|
|
6
|
+
*
|
|
7
|
+
* Security improvements over CWIStyleWalletManager:
|
|
8
|
+
* - No password enumeration attacks possible (no password-derived keys)
|
|
9
|
+
* - No encrypted key material stored on-chain
|
|
10
|
+
* - Server only holds 1 share (cannot reconstruct alone)
|
|
11
|
+
* - Defense-in-depth with mouse entropy + CSPRNG for key generation
|
|
12
|
+
*
|
|
13
|
+
* Default configuration (2-of-3):
|
|
14
|
+
* - Share 1 (server): Stored on WAB server, released only after OTP verification
|
|
15
|
+
* - Shares 2..n (user): Application decides how to store (print, password manager, etc.)
|
|
16
|
+
*
|
|
17
|
+
* The threshold and total shares are configurable. WAB always stores exactly one share.
|
|
18
|
+
*/
|
|
19
|
+
import { PrivateKey, WalletInterface } from '@bsv/sdk';
|
|
20
|
+
import { PrivilegedKeyManager } from './sdk/PrivilegedKeyManager';
|
|
21
|
+
import { EntropyProgressCallback } from './entropy/EntropyCollector';
|
|
22
|
+
/**
|
|
23
|
+
* Result from creating a new Shamir-based wallet
|
|
24
|
+
*/
|
|
25
|
+
export interface CreateShamirWalletResult {
|
|
26
|
+
/**
|
|
27
|
+
* User shares to be stored by the application (excludes server share)
|
|
28
|
+
* For 2-of-3: returns 2 shares, server holds 1
|
|
29
|
+
* For 3-of-5: returns 4 shares, server holds 1
|
|
30
|
+
*/
|
|
31
|
+
userShares: string[];
|
|
32
|
+
/** Hash of the user's identity key (used for server lookup) */
|
|
33
|
+
userIdHash: string;
|
|
34
|
+
/** The generated private key (for immediate wallet use) */
|
|
35
|
+
privateKey: PrivateKey;
|
|
36
|
+
/** The threshold used (k shares needed to reconstruct) */
|
|
37
|
+
threshold: number;
|
|
38
|
+
/** Total number of shares generated */
|
|
39
|
+
totalShares: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Configuration for ShamirWalletManager
|
|
43
|
+
*/
|
|
44
|
+
export interface ShamirWalletManagerConfig {
|
|
45
|
+
/** WAB server URL */
|
|
46
|
+
wabServerUrl: string;
|
|
47
|
+
/** Auth method type for OTP verification (e.g., "TwilioPhone") */
|
|
48
|
+
authMethodType: string;
|
|
49
|
+
/** Function to build the underlying wallet from a private key */
|
|
50
|
+
walletBuilder: (privateKey: PrivateKey, privilegedKeyManager: PrivilegedKeyManager) => Promise<WalletInterface>;
|
|
51
|
+
/**
|
|
52
|
+
* Number of shares required to reconstruct the key (default: 2)
|
|
53
|
+
* Must be >= 2 and <= totalShares
|
|
54
|
+
*/
|
|
55
|
+
threshold?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Total number of shares to generate (default: 3)
|
|
58
|
+
* WAB server stores 1, application receives (totalShares - 1)
|
|
59
|
+
*/
|
|
60
|
+
totalShares?: number;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Callback for handling user shares during wallet creation
|
|
64
|
+
*/
|
|
65
|
+
export type ShareStorageCallback = (shares: string[], threshold: number, totalShares: number) => Promise<boolean>;
|
|
66
|
+
export declare class ShamirWalletManager {
|
|
67
|
+
private config;
|
|
68
|
+
private wabClient;
|
|
69
|
+
private entropyCollector;
|
|
70
|
+
private privateKey?;
|
|
71
|
+
private underlying?;
|
|
72
|
+
private userIdHash?;
|
|
73
|
+
private readonly threshold;
|
|
74
|
+
private readonly totalShares;
|
|
75
|
+
constructor(config: ShamirWalletManagerConfig);
|
|
76
|
+
/**
|
|
77
|
+
* Get the configured threshold
|
|
78
|
+
*/
|
|
79
|
+
getThreshold(): number;
|
|
80
|
+
/**
|
|
81
|
+
* Get the configured total shares
|
|
82
|
+
*/
|
|
83
|
+
getTotalShares(): number;
|
|
84
|
+
/**
|
|
85
|
+
* Reset the entropy collector (e.g., if user wants to start over)
|
|
86
|
+
*/
|
|
87
|
+
resetEntropy(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Add a mouse movement sample for entropy collection
|
|
90
|
+
* Call this from your UI's mousemove handler
|
|
91
|
+
*/
|
|
92
|
+
addMouseEntropy(x: number, y: number): import("./entropy/EntropyCollector").EntropyProgress | null;
|
|
93
|
+
/**
|
|
94
|
+
* Check if enough entropy has been collected
|
|
95
|
+
*/
|
|
96
|
+
hasEnoughEntropy(): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Get entropy collection progress
|
|
99
|
+
*/
|
|
100
|
+
getEntropyProgress(): import("./entropy/EntropyCollector").EntropyProgress;
|
|
101
|
+
/**
|
|
102
|
+
* Collect entropy from browser mouse movements
|
|
103
|
+
* Convenience method that sets up event listeners automatically
|
|
104
|
+
*/
|
|
105
|
+
collectEntropyFromBrowser(element?: EventTarget, onProgress?: EntropyProgressCallback): Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* Generate a user ID hash from a private key
|
|
108
|
+
* This is used to identify the user on the WAB server without revealing the key
|
|
109
|
+
*/
|
|
110
|
+
private generateUserIdHash;
|
|
111
|
+
/**
|
|
112
|
+
* Create a new wallet with Shamir key split
|
|
113
|
+
*
|
|
114
|
+
* Flow:
|
|
115
|
+
* 1. Generate private key from entropy
|
|
116
|
+
* 2. Split into Shamir shares (threshold-of-totalShares)
|
|
117
|
+
* 3. Store first share on WAB server (requires OTP verification)
|
|
118
|
+
* 4. Return remaining shares for application to handle
|
|
119
|
+
*
|
|
120
|
+
* @param authPayload Auth method specific payload (e.g., { phoneNumber: "+1...", otp: "123456" })
|
|
121
|
+
* @param onUserSharesReady Callback when user shares are ready - return true to confirm saved
|
|
122
|
+
* @returns Result containing user shares (server share already stored)
|
|
123
|
+
*/
|
|
124
|
+
createNewWallet(authPayload: {
|
|
125
|
+
phoneNumber?: string;
|
|
126
|
+
email?: string;
|
|
127
|
+
otp: string;
|
|
128
|
+
}, onUserSharesReady: ShareStorageCallback): Promise<CreateShamirWalletResult>;
|
|
129
|
+
/**
|
|
130
|
+
* Start OTP verification for share retrieval
|
|
131
|
+
* Call this before recoverWithSharesBC
|
|
132
|
+
*/
|
|
133
|
+
startOTPVerification(payload: {
|
|
134
|
+
phoneNumber?: string;
|
|
135
|
+
email?: string;
|
|
136
|
+
}): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Set the user ID hash for recovery operations
|
|
139
|
+
* This can be computed from Share A or C (both contain the same threshold/integrity)
|
|
140
|
+
*/
|
|
141
|
+
setUserIdHash(userIdHash: string): void;
|
|
142
|
+
/**
|
|
143
|
+
* Recover wallet using user shares plus the server share
|
|
144
|
+
* Requires OTP verification to retrieve the server share
|
|
145
|
+
*
|
|
146
|
+
* @param userShares Array of user-held shares (need threshold-1 shares)
|
|
147
|
+
* @param authPayload Contains OTP code and auth method data
|
|
148
|
+
*/
|
|
149
|
+
recoverWithServerShare(userShares: string[], authPayload: {
|
|
150
|
+
phoneNumber?: string;
|
|
151
|
+
email?: string;
|
|
152
|
+
otp: string;
|
|
153
|
+
}): Promise<PrivateKey>;
|
|
154
|
+
/**
|
|
155
|
+
* Recover wallet using only user-held shares (no server interaction)
|
|
156
|
+
* Requires at least threshold shares
|
|
157
|
+
*
|
|
158
|
+
* @param userShares Array of user-held shares (need at least threshold shares)
|
|
159
|
+
*/
|
|
160
|
+
recoverWithUserShares(userShares: string[]): Promise<PrivateKey>;
|
|
161
|
+
/**
|
|
162
|
+
* Extract threshold from a share (format: x.y.threshold.integrity)
|
|
163
|
+
*/
|
|
164
|
+
private getThresholdFromShare;
|
|
165
|
+
/**
|
|
166
|
+
* Build the underlying wallet after key recovery
|
|
167
|
+
*/
|
|
168
|
+
buildWallet(): Promise<WalletInterface>;
|
|
169
|
+
/**
|
|
170
|
+
* Get the underlying wallet (must call buildWallet first)
|
|
171
|
+
*/
|
|
172
|
+
getWallet(): WalletInterface;
|
|
173
|
+
/**
|
|
174
|
+
* Rotate keys - generate new key and update server share
|
|
175
|
+
* User must save new user shares
|
|
176
|
+
*
|
|
177
|
+
* @param authPayload Contains OTP code and auth method data
|
|
178
|
+
* @param onUserSharesReady Callback when new user shares are ready
|
|
179
|
+
*/
|
|
180
|
+
rotateKeys(authPayload: {
|
|
181
|
+
phoneNumber?: string;
|
|
182
|
+
email?: string;
|
|
183
|
+
otp: string;
|
|
184
|
+
}, onUserSharesReady: ShareStorageCallback): Promise<CreateShamirWalletResult>;
|
|
185
|
+
/**
|
|
186
|
+
* Validate Shamir share format
|
|
187
|
+
* Expected format: x.y.threshold.integrity (4 dot-separated parts)
|
|
188
|
+
*/
|
|
189
|
+
private validateShareFormat;
|
|
190
|
+
/**
|
|
191
|
+
* Check if the manager has a loaded private key
|
|
192
|
+
*/
|
|
193
|
+
hasPrivateKey(): boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Get the user ID hash (for display or storage)
|
|
196
|
+
*/
|
|
197
|
+
getUserIdHash(): string | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* Delete the user's account and stored share from the WAB server
|
|
200
|
+
* Requires OTP verification
|
|
201
|
+
*
|
|
202
|
+
* WARNING: This permanently deletes the server share.
|
|
203
|
+
* User must have enough remaining shares to meet the threshold for recovery.
|
|
204
|
+
*
|
|
205
|
+
* @param authPayload Contains OTP code and auth method data
|
|
206
|
+
*/
|
|
207
|
+
deleteAccount(authPayload: {
|
|
208
|
+
phoneNumber?: string;
|
|
209
|
+
email?: string;
|
|
210
|
+
otp: string;
|
|
211
|
+
}): Promise<void>;
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=ShamirWalletManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShamirWalletManager.d.ts","sourceRoot":"","sources":["../../src/ShamirWalletManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAe,MAAM,UAAU,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA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C;IAa7C;;OAEG;IACH,SAAS,IAAI,eAAe;IAO5B;;;;;;OAMG;IACG,UAAU,CACd,WAAW,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAClE,iBAAiB,EAAE,oBAAoB,GACtC,OAAO,CAAC,wBAAwB,CAAC;IAqDpC;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAY3B;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,aAAa,IAAI,MAAM,GAAG,SAAS;IAInC;;;;;;;;OAQG;IACG,aAAa,CAAC,WAAW,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAgBvG"}
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ShamirWalletManager
|
|
4
|
+
*
|
|
5
|
+
* A wallet manager that uses Shamir Secret Sharing for key recovery
|
|
6
|
+
* instead of password-derived keys and on-chain UMP tokens.
|
|
7
|
+
*
|
|
8
|
+
* Security improvements over CWIStyleWalletManager:
|
|
9
|
+
* - No password enumeration attacks possible (no password-derived keys)
|
|
10
|
+
* - No encrypted key material stored on-chain
|
|
11
|
+
* - Server only holds 1 share (cannot reconstruct alone)
|
|
12
|
+
* - Defense-in-depth with mouse entropy + CSPRNG for key generation
|
|
13
|
+
*
|
|
14
|
+
* Default configuration (2-of-3):
|
|
15
|
+
* - Share 1 (server): Stored on WAB server, released only after OTP verification
|
|
16
|
+
* - Shares 2..n (user): Application decides how to store (print, password manager, etc.)
|
|
17
|
+
*
|
|
18
|
+
* The threshold and total shares are configurable. WAB always stores exactly one share.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.ShamirWalletManager = void 0;
|
|
22
|
+
const sdk_1 = require("@bsv/sdk");
|
|
23
|
+
const PrivilegedKeyManager_1 = require("./sdk/PrivilegedKeyManager");
|
|
24
|
+
const WABClient_1 = require("./wab-client/WABClient");
|
|
25
|
+
const EntropyCollector_1 = require("./entropy/EntropyCollector");
|
|
26
|
+
class ShamirWalletManager {
|
|
27
|
+
constructor(config) {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
this.config = config;
|
|
30
|
+
this.wabClient = new WABClient_1.WABClient(config.wabServerUrl);
|
|
31
|
+
this.entropyCollector = new EntropyCollector_1.EntropyCollector();
|
|
32
|
+
// Set defaults and validate
|
|
33
|
+
this.threshold = (_a = config.threshold) !== null && _a !== void 0 ? _a : 2;
|
|
34
|
+
this.totalShares = (_b = config.totalShares) !== null && _b !== void 0 ? _b : 3;
|
|
35
|
+
if (this.threshold < 2) {
|
|
36
|
+
throw new Error('Threshold must be at least 2');
|
|
37
|
+
}
|
|
38
|
+
if (this.totalShares < 3) {
|
|
39
|
+
throw new Error('Total shares must be at least 3');
|
|
40
|
+
}
|
|
41
|
+
// User must have at least threshold shares to recover independently
|
|
42
|
+
// (server holds 1 share, user holds totalShares - 1)
|
|
43
|
+
// This prevents WAB from becoming a custodian
|
|
44
|
+
const userShareCount = this.totalShares - 1;
|
|
45
|
+
if (userShareCount < this.threshold) {
|
|
46
|
+
throw new Error(`User must have at least ${this.threshold} shares to recover independently. ` +
|
|
47
|
+
`With ${this.totalShares} total shares and server holding 1, user only gets ${userShareCount}. ` +
|
|
48
|
+
`Increase totalShares to at least ${this.threshold + 1}.`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get the configured threshold
|
|
53
|
+
*/
|
|
54
|
+
getThreshold() {
|
|
55
|
+
return this.threshold;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get the configured total shares
|
|
59
|
+
*/
|
|
60
|
+
getTotalShares() {
|
|
61
|
+
return this.totalShares;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Reset the entropy collector (e.g., if user wants to start over)
|
|
65
|
+
*/
|
|
66
|
+
resetEntropy() {
|
|
67
|
+
this.entropyCollector.reset();
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Add a mouse movement sample for entropy collection
|
|
71
|
+
* Call this from your UI's mousemove handler
|
|
72
|
+
*/
|
|
73
|
+
addMouseEntropy(x, y) {
|
|
74
|
+
return this.entropyCollector.addMouseSample(x, y);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Check if enough entropy has been collected
|
|
78
|
+
*/
|
|
79
|
+
hasEnoughEntropy() {
|
|
80
|
+
return this.entropyCollector.isComplete();
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Get entropy collection progress
|
|
84
|
+
*/
|
|
85
|
+
getEntropyProgress() {
|
|
86
|
+
return this.entropyCollector.getProgress();
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Collect entropy from browser mouse movements
|
|
90
|
+
* Convenience method that sets up event listeners automatically
|
|
91
|
+
*/
|
|
92
|
+
async collectEntropyFromBrowser(element, onProgress) {
|
|
93
|
+
await this.entropyCollector.collectFromBrowser(element, onProgress);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Generate a user ID hash from a private key
|
|
97
|
+
* This is used to identify the user on the WAB server without revealing the key
|
|
98
|
+
*/
|
|
99
|
+
generateUserIdHash(privateKey) {
|
|
100
|
+
const publicKey = privateKey.toPublicKey().toString();
|
|
101
|
+
const hash = sdk_1.Hash.sha256(sdk_1.Utils.toArray(publicKey, 'utf8'));
|
|
102
|
+
return sdk_1.Utils.toHex(hash);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Create a new wallet with Shamir key split
|
|
106
|
+
*
|
|
107
|
+
* Flow:
|
|
108
|
+
* 1. Generate private key from entropy
|
|
109
|
+
* 2. Split into Shamir shares (threshold-of-totalShares)
|
|
110
|
+
* 3. Store first share on WAB server (requires OTP verification)
|
|
111
|
+
* 4. Return remaining shares for application to handle
|
|
112
|
+
*
|
|
113
|
+
* @param authPayload Auth method specific payload (e.g., { phoneNumber: "+1...", otp: "123456" })
|
|
114
|
+
* @param onUserSharesReady Callback when user shares are ready - return true to confirm saved
|
|
115
|
+
* @returns Result containing user shares (server share already stored)
|
|
116
|
+
*/
|
|
117
|
+
async createNewWallet(authPayload, onUserSharesReady) {
|
|
118
|
+
// 1. Generate private key from entropy (mixed with CSPRNG)
|
|
119
|
+
const entropy = this.entropyCollector.generateEntropy();
|
|
120
|
+
const privateKey = new sdk_1.PrivateKey(Array.from(entropy));
|
|
121
|
+
// 2. Split into Shamir shares
|
|
122
|
+
const shares = privateKey.toBackupShares(this.threshold, this.totalShares);
|
|
123
|
+
// First share goes to server, rest go to user
|
|
124
|
+
const serverShare = shares[0];
|
|
125
|
+
const userShares = shares.slice(1);
|
|
126
|
+
// 3. Generate user ID hash for server identification
|
|
127
|
+
const userIdHash = this.generateUserIdHash(privateKey);
|
|
128
|
+
// 4. Store server share on WAB server (requires OTP verification)
|
|
129
|
+
const storeResult = await this.wabClient.storeShare(this.config.authMethodType, authPayload, serverShare, userIdHash);
|
|
130
|
+
if (!storeResult.success) {
|
|
131
|
+
throw new Error(storeResult.message || 'Failed to store share on server');
|
|
132
|
+
}
|
|
133
|
+
// 5. Present user shares for application to handle
|
|
134
|
+
const sharesSaved = await onUserSharesReady(userShares, this.threshold, this.totalShares);
|
|
135
|
+
if (!sharesSaved) {
|
|
136
|
+
console.warn('User shares may not have been saved. Recovery may be limited.');
|
|
137
|
+
}
|
|
138
|
+
// Store state
|
|
139
|
+
this.privateKey = privateKey;
|
|
140
|
+
this.userIdHash = userIdHash;
|
|
141
|
+
return {
|
|
142
|
+
userShares,
|
|
143
|
+
userIdHash,
|
|
144
|
+
privateKey,
|
|
145
|
+
threshold: this.threshold,
|
|
146
|
+
totalShares: this.totalShares
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Start OTP verification for share retrieval
|
|
151
|
+
* Call this before recoverWithSharesBC
|
|
152
|
+
*/
|
|
153
|
+
async startOTPVerification(payload) {
|
|
154
|
+
if (!this.userIdHash) {
|
|
155
|
+
throw new Error('User ID hash not set. Call setUserIdHash first for recovery.');
|
|
156
|
+
}
|
|
157
|
+
const result = await this.wabClient.startShareAuth(this.config.authMethodType, this.userIdHash, payload);
|
|
158
|
+
if (!result.success) {
|
|
159
|
+
throw new Error(result.message || 'Failed to start OTP verification');
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Set the user ID hash for recovery operations
|
|
164
|
+
* This can be computed from Share A or C (both contain the same threshold/integrity)
|
|
165
|
+
*/
|
|
166
|
+
setUserIdHash(userIdHash) {
|
|
167
|
+
this.userIdHash = userIdHash;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Recover wallet using user shares plus the server share
|
|
171
|
+
* Requires OTP verification to retrieve the server share
|
|
172
|
+
*
|
|
173
|
+
* @param userShares Array of user-held shares (need threshold-1 shares)
|
|
174
|
+
* @param authPayload Contains OTP code and auth method data
|
|
175
|
+
*/
|
|
176
|
+
async recoverWithServerShare(userShares, authPayload) {
|
|
177
|
+
// Validate share formats
|
|
178
|
+
for (const share of userShares) {
|
|
179
|
+
this.validateShareFormat(share);
|
|
180
|
+
}
|
|
181
|
+
if (!this.userIdHash) {
|
|
182
|
+
throw new Error('User ID hash not set. Call setUserIdHash first.');
|
|
183
|
+
}
|
|
184
|
+
// Need threshold-1 user shares (server provides 1)
|
|
185
|
+
const threshold = this.getThresholdFromShare(userShares[0]);
|
|
186
|
+
if (userShares.length < threshold - 1) {
|
|
187
|
+
throw new Error(`Need at least ${threshold - 1} user shares to recover with server share. Got ${userShares.length}.`);
|
|
188
|
+
}
|
|
189
|
+
// Retrieve server share
|
|
190
|
+
const retrieveResult = await this.wabClient.retrieveShare(this.config.authMethodType, authPayload, this.userIdHash);
|
|
191
|
+
if (!retrieveResult.success || !retrieveResult.shareB) {
|
|
192
|
+
throw new Error(retrieveResult.message || 'Failed to retrieve share from server');
|
|
193
|
+
}
|
|
194
|
+
// Combine server share with user shares
|
|
195
|
+
const allShares = [retrieveResult.shareB, ...userShares.slice(0, threshold - 1)];
|
|
196
|
+
// Reconstruct private key
|
|
197
|
+
const privateKey = sdk_1.PrivateKey.fromBackupShares(allShares);
|
|
198
|
+
// Verify reconstruction by checking user ID hash
|
|
199
|
+
const reconstructedHash = this.generateUserIdHash(privateKey);
|
|
200
|
+
if (reconstructedHash !== this.userIdHash) {
|
|
201
|
+
throw new Error('Share reconstruction failed: integrity check failed');
|
|
202
|
+
}
|
|
203
|
+
this.privateKey = privateKey;
|
|
204
|
+
return privateKey;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Recover wallet using only user-held shares (no server interaction)
|
|
208
|
+
* Requires at least threshold shares
|
|
209
|
+
*
|
|
210
|
+
* @param userShares Array of user-held shares (need at least threshold shares)
|
|
211
|
+
*/
|
|
212
|
+
async recoverWithUserShares(userShares) {
|
|
213
|
+
if (userShares.length < 2) {
|
|
214
|
+
throw new Error('Need at least 2 shares to recover');
|
|
215
|
+
}
|
|
216
|
+
// Validate share formats
|
|
217
|
+
for (const share of userShares) {
|
|
218
|
+
this.validateShareFormat(share);
|
|
219
|
+
}
|
|
220
|
+
// Get threshold from share
|
|
221
|
+
const threshold = this.getThresholdFromShare(userShares[0]);
|
|
222
|
+
if (userShares.length < threshold) {
|
|
223
|
+
throw new Error(`Need at least ${threshold} shares to recover. Got ${userShares.length}.`);
|
|
224
|
+
}
|
|
225
|
+
// Reconstruct private key using threshold shares
|
|
226
|
+
const privateKey = sdk_1.PrivateKey.fromBackupShares(userShares.slice(0, threshold));
|
|
227
|
+
// Compute and store user ID hash
|
|
228
|
+
this.userIdHash = this.generateUserIdHash(privateKey);
|
|
229
|
+
this.privateKey = privateKey;
|
|
230
|
+
return privateKey;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Extract threshold from a share (format: x.y.threshold.integrity)
|
|
234
|
+
*/
|
|
235
|
+
getThresholdFromShare(share) {
|
|
236
|
+
const parts = share.split('.');
|
|
237
|
+
if (parts.length !== 4) {
|
|
238
|
+
throw new Error('Invalid share format');
|
|
239
|
+
}
|
|
240
|
+
const threshold = parseInt(parts[2], 10);
|
|
241
|
+
if (isNaN(threshold) || threshold < 2) {
|
|
242
|
+
throw new Error('Invalid threshold in share');
|
|
243
|
+
}
|
|
244
|
+
return threshold;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Build the underlying wallet after key recovery
|
|
248
|
+
*/
|
|
249
|
+
async buildWallet() {
|
|
250
|
+
if (!this.privateKey) {
|
|
251
|
+
throw new Error('No private key available. Create or recover wallet first.');
|
|
252
|
+
}
|
|
253
|
+
// Create privileged key manager for secure key operations
|
|
254
|
+
const privilegedKeyManager = new PrivilegedKeyManager_1.PrivilegedKeyManager(async () => this.privateKey);
|
|
255
|
+
// Build the wallet
|
|
256
|
+
this.underlying = await this.config.walletBuilder(this.privateKey, privilegedKeyManager);
|
|
257
|
+
return this.underlying;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Get the underlying wallet (must call buildWallet first)
|
|
261
|
+
*/
|
|
262
|
+
getWallet() {
|
|
263
|
+
if (!this.underlying) {
|
|
264
|
+
throw new Error('Wallet not built. Call buildWallet first.');
|
|
265
|
+
}
|
|
266
|
+
return this.underlying;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Rotate keys - generate new key and update server share
|
|
270
|
+
* User must save new user shares
|
|
271
|
+
*
|
|
272
|
+
* @param authPayload Contains OTP code and auth method data
|
|
273
|
+
* @param onUserSharesReady Callback when new user shares are ready
|
|
274
|
+
*/
|
|
275
|
+
async rotateKeys(authPayload, onUserSharesReady) {
|
|
276
|
+
if (!this.userIdHash) {
|
|
277
|
+
throw new Error('User ID hash not set. Cannot rotate keys.');
|
|
278
|
+
}
|
|
279
|
+
// Require fresh entropy for key rotation
|
|
280
|
+
if (!this.hasEnoughEntropy()) {
|
|
281
|
+
throw new Error('Collect entropy before key rotation');
|
|
282
|
+
}
|
|
283
|
+
// Generate new private key
|
|
284
|
+
const entropy = this.entropyCollector.generateEntropy();
|
|
285
|
+
const newPrivateKey = new sdk_1.PrivateKey(Array.from(entropy));
|
|
286
|
+
// Split into new Shamir shares
|
|
287
|
+
const shares = newPrivateKey.toBackupShares(this.threshold, this.totalShares);
|
|
288
|
+
const serverShare = shares[0];
|
|
289
|
+
const userShares = shares.slice(1);
|
|
290
|
+
// Generate new user ID hash
|
|
291
|
+
const newUserIdHash = this.generateUserIdHash(newPrivateKey);
|
|
292
|
+
// Update server share
|
|
293
|
+
const updateResult = await this.wabClient.updateShare(this.config.authMethodType, authPayload, this.userIdHash, serverShare);
|
|
294
|
+
if (!updateResult.success) {
|
|
295
|
+
throw new Error(updateResult.message || 'Failed to update share on server');
|
|
296
|
+
}
|
|
297
|
+
// Present user shares
|
|
298
|
+
const sharesSaved = await onUserSharesReady(userShares, this.threshold, this.totalShares);
|
|
299
|
+
if (!sharesSaved) {
|
|
300
|
+
console.warn('User shares may not have been saved. Recovery may be limited.');
|
|
301
|
+
}
|
|
302
|
+
// Update state
|
|
303
|
+
this.privateKey = newPrivateKey;
|
|
304
|
+
this.userIdHash = newUserIdHash;
|
|
305
|
+
return {
|
|
306
|
+
userShares,
|
|
307
|
+
userIdHash: newUserIdHash,
|
|
308
|
+
privateKey: newPrivateKey,
|
|
309
|
+
threshold: this.threshold,
|
|
310
|
+
totalShares: this.totalShares
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Validate Shamir share format
|
|
315
|
+
* Expected format: x.y.threshold.integrity (4 dot-separated parts)
|
|
316
|
+
*/
|
|
317
|
+
validateShareFormat(share) {
|
|
318
|
+
const parts = share.split('.');
|
|
319
|
+
if (parts.length !== 4) {
|
|
320
|
+
throw new Error(`Invalid share format. Expected 4 dot-separated parts, got ${parts.length}`);
|
|
321
|
+
}
|
|
322
|
+
const threshold = parseInt(parts[2], 10);
|
|
323
|
+
if (isNaN(threshold) || threshold < 2) {
|
|
324
|
+
throw new Error('Invalid share: threshold must be at least 2');
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Check if the manager has a loaded private key
|
|
329
|
+
*/
|
|
330
|
+
hasPrivateKey() {
|
|
331
|
+
return this.privateKey !== undefined;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Get the user ID hash (for display or storage)
|
|
335
|
+
*/
|
|
336
|
+
getUserIdHash() {
|
|
337
|
+
return this.userIdHash;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Delete the user's account and stored share from the WAB server
|
|
341
|
+
* Requires OTP verification
|
|
342
|
+
*
|
|
343
|
+
* WARNING: This permanently deletes the server share.
|
|
344
|
+
* User must have enough remaining shares to meet the threshold for recovery.
|
|
345
|
+
*
|
|
346
|
+
* @param authPayload Contains OTP code and auth method data
|
|
347
|
+
*/
|
|
348
|
+
async deleteAccount(authPayload) {
|
|
349
|
+
if (!this.userIdHash) {
|
|
350
|
+
throw new Error('User ID hash not set. Cannot delete account.');
|
|
351
|
+
}
|
|
352
|
+
const result = await this.wabClient.deleteShamirUser(this.config.authMethodType, authPayload, this.userIdHash);
|
|
353
|
+
if (!result.success) {
|
|
354
|
+
throw new Error(result.message || 'Failed to delete account');
|
|
355
|
+
}
|
|
356
|
+
// Clear local state
|
|
357
|
+
this.privateKey = undefined;
|
|
358
|
+
this.userIdHash = undefined;
|
|
359
|
+
this.underlying = undefined;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
exports.ShamirWalletManager = ShamirWalletManager;
|
|
363
|
+
//# sourceMappingURL=ShamirWalletManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShamirW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AS,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;QAE9G,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,IAAI,0BAA0B,CAAC,CAAA;QAC/D,CAAC;QAED,oBAAoB;QACpB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;QAC3B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;QAC3B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;IAC7B,CAAC;CACF;AA3aD,kDA2aC"}
|
package/out/src/Wallet.d.ts
CHANGED
|
@@ -147,7 +147,7 @@ export declare class Wallet implements WalletInterface, ProtoWallet {
|
|
|
147
147
|
*
|
|
148
148
|
* @returns {number} sum of output satoshis
|
|
149
149
|
*/
|
|
150
|
-
balance(): Promise<number>;
|
|
150
|
+
balance(args?: ListOutputsArgs): Promise<number>;
|
|
151
151
|
/**
|
|
152
152
|
* Uses `listOutputs` special operation to review the spendability via `Services` of
|
|
153
153
|
* outputs currently considered spendable. Returns the outputs that fail to verify.
|
package/out/src/Wallet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wallet.d.ts","sourceRoot":"","sources":["../../src/Wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,mBAAmB,EACnB,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,aAAa,EACb,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,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